diff --git a/CHANGELOG.md b/CHANGELOG.md index 8a296a7de173..eec412640c55 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,69 @@ # CHANGELOG +## `v43.0.0` + +### New Packages + +| Package Name | API Version | +| -----------: | :---------: | +| azuredata | 2019-07-24-preview | +| billing | 2020-05-01-preview | +| cdn | 2020-04-15 | +| computervision | v3.0 | +| containerservice | 2020-04-01 | +| desktopvirtualization | 2019-09-24-preview
2019-12-10-preview | +| devices | 2020-03-01 | +| frontdoor | 2020-04-01
2020-05-01 | +| machinelearningservices | 2020-04-01 | +| mixedreality | 2020-05-01-preview | +| operationalinsights | 2020-03-01-preview | +| peering | 2020-04-01 | +| signalr | 2020-05-01 | + +### Updated Packages + +| Package Name | API Version | +| -----------: | :---------: | +| alertsmanagement | 2019-05-05 | +| anomalydetector | v1.0 | +| appconfiguration | 2019-11-01-preview | +| appplatform | 2019-05-01-preview | +| cognitiveservices | 2017-04-18 | +| containerregistry | 2019-12-01-preview | +| datafactory | 2018-06-01 | +| desktopvirtualization | 2019-01-23-preview | +| eventgrid | 2018-01-01 | +| hdinsight | 2018-06-01-preview | +| machinelearningservices | 2020-03-01 | +| media | 2018-07-01 | +| migrate | 2020-01-01 | +| sql | 2015-05-01-preview
2017-03-01-preview
2018-06-01-preview
v3.0 | +| storagecache | 2020-03-01 | +| synapse | 2019-06-01-preview | +| web | 2019-08-01 | + +### BreakingChanges + +| Package Name | API Version | +| -----------: | :---------: | +| authoring | luis | +| digitaltwins | 2020-03-01-preview | +| documentdb | 2019-08-01
2020-03-01 | +| eventhub | 2018-01-01-preview | +| insights | v1 | +| kubernetesconfiguration | 2019-11-01-preview | +| kusto | 2020-02-15 | +| netapp | 2019-11-01 | +| operationalinsights | v1 | +| policyinsights | 2018-07-01-preview
2019-10-01 | +| reservations | 2019-07-19-preview | +| security | v1.0
v2.0
v3.0 | +| securityinsight | 2019-01-01-preview | +| siterecovery | 2018-07-10 | +| storage | 2016-12-01
2019-06-01 | +| storagesync | 2019-10-01 | +| timeseriesinsights | 2018-08-15-preview | + ## `v42.3.0` | Package Name | API Version | diff --git a/profiles/latest/cognitiveservices/computervision/computervisionapi/models.go b/profiles/latest/cognitiveservices/computervision/computervisionapi/models.go index 7bcaba1a4dd0..f7d3ee105836 100644 --- a/profiles/latest/cognitiveservices/computervision/computervisionapi/models.go +++ b/profiles/latest/cognitiveservices/computervision/computervisionapi/models.go @@ -19,6 +19,6 @@ package computervisionapi -import original "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.1/computervision/computervisionapi" +import original "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v3.0/computervision/computervisionapi" type BaseClientAPI = original.BaseClientAPI diff --git a/profiles/latest/cognitiveservices/computervision/models.go b/profiles/latest/cognitiveservices/computervision/models.go index 0e57cfceb950..937de0d9b26d 100644 --- a/profiles/latest/cognitiveservices/computervision/models.go +++ b/profiles/latest/cognitiveservices/computervision/models.go @@ -19,7 +19,7 @@ package computervision -import original "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.1/computervision" +import original "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v3.0/computervision" type DescriptionExclude = original.DescriptionExclude @@ -42,59 +42,57 @@ const ( Male Gender = original.Male ) -type OcrLanguages = original.OcrLanguages - -const ( - Ar OcrLanguages = original.Ar - Cs OcrLanguages = original.Cs - Da OcrLanguages = original.Da - De OcrLanguages = original.De - El OcrLanguages = original.El - En OcrLanguages = original.En - Es OcrLanguages = original.Es - Fi OcrLanguages = original.Fi - Fr OcrLanguages = original.Fr - Hu OcrLanguages = original.Hu - It OcrLanguages = original.It - Ja OcrLanguages = original.Ja - Ko OcrLanguages = original.Ko - Nb OcrLanguages = original.Nb - Nl OcrLanguages = original.Nl - Pl OcrLanguages = original.Pl - Pt OcrLanguages = original.Pt - Ro OcrLanguages = original.Ro - Ru OcrLanguages = original.Ru - Sk OcrLanguages = original.Sk - SrCyrl OcrLanguages = original.SrCyrl - SrLatn OcrLanguages = original.SrLatn - Sv OcrLanguages = original.Sv - Tr OcrLanguages = original.Tr - Unk OcrLanguages = original.Unk - ZhHans OcrLanguages = original.ZhHans - ZhHant OcrLanguages = original.ZhHant -) - -type TextOperationStatusCodes = original.TextOperationStatusCodes +type OcrDetectionLanguage = original.OcrDetectionLanguage const ( - Failed TextOperationStatusCodes = original.Failed - NotStarted TextOperationStatusCodes = original.NotStarted - Running TextOperationStatusCodes = original.Running - Succeeded TextOperationStatusCodes = original.Succeeded + De OcrDetectionLanguage = original.De + En OcrDetectionLanguage = original.En + Es OcrDetectionLanguage = original.Es + Fr OcrDetectionLanguage = original.Fr + It OcrDetectionLanguage = original.It + Nl OcrDetectionLanguage = original.Nl + Pt OcrDetectionLanguage = original.Pt ) -type TextRecognitionMode = original.TextRecognitionMode +type OcrLanguages = original.OcrLanguages const ( - Handwritten TextRecognitionMode = original.Handwritten - Printed TextRecognitionMode = original.Printed + OcrLanguagesAr OcrLanguages = original.OcrLanguagesAr + OcrLanguagesCs OcrLanguages = original.OcrLanguagesCs + OcrLanguagesDa OcrLanguages = original.OcrLanguagesDa + OcrLanguagesDe OcrLanguages = original.OcrLanguagesDe + OcrLanguagesEl OcrLanguages = original.OcrLanguagesEl + OcrLanguagesEn OcrLanguages = original.OcrLanguagesEn + OcrLanguagesEs OcrLanguages = original.OcrLanguagesEs + OcrLanguagesFi OcrLanguages = original.OcrLanguagesFi + OcrLanguagesFr OcrLanguages = original.OcrLanguagesFr + OcrLanguagesHu OcrLanguages = original.OcrLanguagesHu + OcrLanguagesIt OcrLanguages = original.OcrLanguagesIt + OcrLanguagesJa OcrLanguages = original.OcrLanguagesJa + OcrLanguagesKo OcrLanguages = original.OcrLanguagesKo + OcrLanguagesNb OcrLanguages = original.OcrLanguagesNb + OcrLanguagesNl OcrLanguages = original.OcrLanguagesNl + OcrLanguagesPl OcrLanguages = original.OcrLanguagesPl + OcrLanguagesPt OcrLanguages = original.OcrLanguagesPt + OcrLanguagesRo OcrLanguages = original.OcrLanguagesRo + OcrLanguagesRu OcrLanguages = original.OcrLanguagesRu + OcrLanguagesSk OcrLanguages = original.OcrLanguagesSk + OcrLanguagesSrCyrl OcrLanguages = original.OcrLanguagesSrCyrl + OcrLanguagesSrLatn OcrLanguages = original.OcrLanguagesSrLatn + OcrLanguagesSv OcrLanguages = original.OcrLanguagesSv + OcrLanguagesTr OcrLanguages = original.OcrLanguagesTr + OcrLanguagesUnk OcrLanguages = original.OcrLanguagesUnk + OcrLanguagesZhHans OcrLanguages = original.OcrLanguagesZhHans + OcrLanguagesZhHant OcrLanguages = original.OcrLanguagesZhHant ) -type TextRecognitionResultConfidenceClass = original.TextRecognitionResultConfidenceClass +type OperationStatusCodes = original.OperationStatusCodes const ( - High TextRecognitionResultConfidenceClass = original.High - Low TextRecognitionResultConfidenceClass = original.Low + Failed OperationStatusCodes = original.Failed + NotStarted OperationStatusCodes = original.NotStarted + Running OperationStatusCodes = original.Running + Succeeded OperationStatusCodes = original.Succeeded ) type TextRecognitionResultDimensionUnit = original.TextRecognitionResultDimensionUnit @@ -119,6 +117,7 @@ const ( ) type AdultInfo = original.AdultInfo +type AnalyzeResults = original.AnalyzeResults type AreaOfInterestResult = original.AreaOfInterestResult type BaseClient = original.BaseClient type BoundingRect = original.BoundingRect @@ -154,9 +153,8 @@ type OcrResult = original.OcrResult type OcrWord = original.OcrWord type ReadCloser = original.ReadCloser type ReadOperationResult = original.ReadOperationResult +type ReadResult = original.ReadResult type TagResult = original.TagResult -type TextOperationResult = original.TextOperationResult -type TextRecognitionResult = original.TextRecognitionResult type Word = original.Word func New(endpoint string) BaseClient { @@ -174,17 +172,14 @@ func PossibleDetailsValues() []Details { func PossibleGenderValues() []Gender { return original.PossibleGenderValues() } +func PossibleOcrDetectionLanguageValues() []OcrDetectionLanguage { + return original.PossibleOcrDetectionLanguageValues() +} func PossibleOcrLanguagesValues() []OcrLanguages { return original.PossibleOcrLanguagesValues() } -func PossibleTextOperationStatusCodesValues() []TextOperationStatusCodes { - return original.PossibleTextOperationStatusCodesValues() -} -func PossibleTextRecognitionModeValues() []TextRecognitionMode { - return original.PossibleTextRecognitionModeValues() -} -func PossibleTextRecognitionResultConfidenceClassValues() []TextRecognitionResultConfidenceClass { - return original.PossibleTextRecognitionResultConfidenceClassValues() +func PossibleOperationStatusCodesValues() []OperationStatusCodes { + return original.PossibleOperationStatusCodesValues() } func PossibleTextRecognitionResultDimensionUnitValues() []TextRecognitionResultDimensionUnit { return original.PossibleTextRecognitionResultDimensionUnitValues() diff --git a/profiles/latest/cognitiveservices/mgmt/cognitiveservices/cognitiveservicesapi/models.go b/profiles/latest/cognitiveservices/mgmt/cognitiveservices/cognitiveservicesapi/models.go index 3f99499ecf94..ccd2d440e821 100644 --- a/profiles/latest/cognitiveservices/mgmt/cognitiveservices/cognitiveservicesapi/models.go +++ b/profiles/latest/cognitiveservices/mgmt/cognitiveservices/cognitiveservicesapi/models.go @@ -24,4 +24,6 @@ import original "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/mg type AccountsClientAPI = original.AccountsClientAPI type BaseClientAPI = original.BaseClientAPI type OperationsClientAPI = original.OperationsClientAPI +type PrivateEndpointConnectionsClientAPI = original.PrivateEndpointConnectionsClientAPI +type PrivateLinkResourcesClientAPI = original.PrivateLinkResourcesClientAPI type ResourceSkusClientAPI = original.ResourceSkusClientAPI diff --git a/profiles/latest/cognitiveservices/mgmt/cognitiveservices/models.go b/profiles/latest/cognitiveservices/mgmt/cognitiveservices/models.go index 01a4214361be..51deddd29d00 100644 --- a/profiles/latest/cognitiveservices/mgmt/cognitiveservices/models.go +++ b/profiles/latest/cognitiveservices/mgmt/cognitiveservices/models.go @@ -58,6 +58,15 @@ const ( Deny NetworkRuleAction = original.Deny ) +type PrivateEndpointServiceConnectionStatus = original.PrivateEndpointServiceConnectionStatus + +const ( + Approved PrivateEndpointServiceConnectionStatus = original.Approved + Disconnected PrivateEndpointServiceConnectionStatus = original.Disconnected + Pending PrivateEndpointServiceConnectionStatus = original.Pending + Rejected PrivateEndpointServiceConnectionStatus = original.Rejected +) + type ProvisioningState = original.ProvisioningState const ( @@ -69,6 +78,13 @@ const ( Succeeded ProvisioningState = original.Succeeded ) +type PublicNetworkAccess = original.PublicNetworkAccess + +const ( + Disabled PublicNetworkAccess = original.Disabled + Enabled PublicNetworkAccess = original.Enabled +) + type QuotaUsageStatus = original.QuotaUsageStatus const ( @@ -121,6 +137,7 @@ type AccountListResultIterator = original.AccountListResultIterator type AccountListResultPage = original.AccountListResultPage type AccountProperties = original.AccountProperties type AccountsClient = original.AccountsClient +type AzureEntityResource = original.AzureEntityResource type BaseClient = original.BaseClient type CheckDomainAvailabilityParameter = original.CheckDomainAvailabilityParameter type CheckDomainAvailabilityResult = original.CheckDomainAvailabilityResult @@ -141,7 +158,18 @@ type OperationEntityListResult = original.OperationEntityListResult type OperationEntityListResultIterator = original.OperationEntityListResultIterator type OperationEntityListResultPage = original.OperationEntityListResultPage type OperationsClient = original.OperationsClient +type PrivateEndpoint = original.PrivateEndpoint +type PrivateEndpointConnection = original.PrivateEndpointConnection +type PrivateEndpointConnectionProperties = original.PrivateEndpointConnectionProperties +type PrivateEndpointConnectionsClient = original.PrivateEndpointConnectionsClient +type PrivateLinkResource = original.PrivateLinkResource +type PrivateLinkResourceListResult = original.PrivateLinkResourceListResult +type PrivateLinkResourceProperties = original.PrivateLinkResourceProperties +type PrivateLinkResourcesClient = original.PrivateLinkResourcesClient +type PrivateLinkServiceConnectionState = original.PrivateLinkServiceConnectionState +type ProxyResource = original.ProxyResource type RegenerateKeyParameters = original.RegenerateKeyParameters +type Resource = original.Resource type ResourceAndSku = original.ResourceAndSku type ResourceSku = original.ResourceSku type ResourceSkuRestrictionInfo = original.ResourceSkuRestrictionInfo @@ -151,6 +179,8 @@ type ResourceSkusResult = original.ResourceSkusResult type ResourceSkusResultIterator = original.ResourceSkusResultIterator type ResourceSkusResultPage = original.ResourceSkusResultPage type Sku = original.Sku +type SkuCapability = original.SkuCapability +type TrackedResource = original.TrackedResource type Usage = original.Usage type UsagesResult = original.UsagesResult type UserAssignedIdentity = original.UserAssignedIdentity @@ -184,6 +214,18 @@ func NewOperationsClient(subscriptionID string) OperationsClient { func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID) } +func NewPrivateEndpointConnectionsClient(subscriptionID string) PrivateEndpointConnectionsClient { + return original.NewPrivateEndpointConnectionsClient(subscriptionID) +} +func NewPrivateEndpointConnectionsClientWithBaseURI(baseURI string, subscriptionID string) PrivateEndpointConnectionsClient { + return original.NewPrivateEndpointConnectionsClientWithBaseURI(baseURI, subscriptionID) +} +func NewPrivateLinkResourcesClient(subscriptionID string) PrivateLinkResourcesClient { + return original.NewPrivateLinkResourcesClient(subscriptionID) +} +func NewPrivateLinkResourcesClientWithBaseURI(baseURI string, subscriptionID string) PrivateLinkResourcesClient { + return original.NewPrivateLinkResourcesClientWithBaseURI(baseURI, subscriptionID) +} func NewResourceSkusClient(subscriptionID string) ResourceSkusClient { return original.NewResourceSkusClient(subscriptionID) } @@ -211,9 +253,15 @@ func PossibleKeySourceValues() []KeySource { func PossibleNetworkRuleActionValues() []NetworkRuleAction { return original.PossibleNetworkRuleActionValues() } +func PossiblePrivateEndpointServiceConnectionStatusValues() []PrivateEndpointServiceConnectionStatus { + return original.PossiblePrivateEndpointServiceConnectionStatusValues() +} func PossibleProvisioningStateValues() []ProvisioningState { return original.PossibleProvisioningStateValues() } +func PossiblePublicNetworkAccessValues() []PublicNetworkAccess { + return original.PossiblePublicNetworkAccessValues() +} func PossibleQuotaUsageStatusValues() []QuotaUsageStatus { return original.PossibleQuotaUsageStatusValues() } diff --git a/profiles/latest/containerservice/mgmt/containerservice/containerserviceapi/models.go b/profiles/latest/containerservice/mgmt/containerservice/containerserviceapi/models.go index 129666002747..e576e4377266 100644 --- a/profiles/latest/containerservice/mgmt/containerservice/containerserviceapi/models.go +++ b/profiles/latest/containerservice/mgmt/containerservice/containerserviceapi/models.go @@ -19,7 +19,7 @@ package containerserviceapi -import original "github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-03-01/containerservice/containerserviceapi" +import original "github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice/containerserviceapi" type AgentPoolsClientAPI = original.AgentPoolsClientAPI type ContainerServicesClientAPI = original.ContainerServicesClientAPI diff --git a/profiles/latest/containerservice/mgmt/containerservice/models.go b/profiles/latest/containerservice/mgmt/containerservice/models.go index 9edf5569af0d..cbe066af5332 100644 --- a/profiles/latest/containerservice/mgmt/containerservice/models.go +++ b/profiles/latest/containerservice/mgmt/containerservice/models.go @@ -22,7 +22,7 @@ package containerservice import ( "context" - original "github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-03-01/containerservice" + original "github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice" ) const ( @@ -177,7 +177,6 @@ const ( type ScaleSetPriority = original.ScaleSetPriority const ( - Low ScaleSetPriority = original.Low Regular ScaleSetPriority = original.Regular Spot ScaleSetPriority = original.Spot ) @@ -380,6 +379,7 @@ type AgentPoolProfile = original.AgentPoolProfile type AgentPoolUpgradeProfile = original.AgentPoolUpgradeProfile type AgentPoolUpgradeProfileProperties = original.AgentPoolUpgradeProfileProperties type AgentPoolUpgradeProfilePropertiesUpgradesItem = original.AgentPoolUpgradeProfilePropertiesUpgradesItem +type AgentPoolUpgradeSettings = original.AgentPoolUpgradeSettings type AgentPoolsClient = original.AgentPoolsClient type AgentPoolsCreateOrUpdateFuture = original.AgentPoolsCreateOrUpdateFuture type AgentPoolsDeleteFuture = original.AgentPoolsDeleteFuture diff --git a/profiles/latest/cosmos-db/mgmt/documentdb/models.go b/profiles/latest/cosmos-db/mgmt/documentdb/models.go index 0acb83dc1059..3db49c113af4 100644 --- a/profiles/latest/cosmos-db/mgmt/documentdb/models.go +++ b/profiles/latest/cosmos-db/mgmt/documentdb/models.go @@ -423,74 +423,74 @@ type Usage = original.Usage type UsagesResult = original.UsagesResult type VirtualNetworkRule = original.VirtualNetworkRule -func New(subscriptionID string, subscriptionID1 string) BaseClient { - return original.New(subscriptionID, subscriptionID1) +func New(subscriptionID string) BaseClient { + return original.New(subscriptionID) } -func NewCassandraResourcesClient(subscriptionID string, subscriptionID1 string) CassandraResourcesClient { - return original.NewCassandraResourcesClient(subscriptionID, subscriptionID1) +func NewCassandraResourcesClient(subscriptionID string) CassandraResourcesClient { + return original.NewCassandraResourcesClient(subscriptionID) } -func NewCassandraResourcesClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) CassandraResourcesClient { - return original.NewCassandraResourcesClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +func NewCassandraResourcesClientWithBaseURI(baseURI string, subscriptionID string) CassandraResourcesClient { + return original.NewCassandraResourcesClientWithBaseURI(baseURI, subscriptionID) } -func NewCollectionClient(subscriptionID string, subscriptionID1 string) CollectionClient { - return original.NewCollectionClient(subscriptionID, subscriptionID1) +func NewCollectionClient(subscriptionID string) CollectionClient { + return original.NewCollectionClient(subscriptionID) } -func NewCollectionClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) CollectionClient { - return original.NewCollectionClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +func NewCollectionClientWithBaseURI(baseURI string, subscriptionID string) CollectionClient { + return original.NewCollectionClientWithBaseURI(baseURI, subscriptionID) } -func NewCollectionPartitionClient(subscriptionID string, subscriptionID1 string) CollectionPartitionClient { - return original.NewCollectionPartitionClient(subscriptionID, subscriptionID1) +func NewCollectionPartitionClient(subscriptionID string) CollectionPartitionClient { + return original.NewCollectionPartitionClient(subscriptionID) } -func NewCollectionPartitionClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) CollectionPartitionClient { - return original.NewCollectionPartitionClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +func NewCollectionPartitionClientWithBaseURI(baseURI string, subscriptionID string) CollectionPartitionClient { + return original.NewCollectionPartitionClientWithBaseURI(baseURI, subscriptionID) } -func NewCollectionPartitionRegionClient(subscriptionID string, subscriptionID1 string) CollectionPartitionRegionClient { - return original.NewCollectionPartitionRegionClient(subscriptionID, subscriptionID1) +func NewCollectionPartitionRegionClient(subscriptionID string) CollectionPartitionRegionClient { + return original.NewCollectionPartitionRegionClient(subscriptionID) } -func NewCollectionPartitionRegionClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) CollectionPartitionRegionClient { - return original.NewCollectionPartitionRegionClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +func NewCollectionPartitionRegionClientWithBaseURI(baseURI string, subscriptionID string) CollectionPartitionRegionClient { + return original.NewCollectionPartitionRegionClientWithBaseURI(baseURI, subscriptionID) } -func NewCollectionRegionClient(subscriptionID string, subscriptionID1 string) CollectionRegionClient { - return original.NewCollectionRegionClient(subscriptionID, subscriptionID1) +func NewCollectionRegionClient(subscriptionID string) CollectionRegionClient { + return original.NewCollectionRegionClient(subscriptionID) } -func NewCollectionRegionClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) CollectionRegionClient { - return original.NewCollectionRegionClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +func NewCollectionRegionClientWithBaseURI(baseURI string, subscriptionID string) CollectionRegionClient { + return original.NewCollectionRegionClientWithBaseURI(baseURI, subscriptionID) } -func NewDatabaseAccountRegionClient(subscriptionID string, subscriptionID1 string) DatabaseAccountRegionClient { - return original.NewDatabaseAccountRegionClient(subscriptionID, subscriptionID1) +func NewDatabaseAccountRegionClient(subscriptionID string) DatabaseAccountRegionClient { + return original.NewDatabaseAccountRegionClient(subscriptionID) } -func NewDatabaseAccountRegionClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) DatabaseAccountRegionClient { - return original.NewDatabaseAccountRegionClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +func NewDatabaseAccountRegionClientWithBaseURI(baseURI string, subscriptionID string) DatabaseAccountRegionClient { + return original.NewDatabaseAccountRegionClientWithBaseURI(baseURI, subscriptionID) } -func NewDatabaseAccountsClient(subscriptionID string, subscriptionID1 string) DatabaseAccountsClient { - return original.NewDatabaseAccountsClient(subscriptionID, subscriptionID1) +func NewDatabaseAccountsClient(subscriptionID string) DatabaseAccountsClient { + return original.NewDatabaseAccountsClient(subscriptionID) } -func NewDatabaseAccountsClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) DatabaseAccountsClient { - return original.NewDatabaseAccountsClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +func NewDatabaseAccountsClientWithBaseURI(baseURI string, subscriptionID string) DatabaseAccountsClient { + return original.NewDatabaseAccountsClientWithBaseURI(baseURI, subscriptionID) } -func NewDatabaseClient(subscriptionID string, subscriptionID1 string) DatabaseClient { - return original.NewDatabaseClient(subscriptionID, subscriptionID1) +func NewDatabaseClient(subscriptionID string) DatabaseClient { + return original.NewDatabaseClient(subscriptionID) } -func NewDatabaseClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) DatabaseClient { - return original.NewDatabaseClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +func NewDatabaseClientWithBaseURI(baseURI string, subscriptionID string) DatabaseClient { + return original.NewDatabaseClientWithBaseURI(baseURI, subscriptionID) } -func NewGremlinResourcesClient(subscriptionID string, subscriptionID1 string) GremlinResourcesClient { - return original.NewGremlinResourcesClient(subscriptionID, subscriptionID1) +func NewGremlinResourcesClient(subscriptionID string) GremlinResourcesClient { + return original.NewGremlinResourcesClient(subscriptionID) } -func NewGremlinResourcesClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) GremlinResourcesClient { - return original.NewGremlinResourcesClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +func NewGremlinResourcesClientWithBaseURI(baseURI string, subscriptionID string) GremlinResourcesClient { + return original.NewGremlinResourcesClientWithBaseURI(baseURI, subscriptionID) } -func NewMongoDBResourcesClient(subscriptionID string, subscriptionID1 string) MongoDBResourcesClient { - return original.NewMongoDBResourcesClient(subscriptionID, subscriptionID1) +func NewMongoDBResourcesClient(subscriptionID string) MongoDBResourcesClient { + return original.NewMongoDBResourcesClient(subscriptionID) } -func NewMongoDBResourcesClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) MongoDBResourcesClient { - return original.NewMongoDBResourcesClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +func NewMongoDBResourcesClientWithBaseURI(baseURI string, subscriptionID string) MongoDBResourcesClient { + return original.NewMongoDBResourcesClientWithBaseURI(baseURI, subscriptionID) } -func NewNotebookWorkspacesClient(subscriptionID string, subscriptionID1 string) NotebookWorkspacesClient { - return original.NewNotebookWorkspacesClient(subscriptionID, subscriptionID1) +func NewNotebookWorkspacesClient(subscriptionID string) NotebookWorkspacesClient { + return original.NewNotebookWorkspacesClient(subscriptionID) } -func NewNotebookWorkspacesClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) NotebookWorkspacesClient { - return original.NewNotebookWorkspacesClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +func NewNotebookWorkspacesClientWithBaseURI(baseURI string, subscriptionID string) NotebookWorkspacesClient { + return original.NewNotebookWorkspacesClientWithBaseURI(baseURI, subscriptionID) } func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator { return original.NewOperationListResultIterator(page) @@ -498,68 +498,68 @@ func NewOperationListResultIterator(page OperationListResultPage) OperationListR func NewOperationListResultPage(getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { return original.NewOperationListResultPage(getNextPage) } -func NewOperationsClient(subscriptionID string, subscriptionID1 string) OperationsClient { - return original.NewOperationsClient(subscriptionID, subscriptionID1) +func NewOperationsClient(subscriptionID string) OperationsClient { + return original.NewOperationsClient(subscriptionID) } -func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) OperationsClient { - return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID) } -func NewPartitionKeyRangeIDClient(subscriptionID string, subscriptionID1 string) PartitionKeyRangeIDClient { - return original.NewPartitionKeyRangeIDClient(subscriptionID, subscriptionID1) +func NewPartitionKeyRangeIDClient(subscriptionID string) PartitionKeyRangeIDClient { + return original.NewPartitionKeyRangeIDClient(subscriptionID) } -func NewPartitionKeyRangeIDClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) PartitionKeyRangeIDClient { - return original.NewPartitionKeyRangeIDClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +func NewPartitionKeyRangeIDClientWithBaseURI(baseURI string, subscriptionID string) PartitionKeyRangeIDClient { + return original.NewPartitionKeyRangeIDClientWithBaseURI(baseURI, subscriptionID) } -func NewPartitionKeyRangeIDRegionClient(subscriptionID string, subscriptionID1 string) PartitionKeyRangeIDRegionClient { - return original.NewPartitionKeyRangeIDRegionClient(subscriptionID, subscriptionID1) +func NewPartitionKeyRangeIDRegionClient(subscriptionID string) PartitionKeyRangeIDRegionClient { + return original.NewPartitionKeyRangeIDRegionClient(subscriptionID) } -func NewPartitionKeyRangeIDRegionClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) PartitionKeyRangeIDRegionClient { - return original.NewPartitionKeyRangeIDRegionClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +func NewPartitionKeyRangeIDRegionClientWithBaseURI(baseURI string, subscriptionID string) PartitionKeyRangeIDRegionClient { + return original.NewPartitionKeyRangeIDRegionClientWithBaseURI(baseURI, subscriptionID) } -func NewPercentileClient(subscriptionID string, subscriptionID1 string) PercentileClient { - return original.NewPercentileClient(subscriptionID, subscriptionID1) +func NewPercentileClient(subscriptionID string) PercentileClient { + return original.NewPercentileClient(subscriptionID) } -func NewPercentileClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) PercentileClient { - return original.NewPercentileClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +func NewPercentileClientWithBaseURI(baseURI string, subscriptionID string) PercentileClient { + return original.NewPercentileClientWithBaseURI(baseURI, subscriptionID) } -func NewPercentileSourceTargetClient(subscriptionID string, subscriptionID1 string) PercentileSourceTargetClient { - return original.NewPercentileSourceTargetClient(subscriptionID, subscriptionID1) +func NewPercentileSourceTargetClient(subscriptionID string) PercentileSourceTargetClient { + return original.NewPercentileSourceTargetClient(subscriptionID) } -func NewPercentileSourceTargetClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) PercentileSourceTargetClient { - return original.NewPercentileSourceTargetClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +func NewPercentileSourceTargetClientWithBaseURI(baseURI string, subscriptionID string) PercentileSourceTargetClient { + return original.NewPercentileSourceTargetClientWithBaseURI(baseURI, subscriptionID) } -func NewPercentileTargetClient(subscriptionID string, subscriptionID1 string) PercentileTargetClient { - return original.NewPercentileTargetClient(subscriptionID, subscriptionID1) +func NewPercentileTargetClient(subscriptionID string) PercentileTargetClient { + return original.NewPercentileTargetClient(subscriptionID) } -func NewPercentileTargetClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) PercentileTargetClient { - return original.NewPercentileTargetClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +func NewPercentileTargetClientWithBaseURI(baseURI string, subscriptionID string) PercentileTargetClient { + return original.NewPercentileTargetClientWithBaseURI(baseURI, subscriptionID) } -func NewPrivateEndpointConnectionsClient(subscriptionID string, subscriptionID1 string) PrivateEndpointConnectionsClient { - return original.NewPrivateEndpointConnectionsClient(subscriptionID, subscriptionID1) +func NewPrivateEndpointConnectionsClient(subscriptionID string) PrivateEndpointConnectionsClient { + return original.NewPrivateEndpointConnectionsClient(subscriptionID) } -func NewPrivateEndpointConnectionsClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) PrivateEndpointConnectionsClient { - return original.NewPrivateEndpointConnectionsClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +func NewPrivateEndpointConnectionsClientWithBaseURI(baseURI string, subscriptionID string) PrivateEndpointConnectionsClient { + return original.NewPrivateEndpointConnectionsClientWithBaseURI(baseURI, subscriptionID) } -func NewPrivateLinkResourcesClient(subscriptionID string, subscriptionID1 string) PrivateLinkResourcesClient { - return original.NewPrivateLinkResourcesClient(subscriptionID, subscriptionID1) +func NewPrivateLinkResourcesClient(subscriptionID string) PrivateLinkResourcesClient { + return original.NewPrivateLinkResourcesClient(subscriptionID) } -func NewPrivateLinkResourcesClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) PrivateLinkResourcesClient { - return original.NewPrivateLinkResourcesClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +func NewPrivateLinkResourcesClientWithBaseURI(baseURI string, subscriptionID string) PrivateLinkResourcesClient { + return original.NewPrivateLinkResourcesClientWithBaseURI(baseURI, subscriptionID) } -func NewSQLResourcesClient(subscriptionID string, subscriptionID1 string) SQLResourcesClient { - return original.NewSQLResourcesClient(subscriptionID, subscriptionID1) +func NewSQLResourcesClient(subscriptionID string) SQLResourcesClient { + return original.NewSQLResourcesClient(subscriptionID) } -func NewSQLResourcesClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) SQLResourcesClient { - return original.NewSQLResourcesClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +func NewSQLResourcesClientWithBaseURI(baseURI string, subscriptionID string) SQLResourcesClient { + return original.NewSQLResourcesClientWithBaseURI(baseURI, subscriptionID) } -func NewTableResourcesClient(subscriptionID string, subscriptionID1 string) TableResourcesClient { - return original.NewTableResourcesClient(subscriptionID, subscriptionID1) +func NewTableResourcesClient(subscriptionID string) TableResourcesClient { + return original.NewTableResourcesClient(subscriptionID) } -func NewTableResourcesClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) TableResourcesClient { - return original.NewTableResourcesClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +func NewTableResourcesClientWithBaseURI(baseURI string, subscriptionID string) TableResourcesClient { + return original.NewTableResourcesClientWithBaseURI(baseURI, subscriptionID) } -func NewWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) BaseClient { - return original.NewWithBaseURI(baseURI, subscriptionID, subscriptionID1) +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return original.NewWithBaseURI(baseURI, subscriptionID) } func PossibleCompositePathSortOrderValues() []CompositePathSortOrder { return original.PossibleCompositePathSortOrderValues() diff --git a/profiles/latest/datafactory/mgmt/datafactory/models.go b/profiles/latest/datafactory/mgmt/datafactory/models.go index 53bfbe3d0685..7d09d747d3d7 100644 --- a/profiles/latest/datafactory/mgmt/datafactory/models.go +++ b/profiles/latest/datafactory/mgmt/datafactory/models.go @@ -806,6 +806,7 @@ const ( TypeDynamicsCrmSource TypeBasicCopySource = original.TypeDynamicsCrmSource TypeDynamicsSource TypeBasicCopySource = original.TypeDynamicsSource TypeEloquaSource TypeBasicCopySource = original.TypeEloquaSource + TypeExcelSource TypeBasicCopySource = original.TypeExcelSource TypeFileSystemSource TypeBasicCopySource = original.TypeFileSystemSource TypeGoogleAdWordsSource TypeBasicCopySource = original.TypeGoogleAdWordsSource TypeGoogleBigQuerySource TypeBasicCopySource = original.TypeGoogleBigQuerySource @@ -867,6 +868,7 @@ const ( TypeVerticaSource TypeBasicCopySource = original.TypeVerticaSource TypeWebSource TypeBasicCopySource = original.TypeWebSource TypeXeroSource TypeBasicCopySource = original.TypeXeroSource + TypeXMLSource TypeBasicCopySource = original.TypeXMLSource TypeZohoSource TypeBasicCopySource = original.TypeZohoSource ) @@ -922,6 +924,7 @@ const ( TypeDynamicsCrmEntity TypeBasicDataset = original.TypeDynamicsCrmEntity TypeDynamicsEntity TypeBasicDataset = original.TypeDynamicsEntity TypeEloquaObject TypeBasicDataset = original.TypeEloquaObject + TypeExcel TypeBasicDataset = original.TypeExcel TypeFileShare TypeBasicDataset = original.TypeFileShare TypeGoogleAdWordsObject TypeBasicDataset = original.TypeGoogleAdWordsObject TypeGoogleBigQueryObject TypeBasicDataset = original.TypeGoogleBigQueryObject @@ -978,6 +981,7 @@ const ( TypeVerticaTable TypeBasicDataset = original.TypeVerticaTable TypeWebTable TypeBasicDataset = original.TypeWebTable TypeXeroObject TypeBasicDataset = original.TypeXeroObject + TypeXML TypeBasicDataset = original.TypeXML TypeZohoObject TypeBasicDataset = original.TypeZohoObject ) @@ -1050,6 +1054,7 @@ const ( TypeDelimitedTextReadSettings TypeBasicFormatReadSettings = original.TypeDelimitedTextReadSettings TypeFormatReadSettings TypeBasicFormatReadSettings = original.TypeFormatReadSettings TypeJSONReadSettings TypeBasicFormatReadSettings = original.TypeJSONReadSettings + TypeXMLReadSettings TypeBasicFormatReadSettings = original.TypeXMLReadSettings ) type TypeBasicFormatWriteSettings = original.TypeBasicFormatWriteSettings @@ -1590,6 +1595,9 @@ type EloquaSource = original.EloquaSource type EntityReference = original.EntityReference type EnvironmentVariableSetup = original.EnvironmentVariableSetup type EnvironmentVariableSetupTypeProperties = original.EnvironmentVariableSetupTypeProperties +type ExcelDataset = original.ExcelDataset +type ExcelDatasetTypeProperties = original.ExcelDatasetTypeProperties +type ExcelSource = original.ExcelSource type ExecuteDataFlowActivity = original.ExecuteDataFlowActivity type ExecuteDataFlowActivityTypeProperties = original.ExecuteDataFlowActivityTypeProperties type ExecuteDataFlowActivityTypePropertiesCompute = original.ExecuteDataFlowActivityTypePropertiesCompute @@ -2137,6 +2145,10 @@ type WebLinkedServiceTypeProperties = original.WebLinkedServiceTypeProperties type WebSource = original.WebSource type WebTableDataset = original.WebTableDataset type WebTableDatasetTypeProperties = original.WebTableDatasetTypeProperties +type XMLDataset = original.XMLDataset +type XMLDatasetTypeProperties = original.XMLDatasetTypeProperties +type XMLReadSettings = original.XMLReadSettings +type XMLSource = original.XMLSource type XeroLinkedService = original.XeroLinkedService type XeroLinkedServiceTypeProperties = original.XeroLinkedServiceTypeProperties type XeroObjectDataset = original.XeroObjectDataset diff --git a/profiles/latest/eventgrid/eventgrid/models.go b/profiles/latest/eventgrid/eventgrid/models.go index 6f8d12fd4239..924a0222c903 100644 --- a/profiles/latest/eventgrid/eventgrid/models.go +++ b/profiles/latest/eventgrid/eventgrid/models.go @@ -21,6 +21,31 @@ package eventgrid import original "github.com/Azure/azure-sdk-for-go/services/eventgrid/2018-01-01/eventgrid" +type AppAction = original.AppAction + +const ( + ChangedAppSettings AppAction = original.ChangedAppSettings + Completed AppAction = original.Completed + Failed AppAction = original.Failed + Restarted AppAction = original.Restarted + Started AppAction = original.Started + Stopped AppAction = original.Stopped +) + +type AppServicePlanAction = original.AppServicePlanAction + +const ( + Updated AppServicePlanAction = original.Updated +) + +type AsyncStatus = original.AsyncStatus + +const ( + AsyncStatusCompleted AsyncStatus = original.AsyncStatusCompleted + AsyncStatusFailed AsyncStatus = original.AsyncStatusFailed + AsyncStatusStarted AsyncStatus = original.AsyncStatusStarted +) + type MediaJobErrorCategory = original.MediaJobErrorCategory const ( @@ -71,8 +96,18 @@ const ( OdataTypeMicrosoftMediaJobOutputAsset OdataType = original.OdataTypeMicrosoftMediaJobOutputAsset ) +type StampKind = original.StampKind + +const ( + AseV1 StampKind = original.AseV1 + AseV2 StampKind = original.AseV2 + Public StampKind = original.Public +) + type AppConfigurationKeyValueDeletedEventData = original.AppConfigurationKeyValueDeletedEventData type AppConfigurationKeyValueModifiedEventData = original.AppConfigurationKeyValueModifiedEventData +type AppEventTypeDetail = original.AppEventTypeDetail +type AppServicePlanEventTypeDetail = original.AppServicePlanEventTypeDetail type BaseClient = original.BaseClient type BasicMediaJobOutput = original.BasicMediaJobOutput type ContainerRegistryArtifactEventData = original.ContainerRegistryArtifactEventData @@ -175,6 +210,20 @@ type StorageDirectoryRenamedEventData = original.StorageDirectoryRenamedEventDat type SubscriptionDeletedEventData = original.SubscriptionDeletedEventData type SubscriptionValidationEventData = original.SubscriptionValidationEventData type SubscriptionValidationResponse = original.SubscriptionValidationResponse +type WebAppServicePlanUpdatedEventData = original.WebAppServicePlanUpdatedEventData +type WebAppServicePlanUpdatedEventDataSku = original.WebAppServicePlanUpdatedEventDataSku +type WebAppUpdatedEventData = original.WebAppUpdatedEventData +type WebBackupOperationCompletedEventData = original.WebBackupOperationCompletedEventData +type WebBackupOperationFailedEventData = original.WebBackupOperationFailedEventData +type WebBackupOperationStartedEventData = original.WebBackupOperationStartedEventData +type WebRestoreOperationCompletedEventData = original.WebRestoreOperationCompletedEventData +type WebRestoreOperationFailedEventData = original.WebRestoreOperationFailedEventData +type WebRestoreOperationStartedEventData = original.WebRestoreOperationStartedEventData +type WebSlotSwapCompletedEventData = original.WebSlotSwapCompletedEventData +type WebSlotSwapFailedEventData = original.WebSlotSwapFailedEventData +type WebSlotSwapStartedEventData = original.WebSlotSwapStartedEventData +type WebSlotSwapWithPreviewCancelledEventData = original.WebSlotSwapWithPreviewCancelledEventData +type WebSlotSwapWithPreviewStartedEventData = original.WebSlotSwapWithPreviewStartedEventData func New() BaseClient { return original.New() @@ -182,6 +231,15 @@ func New() BaseClient { func NewWithoutDefaults() BaseClient { return original.NewWithoutDefaults() } +func PossibleAppActionValues() []AppAction { + return original.PossibleAppActionValues() +} +func PossibleAppServicePlanActionValues() []AppServicePlanAction { + return original.PossibleAppServicePlanActionValues() +} +func PossibleAsyncStatusValues() []AsyncStatus { + return original.PossibleAsyncStatusValues() +} func PossibleMediaJobErrorCategoryValues() []MediaJobErrorCategory { return original.PossibleMediaJobErrorCategoryValues() } @@ -197,6 +255,9 @@ func PossibleMediaJobStateValues() []MediaJobState { func PossibleOdataTypeValues() []OdataType { return original.PossibleOdataTypeValues() } +func PossibleStampKindValues() []StampKind { + return original.PossibleStampKindValues() +} func UserAgent() string { return original.UserAgent() + " profiles/latest" } diff --git a/profiles/latest/frontdoor/mgmt/frontdoor/frontdoorapi/models.go b/profiles/latest/frontdoor/mgmt/frontdoor/frontdoorapi/models.go index ff5e9e8fcb8a..38aa5e643452 100644 --- a/profiles/latest/frontdoor/mgmt/frontdoor/frontdoorapi/models.go +++ b/profiles/latest/frontdoor/mgmt/frontdoor/frontdoorapi/models.go @@ -19,14 +19,15 @@ package frontdoorapi -import original "github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-01-01/frontdoor/frontdoorapi" +import original "github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-05-01/frontdoor/frontdoorapi" -type BaseClientAPI = original.BaseClientAPI type EndpointsClientAPI = original.EndpointsClientAPI type ExperimentsClientAPI = original.ExperimentsClientAPI type FrontDoorsClientAPI = original.FrontDoorsClientAPI type FrontendEndpointsClientAPI = original.FrontendEndpointsClientAPI type ManagedRuleSetsClientAPI = original.ManagedRuleSetsClientAPI +type NameAvailabilityClientAPI = original.NameAvailabilityClientAPI +type NameAvailabilityWithSubscriptionClientAPI = original.NameAvailabilityWithSubscriptionClientAPI type NetworkExperimentProfilesClientAPI = original.NetworkExperimentProfilesClientAPI type PoliciesClientAPI = original.PoliciesClientAPI type PreconfiguredEndpointsClientAPI = original.PreconfiguredEndpointsClientAPI diff --git a/profiles/latest/frontdoor/mgmt/frontdoor/models.go b/profiles/latest/frontdoor/mgmt/frontdoor/models.go index 309efd88f5b5..70541086ebb7 100644 --- a/profiles/latest/frontdoor/mgmt/frontdoor/models.go +++ b/profiles/latest/frontdoor/mgmt/frontdoor/models.go @@ -22,7 +22,7 @@ package frontdoor import ( "context" - original "github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-01-01/frontdoor" + original "github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-05-01/frontdoor" ) const ( @@ -535,6 +535,8 @@ type ManagedRuleSetDefinitionProperties = original.ManagedRuleSetDefinitionPrope type ManagedRuleSetList = original.ManagedRuleSetList type ManagedRuleSetsClient = original.ManagedRuleSetsClient type MatchCondition = original.MatchCondition +type NameAvailabilityClient = original.NameAvailabilityClient +type NameAvailabilityWithSubscriptionClient = original.NameAvailabilityWithSubscriptionClient type NetworkExperimentProfilesClient = original.NetworkExperimentProfilesClient type NetworkExperimentProfilesCreateOrUpdateFuture = original.NetworkExperimentProfilesCreateOrUpdateFuture type NetworkExperimentProfilesDeleteFuture = original.NetworkExperimentProfilesDeleteFuture @@ -649,6 +651,18 @@ func NewManagedRuleSetsClient(subscriptionID string) ManagedRuleSetsClient { func NewManagedRuleSetsClientWithBaseURI(baseURI string, subscriptionID string) ManagedRuleSetsClient { return original.NewManagedRuleSetsClientWithBaseURI(baseURI, subscriptionID) } +func NewNameAvailabilityClient(subscriptionID string) NameAvailabilityClient { + return original.NewNameAvailabilityClient(subscriptionID) +} +func NewNameAvailabilityClientWithBaseURI(baseURI string, subscriptionID string) NameAvailabilityClient { + return original.NewNameAvailabilityClientWithBaseURI(baseURI, subscriptionID) +} +func NewNameAvailabilityWithSubscriptionClient(subscriptionID string) NameAvailabilityWithSubscriptionClient { + return original.NewNameAvailabilityWithSubscriptionClient(subscriptionID) +} +func NewNameAvailabilityWithSubscriptionClientWithBaseURI(baseURI string, subscriptionID string) NameAvailabilityWithSubscriptionClient { + return original.NewNameAvailabilityWithSubscriptionClientWithBaseURI(baseURI, subscriptionID) +} func NewNetworkExperimentProfilesClient(subscriptionID string) NetworkExperimentProfilesClient { return original.NewNetworkExperimentProfilesClient(subscriptionID) } diff --git a/profiles/latest/iothub/mgmt/devices/devicesapi/models.go b/profiles/latest/iothub/mgmt/devices/devicesapi/models.go index 361bf7676bc4..3a96ff7e0c8d 100644 --- a/profiles/latest/iothub/mgmt/devices/devicesapi/models.go +++ b/profiles/latest/iothub/mgmt/devices/devicesapi/models.go @@ -19,9 +19,12 @@ package devicesapi -import original "github.com/Azure/azure-sdk-for-go/services/iothub/mgmt/2018-04-01/devices/devicesapi" +import original "github.com/Azure/azure-sdk-for-go/services/iothub/mgmt/2020-03-01/devices/devicesapi" type CertificatesClientAPI = original.CertificatesClientAPI +type IotHubClientAPI = original.IotHubClientAPI type IotHubResourceClientAPI = original.IotHubResourceClientAPI type OperationsClientAPI = original.OperationsClientAPI +type PrivateEndpointConnectionsClientAPI = original.PrivateEndpointConnectionsClientAPI +type PrivateLinkResourcesClientAPI = original.PrivateLinkResourcesClientAPI type ResourceProviderCommonClientAPI = original.ResourceProviderCommonClientAPI diff --git a/profiles/latest/iothub/mgmt/devices/models.go b/profiles/latest/iothub/mgmt/devices/models.go index 15030487e80a..d6cc1036466b 100644 --- a/profiles/latest/iothub/mgmt/devices/models.go +++ b/profiles/latest/iothub/mgmt/devices/models.go @@ -22,7 +22,7 @@ package devices import ( "context" - original "github.com/Azure/azure-sdk-for-go/services/iothub/mgmt/2018-04-01/devices" + original "github.com/Azure/azure-sdk-for-go/services/iothub/mgmt/2020-03-01/devices" ) const ( @@ -49,6 +49,13 @@ const ( ServiceConnectDeviceConnect AccessRights = original.ServiceConnectDeviceConnect ) +type AuthenticationType = original.AuthenticationType + +const ( + IdentityBased AuthenticationType = original.IdentityBased + KeyBased AuthenticationType = original.KeyBased +) + type Capabilities = original.Capabilities const ( @@ -56,6 +63,14 @@ const ( None Capabilities = original.None ) +type Encoding = original.Encoding + +const ( + Avro Encoding = original.Avro + AvroDeflate Encoding = original.AvroDeflate + JSON Encoding = original.JSON +) + type EndpointHealthStatus = original.EndpointHealthStatus const ( @@ -79,6 +94,13 @@ const ( Invalid IotHubNameUnavailabilityReason = original.Invalid ) +type IotHubReplicaRoleType = original.IotHubReplicaRoleType + +const ( + Primary IotHubReplicaRoleType = original.Primary + Secondary IotHubReplicaRoleType = original.Secondary +) + type IotHubScaleType = original.IotHubScaleType const ( @@ -133,13 +155,20 @@ const ( JobTypeWriteDeviceProperties JobType = original.JobTypeWriteDeviceProperties ) -type OperationMonitoringLevel = original.OperationMonitoringLevel +type PrivateLinkServiceConnectionStatus = original.PrivateLinkServiceConnectionStatus + +const ( + Approved PrivateLinkServiceConnectionStatus = original.Approved + Disconnected PrivateLinkServiceConnectionStatus = original.Disconnected + Pending PrivateLinkServiceConnectionStatus = original.Pending + Rejected PrivateLinkServiceConnectionStatus = original.Rejected +) + +type PublicNetworkAccess = original.PublicNetworkAccess const ( - OperationMonitoringLevelError OperationMonitoringLevel = original.OperationMonitoringLevelError - OperationMonitoringLevelErrorInformation OperationMonitoringLevel = original.OperationMonitoringLevelErrorInformation - OperationMonitoringLevelInformation OperationMonitoringLevel = original.OperationMonitoringLevelInformation - OperationMonitoringLevelNone OperationMonitoringLevel = original.OperationMonitoringLevelNone + Disabled PublicNetworkAccess = original.Disabled + Enabled PublicNetworkAccess = original.Enabled ) type RouteErrorSeverity = original.RouteErrorSeverity @@ -181,6 +210,7 @@ type EndpointHealthData = original.EndpointHealthData type EndpointHealthDataListResult = original.EndpointHealthDataListResult type EndpointHealthDataListResultIterator = original.EndpointHealthDataListResultIterator type EndpointHealthDataListResultPage = original.EndpointHealthDataListResultPage +type EnrichmentProperties = original.EnrichmentProperties type ErrorDetails = original.ErrorDetails type EventHubConsumerGroupInfo = original.EventHubConsumerGroupInfo type EventHubConsumerGroupsListResult = original.EventHubConsumerGroupsListResult @@ -188,15 +218,21 @@ type EventHubConsumerGroupsListResultIterator = original.EventHubConsumerGroupsL type EventHubConsumerGroupsListResultPage = original.EventHubConsumerGroupsListResultPage type EventHubProperties = original.EventHubProperties type ExportDevicesRequest = original.ExportDevicesRequest +type FailoverInput = original.FailoverInput type FallbackRouteProperties = original.FallbackRouteProperties type FeedbackProperties = original.FeedbackProperties +type GroupIDInformation = original.GroupIDInformation +type GroupIDInformationProperties = original.GroupIDInformationProperties type IPFilterRule = original.IPFilterRule type ImportDevicesRequest = original.ImportDevicesRequest type IotHubCapacity = original.IotHubCapacity +type IotHubClient = original.IotHubClient type IotHubDescription = original.IotHubDescription type IotHubDescriptionListResult = original.IotHubDescriptionListResult type IotHubDescriptionListResultIterator = original.IotHubDescriptionListResultIterator type IotHubDescriptionListResultPage = original.IotHubDescriptionListResultPage +type IotHubLocationDescription = original.IotHubLocationDescription +type IotHubManualFailoverFuture = original.IotHubManualFailoverFuture type IotHubNameAvailabilityInfo = original.IotHubNameAvailabilityInfo type IotHubProperties = original.IotHubProperties type IotHubQuotaMetricInfo = original.IotHubQuotaMetricInfo @@ -216,6 +252,7 @@ type JobResponse = original.JobResponse type JobResponseListResult = original.JobResponseListResult type JobResponseListResultIterator = original.JobResponseListResultIterator type JobResponseListResultPage = original.JobResponseListResultPage +type ListPrivateEndpointConnection = original.ListPrivateEndpointConnection type MatchedRoute = original.MatchedRoute type MessagingEndpointProperties = original.MessagingEndpointProperties type Name = original.Name @@ -226,7 +263,15 @@ type OperationListResult = original.OperationListResult type OperationListResultIterator = original.OperationListResultIterator type OperationListResultPage = original.OperationListResultPage type OperationsClient = original.OperationsClient -type OperationsMonitoringProperties = original.OperationsMonitoringProperties +type PrivateEndpoint = original.PrivateEndpoint +type PrivateEndpointConnection = original.PrivateEndpointConnection +type PrivateEndpointConnectionProperties = original.PrivateEndpointConnectionProperties +type PrivateEndpointConnectionsClient = original.PrivateEndpointConnectionsClient +type PrivateEndpointConnectionsDeleteFuture = original.PrivateEndpointConnectionsDeleteFuture +type PrivateEndpointConnectionsUpdateFuture = original.PrivateEndpointConnectionsUpdateFuture +type PrivateLinkResources = original.PrivateLinkResources +type PrivateLinkResourcesClient = original.PrivateLinkResourcesClient +type PrivateLinkServiceConnectionState = original.PrivateLinkServiceConnectionState type RegistryStatistics = original.RegistryStatistics type Resource = original.Resource type ResourceProviderCommonClient = original.ResourceProviderCommonClient @@ -279,6 +324,12 @@ func NewEventHubConsumerGroupsListResultIterator(page EventHubConsumerGroupsList func NewEventHubConsumerGroupsListResultPage(getNextPage func(context.Context, EventHubConsumerGroupsListResult) (EventHubConsumerGroupsListResult, error)) EventHubConsumerGroupsListResultPage { return original.NewEventHubConsumerGroupsListResultPage(getNextPage) } +func NewIotHubClient(subscriptionID string) IotHubClient { + return original.NewIotHubClient(subscriptionID) +} +func NewIotHubClientWithBaseURI(baseURI string, subscriptionID string) IotHubClient { + return original.NewIotHubClientWithBaseURI(baseURI, subscriptionID) +} func NewIotHubDescriptionListResultIterator(page IotHubDescriptionListResultPage) IotHubDescriptionListResultIterator { return original.NewIotHubDescriptionListResultIterator(page) } @@ -321,6 +372,18 @@ func NewOperationsClient(subscriptionID string) OperationsClient { func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID) } +func NewPrivateEndpointConnectionsClient(subscriptionID string) PrivateEndpointConnectionsClient { + return original.NewPrivateEndpointConnectionsClient(subscriptionID) +} +func NewPrivateEndpointConnectionsClientWithBaseURI(baseURI string, subscriptionID string) PrivateEndpointConnectionsClient { + return original.NewPrivateEndpointConnectionsClientWithBaseURI(baseURI, subscriptionID) +} +func NewPrivateLinkResourcesClient(subscriptionID string) PrivateLinkResourcesClient { + return original.NewPrivateLinkResourcesClient(subscriptionID) +} +func NewPrivateLinkResourcesClientWithBaseURI(baseURI string, subscriptionID string) PrivateLinkResourcesClient { + return original.NewPrivateLinkResourcesClientWithBaseURI(baseURI, subscriptionID) +} func NewResourceProviderCommonClient(subscriptionID string) ResourceProviderCommonClient { return original.NewResourceProviderCommonClient(subscriptionID) } @@ -339,9 +402,15 @@ func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { func PossibleAccessRightsValues() []AccessRights { return original.PossibleAccessRightsValues() } +func PossibleAuthenticationTypeValues() []AuthenticationType { + return original.PossibleAuthenticationTypeValues() +} func PossibleCapabilitiesValues() []Capabilities { return original.PossibleCapabilitiesValues() } +func PossibleEncodingValues() []Encoding { + return original.PossibleEncodingValues() +} func PossibleEndpointHealthStatusValues() []EndpointHealthStatus { return original.PossibleEndpointHealthStatusValues() } @@ -351,6 +420,9 @@ func PossibleIPFilterActionTypeValues() []IPFilterActionType { func PossibleIotHubNameUnavailabilityReasonValues() []IotHubNameUnavailabilityReason { return original.PossibleIotHubNameUnavailabilityReasonValues() } +func PossibleIotHubReplicaRoleTypeValues() []IotHubReplicaRoleType { + return original.PossibleIotHubReplicaRoleTypeValues() +} func PossibleIotHubScaleTypeValues() []IotHubScaleType { return original.PossibleIotHubScaleTypeValues() } @@ -366,8 +438,11 @@ func PossibleJobStatusValues() []JobStatus { func PossibleJobTypeValues() []JobType { return original.PossibleJobTypeValues() } -func PossibleOperationMonitoringLevelValues() []OperationMonitoringLevel { - return original.PossibleOperationMonitoringLevelValues() +func PossiblePrivateLinkServiceConnectionStatusValues() []PrivateLinkServiceConnectionStatus { + return original.PossiblePrivateLinkServiceConnectionStatusValues() +} +func PossiblePublicNetworkAccessValues() []PublicNetworkAccess { + return original.PossiblePublicNetworkAccessValues() } func PossibleRouteErrorSeverityValues() []RouteErrorSeverity { return original.PossibleRouteErrorSeverityValues() diff --git a/profiles/latest/machinelearningservices/mgmt/machinelearningservices/machinelearningservicesapi/models.go b/profiles/latest/machinelearningservices/mgmt/machinelearningservices/machinelearningservicesapi/models.go index df1d83269022..c036104d69a0 100644 --- a/profiles/latest/machinelearningservices/mgmt/machinelearningservices/machinelearningservicesapi/models.go +++ b/profiles/latest/machinelearningservices/mgmt/machinelearningservices/machinelearningservicesapi/models.go @@ -19,7 +19,7 @@ package machinelearningservicesapi -import original "github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2020-03-01/machinelearningservices/machinelearningservicesapi" +import original "github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2020-04-01/machinelearningservices/machinelearningservicesapi" type BaseClientAPI = original.BaseClientAPI type MachineLearningComputeClientAPI = original.MachineLearningComputeClientAPI diff --git a/profiles/latest/machinelearningservices/mgmt/machinelearningservices/models.go b/profiles/latest/machinelearningservices/mgmt/machinelearningservices/models.go index 1cef1c73e6c5..d5182bec9518 100644 --- a/profiles/latest/machinelearningservices/mgmt/machinelearningservices/models.go +++ b/profiles/latest/machinelearningservices/mgmt/machinelearningservices/models.go @@ -22,7 +22,7 @@ package machinelearningservices import ( "context" - original "github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2020-03-01/machinelearningservices" + original "github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2020-04-01/machinelearningservices" ) const ( @@ -151,7 +151,10 @@ const ( type ResourceIdentityType = original.ResourceIdentityType const ( - SystemAssigned ResourceIdentityType = original.SystemAssigned + None ResourceIdentityType = original.None + SystemAssigned ResourceIdentityType = original.SystemAssigned + SystemAssignedUserAssigned ResourceIdentityType = original.SystemAssignedUserAssigned + UserAssigned ResourceIdentityType = original.UserAssigned ) type Status = original.Status @@ -227,6 +230,7 @@ type ErrorResponse = original.ErrorResponse type HDInsight = original.HDInsight type HDInsightProperties = original.HDInsightProperties type Identity = original.Identity +type IdentityUserAssignedIdentitiesValue = original.IdentityUserAssignedIdentitiesValue type KeyVaultProperties = original.KeyVaultProperties type ListAmlUserFeatureResult = original.ListAmlUserFeatureResult type ListAmlUserFeatureResultIterator = original.ListAmlUserFeatureResultIterator diff --git a/profiles/latest/mediaservices/mgmt/media/models.go b/profiles/latest/mediaservices/mgmt/media/models.go index 74eb67ee7cff..3e2e3843f8a4 100644 --- a/profiles/latest/mediaservices/mgmt/media/models.go +++ b/profiles/latest/mediaservices/mgmt/media/models.go @@ -584,6 +584,9 @@ type CopyVideo = original.CopyVideo type CrossSiteAccessPolicies = original.CrossSiteAccessPolicies type DefaultKey = original.DefaultKey type Deinterlace = original.Deinterlace +type EdgePolicies = original.EdgePolicies +type EdgeUsageDataCollectionPolicy = original.EdgeUsageDataCollectionPolicy +type EdgeUsageDataEventHub = original.EdgeUsageDataEventHub type EnabledProtocols = original.EnabledProtocols type EntityNameAvailabilityCheckOutput = original.EntityNameAvailabilityCheckOutput type EnvelopeEncryption = original.EnvelopeEncryption @@ -622,6 +625,7 @@ type JpgLayer = original.JpgLayer type Layer = original.Layer type ListContainerSasInput = original.ListContainerSasInput type ListContentKeysResponse = original.ListContentKeysResponse +type ListEdgePoliciesInput = original.ListEdgePoliciesInput type ListPathsResponse = original.ListPathsResponse type ListStreamingLocatorsResponse = original.ListStreamingLocatorsResponse type LiveEvent = original.LiveEvent diff --git a/profiles/latest/operationalinsights/operationalinsights/models.go b/profiles/latest/operationalinsights/operationalinsights/models.go index bb66c22bb725..0de31e2cd077 100644 --- a/profiles/latest/operationalinsights/operationalinsights/models.go +++ b/profiles/latest/operationalinsights/operationalinsights/models.go @@ -42,11 +42,11 @@ type Column = original.Column type ErrorDetail = original.ErrorDetail type ErrorInfo = original.ErrorInfo type ErrorResponse = original.ErrorResponse -type GetClient = original.GetClient type MetadataApplication = original.MetadataApplication type MetadataApplicationRelated = original.MetadataApplicationRelated type MetadataCategory = original.MetadataCategory type MetadataCategoryRelated = original.MetadataCategoryRelated +type MetadataClient = original.MetadataClient type MetadataFunction = original.MetadataFunction type MetadataFunctionRelated = original.MetadataFunctionRelated type MetadataPermissions = original.MetadataPermissions @@ -65,7 +65,6 @@ type MetadataTableColumnsItem = original.MetadataTableColumnsItem type MetadataTableRelated = original.MetadataTableRelated type MetadataWorkspace = original.MetadataWorkspace type MetadataWorkspaceRelated = original.MetadataWorkspaceRelated -type PostClient = original.PostClient type QueryBody = original.QueryBody type QueryClient = original.QueryClient type QueryResults = original.QueryResults @@ -74,17 +73,11 @@ type Table = original.Table func New() BaseClient { return original.New() } -func NewGetClient() GetClient { - return original.NewGetClient() +func NewMetadataClient() MetadataClient { + return original.NewMetadataClient() } -func NewGetClientWithBaseURI(baseURI string) GetClient { - return original.NewGetClientWithBaseURI(baseURI) -} -func NewPostClient() PostClient { - return original.NewPostClient() -} -func NewPostClientWithBaseURI(baseURI string) PostClient { - return original.NewPostClientWithBaseURI(baseURI) +func NewMetadataClientWithBaseURI(baseURI string) MetadataClient { + return original.NewMetadataClientWithBaseURI(baseURI) } func NewQueryClient() QueryClient { return original.NewQueryClient() diff --git a/profiles/latest/operationalinsights/operationalinsights/operationalinsightsapi/models.go b/profiles/latest/operationalinsights/operationalinsights/operationalinsightsapi/models.go index 33574cfb07c9..077ff883d4c0 100644 --- a/profiles/latest/operationalinsights/operationalinsights/operationalinsightsapi/models.go +++ b/profiles/latest/operationalinsights/operationalinsights/operationalinsightsapi/models.go @@ -21,6 +21,5 @@ package operationalinsightsapi import original "github.com/Azure/azure-sdk-for-go/services/operationalinsights/v1/operationalinsights/operationalinsightsapi" -type GetClientAPI = original.GetClientAPI -type PostClientAPI = original.PostClientAPI +type MetadataClientAPI = original.MetadataClientAPI type QueryClientAPI = original.QueryClientAPI diff --git a/profiles/latest/peering/mgmt/peering/models.go b/profiles/latest/peering/mgmt/peering/models.go new file mode 100644 index 000000000000..cd45f73b66d0 --- /dev/null +++ b/profiles/latest/peering/mgmt/peering/models.go @@ -0,0 +1,470 @@ +// +build go1.9 + +// Copyright 2020 Microsoft Corporation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This code was auto-generated by: +// github.com/Azure/azure-sdk-for-go/tools/profileBuilder + +package peering + +import ( + "context" + + original "github.com/Azure/azure-sdk-for-go/services/peering/mgmt/2020-04-01/peering" +) + +const ( + DefaultBaseURI = original.DefaultBaseURI +) + +type ConnectionState = original.ConnectionState + +const ( + Active ConnectionState = original.Active + Approved ConnectionState = original.Approved + None ConnectionState = original.None + PendingApproval ConnectionState = original.PendingApproval + ProvisioningCompleted ConnectionState = original.ProvisioningCompleted + ProvisioningFailed ConnectionState = original.ProvisioningFailed + ProvisioningStarted ConnectionState = original.ProvisioningStarted + Validating ConnectionState = original.Validating +) + +type DirectPeeringType = original.DirectPeeringType + +const ( + Cdn DirectPeeringType = original.Cdn + Edge DirectPeeringType = original.Edge + Internal DirectPeeringType = original.Internal + Ix DirectPeeringType = original.Ix + IxRs DirectPeeringType = original.IxRs + Transit DirectPeeringType = original.Transit +) + +type Family = original.Family + +const ( + Direct Family = original.Direct + Exchange Family = original.Exchange +) + +type Kind = original.Kind + +const ( + KindDirect Kind = original.KindDirect + KindExchange Kind = original.KindExchange +) + +type LearnedType = original.LearnedType + +const ( + LearnedTypeNone LearnedType = original.LearnedTypeNone + LearnedTypeViaServiceProvider LearnedType = original.LearnedTypeViaServiceProvider + LearnedTypeViaSession LearnedType = original.LearnedTypeViaSession +) + +type PrefixValidationState = original.PrefixValidationState + +const ( + PrefixValidationStateFailed PrefixValidationState = original.PrefixValidationStateFailed + PrefixValidationStateInvalid PrefixValidationState = original.PrefixValidationStateInvalid + PrefixValidationStateNone PrefixValidationState = original.PrefixValidationStateNone + PrefixValidationStatePending PrefixValidationState = original.PrefixValidationStatePending + PrefixValidationStateUnknown PrefixValidationState = original.PrefixValidationStateUnknown + PrefixValidationStateVerified PrefixValidationState = original.PrefixValidationStateVerified + PrefixValidationStateWarning PrefixValidationState = original.PrefixValidationStateWarning +) + +type ProvisioningState = original.ProvisioningState + +const ( + Deleting ProvisioningState = original.Deleting + Failed ProvisioningState = original.Failed + Succeeded ProvisioningState = original.Succeeded + Updating ProvisioningState = original.Updating +) + +type Role = original.Role + +const ( + RoleEscalation Role = original.RoleEscalation + RoleNoc Role = original.RoleNoc + RoleOther Role = original.RoleOther + RolePolicy Role = original.RolePolicy + RoleService Role = original.RoleService + RoleTechnical Role = original.RoleTechnical +) + +type SessionAddressProvider = original.SessionAddressProvider + +const ( + Microsoft SessionAddressProvider = original.Microsoft + Peer SessionAddressProvider = original.Peer +) + +type SessionStateV4 = original.SessionStateV4 + +const ( + SessionStateV4Active SessionStateV4 = original.SessionStateV4Active + SessionStateV4Connect SessionStateV4 = original.SessionStateV4Connect + SessionStateV4Established SessionStateV4 = original.SessionStateV4Established + SessionStateV4Idle SessionStateV4 = original.SessionStateV4Idle + SessionStateV4None SessionStateV4 = original.SessionStateV4None + SessionStateV4OpenConfirm SessionStateV4 = original.SessionStateV4OpenConfirm + SessionStateV4OpenReceived SessionStateV4 = original.SessionStateV4OpenReceived + SessionStateV4OpenSent SessionStateV4 = original.SessionStateV4OpenSent + SessionStateV4PendingAdd SessionStateV4 = original.SessionStateV4PendingAdd + SessionStateV4PendingRemove SessionStateV4 = original.SessionStateV4PendingRemove + SessionStateV4PendingUpdate SessionStateV4 = original.SessionStateV4PendingUpdate +) + +type SessionStateV6 = original.SessionStateV6 + +const ( + SessionStateV6Active SessionStateV6 = original.SessionStateV6Active + SessionStateV6Connect SessionStateV6 = original.SessionStateV6Connect + SessionStateV6Established SessionStateV6 = original.SessionStateV6Established + SessionStateV6Idle SessionStateV6 = original.SessionStateV6Idle + SessionStateV6None SessionStateV6 = original.SessionStateV6None + SessionStateV6OpenConfirm SessionStateV6 = original.SessionStateV6OpenConfirm + SessionStateV6OpenReceived SessionStateV6 = original.SessionStateV6OpenReceived + SessionStateV6OpenSent SessionStateV6 = original.SessionStateV6OpenSent + SessionStateV6PendingAdd SessionStateV6 = original.SessionStateV6PendingAdd + SessionStateV6PendingRemove SessionStateV6 = original.SessionStateV6PendingRemove + SessionStateV6PendingUpdate SessionStateV6 = original.SessionStateV6PendingUpdate +) + +type Size = original.Size + +const ( + Free Size = original.Free + Metered Size = original.Metered + Unlimited Size = original.Unlimited +) + +type Tier = original.Tier + +const ( + Basic Tier = original.Basic + Premium Tier = original.Premium +) + +type ValidationState = original.ValidationState + +const ( + ValidationStateApproved ValidationState = original.ValidationStateApproved + ValidationStateFailed ValidationState = original.ValidationStateFailed + ValidationStateNone ValidationState = original.ValidationStateNone + ValidationStatePending ValidationState = original.ValidationStatePending +) + +type BandwidthOffer = original.BandwidthOffer +type BaseClient = original.BaseClient +type BgpSession = original.BgpSession +type CheckServiceProviderAvailabilityInput = original.CheckServiceProviderAvailabilityInput +type ContactDetail = original.ContactDetail +type DirectConnection = original.DirectConnection +type DirectPeeringFacility = original.DirectPeeringFacility +type ErrorDetail = original.ErrorDetail +type ErrorResponse = original.ErrorResponse +type ExchangeConnection = original.ExchangeConnection +type ExchangePeeringFacility = original.ExchangePeeringFacility +type LegacyPeeringsClient = original.LegacyPeeringsClient +type ListResult = original.ListResult +type ListResultIterator = original.ListResultIterator +type ListResultPage = original.ListResultPage +type Location = original.Location +type LocationListResult = original.LocationListResult +type LocationListResultIterator = original.LocationListResultIterator +type LocationListResultPage = original.LocationListResultPage +type LocationProperties = original.LocationProperties +type LocationPropertiesDirect = original.LocationPropertiesDirect +type LocationPropertiesExchange = original.LocationPropertiesExchange +type LocationsClient = original.LocationsClient +type Model = original.Model +type Operation = original.Operation +type OperationDisplayInfo = original.OperationDisplayInfo +type OperationListResult = original.OperationListResult +type OperationListResultIterator = original.OperationListResultIterator +type OperationListResultPage = original.OperationListResultPage +type OperationsClient = original.OperationsClient +type PeerAsn = original.PeerAsn +type PeerAsnListResult = original.PeerAsnListResult +type PeerAsnListResultIterator = original.PeerAsnListResultIterator +type PeerAsnListResultPage = original.PeerAsnListResultPage +type PeerAsnProperties = original.PeerAsnProperties +type PeerAsnsClient = original.PeerAsnsClient +type PeeringsClient = original.PeeringsClient +type PrefixesClient = original.PrefixesClient +type Properties = original.Properties +type PropertiesDirect = original.PropertiesDirect +type PropertiesExchange = original.PropertiesExchange +type ReceivedRoute = original.ReceivedRoute +type ReceivedRouteListResult = original.ReceivedRouteListResult +type ReceivedRouteListResultIterator = original.ReceivedRouteListResultIterator +type ReceivedRouteListResultPage = original.ReceivedRouteListResultPage +type ReceivedRoutesClient = original.ReceivedRoutesClient +type RegisteredAsn = original.RegisteredAsn +type RegisteredAsnListResult = original.RegisteredAsnListResult +type RegisteredAsnListResultIterator = original.RegisteredAsnListResultIterator +type RegisteredAsnListResultPage = original.RegisteredAsnListResultPage +type RegisteredAsnProperties = original.RegisteredAsnProperties +type RegisteredAsnsClient = original.RegisteredAsnsClient +type RegisteredPrefix = original.RegisteredPrefix +type RegisteredPrefixListResult = original.RegisteredPrefixListResult +type RegisteredPrefixListResultIterator = original.RegisteredPrefixListResultIterator +type RegisteredPrefixListResultPage = original.RegisteredPrefixListResultPage +type RegisteredPrefixProperties = original.RegisteredPrefixProperties +type RegisteredPrefixesClient = original.RegisteredPrefixesClient +type Resource = original.Resource +type ResourceTags = original.ResourceTags +type Service = original.Service +type ServiceCountriesClient = original.ServiceCountriesClient +type ServiceCountry = original.ServiceCountry +type ServiceCountryListResult = original.ServiceCountryListResult +type ServiceCountryListResultIterator = original.ServiceCountryListResultIterator +type ServiceCountryListResultPage = original.ServiceCountryListResultPage +type ServiceListResult = original.ServiceListResult +type ServiceListResultIterator = original.ServiceListResultIterator +type ServiceListResultPage = original.ServiceListResultPage +type ServiceLocation = original.ServiceLocation +type ServiceLocationListResult = original.ServiceLocationListResult +type ServiceLocationListResultIterator = original.ServiceLocationListResultIterator +type ServiceLocationListResultPage = original.ServiceLocationListResultPage +type ServiceLocationProperties = original.ServiceLocationProperties +type ServiceLocationsClient = original.ServiceLocationsClient +type ServicePrefix = original.ServicePrefix +type ServicePrefixEvent = original.ServicePrefixEvent +type ServicePrefixListResult = original.ServicePrefixListResult +type ServicePrefixListResultIterator = original.ServicePrefixListResultIterator +type ServicePrefixListResultPage = original.ServicePrefixListResultPage +type ServicePrefixProperties = original.ServicePrefixProperties +type ServiceProperties = original.ServiceProperties +type ServiceProvider = original.ServiceProvider +type ServiceProviderListResult = original.ServiceProviderListResult +type ServiceProviderListResultIterator = original.ServiceProviderListResultIterator +type ServiceProviderListResultPage = original.ServiceProviderListResultPage +type ServiceProviderProperties = original.ServiceProviderProperties +type ServiceProvidersClient = original.ServiceProvidersClient +type ServiceSku = original.ServiceSku +type ServicesClient = original.ServicesClient +type Sku = original.Sku +type String = original.String +type SubResource = original.SubResource + +func New(subscriptionID string) BaseClient { + return original.New(subscriptionID) +} +func NewLegacyPeeringsClient(subscriptionID string) LegacyPeeringsClient { + return original.NewLegacyPeeringsClient(subscriptionID) +} +func NewLegacyPeeringsClientWithBaseURI(baseURI string, subscriptionID string) LegacyPeeringsClient { + return original.NewLegacyPeeringsClientWithBaseURI(baseURI, subscriptionID) +} +func NewListResultIterator(page ListResultPage) ListResultIterator { + return original.NewListResultIterator(page) +} +func NewListResultPage(getNextPage func(context.Context, ListResult) (ListResult, error)) ListResultPage { + return original.NewListResultPage(getNextPage) +} +func NewLocationListResultIterator(page LocationListResultPage) LocationListResultIterator { + return original.NewLocationListResultIterator(page) +} +func NewLocationListResultPage(getNextPage func(context.Context, LocationListResult) (LocationListResult, error)) LocationListResultPage { + return original.NewLocationListResultPage(getNextPage) +} +func NewLocationsClient(subscriptionID string) LocationsClient { + return original.NewLocationsClient(subscriptionID) +} +func NewLocationsClientWithBaseURI(baseURI string, subscriptionID string) LocationsClient { + return original.NewLocationsClientWithBaseURI(baseURI, subscriptionID) +} +func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator { + return original.NewOperationListResultIterator(page) +} +func NewOperationListResultPage(getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { + return original.NewOperationListResultPage(getNextPage) +} +func NewOperationsClient(subscriptionID string) OperationsClient { + return original.NewOperationsClient(subscriptionID) +} +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID) +} +func NewPeerAsnListResultIterator(page PeerAsnListResultPage) PeerAsnListResultIterator { + return original.NewPeerAsnListResultIterator(page) +} +func NewPeerAsnListResultPage(getNextPage func(context.Context, PeerAsnListResult) (PeerAsnListResult, error)) PeerAsnListResultPage { + return original.NewPeerAsnListResultPage(getNextPage) +} +func NewPeerAsnsClient(subscriptionID string) PeerAsnsClient { + return original.NewPeerAsnsClient(subscriptionID) +} +func NewPeerAsnsClientWithBaseURI(baseURI string, subscriptionID string) PeerAsnsClient { + return original.NewPeerAsnsClientWithBaseURI(baseURI, subscriptionID) +} +func NewPeeringsClient(subscriptionID string) PeeringsClient { + return original.NewPeeringsClient(subscriptionID) +} +func NewPeeringsClientWithBaseURI(baseURI string, subscriptionID string) PeeringsClient { + return original.NewPeeringsClientWithBaseURI(baseURI, subscriptionID) +} +func NewPrefixesClient(subscriptionID string) PrefixesClient { + return original.NewPrefixesClient(subscriptionID) +} +func NewPrefixesClientWithBaseURI(baseURI string, subscriptionID string) PrefixesClient { + return original.NewPrefixesClientWithBaseURI(baseURI, subscriptionID) +} +func NewReceivedRouteListResultIterator(page ReceivedRouteListResultPage) ReceivedRouteListResultIterator { + return original.NewReceivedRouteListResultIterator(page) +} +func NewReceivedRouteListResultPage(getNextPage func(context.Context, ReceivedRouteListResult) (ReceivedRouteListResult, error)) ReceivedRouteListResultPage { + return original.NewReceivedRouteListResultPage(getNextPage) +} +func NewReceivedRoutesClient(subscriptionID string) ReceivedRoutesClient { + return original.NewReceivedRoutesClient(subscriptionID) +} +func NewReceivedRoutesClientWithBaseURI(baseURI string, subscriptionID string) ReceivedRoutesClient { + return original.NewReceivedRoutesClientWithBaseURI(baseURI, subscriptionID) +} +func NewRegisteredAsnListResultIterator(page RegisteredAsnListResultPage) RegisteredAsnListResultIterator { + return original.NewRegisteredAsnListResultIterator(page) +} +func NewRegisteredAsnListResultPage(getNextPage func(context.Context, RegisteredAsnListResult) (RegisteredAsnListResult, error)) RegisteredAsnListResultPage { + return original.NewRegisteredAsnListResultPage(getNextPage) +} +func NewRegisteredAsnsClient(subscriptionID string) RegisteredAsnsClient { + return original.NewRegisteredAsnsClient(subscriptionID) +} +func NewRegisteredAsnsClientWithBaseURI(baseURI string, subscriptionID string) RegisteredAsnsClient { + return original.NewRegisteredAsnsClientWithBaseURI(baseURI, subscriptionID) +} +func NewRegisteredPrefixListResultIterator(page RegisteredPrefixListResultPage) RegisteredPrefixListResultIterator { + return original.NewRegisteredPrefixListResultIterator(page) +} +func NewRegisteredPrefixListResultPage(getNextPage func(context.Context, RegisteredPrefixListResult) (RegisteredPrefixListResult, error)) RegisteredPrefixListResultPage { + return original.NewRegisteredPrefixListResultPage(getNextPage) +} +func NewRegisteredPrefixesClient(subscriptionID string) RegisteredPrefixesClient { + return original.NewRegisteredPrefixesClient(subscriptionID) +} +func NewRegisteredPrefixesClientWithBaseURI(baseURI string, subscriptionID string) RegisteredPrefixesClient { + return original.NewRegisteredPrefixesClientWithBaseURI(baseURI, subscriptionID) +} +func NewServiceCountriesClient(subscriptionID string) ServiceCountriesClient { + return original.NewServiceCountriesClient(subscriptionID) +} +func NewServiceCountriesClientWithBaseURI(baseURI string, subscriptionID string) ServiceCountriesClient { + return original.NewServiceCountriesClientWithBaseURI(baseURI, subscriptionID) +} +func NewServiceCountryListResultIterator(page ServiceCountryListResultPage) ServiceCountryListResultIterator { + return original.NewServiceCountryListResultIterator(page) +} +func NewServiceCountryListResultPage(getNextPage func(context.Context, ServiceCountryListResult) (ServiceCountryListResult, error)) ServiceCountryListResultPage { + return original.NewServiceCountryListResultPage(getNextPage) +} +func NewServiceListResultIterator(page ServiceListResultPage) ServiceListResultIterator { + return original.NewServiceListResultIterator(page) +} +func NewServiceListResultPage(getNextPage func(context.Context, ServiceListResult) (ServiceListResult, error)) ServiceListResultPage { + return original.NewServiceListResultPage(getNextPage) +} +func NewServiceLocationListResultIterator(page ServiceLocationListResultPage) ServiceLocationListResultIterator { + return original.NewServiceLocationListResultIterator(page) +} +func NewServiceLocationListResultPage(getNextPage func(context.Context, ServiceLocationListResult) (ServiceLocationListResult, error)) ServiceLocationListResultPage { + return original.NewServiceLocationListResultPage(getNextPage) +} +func NewServiceLocationsClient(subscriptionID string) ServiceLocationsClient { + return original.NewServiceLocationsClient(subscriptionID) +} +func NewServiceLocationsClientWithBaseURI(baseURI string, subscriptionID string) ServiceLocationsClient { + return original.NewServiceLocationsClientWithBaseURI(baseURI, subscriptionID) +} +func NewServicePrefixListResultIterator(page ServicePrefixListResultPage) ServicePrefixListResultIterator { + return original.NewServicePrefixListResultIterator(page) +} +func NewServicePrefixListResultPage(getNextPage func(context.Context, ServicePrefixListResult) (ServicePrefixListResult, error)) ServicePrefixListResultPage { + return original.NewServicePrefixListResultPage(getNextPage) +} +func NewServiceProviderListResultIterator(page ServiceProviderListResultPage) ServiceProviderListResultIterator { + return original.NewServiceProviderListResultIterator(page) +} +func NewServiceProviderListResultPage(getNextPage func(context.Context, ServiceProviderListResult) (ServiceProviderListResult, error)) ServiceProviderListResultPage { + return original.NewServiceProviderListResultPage(getNextPage) +} +func NewServiceProvidersClient(subscriptionID string) ServiceProvidersClient { + return original.NewServiceProvidersClient(subscriptionID) +} +func NewServiceProvidersClientWithBaseURI(baseURI string, subscriptionID string) ServiceProvidersClient { + return original.NewServiceProvidersClientWithBaseURI(baseURI, subscriptionID) +} +func NewServicesClient(subscriptionID string) ServicesClient { + return original.NewServicesClient(subscriptionID) +} +func NewServicesClientWithBaseURI(baseURI string, subscriptionID string) ServicesClient { + return original.NewServicesClientWithBaseURI(baseURI, subscriptionID) +} +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return original.NewWithBaseURI(baseURI, subscriptionID) +} +func PossibleConnectionStateValues() []ConnectionState { + return original.PossibleConnectionStateValues() +} +func PossibleDirectPeeringTypeValues() []DirectPeeringType { + return original.PossibleDirectPeeringTypeValues() +} +func PossibleFamilyValues() []Family { + return original.PossibleFamilyValues() +} +func PossibleKindValues() []Kind { + return original.PossibleKindValues() +} +func PossibleLearnedTypeValues() []LearnedType { + return original.PossibleLearnedTypeValues() +} +func PossiblePrefixValidationStateValues() []PrefixValidationState { + return original.PossiblePrefixValidationStateValues() +} +func PossibleProvisioningStateValues() []ProvisioningState { + return original.PossibleProvisioningStateValues() +} +func PossibleRoleValues() []Role { + return original.PossibleRoleValues() +} +func PossibleSessionAddressProviderValues() []SessionAddressProvider { + return original.PossibleSessionAddressProviderValues() +} +func PossibleSessionStateV4Values() []SessionStateV4 { + return original.PossibleSessionStateV4Values() +} +func PossibleSessionStateV6Values() []SessionStateV6 { + return original.PossibleSessionStateV6Values() +} +func PossibleSizeValues() []Size { + return original.PossibleSizeValues() +} +func PossibleTierValues() []Tier { + return original.PossibleTierValues() +} +func PossibleValidationStateValues() []ValidationState { + return original.PossibleValidationStateValues() +} +func UserAgent() string { + return original.UserAgent() + " profiles/latest" +} +func Version() string { + return original.Version() +} diff --git a/profiles/latest/peering/mgmt/peering/peeringapi/models.go b/profiles/latest/peering/mgmt/peering/peeringapi/models.go new file mode 100644 index 000000000000..4faad3dcb584 --- /dev/null +++ b/profiles/latest/peering/mgmt/peering/peeringapi/models.go @@ -0,0 +1,37 @@ +// +build go1.9 + +// Copyright 2020 Microsoft Corporation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This code was auto-generated by: +// github.com/Azure/azure-sdk-for-go/tools/profileBuilder + +package peeringapi + +import original "github.com/Azure/azure-sdk-for-go/services/peering/mgmt/2020-04-01/peering/peeringapi" + +type BaseClientAPI = original.BaseClientAPI +type LegacyPeeringsClientAPI = original.LegacyPeeringsClientAPI +type LocationsClientAPI = original.LocationsClientAPI +type OperationsClientAPI = original.OperationsClientAPI +type PeerAsnsClientAPI = original.PeerAsnsClientAPI +type PeeringsClientAPI = original.PeeringsClientAPI +type PrefixesClientAPI = original.PrefixesClientAPI +type ReceivedRoutesClientAPI = original.ReceivedRoutesClientAPI +type RegisteredAsnsClientAPI = original.RegisteredAsnsClientAPI +type RegisteredPrefixesClientAPI = original.RegisteredPrefixesClientAPI +type ServiceCountriesClientAPI = original.ServiceCountriesClientAPI +type ServiceLocationsClientAPI = original.ServiceLocationsClientAPI +type ServiceProvidersClientAPI = original.ServiceProvidersClientAPI +type ServicesClientAPI = original.ServicesClientAPI diff --git a/profiles/latest/policyinsights/mgmt/policyinsights/models.go b/profiles/latest/policyinsights/mgmt/policyinsights/models.go index 652b30c55391..ec5e5af2c778 100644 --- a/profiles/latest/policyinsights/mgmt/policyinsights/models.go +++ b/profiles/latest/policyinsights/mgmt/policyinsights/models.go @@ -62,6 +62,8 @@ type PolicyEvaluationDetails = original.PolicyEvaluationDetails type PolicyEvent = original.PolicyEvent type PolicyEventsClient = original.PolicyEventsClient type PolicyEventsQueryResults = original.PolicyEventsQueryResults +type PolicyEventsQueryResultsIterator = original.PolicyEventsQueryResultsIterator +type PolicyEventsQueryResultsPage = original.PolicyEventsQueryResultsPage type PolicyGroupSummary = original.PolicyGroupSummary type PolicyMetadata = original.PolicyMetadata type PolicyMetadataClient = original.PolicyMetadataClient @@ -73,6 +75,8 @@ type PolicyMetadataSlimProperties = original.PolicyMetadataSlimProperties type PolicyState = original.PolicyState type PolicyStatesClient = original.PolicyStatesClient type PolicyStatesQueryResults = original.PolicyStatesQueryResults +type PolicyStatesQueryResultsIterator = original.PolicyStatesQueryResultsIterator +type PolicyStatesQueryResultsPage = original.PolicyStatesQueryResultsPage type PolicyStatesTriggerResourceGroupEvaluationFuture = original.PolicyStatesTriggerResourceGroupEvaluationFuture type PolicyStatesTriggerSubscriptionEvaluationFuture = original.PolicyStatesTriggerSubscriptionEvaluationFuture type PolicyTrackedResource = original.PolicyTrackedResource @@ -95,7 +99,6 @@ type RemediationListResultPage = original.RemediationListResultPage type RemediationProperties = original.RemediationProperties type RemediationsClient = original.RemediationsClient type SlimPolicyMetadata = original.SlimPolicyMetadata -type String = original.String type SummarizeResults = original.SummarizeResults type Summary = original.Summary type SummaryResults = original.SummaryResults @@ -117,6 +120,12 @@ func NewPolicyEventsClient() PolicyEventsClient { func NewPolicyEventsClientWithBaseURI(baseURI string) PolicyEventsClient { return original.NewPolicyEventsClientWithBaseURI(baseURI) } +func NewPolicyEventsQueryResultsIterator(page PolicyEventsQueryResultsPage) PolicyEventsQueryResultsIterator { + return original.NewPolicyEventsQueryResultsIterator(page) +} +func NewPolicyEventsQueryResultsPage(getNextPage func(context.Context, PolicyEventsQueryResults) (PolicyEventsQueryResults, error)) PolicyEventsQueryResultsPage { + return original.NewPolicyEventsQueryResultsPage(getNextPage) +} func NewPolicyMetadataClient() PolicyMetadataClient { return original.NewPolicyMetadataClient() } @@ -135,6 +144,12 @@ func NewPolicyStatesClient() PolicyStatesClient { func NewPolicyStatesClientWithBaseURI(baseURI string) PolicyStatesClient { return original.NewPolicyStatesClientWithBaseURI(baseURI) } +func NewPolicyStatesQueryResultsIterator(page PolicyStatesQueryResultsPage) PolicyStatesQueryResultsIterator { + return original.NewPolicyStatesQueryResultsIterator(page) +} +func NewPolicyStatesQueryResultsPage(getNextPage func(context.Context, PolicyStatesQueryResults) (PolicyStatesQueryResults, error)) PolicyStatesQueryResultsPage { + return original.NewPolicyStatesQueryResultsPage(getNextPage) +} func NewPolicyTrackedResourcesClient() PolicyTrackedResourcesClient { return original.NewPolicyTrackedResourcesClient() } diff --git a/profiles/latest/recoveryservices/mgmt/siterecovery/models.go b/profiles/latest/recoveryservices/mgmt/siterecovery/models.go index 9a946855ae43..b5555a5f1a2c 100644 --- a/profiles/latest/recoveryservices/mgmt/siterecovery/models.go +++ b/profiles/latest/recoveryservices/mgmt/siterecovery/models.go @@ -361,8 +361,8 @@ const ( type InstanceTypeBasicRecoveryPlanProviderSpecificDetails = original.InstanceTypeBasicRecoveryPlanProviderSpecificDetails const ( - InstanceTypeRecoveryPlanA2ADetails InstanceTypeBasicRecoveryPlanProviderSpecificDetails = original.InstanceTypeRecoveryPlanA2ADetails - InstanceTypeRecoveryPlanProviderSpecificDetails InstanceTypeBasicRecoveryPlanProviderSpecificDetails = original.InstanceTypeRecoveryPlanProviderSpecificDetails + InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A InstanceTypeBasicRecoveryPlanProviderSpecificDetails = original.InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A + InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeRecoveryPlanProviderSpecificDetails InstanceTypeBasicRecoveryPlanProviderSpecificDetails = original.InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeRecoveryPlanProviderSpecificDetails ) type InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = original.InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput diff --git a/profiles/latest/signalr/mgmt/signalr/models.go b/profiles/latest/signalr/mgmt/signalr/models.go index 8e7b499f007f..253a3b469bb1 100644 --- a/profiles/latest/signalr/mgmt/signalr/models.go +++ b/profiles/latest/signalr/mgmt/signalr/models.go @@ -22,17 +22,25 @@ package signalr import ( "context" - original "github.com/Azure/azure-sdk-for-go/services/signalr/mgmt/2018-10-01/signalr" + original "github.com/Azure/azure-sdk-for-go/services/signalr/mgmt/2020-05-01/signalr" ) const ( DefaultBaseURI = original.DefaultBaseURI ) +type ACLAction = original.ACLAction + +const ( + Allow ACLAction = original.Allow + Deny ACLAction = original.Deny +) + type FeatureFlags = original.FeatureFlags const ( EnableConnectivityLogs FeatureFlags = original.EnableConnectivityLogs + EnableMessagingLogs FeatureFlags = original.EnableMessagingLogs ServiceMode FeatureFlags = original.ServiceMode ) @@ -43,6 +51,15 @@ const ( Secondary KeyType = original.Secondary ) +type PrivateLinkServiceConnectionStatus = original.PrivateLinkServiceConnectionStatus + +const ( + Approved PrivateLinkServiceConnectionStatus = original.Approved + Disconnected PrivateLinkServiceConnectionStatus = original.Disconnected + Pending PrivateLinkServiceConnectionStatus = original.Pending + Rejected PrivateLinkServiceConnectionStatus = original.Rejected +) + type ProvisioningState = original.ProvisioningState const ( @@ -57,6 +74,21 @@ const ( Updating ProvisioningState = original.Updating ) +type RequestType = original.RequestType + +const ( + ClientConnection RequestType = original.ClientConnection + RESTAPI RequestType = original.RESTAPI + ServerConnection RequestType = original.ServerConnection +) + +type ServiceKind = original.ServiceKind + +const ( + RawWebSockets ServiceKind = original.RawWebSockets + SignalR ServiceKind = original.SignalR +) + type SkuTier = original.SkuTier const ( @@ -71,7 +103,6 @@ type Client = original.Client type CorsSettings = original.CorsSettings type CreateOrUpdateFuture = original.CreateOrUpdateFuture type CreateOrUpdateProperties = original.CreateOrUpdateProperties -type CreateParameters = original.CreateParameters type DeleteFuture = original.DeleteFuture type Dimension = original.Dimension type ErrorResponse = original.ErrorResponse @@ -82,6 +113,8 @@ type LogSpecification = original.LogSpecification type MetricSpecification = original.MetricSpecification type NameAvailability = original.NameAvailability type NameAvailabilityParameters = original.NameAvailabilityParameters +type NetworkACL = original.NetworkACL +type NetworkACLs = original.NetworkACLs type Operation = original.Operation type OperationDisplay = original.OperationDisplay type OperationList = original.OperationList @@ -89,7 +122,21 @@ type OperationListIterator = original.OperationListIterator type OperationListPage = original.OperationListPage type OperationProperties = original.OperationProperties type OperationsClient = original.OperationsClient +type PrivateEndpoint = original.PrivateEndpoint +type PrivateEndpointACL = original.PrivateEndpointACL +type PrivateEndpointConnection = original.PrivateEndpointConnection +type PrivateEndpointConnectionProperties = original.PrivateEndpointConnectionProperties +type PrivateEndpointConnectionsClient = original.PrivateEndpointConnectionsClient +type PrivateEndpointConnectionsDeleteFuture = original.PrivateEndpointConnectionsDeleteFuture +type PrivateLinkResource = original.PrivateLinkResource +type PrivateLinkResourceList = original.PrivateLinkResourceList +type PrivateLinkResourceListIterator = original.PrivateLinkResourceListIterator +type PrivateLinkResourceListPage = original.PrivateLinkResourceListPage +type PrivateLinkResourceProperties = original.PrivateLinkResourceProperties +type PrivateLinkResourcesClient = original.PrivateLinkResourcesClient +type PrivateLinkServiceConnectionState = original.PrivateLinkServiceConnectionState type Properties = original.Properties +type ProxyResource = original.ProxyResource type RegenerateKeyFuture = original.RegenerateKeyFuture type RegenerateKeyParameters = original.RegenerateKeyParameters type Resource = original.Resource @@ -99,10 +146,11 @@ type ResourceListPage = original.ResourceListPage type ResourceSku = original.ResourceSku type ResourceType = original.ResourceType type RestartFuture = original.RestartFuture +type ServerlessUpstreamSettings = original.ServerlessUpstreamSettings type ServiceSpecification = original.ServiceSpecification type TrackedResource = original.TrackedResource type UpdateFuture = original.UpdateFuture -type UpdateParameters = original.UpdateParameters +type UpstreamTemplate = original.UpstreamTemplate type Usage = original.Usage type UsageList = original.UsageList type UsageListIterator = original.UsageListIterator @@ -131,6 +179,24 @@ func NewOperationsClient(subscriptionID string) OperationsClient { func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID) } +func NewPrivateEndpointConnectionsClient(subscriptionID string) PrivateEndpointConnectionsClient { + return original.NewPrivateEndpointConnectionsClient(subscriptionID) +} +func NewPrivateEndpointConnectionsClientWithBaseURI(baseURI string, subscriptionID string) PrivateEndpointConnectionsClient { + return original.NewPrivateEndpointConnectionsClientWithBaseURI(baseURI, subscriptionID) +} +func NewPrivateLinkResourceListIterator(page PrivateLinkResourceListPage) PrivateLinkResourceListIterator { + return original.NewPrivateLinkResourceListIterator(page) +} +func NewPrivateLinkResourceListPage(getNextPage func(context.Context, PrivateLinkResourceList) (PrivateLinkResourceList, error)) PrivateLinkResourceListPage { + return original.NewPrivateLinkResourceListPage(getNextPage) +} +func NewPrivateLinkResourcesClient(subscriptionID string) PrivateLinkResourcesClient { + return original.NewPrivateLinkResourcesClient(subscriptionID) +} +func NewPrivateLinkResourcesClientWithBaseURI(baseURI string, subscriptionID string) PrivateLinkResourcesClient { + return original.NewPrivateLinkResourcesClientWithBaseURI(baseURI, subscriptionID) +} func NewResourceListIterator(page ResourceListPage) ResourceListIterator { return original.NewResourceListIterator(page) } @@ -152,15 +218,27 @@ func NewUsagesClientWithBaseURI(baseURI string, subscriptionID string) UsagesCli func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { return original.NewWithBaseURI(baseURI, subscriptionID) } +func PossibleACLActionValues() []ACLAction { + return original.PossibleACLActionValues() +} func PossibleFeatureFlagsValues() []FeatureFlags { return original.PossibleFeatureFlagsValues() } func PossibleKeyTypeValues() []KeyType { return original.PossibleKeyTypeValues() } +func PossiblePrivateLinkServiceConnectionStatusValues() []PrivateLinkServiceConnectionStatus { + return original.PossiblePrivateLinkServiceConnectionStatusValues() +} func PossibleProvisioningStateValues() []ProvisioningState { return original.PossibleProvisioningStateValues() } +func PossibleRequestTypeValues() []RequestType { + return original.PossibleRequestTypeValues() +} +func PossibleServiceKindValues() []ServiceKind { + return original.PossibleServiceKindValues() +} func PossibleSkuTierValues() []SkuTier { return original.PossibleSkuTierValues() } diff --git a/profiles/latest/signalr/mgmt/signalr/signalrapi/models.go b/profiles/latest/signalr/mgmt/signalr/signalrapi/models.go index a6761c7662e2..0e70654c13f8 100644 --- a/profiles/latest/signalr/mgmt/signalr/signalrapi/models.go +++ b/profiles/latest/signalr/mgmt/signalr/signalrapi/models.go @@ -19,8 +19,10 @@ package signalrapi -import original "github.com/Azure/azure-sdk-for-go/services/signalr/mgmt/2018-10-01/signalr/signalrapi" +import original "github.com/Azure/azure-sdk-for-go/services/signalr/mgmt/2020-05-01/signalr/signalrapi" type ClientAPI = original.ClientAPI type OperationsClientAPI = original.OperationsClientAPI +type PrivateEndpointConnectionsClientAPI = original.PrivateEndpointConnectionsClientAPI +type PrivateLinkResourcesClientAPI = original.PrivateLinkResourcesClientAPI type UsagesClientAPI = original.UsagesClientAPI diff --git a/profiles/latest/storage/mgmt/storage/models.go b/profiles/latest/storage/mgmt/storage/models.go index 96eba457f9ac..9f49cce00959 100644 --- a/profiles/latest/storage/mgmt/storage/models.go +++ b/profiles/latest/storage/mgmt/storage/models.go @@ -217,6 +217,12 @@ const ( LeaseStatusUnlocked LeaseStatus = original.LeaseStatusUnlocked ) +type ListContainersInclude = original.ListContainersInclude + +const ( + Deleted ListContainersInclude = original.Deleted +) + type ListKeyExpand = original.ListKeyExpand const ( @@ -226,7 +232,7 @@ const ( type ListSharesExpand = original.ListSharesExpand const ( - Deleted ListSharesExpand = original.Deleted + ListSharesExpandDeleted ListSharesExpand = original.ListSharesExpandDeleted ) type Permissions = original.Permissions @@ -465,7 +471,17 @@ type ListContainerItem = original.ListContainerItem type ListContainerItems = original.ListContainerItems type ListContainerItemsIterator = original.ListContainerItemsIterator type ListContainerItemsPage = original.ListContainerItemsPage +type ListQueue = original.ListQueue +type ListQueueProperties = original.ListQueueProperties +type ListQueueResource = original.ListQueueResource +type ListQueueResourceIterator = original.ListQueueResourceIterator +type ListQueueResourcePage = original.ListQueueResourcePage +type ListQueueServices = original.ListQueueServices type ListServiceSasResponse = original.ListServiceSasResponse +type ListTableResource = original.ListTableResource +type ListTableResourceIterator = original.ListTableResourceIterator +type ListTableResourcePage = original.ListTableResourcePage +type ListTableServices = original.ListTableServices type ManagementPoliciesClient = original.ManagementPoliciesClient type ManagementPolicy = original.ManagementPolicy type ManagementPolicyAction = original.ManagementPolicyAction @@ -491,6 +507,7 @@ type OperationProperties = original.OperationProperties type OperationsClient = original.OperationsClient type PrivateEndpoint = original.PrivateEndpoint type PrivateEndpointConnection = original.PrivateEndpointConnection +type PrivateEndpointConnectionListResult = original.PrivateEndpointConnectionListResult type PrivateEndpointConnectionProperties = original.PrivateEndpointConnectionProperties type PrivateEndpointConnectionsClient = original.PrivateEndpointConnectionsClient type PrivateLinkResource = original.PrivateLinkResource @@ -499,6 +516,12 @@ type PrivateLinkResourceProperties = original.PrivateLinkResourceProperties type PrivateLinkResourcesClient = original.PrivateLinkResourcesClient type PrivateLinkServiceConnectionState = original.PrivateLinkServiceConnectionState type ProxyResource = original.ProxyResource +type Queue = original.Queue +type QueueClient = original.QueueClient +type QueueProperties = original.QueueProperties +type QueueServiceProperties = original.QueueServiceProperties +type QueueServicePropertiesProperties = original.QueueServicePropertiesProperties +type QueueServicesClient = original.QueueServicesClient type Resource = original.Resource type RestorePolicyProperties = original.RestorePolicyProperties type Restriction = original.Restriction @@ -510,6 +533,12 @@ type Sku = original.Sku type SkuInformation = original.SkuInformation type SkuListResult = original.SkuListResult type SkusClient = original.SkusClient +type Table = original.Table +type TableClient = original.TableClient +type TableProperties = original.TableProperties +type TableServiceProperties = original.TableServiceProperties +type TableServicePropertiesProperties = original.TableServicePropertiesProperties +type TableServicesClient = original.TableServicesClient type TagFilter = original.TagFilter type TagProperty = original.TagProperty type TrackedResource = original.TrackedResource @@ -583,6 +612,18 @@ func NewListContainerItemsIterator(page ListContainerItemsPage) ListContainerIte func NewListContainerItemsPage(getNextPage func(context.Context, ListContainerItems) (ListContainerItems, error)) ListContainerItemsPage { return original.NewListContainerItemsPage(getNextPage) } +func NewListQueueResourceIterator(page ListQueueResourcePage) ListQueueResourceIterator { + return original.NewListQueueResourceIterator(page) +} +func NewListQueueResourcePage(getNextPage func(context.Context, ListQueueResource) (ListQueueResource, error)) ListQueueResourcePage { + return original.NewListQueueResourcePage(getNextPage) +} +func NewListTableResourceIterator(page ListTableResourcePage) ListTableResourceIterator { + return original.NewListTableResourceIterator(page) +} +func NewListTableResourcePage(getNextPage func(context.Context, ListTableResource) (ListTableResource, error)) ListTableResourcePage { + return original.NewListTableResourcePage(getNextPage) +} func NewManagementPoliciesClient(subscriptionID string) ManagementPoliciesClient { return original.NewManagementPoliciesClient(subscriptionID) } @@ -613,12 +654,36 @@ func NewPrivateLinkResourcesClient(subscriptionID string) PrivateLinkResourcesCl func NewPrivateLinkResourcesClientWithBaseURI(baseURI string, subscriptionID string) PrivateLinkResourcesClient { return original.NewPrivateLinkResourcesClientWithBaseURI(baseURI, subscriptionID) } +func NewQueueClient(subscriptionID string) QueueClient { + return original.NewQueueClient(subscriptionID) +} +func NewQueueClientWithBaseURI(baseURI string, subscriptionID string) QueueClient { + return original.NewQueueClientWithBaseURI(baseURI, subscriptionID) +} +func NewQueueServicesClient(subscriptionID string) QueueServicesClient { + return original.NewQueueServicesClient(subscriptionID) +} +func NewQueueServicesClientWithBaseURI(baseURI string, subscriptionID string) QueueServicesClient { + return original.NewQueueServicesClientWithBaseURI(baseURI, subscriptionID) +} func NewSkusClient(subscriptionID string) SkusClient { return original.NewSkusClient(subscriptionID) } func NewSkusClientWithBaseURI(baseURI string, subscriptionID string) SkusClient { return original.NewSkusClientWithBaseURI(baseURI, subscriptionID) } +func NewTableClient(subscriptionID string) TableClient { + return original.NewTableClient(subscriptionID) +} +func NewTableClientWithBaseURI(baseURI string, subscriptionID string) TableClient { + return original.NewTableClientWithBaseURI(baseURI, subscriptionID) +} +func NewTableServicesClient(subscriptionID string) TableServicesClient { + return original.NewTableServicesClient(subscriptionID) +} +func NewTableServicesClientWithBaseURI(baseURI string, subscriptionID string) TableServicesClient { + return original.NewTableServicesClientWithBaseURI(baseURI, subscriptionID) +} func NewUsagesClient(subscriptionID string) UsagesClient { return original.NewUsagesClient(subscriptionID) } @@ -703,6 +768,9 @@ func PossibleLeaseStateValues() []LeaseState { func PossibleLeaseStatusValues() []LeaseStatus { return original.PossibleLeaseStatusValues() } +func PossibleListContainersIncludeValues() []ListContainersInclude { + return original.PossibleListContainersIncludeValues() +} func PossibleListKeyExpandValues() []ListKeyExpand { return original.PossibleListKeyExpandValues() } diff --git a/profiles/latest/storage/mgmt/storage/storageapi/models.go b/profiles/latest/storage/mgmt/storage/storageapi/models.go index 7c2858b890d0..2954e02cbc90 100644 --- a/profiles/latest/storage/mgmt/storage/storageapi/models.go +++ b/profiles/latest/storage/mgmt/storage/storageapi/models.go @@ -32,5 +32,9 @@ type ObjectReplicationPoliciesClientAPI = original.ObjectReplicationPoliciesClie type OperationsClientAPI = original.OperationsClientAPI type PrivateEndpointConnectionsClientAPI = original.PrivateEndpointConnectionsClientAPI type PrivateLinkResourcesClientAPI = original.PrivateLinkResourcesClientAPI +type QueueClientAPI = original.QueueClientAPI +type QueueServicesClientAPI = original.QueueServicesClientAPI type SkusClientAPI = original.SkusClientAPI +type TableClientAPI = original.TableClientAPI +type TableServicesClientAPI = original.TableServicesClientAPI type UsagesClientAPI = original.UsagesClientAPI diff --git a/profiles/latest/storagecache/mgmt/storagecache/models.go b/profiles/latest/storagecache/mgmt/storagecache/models.go index f0078d72410d..520dda8dc0a8 100644 --- a/profiles/latest/storagecache/mgmt/storagecache/models.go +++ b/profiles/latest/storagecache/mgmt/storagecache/models.go @@ -97,6 +97,8 @@ type APIOperationDisplay = original.APIOperationDisplay type APIOperationListResult = original.APIOperationListResult type APIOperationListResultIterator = original.APIOperationListResultIterator type APIOperationListResultPage = original.APIOperationListResultPage +type AscOperation = original.AscOperation +type AscOperationsClient = original.AscOperationsClient type BaseClient = original.BaseClient type BasicStorageTargetProperties = original.BasicStorageTargetProperties type Cache = original.Cache @@ -122,6 +124,7 @@ type ClfsTarget = original.ClfsTarget type ClfsTargetProperties = original.ClfsTargetProperties type CloudError = original.CloudError type CloudErrorBody = original.CloudErrorBody +type ErrorResponse = original.ErrorResponse type KeyVaultKeyReference = original.KeyVaultKeyReference type KeyVaultKeyReferenceSourceVault = original.KeyVaultKeyReferenceSourceVault type NamespaceJunction = original.NamespaceJunction @@ -164,6 +167,12 @@ func NewAPIOperationListResultIterator(page APIOperationListResultPage) APIOpera func NewAPIOperationListResultPage(getNextPage func(context.Context, APIOperationListResult) (APIOperationListResult, error)) APIOperationListResultPage { return original.NewAPIOperationListResultPage(getNextPage) } +func NewAscOperationsClient(subscriptionID string) AscOperationsClient { + return original.NewAscOperationsClient(subscriptionID) +} +func NewAscOperationsClientWithBaseURI(baseURI string, subscriptionID string) AscOperationsClient { + return original.NewAscOperationsClientWithBaseURI(baseURI, subscriptionID) +} func NewCachesClient(subscriptionID string) CachesClient { return original.NewCachesClient(subscriptionID) } diff --git a/profiles/latest/storagecache/mgmt/storagecache/storagecacheapi/models.go b/profiles/latest/storagecache/mgmt/storagecache/storagecacheapi/models.go index b466f18cbf4a..702d774a2fa0 100644 --- a/profiles/latest/storagecache/mgmt/storagecache/storagecacheapi/models.go +++ b/profiles/latest/storagecache/mgmt/storagecache/storagecacheapi/models.go @@ -21,6 +21,7 @@ package storagecacheapi import original "github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2020-03-01/storagecache/storagecacheapi" +type AscOperationsClientAPI = original.AscOperationsClientAPI type CachesClientAPI = original.CachesClientAPI type OperationsClientAPI = original.OperationsClientAPI type SkusClientAPI = original.SkusClientAPI diff --git a/profiles/latest/storagesync/mgmt/storagesync/models.go b/profiles/latest/storagesync/mgmt/storagesync/models.go index 3e84036a1663..39f54d9c33bf 100644 --- a/profiles/latest/storagesync/mgmt/storagesync/models.go +++ b/profiles/latest/storagesync/mgmt/storagesync/models.go @@ -230,8 +230,6 @@ type ServerEndpointFilesNotSyncingError = original.ServerEndpointFilesNotSyncing type ServerEndpointProperties = original.ServerEndpointProperties type ServerEndpointRecallError = original.ServerEndpointRecallError type ServerEndpointRecallStatus = original.ServerEndpointRecallStatus -type ServerEndpointSyncActivityStatus = original.ServerEndpointSyncActivityStatus -type ServerEndpointSyncSessionStatus = original.ServerEndpointSyncSessionStatus type ServerEndpointSyncStatus = original.ServerEndpointSyncStatus type ServerEndpointUpdateParameters = original.ServerEndpointUpdateParameters type ServerEndpointUpdateProperties = original.ServerEndpointUpdateProperties @@ -247,11 +245,13 @@ type ServiceProperties = original.ServiceProperties type ServiceUpdateParameters = original.ServiceUpdateParameters type ServicesClient = original.ServicesClient type SubscriptionState = original.SubscriptionState +type SyncActivityStatus = original.SyncActivityStatus type SyncGroup = original.SyncGroup type SyncGroupArray = original.SyncGroupArray type SyncGroupCreateParameters = original.SyncGroupCreateParameters type SyncGroupProperties = original.SyncGroupProperties type SyncGroupsClient = original.SyncGroupsClient +type SyncSessionStatus = original.SyncSessionStatus type TrackedResource = original.TrackedResource type TriggerChangeDetectionParameters = original.TriggerChangeDetectionParameters type TriggerRolloverRequest = original.TriggerRolloverRequest diff --git a/profiles/latest/web/mgmt/web/models.go b/profiles/latest/web/mgmt/web/models.go index 25363dd269b8..067bc6e1426e 100644 --- a/profiles/latest/web/mgmt/web/models.go +++ b/profiles/latest/web/mgmt/web/models.go @@ -440,9 +440,10 @@ const ( type ManagedServiceIdentityType = original.ManagedServiceIdentityType const ( - ManagedServiceIdentityTypeNone ManagedServiceIdentityType = original.ManagedServiceIdentityTypeNone - ManagedServiceIdentityTypeSystemAssigned ManagedServiceIdentityType = original.ManagedServiceIdentityTypeSystemAssigned - ManagedServiceIdentityTypeUserAssigned ManagedServiceIdentityType = original.ManagedServiceIdentityTypeUserAssigned + ManagedServiceIdentityTypeNone ManagedServiceIdentityType = original.ManagedServiceIdentityTypeNone + ManagedServiceIdentityTypeSystemAssigned ManagedServiceIdentityType = original.ManagedServiceIdentityTypeSystemAssigned + ManagedServiceIdentityTypeSystemAssignedUserAssigned ManagedServiceIdentityType = original.ManagedServiceIdentityTypeSystemAssignedUserAssigned + ManagedServiceIdentityTypeUserAssigned ManagedServiceIdentityType = original.ManagedServiceIdentityTypeUserAssigned ) type MySQLMigrationType = original.MySQLMigrationType @@ -857,6 +858,10 @@ type CsmOperationCollectionPage = original.CsmOperationCollectionPage type CsmOperationDescription = original.CsmOperationDescription type CsmOperationDescriptionProperties = original.CsmOperationDescriptionProperties type CsmOperationDisplay = original.CsmOperationDisplay +type CsmPublishingCredentialsPoliciesCollection = original.CsmPublishingCredentialsPoliciesCollection +type CsmPublishingCredentialsPoliciesCollectionProperties = original.CsmPublishingCredentialsPoliciesCollectionProperties +type CsmPublishingCredentialsPoliciesEntity = original.CsmPublishingCredentialsPoliciesEntity +type CsmPublishingCredentialsPoliciesEntityProperties = original.CsmPublishingCredentialsPoliciesEntityProperties type CsmPublishingProfileOptions = original.CsmPublishingProfileOptions type CsmSlotEntity = original.CsmSlotEntity type CsmUsageQuota = original.CsmUsageQuota diff --git a/profiles/preview/cognitiveservices/computervision/computervisionapi/models.go b/profiles/preview/cognitiveservices/computervision/computervisionapi/models.go index 7bcaba1a4dd0..f7d3ee105836 100644 --- a/profiles/preview/cognitiveservices/computervision/computervisionapi/models.go +++ b/profiles/preview/cognitiveservices/computervision/computervisionapi/models.go @@ -19,6 +19,6 @@ package computervisionapi -import original "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.1/computervision/computervisionapi" +import original "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v3.0/computervision/computervisionapi" type BaseClientAPI = original.BaseClientAPI diff --git a/profiles/preview/cognitiveservices/computervision/models.go b/profiles/preview/cognitiveservices/computervision/models.go index 0f6b66185f05..2230533f2c17 100644 --- a/profiles/preview/cognitiveservices/computervision/models.go +++ b/profiles/preview/cognitiveservices/computervision/models.go @@ -19,7 +19,7 @@ package computervision -import original "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v2.1/computervision" +import original "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v3.0/computervision" type DescriptionExclude = original.DescriptionExclude @@ -42,59 +42,57 @@ const ( Male Gender = original.Male ) -type OcrLanguages = original.OcrLanguages - -const ( - Ar OcrLanguages = original.Ar - Cs OcrLanguages = original.Cs - Da OcrLanguages = original.Da - De OcrLanguages = original.De - El OcrLanguages = original.El - En OcrLanguages = original.En - Es OcrLanguages = original.Es - Fi OcrLanguages = original.Fi - Fr OcrLanguages = original.Fr - Hu OcrLanguages = original.Hu - It OcrLanguages = original.It - Ja OcrLanguages = original.Ja - Ko OcrLanguages = original.Ko - Nb OcrLanguages = original.Nb - Nl OcrLanguages = original.Nl - Pl OcrLanguages = original.Pl - Pt OcrLanguages = original.Pt - Ro OcrLanguages = original.Ro - Ru OcrLanguages = original.Ru - Sk OcrLanguages = original.Sk - SrCyrl OcrLanguages = original.SrCyrl - SrLatn OcrLanguages = original.SrLatn - Sv OcrLanguages = original.Sv - Tr OcrLanguages = original.Tr - Unk OcrLanguages = original.Unk - ZhHans OcrLanguages = original.ZhHans - ZhHant OcrLanguages = original.ZhHant -) - -type TextOperationStatusCodes = original.TextOperationStatusCodes +type OcrDetectionLanguage = original.OcrDetectionLanguage const ( - Failed TextOperationStatusCodes = original.Failed - NotStarted TextOperationStatusCodes = original.NotStarted - Running TextOperationStatusCodes = original.Running - Succeeded TextOperationStatusCodes = original.Succeeded + De OcrDetectionLanguage = original.De + En OcrDetectionLanguage = original.En + Es OcrDetectionLanguage = original.Es + Fr OcrDetectionLanguage = original.Fr + It OcrDetectionLanguage = original.It + Nl OcrDetectionLanguage = original.Nl + Pt OcrDetectionLanguage = original.Pt ) -type TextRecognitionMode = original.TextRecognitionMode +type OcrLanguages = original.OcrLanguages const ( - Handwritten TextRecognitionMode = original.Handwritten - Printed TextRecognitionMode = original.Printed + OcrLanguagesAr OcrLanguages = original.OcrLanguagesAr + OcrLanguagesCs OcrLanguages = original.OcrLanguagesCs + OcrLanguagesDa OcrLanguages = original.OcrLanguagesDa + OcrLanguagesDe OcrLanguages = original.OcrLanguagesDe + OcrLanguagesEl OcrLanguages = original.OcrLanguagesEl + OcrLanguagesEn OcrLanguages = original.OcrLanguagesEn + OcrLanguagesEs OcrLanguages = original.OcrLanguagesEs + OcrLanguagesFi OcrLanguages = original.OcrLanguagesFi + OcrLanguagesFr OcrLanguages = original.OcrLanguagesFr + OcrLanguagesHu OcrLanguages = original.OcrLanguagesHu + OcrLanguagesIt OcrLanguages = original.OcrLanguagesIt + OcrLanguagesJa OcrLanguages = original.OcrLanguagesJa + OcrLanguagesKo OcrLanguages = original.OcrLanguagesKo + OcrLanguagesNb OcrLanguages = original.OcrLanguagesNb + OcrLanguagesNl OcrLanguages = original.OcrLanguagesNl + OcrLanguagesPl OcrLanguages = original.OcrLanguagesPl + OcrLanguagesPt OcrLanguages = original.OcrLanguagesPt + OcrLanguagesRo OcrLanguages = original.OcrLanguagesRo + OcrLanguagesRu OcrLanguages = original.OcrLanguagesRu + OcrLanguagesSk OcrLanguages = original.OcrLanguagesSk + OcrLanguagesSrCyrl OcrLanguages = original.OcrLanguagesSrCyrl + OcrLanguagesSrLatn OcrLanguages = original.OcrLanguagesSrLatn + OcrLanguagesSv OcrLanguages = original.OcrLanguagesSv + OcrLanguagesTr OcrLanguages = original.OcrLanguagesTr + OcrLanguagesUnk OcrLanguages = original.OcrLanguagesUnk + OcrLanguagesZhHans OcrLanguages = original.OcrLanguagesZhHans + OcrLanguagesZhHant OcrLanguages = original.OcrLanguagesZhHant ) -type TextRecognitionResultConfidenceClass = original.TextRecognitionResultConfidenceClass +type OperationStatusCodes = original.OperationStatusCodes const ( - High TextRecognitionResultConfidenceClass = original.High - Low TextRecognitionResultConfidenceClass = original.Low + Failed OperationStatusCodes = original.Failed + NotStarted OperationStatusCodes = original.NotStarted + Running OperationStatusCodes = original.Running + Succeeded OperationStatusCodes = original.Succeeded ) type TextRecognitionResultDimensionUnit = original.TextRecognitionResultDimensionUnit @@ -119,6 +117,7 @@ const ( ) type AdultInfo = original.AdultInfo +type AnalyzeResults = original.AnalyzeResults type AreaOfInterestResult = original.AreaOfInterestResult type BaseClient = original.BaseClient type BoundingRect = original.BoundingRect @@ -154,9 +153,8 @@ type OcrResult = original.OcrResult type OcrWord = original.OcrWord type ReadCloser = original.ReadCloser type ReadOperationResult = original.ReadOperationResult +type ReadResult = original.ReadResult type TagResult = original.TagResult -type TextOperationResult = original.TextOperationResult -type TextRecognitionResult = original.TextRecognitionResult type Word = original.Word func New(endpoint string) BaseClient { @@ -174,17 +172,14 @@ func PossibleDetailsValues() []Details { func PossibleGenderValues() []Gender { return original.PossibleGenderValues() } +func PossibleOcrDetectionLanguageValues() []OcrDetectionLanguage { + return original.PossibleOcrDetectionLanguageValues() +} func PossibleOcrLanguagesValues() []OcrLanguages { return original.PossibleOcrLanguagesValues() } -func PossibleTextOperationStatusCodesValues() []TextOperationStatusCodes { - return original.PossibleTextOperationStatusCodesValues() -} -func PossibleTextRecognitionModeValues() []TextRecognitionMode { - return original.PossibleTextRecognitionModeValues() -} -func PossibleTextRecognitionResultConfidenceClassValues() []TextRecognitionResultConfidenceClass { - return original.PossibleTextRecognitionResultConfidenceClassValues() +func PossibleOperationStatusCodesValues() []OperationStatusCodes { + return original.PossibleOperationStatusCodesValues() } func PossibleTextRecognitionResultDimensionUnitValues() []TextRecognitionResultDimensionUnit { return original.PossibleTextRecognitionResultDimensionUnitValues() diff --git a/profiles/preview/cognitiveservices/mgmt/cognitiveservices/cognitiveservicesapi/models.go b/profiles/preview/cognitiveservices/mgmt/cognitiveservices/cognitiveservicesapi/models.go index 3f99499ecf94..ccd2d440e821 100644 --- a/profiles/preview/cognitiveservices/mgmt/cognitiveservices/cognitiveservicesapi/models.go +++ b/profiles/preview/cognitiveservices/mgmt/cognitiveservices/cognitiveservicesapi/models.go @@ -24,4 +24,6 @@ import original "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/mg type AccountsClientAPI = original.AccountsClientAPI type BaseClientAPI = original.BaseClientAPI type OperationsClientAPI = original.OperationsClientAPI +type PrivateEndpointConnectionsClientAPI = original.PrivateEndpointConnectionsClientAPI +type PrivateLinkResourcesClientAPI = original.PrivateLinkResourcesClientAPI type ResourceSkusClientAPI = original.ResourceSkusClientAPI diff --git a/profiles/preview/cognitiveservices/mgmt/cognitiveservices/models.go b/profiles/preview/cognitiveservices/mgmt/cognitiveservices/models.go index 062efdd9b727..fa6ddb29b8c1 100644 --- a/profiles/preview/cognitiveservices/mgmt/cognitiveservices/models.go +++ b/profiles/preview/cognitiveservices/mgmt/cognitiveservices/models.go @@ -58,6 +58,15 @@ const ( Deny NetworkRuleAction = original.Deny ) +type PrivateEndpointServiceConnectionStatus = original.PrivateEndpointServiceConnectionStatus + +const ( + Approved PrivateEndpointServiceConnectionStatus = original.Approved + Disconnected PrivateEndpointServiceConnectionStatus = original.Disconnected + Pending PrivateEndpointServiceConnectionStatus = original.Pending + Rejected PrivateEndpointServiceConnectionStatus = original.Rejected +) + type ProvisioningState = original.ProvisioningState const ( @@ -69,6 +78,13 @@ const ( Succeeded ProvisioningState = original.Succeeded ) +type PublicNetworkAccess = original.PublicNetworkAccess + +const ( + Disabled PublicNetworkAccess = original.Disabled + Enabled PublicNetworkAccess = original.Enabled +) + type QuotaUsageStatus = original.QuotaUsageStatus const ( @@ -121,6 +137,7 @@ type AccountListResultIterator = original.AccountListResultIterator type AccountListResultPage = original.AccountListResultPage type AccountProperties = original.AccountProperties type AccountsClient = original.AccountsClient +type AzureEntityResource = original.AzureEntityResource type BaseClient = original.BaseClient type CheckDomainAvailabilityParameter = original.CheckDomainAvailabilityParameter type CheckDomainAvailabilityResult = original.CheckDomainAvailabilityResult @@ -141,7 +158,18 @@ type OperationEntityListResult = original.OperationEntityListResult type OperationEntityListResultIterator = original.OperationEntityListResultIterator type OperationEntityListResultPage = original.OperationEntityListResultPage type OperationsClient = original.OperationsClient +type PrivateEndpoint = original.PrivateEndpoint +type PrivateEndpointConnection = original.PrivateEndpointConnection +type PrivateEndpointConnectionProperties = original.PrivateEndpointConnectionProperties +type PrivateEndpointConnectionsClient = original.PrivateEndpointConnectionsClient +type PrivateLinkResource = original.PrivateLinkResource +type PrivateLinkResourceListResult = original.PrivateLinkResourceListResult +type PrivateLinkResourceProperties = original.PrivateLinkResourceProperties +type PrivateLinkResourcesClient = original.PrivateLinkResourcesClient +type PrivateLinkServiceConnectionState = original.PrivateLinkServiceConnectionState +type ProxyResource = original.ProxyResource type RegenerateKeyParameters = original.RegenerateKeyParameters +type Resource = original.Resource type ResourceAndSku = original.ResourceAndSku type ResourceSku = original.ResourceSku type ResourceSkuRestrictionInfo = original.ResourceSkuRestrictionInfo @@ -151,6 +179,8 @@ type ResourceSkusResult = original.ResourceSkusResult type ResourceSkusResultIterator = original.ResourceSkusResultIterator type ResourceSkusResultPage = original.ResourceSkusResultPage type Sku = original.Sku +type SkuCapability = original.SkuCapability +type TrackedResource = original.TrackedResource type Usage = original.Usage type UsagesResult = original.UsagesResult type UserAssignedIdentity = original.UserAssignedIdentity @@ -184,6 +214,18 @@ func NewOperationsClient(subscriptionID string) OperationsClient { func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID) } +func NewPrivateEndpointConnectionsClient(subscriptionID string) PrivateEndpointConnectionsClient { + return original.NewPrivateEndpointConnectionsClient(subscriptionID) +} +func NewPrivateEndpointConnectionsClientWithBaseURI(baseURI string, subscriptionID string) PrivateEndpointConnectionsClient { + return original.NewPrivateEndpointConnectionsClientWithBaseURI(baseURI, subscriptionID) +} +func NewPrivateLinkResourcesClient(subscriptionID string) PrivateLinkResourcesClient { + return original.NewPrivateLinkResourcesClient(subscriptionID) +} +func NewPrivateLinkResourcesClientWithBaseURI(baseURI string, subscriptionID string) PrivateLinkResourcesClient { + return original.NewPrivateLinkResourcesClientWithBaseURI(baseURI, subscriptionID) +} func NewResourceSkusClient(subscriptionID string) ResourceSkusClient { return original.NewResourceSkusClient(subscriptionID) } @@ -211,9 +253,15 @@ func PossibleKeySourceValues() []KeySource { func PossibleNetworkRuleActionValues() []NetworkRuleAction { return original.PossibleNetworkRuleActionValues() } +func PossiblePrivateEndpointServiceConnectionStatusValues() []PrivateEndpointServiceConnectionStatus { + return original.PossiblePrivateEndpointServiceConnectionStatusValues() +} func PossibleProvisioningStateValues() []ProvisioningState { return original.PossibleProvisioningStateValues() } +func PossiblePublicNetworkAccessValues() []PublicNetworkAccess { + return original.PossiblePublicNetworkAccessValues() +} func PossibleQuotaUsageStatusValues() []QuotaUsageStatus { return original.PossibleQuotaUsageStatusValues() } diff --git a/profiles/preview/containerservice/mgmt/containerservice/containerserviceapi/models.go b/profiles/preview/containerservice/mgmt/containerservice/containerserviceapi/models.go index 129666002747..e576e4377266 100644 --- a/profiles/preview/containerservice/mgmt/containerservice/containerserviceapi/models.go +++ b/profiles/preview/containerservice/mgmt/containerservice/containerserviceapi/models.go @@ -19,7 +19,7 @@ package containerserviceapi -import original "github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-03-01/containerservice/containerserviceapi" +import original "github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice/containerserviceapi" type AgentPoolsClientAPI = original.AgentPoolsClientAPI type ContainerServicesClientAPI = original.ContainerServicesClientAPI diff --git a/profiles/preview/containerservice/mgmt/containerservice/models.go b/profiles/preview/containerservice/mgmt/containerservice/models.go index 4e5f0ded8427..691248299053 100644 --- a/profiles/preview/containerservice/mgmt/containerservice/models.go +++ b/profiles/preview/containerservice/mgmt/containerservice/models.go @@ -22,7 +22,7 @@ package containerservice import ( "context" - original "github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-03-01/containerservice" + original "github.com/Azure/azure-sdk-for-go/services/containerservice/mgmt/2020-04-01/containerservice" ) const ( @@ -177,7 +177,6 @@ const ( type ScaleSetPriority = original.ScaleSetPriority const ( - Low ScaleSetPriority = original.Low Regular ScaleSetPriority = original.Regular Spot ScaleSetPriority = original.Spot ) @@ -380,6 +379,7 @@ type AgentPoolProfile = original.AgentPoolProfile type AgentPoolUpgradeProfile = original.AgentPoolUpgradeProfile type AgentPoolUpgradeProfileProperties = original.AgentPoolUpgradeProfileProperties type AgentPoolUpgradeProfilePropertiesUpgradesItem = original.AgentPoolUpgradeProfilePropertiesUpgradesItem +type AgentPoolUpgradeSettings = original.AgentPoolUpgradeSettings type AgentPoolsClient = original.AgentPoolsClient type AgentPoolsCreateOrUpdateFuture = original.AgentPoolsCreateOrUpdateFuture type AgentPoolsDeleteFuture = original.AgentPoolsDeleteFuture diff --git a/profiles/preview/cosmos-db/mgmt/documentdb/models.go b/profiles/preview/cosmos-db/mgmt/documentdb/models.go index eca19335839b..7e3043918905 100644 --- a/profiles/preview/cosmos-db/mgmt/documentdb/models.go +++ b/profiles/preview/cosmos-db/mgmt/documentdb/models.go @@ -423,74 +423,74 @@ type Usage = original.Usage type UsagesResult = original.UsagesResult type VirtualNetworkRule = original.VirtualNetworkRule -func New(subscriptionID string, subscriptionID1 string) BaseClient { - return original.New(subscriptionID, subscriptionID1) +func New(subscriptionID string) BaseClient { + return original.New(subscriptionID) } -func NewCassandraResourcesClient(subscriptionID string, subscriptionID1 string) CassandraResourcesClient { - return original.NewCassandraResourcesClient(subscriptionID, subscriptionID1) +func NewCassandraResourcesClient(subscriptionID string) CassandraResourcesClient { + return original.NewCassandraResourcesClient(subscriptionID) } -func NewCassandraResourcesClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) CassandraResourcesClient { - return original.NewCassandraResourcesClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +func NewCassandraResourcesClientWithBaseURI(baseURI string, subscriptionID string) CassandraResourcesClient { + return original.NewCassandraResourcesClientWithBaseURI(baseURI, subscriptionID) } -func NewCollectionClient(subscriptionID string, subscriptionID1 string) CollectionClient { - return original.NewCollectionClient(subscriptionID, subscriptionID1) +func NewCollectionClient(subscriptionID string) CollectionClient { + return original.NewCollectionClient(subscriptionID) } -func NewCollectionClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) CollectionClient { - return original.NewCollectionClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +func NewCollectionClientWithBaseURI(baseURI string, subscriptionID string) CollectionClient { + return original.NewCollectionClientWithBaseURI(baseURI, subscriptionID) } -func NewCollectionPartitionClient(subscriptionID string, subscriptionID1 string) CollectionPartitionClient { - return original.NewCollectionPartitionClient(subscriptionID, subscriptionID1) +func NewCollectionPartitionClient(subscriptionID string) CollectionPartitionClient { + return original.NewCollectionPartitionClient(subscriptionID) } -func NewCollectionPartitionClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) CollectionPartitionClient { - return original.NewCollectionPartitionClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +func NewCollectionPartitionClientWithBaseURI(baseURI string, subscriptionID string) CollectionPartitionClient { + return original.NewCollectionPartitionClientWithBaseURI(baseURI, subscriptionID) } -func NewCollectionPartitionRegionClient(subscriptionID string, subscriptionID1 string) CollectionPartitionRegionClient { - return original.NewCollectionPartitionRegionClient(subscriptionID, subscriptionID1) +func NewCollectionPartitionRegionClient(subscriptionID string) CollectionPartitionRegionClient { + return original.NewCollectionPartitionRegionClient(subscriptionID) } -func NewCollectionPartitionRegionClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) CollectionPartitionRegionClient { - return original.NewCollectionPartitionRegionClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +func NewCollectionPartitionRegionClientWithBaseURI(baseURI string, subscriptionID string) CollectionPartitionRegionClient { + return original.NewCollectionPartitionRegionClientWithBaseURI(baseURI, subscriptionID) } -func NewCollectionRegionClient(subscriptionID string, subscriptionID1 string) CollectionRegionClient { - return original.NewCollectionRegionClient(subscriptionID, subscriptionID1) +func NewCollectionRegionClient(subscriptionID string) CollectionRegionClient { + return original.NewCollectionRegionClient(subscriptionID) } -func NewCollectionRegionClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) CollectionRegionClient { - return original.NewCollectionRegionClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +func NewCollectionRegionClientWithBaseURI(baseURI string, subscriptionID string) CollectionRegionClient { + return original.NewCollectionRegionClientWithBaseURI(baseURI, subscriptionID) } -func NewDatabaseAccountRegionClient(subscriptionID string, subscriptionID1 string) DatabaseAccountRegionClient { - return original.NewDatabaseAccountRegionClient(subscriptionID, subscriptionID1) +func NewDatabaseAccountRegionClient(subscriptionID string) DatabaseAccountRegionClient { + return original.NewDatabaseAccountRegionClient(subscriptionID) } -func NewDatabaseAccountRegionClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) DatabaseAccountRegionClient { - return original.NewDatabaseAccountRegionClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +func NewDatabaseAccountRegionClientWithBaseURI(baseURI string, subscriptionID string) DatabaseAccountRegionClient { + return original.NewDatabaseAccountRegionClientWithBaseURI(baseURI, subscriptionID) } -func NewDatabaseAccountsClient(subscriptionID string, subscriptionID1 string) DatabaseAccountsClient { - return original.NewDatabaseAccountsClient(subscriptionID, subscriptionID1) +func NewDatabaseAccountsClient(subscriptionID string) DatabaseAccountsClient { + return original.NewDatabaseAccountsClient(subscriptionID) } -func NewDatabaseAccountsClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) DatabaseAccountsClient { - return original.NewDatabaseAccountsClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +func NewDatabaseAccountsClientWithBaseURI(baseURI string, subscriptionID string) DatabaseAccountsClient { + return original.NewDatabaseAccountsClientWithBaseURI(baseURI, subscriptionID) } -func NewDatabaseClient(subscriptionID string, subscriptionID1 string) DatabaseClient { - return original.NewDatabaseClient(subscriptionID, subscriptionID1) +func NewDatabaseClient(subscriptionID string) DatabaseClient { + return original.NewDatabaseClient(subscriptionID) } -func NewDatabaseClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) DatabaseClient { - return original.NewDatabaseClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +func NewDatabaseClientWithBaseURI(baseURI string, subscriptionID string) DatabaseClient { + return original.NewDatabaseClientWithBaseURI(baseURI, subscriptionID) } -func NewGremlinResourcesClient(subscriptionID string, subscriptionID1 string) GremlinResourcesClient { - return original.NewGremlinResourcesClient(subscriptionID, subscriptionID1) +func NewGremlinResourcesClient(subscriptionID string) GremlinResourcesClient { + return original.NewGremlinResourcesClient(subscriptionID) } -func NewGremlinResourcesClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) GremlinResourcesClient { - return original.NewGremlinResourcesClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +func NewGremlinResourcesClientWithBaseURI(baseURI string, subscriptionID string) GremlinResourcesClient { + return original.NewGremlinResourcesClientWithBaseURI(baseURI, subscriptionID) } -func NewMongoDBResourcesClient(subscriptionID string, subscriptionID1 string) MongoDBResourcesClient { - return original.NewMongoDBResourcesClient(subscriptionID, subscriptionID1) +func NewMongoDBResourcesClient(subscriptionID string) MongoDBResourcesClient { + return original.NewMongoDBResourcesClient(subscriptionID) } -func NewMongoDBResourcesClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) MongoDBResourcesClient { - return original.NewMongoDBResourcesClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +func NewMongoDBResourcesClientWithBaseURI(baseURI string, subscriptionID string) MongoDBResourcesClient { + return original.NewMongoDBResourcesClientWithBaseURI(baseURI, subscriptionID) } -func NewNotebookWorkspacesClient(subscriptionID string, subscriptionID1 string) NotebookWorkspacesClient { - return original.NewNotebookWorkspacesClient(subscriptionID, subscriptionID1) +func NewNotebookWorkspacesClient(subscriptionID string) NotebookWorkspacesClient { + return original.NewNotebookWorkspacesClient(subscriptionID) } -func NewNotebookWorkspacesClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) NotebookWorkspacesClient { - return original.NewNotebookWorkspacesClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +func NewNotebookWorkspacesClientWithBaseURI(baseURI string, subscriptionID string) NotebookWorkspacesClient { + return original.NewNotebookWorkspacesClientWithBaseURI(baseURI, subscriptionID) } func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator { return original.NewOperationListResultIterator(page) @@ -498,68 +498,68 @@ func NewOperationListResultIterator(page OperationListResultPage) OperationListR func NewOperationListResultPage(getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { return original.NewOperationListResultPage(getNextPage) } -func NewOperationsClient(subscriptionID string, subscriptionID1 string) OperationsClient { - return original.NewOperationsClient(subscriptionID, subscriptionID1) +func NewOperationsClient(subscriptionID string) OperationsClient { + return original.NewOperationsClient(subscriptionID) } -func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) OperationsClient { - return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID) } -func NewPartitionKeyRangeIDClient(subscriptionID string, subscriptionID1 string) PartitionKeyRangeIDClient { - return original.NewPartitionKeyRangeIDClient(subscriptionID, subscriptionID1) +func NewPartitionKeyRangeIDClient(subscriptionID string) PartitionKeyRangeIDClient { + return original.NewPartitionKeyRangeIDClient(subscriptionID) } -func NewPartitionKeyRangeIDClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) PartitionKeyRangeIDClient { - return original.NewPartitionKeyRangeIDClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +func NewPartitionKeyRangeIDClientWithBaseURI(baseURI string, subscriptionID string) PartitionKeyRangeIDClient { + return original.NewPartitionKeyRangeIDClientWithBaseURI(baseURI, subscriptionID) } -func NewPartitionKeyRangeIDRegionClient(subscriptionID string, subscriptionID1 string) PartitionKeyRangeIDRegionClient { - return original.NewPartitionKeyRangeIDRegionClient(subscriptionID, subscriptionID1) +func NewPartitionKeyRangeIDRegionClient(subscriptionID string) PartitionKeyRangeIDRegionClient { + return original.NewPartitionKeyRangeIDRegionClient(subscriptionID) } -func NewPartitionKeyRangeIDRegionClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) PartitionKeyRangeIDRegionClient { - return original.NewPartitionKeyRangeIDRegionClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +func NewPartitionKeyRangeIDRegionClientWithBaseURI(baseURI string, subscriptionID string) PartitionKeyRangeIDRegionClient { + return original.NewPartitionKeyRangeIDRegionClientWithBaseURI(baseURI, subscriptionID) } -func NewPercentileClient(subscriptionID string, subscriptionID1 string) PercentileClient { - return original.NewPercentileClient(subscriptionID, subscriptionID1) +func NewPercentileClient(subscriptionID string) PercentileClient { + return original.NewPercentileClient(subscriptionID) } -func NewPercentileClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) PercentileClient { - return original.NewPercentileClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +func NewPercentileClientWithBaseURI(baseURI string, subscriptionID string) PercentileClient { + return original.NewPercentileClientWithBaseURI(baseURI, subscriptionID) } -func NewPercentileSourceTargetClient(subscriptionID string, subscriptionID1 string) PercentileSourceTargetClient { - return original.NewPercentileSourceTargetClient(subscriptionID, subscriptionID1) +func NewPercentileSourceTargetClient(subscriptionID string) PercentileSourceTargetClient { + return original.NewPercentileSourceTargetClient(subscriptionID) } -func NewPercentileSourceTargetClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) PercentileSourceTargetClient { - return original.NewPercentileSourceTargetClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +func NewPercentileSourceTargetClientWithBaseURI(baseURI string, subscriptionID string) PercentileSourceTargetClient { + return original.NewPercentileSourceTargetClientWithBaseURI(baseURI, subscriptionID) } -func NewPercentileTargetClient(subscriptionID string, subscriptionID1 string) PercentileTargetClient { - return original.NewPercentileTargetClient(subscriptionID, subscriptionID1) +func NewPercentileTargetClient(subscriptionID string) PercentileTargetClient { + return original.NewPercentileTargetClient(subscriptionID) } -func NewPercentileTargetClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) PercentileTargetClient { - return original.NewPercentileTargetClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +func NewPercentileTargetClientWithBaseURI(baseURI string, subscriptionID string) PercentileTargetClient { + return original.NewPercentileTargetClientWithBaseURI(baseURI, subscriptionID) } -func NewPrivateEndpointConnectionsClient(subscriptionID string, subscriptionID1 string) PrivateEndpointConnectionsClient { - return original.NewPrivateEndpointConnectionsClient(subscriptionID, subscriptionID1) +func NewPrivateEndpointConnectionsClient(subscriptionID string) PrivateEndpointConnectionsClient { + return original.NewPrivateEndpointConnectionsClient(subscriptionID) } -func NewPrivateEndpointConnectionsClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) PrivateEndpointConnectionsClient { - return original.NewPrivateEndpointConnectionsClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +func NewPrivateEndpointConnectionsClientWithBaseURI(baseURI string, subscriptionID string) PrivateEndpointConnectionsClient { + return original.NewPrivateEndpointConnectionsClientWithBaseURI(baseURI, subscriptionID) } -func NewPrivateLinkResourcesClient(subscriptionID string, subscriptionID1 string) PrivateLinkResourcesClient { - return original.NewPrivateLinkResourcesClient(subscriptionID, subscriptionID1) +func NewPrivateLinkResourcesClient(subscriptionID string) PrivateLinkResourcesClient { + return original.NewPrivateLinkResourcesClient(subscriptionID) } -func NewPrivateLinkResourcesClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) PrivateLinkResourcesClient { - return original.NewPrivateLinkResourcesClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +func NewPrivateLinkResourcesClientWithBaseURI(baseURI string, subscriptionID string) PrivateLinkResourcesClient { + return original.NewPrivateLinkResourcesClientWithBaseURI(baseURI, subscriptionID) } -func NewSQLResourcesClient(subscriptionID string, subscriptionID1 string) SQLResourcesClient { - return original.NewSQLResourcesClient(subscriptionID, subscriptionID1) +func NewSQLResourcesClient(subscriptionID string) SQLResourcesClient { + return original.NewSQLResourcesClient(subscriptionID) } -func NewSQLResourcesClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) SQLResourcesClient { - return original.NewSQLResourcesClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +func NewSQLResourcesClientWithBaseURI(baseURI string, subscriptionID string) SQLResourcesClient { + return original.NewSQLResourcesClientWithBaseURI(baseURI, subscriptionID) } -func NewTableResourcesClient(subscriptionID string, subscriptionID1 string) TableResourcesClient { - return original.NewTableResourcesClient(subscriptionID, subscriptionID1) +func NewTableResourcesClient(subscriptionID string) TableResourcesClient { + return original.NewTableResourcesClient(subscriptionID) } -func NewTableResourcesClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) TableResourcesClient { - return original.NewTableResourcesClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +func NewTableResourcesClientWithBaseURI(baseURI string, subscriptionID string) TableResourcesClient { + return original.NewTableResourcesClientWithBaseURI(baseURI, subscriptionID) } -func NewWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) BaseClient { - return original.NewWithBaseURI(baseURI, subscriptionID, subscriptionID1) +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return original.NewWithBaseURI(baseURI, subscriptionID) } func PossibleCompositePathSortOrderValues() []CompositePathSortOrder { return original.PossibleCompositePathSortOrderValues() diff --git a/profiles/preview/datafactory/mgmt/datafactory/models.go b/profiles/preview/datafactory/mgmt/datafactory/models.go index 999c5715b44a..655e9e5202a1 100644 --- a/profiles/preview/datafactory/mgmt/datafactory/models.go +++ b/profiles/preview/datafactory/mgmt/datafactory/models.go @@ -806,6 +806,7 @@ const ( TypeDynamicsCrmSource TypeBasicCopySource = original.TypeDynamicsCrmSource TypeDynamicsSource TypeBasicCopySource = original.TypeDynamicsSource TypeEloquaSource TypeBasicCopySource = original.TypeEloquaSource + TypeExcelSource TypeBasicCopySource = original.TypeExcelSource TypeFileSystemSource TypeBasicCopySource = original.TypeFileSystemSource TypeGoogleAdWordsSource TypeBasicCopySource = original.TypeGoogleAdWordsSource TypeGoogleBigQuerySource TypeBasicCopySource = original.TypeGoogleBigQuerySource @@ -867,6 +868,7 @@ const ( TypeVerticaSource TypeBasicCopySource = original.TypeVerticaSource TypeWebSource TypeBasicCopySource = original.TypeWebSource TypeXeroSource TypeBasicCopySource = original.TypeXeroSource + TypeXMLSource TypeBasicCopySource = original.TypeXMLSource TypeZohoSource TypeBasicCopySource = original.TypeZohoSource ) @@ -922,6 +924,7 @@ const ( TypeDynamicsCrmEntity TypeBasicDataset = original.TypeDynamicsCrmEntity TypeDynamicsEntity TypeBasicDataset = original.TypeDynamicsEntity TypeEloquaObject TypeBasicDataset = original.TypeEloquaObject + TypeExcel TypeBasicDataset = original.TypeExcel TypeFileShare TypeBasicDataset = original.TypeFileShare TypeGoogleAdWordsObject TypeBasicDataset = original.TypeGoogleAdWordsObject TypeGoogleBigQueryObject TypeBasicDataset = original.TypeGoogleBigQueryObject @@ -978,6 +981,7 @@ const ( TypeVerticaTable TypeBasicDataset = original.TypeVerticaTable TypeWebTable TypeBasicDataset = original.TypeWebTable TypeXeroObject TypeBasicDataset = original.TypeXeroObject + TypeXML TypeBasicDataset = original.TypeXML TypeZohoObject TypeBasicDataset = original.TypeZohoObject ) @@ -1050,6 +1054,7 @@ const ( TypeDelimitedTextReadSettings TypeBasicFormatReadSettings = original.TypeDelimitedTextReadSettings TypeFormatReadSettings TypeBasicFormatReadSettings = original.TypeFormatReadSettings TypeJSONReadSettings TypeBasicFormatReadSettings = original.TypeJSONReadSettings + TypeXMLReadSettings TypeBasicFormatReadSettings = original.TypeXMLReadSettings ) type TypeBasicFormatWriteSettings = original.TypeBasicFormatWriteSettings @@ -1590,6 +1595,9 @@ type EloquaSource = original.EloquaSource type EntityReference = original.EntityReference type EnvironmentVariableSetup = original.EnvironmentVariableSetup type EnvironmentVariableSetupTypeProperties = original.EnvironmentVariableSetupTypeProperties +type ExcelDataset = original.ExcelDataset +type ExcelDatasetTypeProperties = original.ExcelDatasetTypeProperties +type ExcelSource = original.ExcelSource type ExecuteDataFlowActivity = original.ExecuteDataFlowActivity type ExecuteDataFlowActivityTypeProperties = original.ExecuteDataFlowActivityTypeProperties type ExecuteDataFlowActivityTypePropertiesCompute = original.ExecuteDataFlowActivityTypePropertiesCompute @@ -2137,6 +2145,10 @@ type WebLinkedServiceTypeProperties = original.WebLinkedServiceTypeProperties type WebSource = original.WebSource type WebTableDataset = original.WebTableDataset type WebTableDatasetTypeProperties = original.WebTableDatasetTypeProperties +type XMLDataset = original.XMLDataset +type XMLDatasetTypeProperties = original.XMLDatasetTypeProperties +type XMLReadSettings = original.XMLReadSettings +type XMLSource = original.XMLSource type XeroLinkedService = original.XeroLinkedService type XeroLinkedServiceTypeProperties = original.XeroLinkedServiceTypeProperties type XeroObjectDataset = original.XeroObjectDataset diff --git a/profiles/preview/eventgrid/eventgrid/models.go b/profiles/preview/eventgrid/eventgrid/models.go index 9915ac4d74f7..5a3f8ea72084 100644 --- a/profiles/preview/eventgrid/eventgrid/models.go +++ b/profiles/preview/eventgrid/eventgrid/models.go @@ -21,6 +21,31 @@ package eventgrid import original "github.com/Azure/azure-sdk-for-go/services/eventgrid/2018-01-01/eventgrid" +type AppAction = original.AppAction + +const ( + ChangedAppSettings AppAction = original.ChangedAppSettings + Completed AppAction = original.Completed + Failed AppAction = original.Failed + Restarted AppAction = original.Restarted + Started AppAction = original.Started + Stopped AppAction = original.Stopped +) + +type AppServicePlanAction = original.AppServicePlanAction + +const ( + Updated AppServicePlanAction = original.Updated +) + +type AsyncStatus = original.AsyncStatus + +const ( + AsyncStatusCompleted AsyncStatus = original.AsyncStatusCompleted + AsyncStatusFailed AsyncStatus = original.AsyncStatusFailed + AsyncStatusStarted AsyncStatus = original.AsyncStatusStarted +) + type MediaJobErrorCategory = original.MediaJobErrorCategory const ( @@ -71,8 +96,18 @@ const ( OdataTypeMicrosoftMediaJobOutputAsset OdataType = original.OdataTypeMicrosoftMediaJobOutputAsset ) +type StampKind = original.StampKind + +const ( + AseV1 StampKind = original.AseV1 + AseV2 StampKind = original.AseV2 + Public StampKind = original.Public +) + type AppConfigurationKeyValueDeletedEventData = original.AppConfigurationKeyValueDeletedEventData type AppConfigurationKeyValueModifiedEventData = original.AppConfigurationKeyValueModifiedEventData +type AppEventTypeDetail = original.AppEventTypeDetail +type AppServicePlanEventTypeDetail = original.AppServicePlanEventTypeDetail type BaseClient = original.BaseClient type BasicMediaJobOutput = original.BasicMediaJobOutput type ContainerRegistryArtifactEventData = original.ContainerRegistryArtifactEventData @@ -175,6 +210,20 @@ type StorageDirectoryRenamedEventData = original.StorageDirectoryRenamedEventDat type SubscriptionDeletedEventData = original.SubscriptionDeletedEventData type SubscriptionValidationEventData = original.SubscriptionValidationEventData type SubscriptionValidationResponse = original.SubscriptionValidationResponse +type WebAppServicePlanUpdatedEventData = original.WebAppServicePlanUpdatedEventData +type WebAppServicePlanUpdatedEventDataSku = original.WebAppServicePlanUpdatedEventDataSku +type WebAppUpdatedEventData = original.WebAppUpdatedEventData +type WebBackupOperationCompletedEventData = original.WebBackupOperationCompletedEventData +type WebBackupOperationFailedEventData = original.WebBackupOperationFailedEventData +type WebBackupOperationStartedEventData = original.WebBackupOperationStartedEventData +type WebRestoreOperationCompletedEventData = original.WebRestoreOperationCompletedEventData +type WebRestoreOperationFailedEventData = original.WebRestoreOperationFailedEventData +type WebRestoreOperationStartedEventData = original.WebRestoreOperationStartedEventData +type WebSlotSwapCompletedEventData = original.WebSlotSwapCompletedEventData +type WebSlotSwapFailedEventData = original.WebSlotSwapFailedEventData +type WebSlotSwapStartedEventData = original.WebSlotSwapStartedEventData +type WebSlotSwapWithPreviewCancelledEventData = original.WebSlotSwapWithPreviewCancelledEventData +type WebSlotSwapWithPreviewStartedEventData = original.WebSlotSwapWithPreviewStartedEventData func New() BaseClient { return original.New() @@ -182,6 +231,15 @@ func New() BaseClient { func NewWithoutDefaults() BaseClient { return original.NewWithoutDefaults() } +func PossibleAppActionValues() []AppAction { + return original.PossibleAppActionValues() +} +func PossibleAppServicePlanActionValues() []AppServicePlanAction { + return original.PossibleAppServicePlanActionValues() +} +func PossibleAsyncStatusValues() []AsyncStatus { + return original.PossibleAsyncStatusValues() +} func PossibleMediaJobErrorCategoryValues() []MediaJobErrorCategory { return original.PossibleMediaJobErrorCategoryValues() } @@ -197,6 +255,9 @@ func PossibleMediaJobStateValues() []MediaJobState { func PossibleOdataTypeValues() []OdataType { return original.PossibleOdataTypeValues() } +func PossibleStampKindValues() []StampKind { + return original.PossibleStampKindValues() +} func UserAgent() string { return original.UserAgent() + " profiles/preview" } diff --git a/profiles/preview/frontdoor/mgmt/frontdoor/frontdoorapi/models.go b/profiles/preview/frontdoor/mgmt/frontdoor/frontdoorapi/models.go index ff5e9e8fcb8a..38aa5e643452 100644 --- a/profiles/preview/frontdoor/mgmt/frontdoor/frontdoorapi/models.go +++ b/profiles/preview/frontdoor/mgmt/frontdoor/frontdoorapi/models.go @@ -19,14 +19,15 @@ package frontdoorapi -import original "github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-01-01/frontdoor/frontdoorapi" +import original "github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-05-01/frontdoor/frontdoorapi" -type BaseClientAPI = original.BaseClientAPI type EndpointsClientAPI = original.EndpointsClientAPI type ExperimentsClientAPI = original.ExperimentsClientAPI type FrontDoorsClientAPI = original.FrontDoorsClientAPI type FrontendEndpointsClientAPI = original.FrontendEndpointsClientAPI type ManagedRuleSetsClientAPI = original.ManagedRuleSetsClientAPI +type NameAvailabilityClientAPI = original.NameAvailabilityClientAPI +type NameAvailabilityWithSubscriptionClientAPI = original.NameAvailabilityWithSubscriptionClientAPI type NetworkExperimentProfilesClientAPI = original.NetworkExperimentProfilesClientAPI type PoliciesClientAPI = original.PoliciesClientAPI type PreconfiguredEndpointsClientAPI = original.PreconfiguredEndpointsClientAPI diff --git a/profiles/preview/frontdoor/mgmt/frontdoor/models.go b/profiles/preview/frontdoor/mgmt/frontdoor/models.go index 59a12c21d5e9..155e563508a2 100644 --- a/profiles/preview/frontdoor/mgmt/frontdoor/models.go +++ b/profiles/preview/frontdoor/mgmt/frontdoor/models.go @@ -22,7 +22,7 @@ package frontdoor import ( "context" - original "github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-01-01/frontdoor" + original "github.com/Azure/azure-sdk-for-go/services/frontdoor/mgmt/2020-05-01/frontdoor" ) const ( @@ -535,6 +535,8 @@ type ManagedRuleSetDefinitionProperties = original.ManagedRuleSetDefinitionPrope type ManagedRuleSetList = original.ManagedRuleSetList type ManagedRuleSetsClient = original.ManagedRuleSetsClient type MatchCondition = original.MatchCondition +type NameAvailabilityClient = original.NameAvailabilityClient +type NameAvailabilityWithSubscriptionClient = original.NameAvailabilityWithSubscriptionClient type NetworkExperimentProfilesClient = original.NetworkExperimentProfilesClient type NetworkExperimentProfilesCreateOrUpdateFuture = original.NetworkExperimentProfilesCreateOrUpdateFuture type NetworkExperimentProfilesDeleteFuture = original.NetworkExperimentProfilesDeleteFuture @@ -649,6 +651,18 @@ func NewManagedRuleSetsClient(subscriptionID string) ManagedRuleSetsClient { func NewManagedRuleSetsClientWithBaseURI(baseURI string, subscriptionID string) ManagedRuleSetsClient { return original.NewManagedRuleSetsClientWithBaseURI(baseURI, subscriptionID) } +func NewNameAvailabilityClient(subscriptionID string) NameAvailabilityClient { + return original.NewNameAvailabilityClient(subscriptionID) +} +func NewNameAvailabilityClientWithBaseURI(baseURI string, subscriptionID string) NameAvailabilityClient { + return original.NewNameAvailabilityClientWithBaseURI(baseURI, subscriptionID) +} +func NewNameAvailabilityWithSubscriptionClient(subscriptionID string) NameAvailabilityWithSubscriptionClient { + return original.NewNameAvailabilityWithSubscriptionClient(subscriptionID) +} +func NewNameAvailabilityWithSubscriptionClientWithBaseURI(baseURI string, subscriptionID string) NameAvailabilityWithSubscriptionClient { + return original.NewNameAvailabilityWithSubscriptionClientWithBaseURI(baseURI, subscriptionID) +} func NewNetworkExperimentProfilesClient(subscriptionID string) NetworkExperimentProfilesClient { return original.NewNetworkExperimentProfilesClient(subscriptionID) } diff --git a/profiles/preview/iothub/mgmt/devices/devicesapi/models.go b/profiles/preview/iothub/mgmt/devices/devicesapi/models.go index 361bf7676bc4..3a96ff7e0c8d 100644 --- a/profiles/preview/iothub/mgmt/devices/devicesapi/models.go +++ b/profiles/preview/iothub/mgmt/devices/devicesapi/models.go @@ -19,9 +19,12 @@ package devicesapi -import original "github.com/Azure/azure-sdk-for-go/services/iothub/mgmt/2018-04-01/devices/devicesapi" +import original "github.com/Azure/azure-sdk-for-go/services/iothub/mgmt/2020-03-01/devices/devicesapi" type CertificatesClientAPI = original.CertificatesClientAPI +type IotHubClientAPI = original.IotHubClientAPI type IotHubResourceClientAPI = original.IotHubResourceClientAPI type OperationsClientAPI = original.OperationsClientAPI +type PrivateEndpointConnectionsClientAPI = original.PrivateEndpointConnectionsClientAPI +type PrivateLinkResourcesClientAPI = original.PrivateLinkResourcesClientAPI type ResourceProviderCommonClientAPI = original.ResourceProviderCommonClientAPI diff --git a/profiles/preview/iothub/mgmt/devices/models.go b/profiles/preview/iothub/mgmt/devices/models.go index 54935fe50a3b..17deea9e3049 100644 --- a/profiles/preview/iothub/mgmt/devices/models.go +++ b/profiles/preview/iothub/mgmt/devices/models.go @@ -22,7 +22,7 @@ package devices import ( "context" - original "github.com/Azure/azure-sdk-for-go/services/iothub/mgmt/2018-04-01/devices" + original "github.com/Azure/azure-sdk-for-go/services/iothub/mgmt/2020-03-01/devices" ) const ( @@ -49,6 +49,13 @@ const ( ServiceConnectDeviceConnect AccessRights = original.ServiceConnectDeviceConnect ) +type AuthenticationType = original.AuthenticationType + +const ( + IdentityBased AuthenticationType = original.IdentityBased + KeyBased AuthenticationType = original.KeyBased +) + type Capabilities = original.Capabilities const ( @@ -56,6 +63,14 @@ const ( None Capabilities = original.None ) +type Encoding = original.Encoding + +const ( + Avro Encoding = original.Avro + AvroDeflate Encoding = original.AvroDeflate + JSON Encoding = original.JSON +) + type EndpointHealthStatus = original.EndpointHealthStatus const ( @@ -79,6 +94,13 @@ const ( Invalid IotHubNameUnavailabilityReason = original.Invalid ) +type IotHubReplicaRoleType = original.IotHubReplicaRoleType + +const ( + Primary IotHubReplicaRoleType = original.Primary + Secondary IotHubReplicaRoleType = original.Secondary +) + type IotHubScaleType = original.IotHubScaleType const ( @@ -133,13 +155,20 @@ const ( JobTypeWriteDeviceProperties JobType = original.JobTypeWriteDeviceProperties ) -type OperationMonitoringLevel = original.OperationMonitoringLevel +type PrivateLinkServiceConnectionStatus = original.PrivateLinkServiceConnectionStatus + +const ( + Approved PrivateLinkServiceConnectionStatus = original.Approved + Disconnected PrivateLinkServiceConnectionStatus = original.Disconnected + Pending PrivateLinkServiceConnectionStatus = original.Pending + Rejected PrivateLinkServiceConnectionStatus = original.Rejected +) + +type PublicNetworkAccess = original.PublicNetworkAccess const ( - OperationMonitoringLevelError OperationMonitoringLevel = original.OperationMonitoringLevelError - OperationMonitoringLevelErrorInformation OperationMonitoringLevel = original.OperationMonitoringLevelErrorInformation - OperationMonitoringLevelInformation OperationMonitoringLevel = original.OperationMonitoringLevelInformation - OperationMonitoringLevelNone OperationMonitoringLevel = original.OperationMonitoringLevelNone + Disabled PublicNetworkAccess = original.Disabled + Enabled PublicNetworkAccess = original.Enabled ) type RouteErrorSeverity = original.RouteErrorSeverity @@ -181,6 +210,7 @@ type EndpointHealthData = original.EndpointHealthData type EndpointHealthDataListResult = original.EndpointHealthDataListResult type EndpointHealthDataListResultIterator = original.EndpointHealthDataListResultIterator type EndpointHealthDataListResultPage = original.EndpointHealthDataListResultPage +type EnrichmentProperties = original.EnrichmentProperties type ErrorDetails = original.ErrorDetails type EventHubConsumerGroupInfo = original.EventHubConsumerGroupInfo type EventHubConsumerGroupsListResult = original.EventHubConsumerGroupsListResult @@ -188,15 +218,21 @@ type EventHubConsumerGroupsListResultIterator = original.EventHubConsumerGroupsL type EventHubConsumerGroupsListResultPage = original.EventHubConsumerGroupsListResultPage type EventHubProperties = original.EventHubProperties type ExportDevicesRequest = original.ExportDevicesRequest +type FailoverInput = original.FailoverInput type FallbackRouteProperties = original.FallbackRouteProperties type FeedbackProperties = original.FeedbackProperties +type GroupIDInformation = original.GroupIDInformation +type GroupIDInformationProperties = original.GroupIDInformationProperties type IPFilterRule = original.IPFilterRule type ImportDevicesRequest = original.ImportDevicesRequest type IotHubCapacity = original.IotHubCapacity +type IotHubClient = original.IotHubClient type IotHubDescription = original.IotHubDescription type IotHubDescriptionListResult = original.IotHubDescriptionListResult type IotHubDescriptionListResultIterator = original.IotHubDescriptionListResultIterator type IotHubDescriptionListResultPage = original.IotHubDescriptionListResultPage +type IotHubLocationDescription = original.IotHubLocationDescription +type IotHubManualFailoverFuture = original.IotHubManualFailoverFuture type IotHubNameAvailabilityInfo = original.IotHubNameAvailabilityInfo type IotHubProperties = original.IotHubProperties type IotHubQuotaMetricInfo = original.IotHubQuotaMetricInfo @@ -216,6 +252,7 @@ type JobResponse = original.JobResponse type JobResponseListResult = original.JobResponseListResult type JobResponseListResultIterator = original.JobResponseListResultIterator type JobResponseListResultPage = original.JobResponseListResultPage +type ListPrivateEndpointConnection = original.ListPrivateEndpointConnection type MatchedRoute = original.MatchedRoute type MessagingEndpointProperties = original.MessagingEndpointProperties type Name = original.Name @@ -226,7 +263,15 @@ type OperationListResult = original.OperationListResult type OperationListResultIterator = original.OperationListResultIterator type OperationListResultPage = original.OperationListResultPage type OperationsClient = original.OperationsClient -type OperationsMonitoringProperties = original.OperationsMonitoringProperties +type PrivateEndpoint = original.PrivateEndpoint +type PrivateEndpointConnection = original.PrivateEndpointConnection +type PrivateEndpointConnectionProperties = original.PrivateEndpointConnectionProperties +type PrivateEndpointConnectionsClient = original.PrivateEndpointConnectionsClient +type PrivateEndpointConnectionsDeleteFuture = original.PrivateEndpointConnectionsDeleteFuture +type PrivateEndpointConnectionsUpdateFuture = original.PrivateEndpointConnectionsUpdateFuture +type PrivateLinkResources = original.PrivateLinkResources +type PrivateLinkResourcesClient = original.PrivateLinkResourcesClient +type PrivateLinkServiceConnectionState = original.PrivateLinkServiceConnectionState type RegistryStatistics = original.RegistryStatistics type Resource = original.Resource type ResourceProviderCommonClient = original.ResourceProviderCommonClient @@ -279,6 +324,12 @@ func NewEventHubConsumerGroupsListResultIterator(page EventHubConsumerGroupsList func NewEventHubConsumerGroupsListResultPage(getNextPage func(context.Context, EventHubConsumerGroupsListResult) (EventHubConsumerGroupsListResult, error)) EventHubConsumerGroupsListResultPage { return original.NewEventHubConsumerGroupsListResultPage(getNextPage) } +func NewIotHubClient(subscriptionID string) IotHubClient { + return original.NewIotHubClient(subscriptionID) +} +func NewIotHubClientWithBaseURI(baseURI string, subscriptionID string) IotHubClient { + return original.NewIotHubClientWithBaseURI(baseURI, subscriptionID) +} func NewIotHubDescriptionListResultIterator(page IotHubDescriptionListResultPage) IotHubDescriptionListResultIterator { return original.NewIotHubDescriptionListResultIterator(page) } @@ -321,6 +372,18 @@ func NewOperationsClient(subscriptionID string) OperationsClient { func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID) } +func NewPrivateEndpointConnectionsClient(subscriptionID string) PrivateEndpointConnectionsClient { + return original.NewPrivateEndpointConnectionsClient(subscriptionID) +} +func NewPrivateEndpointConnectionsClientWithBaseURI(baseURI string, subscriptionID string) PrivateEndpointConnectionsClient { + return original.NewPrivateEndpointConnectionsClientWithBaseURI(baseURI, subscriptionID) +} +func NewPrivateLinkResourcesClient(subscriptionID string) PrivateLinkResourcesClient { + return original.NewPrivateLinkResourcesClient(subscriptionID) +} +func NewPrivateLinkResourcesClientWithBaseURI(baseURI string, subscriptionID string) PrivateLinkResourcesClient { + return original.NewPrivateLinkResourcesClientWithBaseURI(baseURI, subscriptionID) +} func NewResourceProviderCommonClient(subscriptionID string) ResourceProviderCommonClient { return original.NewResourceProviderCommonClient(subscriptionID) } @@ -339,9 +402,15 @@ func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { func PossibleAccessRightsValues() []AccessRights { return original.PossibleAccessRightsValues() } +func PossibleAuthenticationTypeValues() []AuthenticationType { + return original.PossibleAuthenticationTypeValues() +} func PossibleCapabilitiesValues() []Capabilities { return original.PossibleCapabilitiesValues() } +func PossibleEncodingValues() []Encoding { + return original.PossibleEncodingValues() +} func PossibleEndpointHealthStatusValues() []EndpointHealthStatus { return original.PossibleEndpointHealthStatusValues() } @@ -351,6 +420,9 @@ func PossibleIPFilterActionTypeValues() []IPFilterActionType { func PossibleIotHubNameUnavailabilityReasonValues() []IotHubNameUnavailabilityReason { return original.PossibleIotHubNameUnavailabilityReasonValues() } +func PossibleIotHubReplicaRoleTypeValues() []IotHubReplicaRoleType { + return original.PossibleIotHubReplicaRoleTypeValues() +} func PossibleIotHubScaleTypeValues() []IotHubScaleType { return original.PossibleIotHubScaleTypeValues() } @@ -366,8 +438,11 @@ func PossibleJobStatusValues() []JobStatus { func PossibleJobTypeValues() []JobType { return original.PossibleJobTypeValues() } -func PossibleOperationMonitoringLevelValues() []OperationMonitoringLevel { - return original.PossibleOperationMonitoringLevelValues() +func PossiblePrivateLinkServiceConnectionStatusValues() []PrivateLinkServiceConnectionStatus { + return original.PossiblePrivateLinkServiceConnectionStatusValues() +} +func PossiblePublicNetworkAccessValues() []PublicNetworkAccess { + return original.PossiblePublicNetworkAccessValues() } func PossibleRouteErrorSeverityValues() []RouteErrorSeverity { return original.PossibleRouteErrorSeverityValues() diff --git a/profiles/preview/machinelearningservices/mgmt/machinelearningservices/machinelearningservicesapi/models.go b/profiles/preview/machinelearningservices/mgmt/machinelearningservices/machinelearningservicesapi/models.go index df1d83269022..c036104d69a0 100644 --- a/profiles/preview/machinelearningservices/mgmt/machinelearningservices/machinelearningservicesapi/models.go +++ b/profiles/preview/machinelearningservices/mgmt/machinelearningservices/machinelearningservicesapi/models.go @@ -19,7 +19,7 @@ package machinelearningservicesapi -import original "github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2020-03-01/machinelearningservices/machinelearningservicesapi" +import original "github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2020-04-01/machinelearningservices/machinelearningservicesapi" type BaseClientAPI = original.BaseClientAPI type MachineLearningComputeClientAPI = original.MachineLearningComputeClientAPI diff --git a/profiles/preview/machinelearningservices/mgmt/machinelearningservices/models.go b/profiles/preview/machinelearningservices/mgmt/machinelearningservices/models.go index eee392346d5a..116da5403b42 100644 --- a/profiles/preview/machinelearningservices/mgmt/machinelearningservices/models.go +++ b/profiles/preview/machinelearningservices/mgmt/machinelearningservices/models.go @@ -22,7 +22,7 @@ package machinelearningservices import ( "context" - original "github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2020-03-01/machinelearningservices" + original "github.com/Azure/azure-sdk-for-go/services/machinelearningservices/mgmt/2020-04-01/machinelearningservices" ) const ( @@ -151,7 +151,10 @@ const ( type ResourceIdentityType = original.ResourceIdentityType const ( - SystemAssigned ResourceIdentityType = original.SystemAssigned + None ResourceIdentityType = original.None + SystemAssigned ResourceIdentityType = original.SystemAssigned + SystemAssignedUserAssigned ResourceIdentityType = original.SystemAssignedUserAssigned + UserAssigned ResourceIdentityType = original.UserAssigned ) type Status = original.Status @@ -227,6 +230,7 @@ type ErrorResponse = original.ErrorResponse type HDInsight = original.HDInsight type HDInsightProperties = original.HDInsightProperties type Identity = original.Identity +type IdentityUserAssignedIdentitiesValue = original.IdentityUserAssignedIdentitiesValue type KeyVaultProperties = original.KeyVaultProperties type ListAmlUserFeatureResult = original.ListAmlUserFeatureResult type ListAmlUserFeatureResultIterator = original.ListAmlUserFeatureResultIterator diff --git a/profiles/preview/mediaservices/mgmt/media/models.go b/profiles/preview/mediaservices/mgmt/media/models.go index 9b9f6a582a6f..db13aaf27837 100644 --- a/profiles/preview/mediaservices/mgmt/media/models.go +++ b/profiles/preview/mediaservices/mgmt/media/models.go @@ -584,6 +584,9 @@ type CopyVideo = original.CopyVideo type CrossSiteAccessPolicies = original.CrossSiteAccessPolicies type DefaultKey = original.DefaultKey type Deinterlace = original.Deinterlace +type EdgePolicies = original.EdgePolicies +type EdgeUsageDataCollectionPolicy = original.EdgeUsageDataCollectionPolicy +type EdgeUsageDataEventHub = original.EdgeUsageDataEventHub type EnabledProtocols = original.EnabledProtocols type EntityNameAvailabilityCheckOutput = original.EntityNameAvailabilityCheckOutput type EnvelopeEncryption = original.EnvelopeEncryption @@ -622,6 +625,7 @@ type JpgLayer = original.JpgLayer type Layer = original.Layer type ListContainerSasInput = original.ListContainerSasInput type ListContentKeysResponse = original.ListContentKeysResponse +type ListEdgePoliciesInput = original.ListEdgePoliciesInput type ListPathsResponse = original.ListPathsResponse type ListStreamingLocatorsResponse = original.ListStreamingLocatorsResponse type LiveEvent = original.LiveEvent diff --git a/profiles/preview/operationalinsights/operationalinsights/models.go b/profiles/preview/operationalinsights/operationalinsights/models.go index cc39c05b489e..abf070a52ccc 100644 --- a/profiles/preview/operationalinsights/operationalinsights/models.go +++ b/profiles/preview/operationalinsights/operationalinsights/models.go @@ -42,11 +42,11 @@ type Column = original.Column type ErrorDetail = original.ErrorDetail type ErrorInfo = original.ErrorInfo type ErrorResponse = original.ErrorResponse -type GetClient = original.GetClient type MetadataApplication = original.MetadataApplication type MetadataApplicationRelated = original.MetadataApplicationRelated type MetadataCategory = original.MetadataCategory type MetadataCategoryRelated = original.MetadataCategoryRelated +type MetadataClient = original.MetadataClient type MetadataFunction = original.MetadataFunction type MetadataFunctionRelated = original.MetadataFunctionRelated type MetadataPermissions = original.MetadataPermissions @@ -65,7 +65,6 @@ type MetadataTableColumnsItem = original.MetadataTableColumnsItem type MetadataTableRelated = original.MetadataTableRelated type MetadataWorkspace = original.MetadataWorkspace type MetadataWorkspaceRelated = original.MetadataWorkspaceRelated -type PostClient = original.PostClient type QueryBody = original.QueryBody type QueryClient = original.QueryClient type QueryResults = original.QueryResults @@ -74,17 +73,11 @@ type Table = original.Table func New() BaseClient { return original.New() } -func NewGetClient() GetClient { - return original.NewGetClient() +func NewMetadataClient() MetadataClient { + return original.NewMetadataClient() } -func NewGetClientWithBaseURI(baseURI string) GetClient { - return original.NewGetClientWithBaseURI(baseURI) -} -func NewPostClient() PostClient { - return original.NewPostClient() -} -func NewPostClientWithBaseURI(baseURI string) PostClient { - return original.NewPostClientWithBaseURI(baseURI) +func NewMetadataClientWithBaseURI(baseURI string) MetadataClient { + return original.NewMetadataClientWithBaseURI(baseURI) } func NewQueryClient() QueryClient { return original.NewQueryClient() diff --git a/profiles/preview/operationalinsights/operationalinsights/operationalinsightsapi/models.go b/profiles/preview/operationalinsights/operationalinsights/operationalinsightsapi/models.go index 33574cfb07c9..077ff883d4c0 100644 --- a/profiles/preview/operationalinsights/operationalinsights/operationalinsightsapi/models.go +++ b/profiles/preview/operationalinsights/operationalinsights/operationalinsightsapi/models.go @@ -21,6 +21,5 @@ package operationalinsightsapi import original "github.com/Azure/azure-sdk-for-go/services/operationalinsights/v1/operationalinsights/operationalinsightsapi" -type GetClientAPI = original.GetClientAPI -type PostClientAPI = original.PostClientAPI +type MetadataClientAPI = original.MetadataClientAPI type QueryClientAPI = original.QueryClientAPI diff --git a/profiles/preview/peering/mgmt/peering/models.go b/profiles/preview/peering/mgmt/peering/models.go new file mode 100644 index 000000000000..a02cbcd33876 --- /dev/null +++ b/profiles/preview/peering/mgmt/peering/models.go @@ -0,0 +1,470 @@ +// +build go1.9 + +// Copyright 2020 Microsoft Corporation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This code was auto-generated by: +// github.com/Azure/azure-sdk-for-go/tools/profileBuilder + +package peering + +import ( + "context" + + original "github.com/Azure/azure-sdk-for-go/services/peering/mgmt/2020-04-01/peering" +) + +const ( + DefaultBaseURI = original.DefaultBaseURI +) + +type ConnectionState = original.ConnectionState + +const ( + Active ConnectionState = original.Active + Approved ConnectionState = original.Approved + None ConnectionState = original.None + PendingApproval ConnectionState = original.PendingApproval + ProvisioningCompleted ConnectionState = original.ProvisioningCompleted + ProvisioningFailed ConnectionState = original.ProvisioningFailed + ProvisioningStarted ConnectionState = original.ProvisioningStarted + Validating ConnectionState = original.Validating +) + +type DirectPeeringType = original.DirectPeeringType + +const ( + Cdn DirectPeeringType = original.Cdn + Edge DirectPeeringType = original.Edge + Internal DirectPeeringType = original.Internal + Ix DirectPeeringType = original.Ix + IxRs DirectPeeringType = original.IxRs + Transit DirectPeeringType = original.Transit +) + +type Family = original.Family + +const ( + Direct Family = original.Direct + Exchange Family = original.Exchange +) + +type Kind = original.Kind + +const ( + KindDirect Kind = original.KindDirect + KindExchange Kind = original.KindExchange +) + +type LearnedType = original.LearnedType + +const ( + LearnedTypeNone LearnedType = original.LearnedTypeNone + LearnedTypeViaServiceProvider LearnedType = original.LearnedTypeViaServiceProvider + LearnedTypeViaSession LearnedType = original.LearnedTypeViaSession +) + +type PrefixValidationState = original.PrefixValidationState + +const ( + PrefixValidationStateFailed PrefixValidationState = original.PrefixValidationStateFailed + PrefixValidationStateInvalid PrefixValidationState = original.PrefixValidationStateInvalid + PrefixValidationStateNone PrefixValidationState = original.PrefixValidationStateNone + PrefixValidationStatePending PrefixValidationState = original.PrefixValidationStatePending + PrefixValidationStateUnknown PrefixValidationState = original.PrefixValidationStateUnknown + PrefixValidationStateVerified PrefixValidationState = original.PrefixValidationStateVerified + PrefixValidationStateWarning PrefixValidationState = original.PrefixValidationStateWarning +) + +type ProvisioningState = original.ProvisioningState + +const ( + Deleting ProvisioningState = original.Deleting + Failed ProvisioningState = original.Failed + Succeeded ProvisioningState = original.Succeeded + Updating ProvisioningState = original.Updating +) + +type Role = original.Role + +const ( + RoleEscalation Role = original.RoleEscalation + RoleNoc Role = original.RoleNoc + RoleOther Role = original.RoleOther + RolePolicy Role = original.RolePolicy + RoleService Role = original.RoleService + RoleTechnical Role = original.RoleTechnical +) + +type SessionAddressProvider = original.SessionAddressProvider + +const ( + Microsoft SessionAddressProvider = original.Microsoft + Peer SessionAddressProvider = original.Peer +) + +type SessionStateV4 = original.SessionStateV4 + +const ( + SessionStateV4Active SessionStateV4 = original.SessionStateV4Active + SessionStateV4Connect SessionStateV4 = original.SessionStateV4Connect + SessionStateV4Established SessionStateV4 = original.SessionStateV4Established + SessionStateV4Idle SessionStateV4 = original.SessionStateV4Idle + SessionStateV4None SessionStateV4 = original.SessionStateV4None + SessionStateV4OpenConfirm SessionStateV4 = original.SessionStateV4OpenConfirm + SessionStateV4OpenReceived SessionStateV4 = original.SessionStateV4OpenReceived + SessionStateV4OpenSent SessionStateV4 = original.SessionStateV4OpenSent + SessionStateV4PendingAdd SessionStateV4 = original.SessionStateV4PendingAdd + SessionStateV4PendingRemove SessionStateV4 = original.SessionStateV4PendingRemove + SessionStateV4PendingUpdate SessionStateV4 = original.SessionStateV4PendingUpdate +) + +type SessionStateV6 = original.SessionStateV6 + +const ( + SessionStateV6Active SessionStateV6 = original.SessionStateV6Active + SessionStateV6Connect SessionStateV6 = original.SessionStateV6Connect + SessionStateV6Established SessionStateV6 = original.SessionStateV6Established + SessionStateV6Idle SessionStateV6 = original.SessionStateV6Idle + SessionStateV6None SessionStateV6 = original.SessionStateV6None + SessionStateV6OpenConfirm SessionStateV6 = original.SessionStateV6OpenConfirm + SessionStateV6OpenReceived SessionStateV6 = original.SessionStateV6OpenReceived + SessionStateV6OpenSent SessionStateV6 = original.SessionStateV6OpenSent + SessionStateV6PendingAdd SessionStateV6 = original.SessionStateV6PendingAdd + SessionStateV6PendingRemove SessionStateV6 = original.SessionStateV6PendingRemove + SessionStateV6PendingUpdate SessionStateV6 = original.SessionStateV6PendingUpdate +) + +type Size = original.Size + +const ( + Free Size = original.Free + Metered Size = original.Metered + Unlimited Size = original.Unlimited +) + +type Tier = original.Tier + +const ( + Basic Tier = original.Basic + Premium Tier = original.Premium +) + +type ValidationState = original.ValidationState + +const ( + ValidationStateApproved ValidationState = original.ValidationStateApproved + ValidationStateFailed ValidationState = original.ValidationStateFailed + ValidationStateNone ValidationState = original.ValidationStateNone + ValidationStatePending ValidationState = original.ValidationStatePending +) + +type BandwidthOffer = original.BandwidthOffer +type BaseClient = original.BaseClient +type BgpSession = original.BgpSession +type CheckServiceProviderAvailabilityInput = original.CheckServiceProviderAvailabilityInput +type ContactDetail = original.ContactDetail +type DirectConnection = original.DirectConnection +type DirectPeeringFacility = original.DirectPeeringFacility +type ErrorDetail = original.ErrorDetail +type ErrorResponse = original.ErrorResponse +type ExchangeConnection = original.ExchangeConnection +type ExchangePeeringFacility = original.ExchangePeeringFacility +type LegacyPeeringsClient = original.LegacyPeeringsClient +type ListResult = original.ListResult +type ListResultIterator = original.ListResultIterator +type ListResultPage = original.ListResultPage +type Location = original.Location +type LocationListResult = original.LocationListResult +type LocationListResultIterator = original.LocationListResultIterator +type LocationListResultPage = original.LocationListResultPage +type LocationProperties = original.LocationProperties +type LocationPropertiesDirect = original.LocationPropertiesDirect +type LocationPropertiesExchange = original.LocationPropertiesExchange +type LocationsClient = original.LocationsClient +type Model = original.Model +type Operation = original.Operation +type OperationDisplayInfo = original.OperationDisplayInfo +type OperationListResult = original.OperationListResult +type OperationListResultIterator = original.OperationListResultIterator +type OperationListResultPage = original.OperationListResultPage +type OperationsClient = original.OperationsClient +type PeerAsn = original.PeerAsn +type PeerAsnListResult = original.PeerAsnListResult +type PeerAsnListResultIterator = original.PeerAsnListResultIterator +type PeerAsnListResultPage = original.PeerAsnListResultPage +type PeerAsnProperties = original.PeerAsnProperties +type PeerAsnsClient = original.PeerAsnsClient +type PeeringsClient = original.PeeringsClient +type PrefixesClient = original.PrefixesClient +type Properties = original.Properties +type PropertiesDirect = original.PropertiesDirect +type PropertiesExchange = original.PropertiesExchange +type ReceivedRoute = original.ReceivedRoute +type ReceivedRouteListResult = original.ReceivedRouteListResult +type ReceivedRouteListResultIterator = original.ReceivedRouteListResultIterator +type ReceivedRouteListResultPage = original.ReceivedRouteListResultPage +type ReceivedRoutesClient = original.ReceivedRoutesClient +type RegisteredAsn = original.RegisteredAsn +type RegisteredAsnListResult = original.RegisteredAsnListResult +type RegisteredAsnListResultIterator = original.RegisteredAsnListResultIterator +type RegisteredAsnListResultPage = original.RegisteredAsnListResultPage +type RegisteredAsnProperties = original.RegisteredAsnProperties +type RegisteredAsnsClient = original.RegisteredAsnsClient +type RegisteredPrefix = original.RegisteredPrefix +type RegisteredPrefixListResult = original.RegisteredPrefixListResult +type RegisteredPrefixListResultIterator = original.RegisteredPrefixListResultIterator +type RegisteredPrefixListResultPage = original.RegisteredPrefixListResultPage +type RegisteredPrefixProperties = original.RegisteredPrefixProperties +type RegisteredPrefixesClient = original.RegisteredPrefixesClient +type Resource = original.Resource +type ResourceTags = original.ResourceTags +type Service = original.Service +type ServiceCountriesClient = original.ServiceCountriesClient +type ServiceCountry = original.ServiceCountry +type ServiceCountryListResult = original.ServiceCountryListResult +type ServiceCountryListResultIterator = original.ServiceCountryListResultIterator +type ServiceCountryListResultPage = original.ServiceCountryListResultPage +type ServiceListResult = original.ServiceListResult +type ServiceListResultIterator = original.ServiceListResultIterator +type ServiceListResultPage = original.ServiceListResultPage +type ServiceLocation = original.ServiceLocation +type ServiceLocationListResult = original.ServiceLocationListResult +type ServiceLocationListResultIterator = original.ServiceLocationListResultIterator +type ServiceLocationListResultPage = original.ServiceLocationListResultPage +type ServiceLocationProperties = original.ServiceLocationProperties +type ServiceLocationsClient = original.ServiceLocationsClient +type ServicePrefix = original.ServicePrefix +type ServicePrefixEvent = original.ServicePrefixEvent +type ServicePrefixListResult = original.ServicePrefixListResult +type ServicePrefixListResultIterator = original.ServicePrefixListResultIterator +type ServicePrefixListResultPage = original.ServicePrefixListResultPage +type ServicePrefixProperties = original.ServicePrefixProperties +type ServiceProperties = original.ServiceProperties +type ServiceProvider = original.ServiceProvider +type ServiceProviderListResult = original.ServiceProviderListResult +type ServiceProviderListResultIterator = original.ServiceProviderListResultIterator +type ServiceProviderListResultPage = original.ServiceProviderListResultPage +type ServiceProviderProperties = original.ServiceProviderProperties +type ServiceProvidersClient = original.ServiceProvidersClient +type ServiceSku = original.ServiceSku +type ServicesClient = original.ServicesClient +type Sku = original.Sku +type String = original.String +type SubResource = original.SubResource + +func New(subscriptionID string) BaseClient { + return original.New(subscriptionID) +} +func NewLegacyPeeringsClient(subscriptionID string) LegacyPeeringsClient { + return original.NewLegacyPeeringsClient(subscriptionID) +} +func NewLegacyPeeringsClientWithBaseURI(baseURI string, subscriptionID string) LegacyPeeringsClient { + return original.NewLegacyPeeringsClientWithBaseURI(baseURI, subscriptionID) +} +func NewListResultIterator(page ListResultPage) ListResultIterator { + return original.NewListResultIterator(page) +} +func NewListResultPage(getNextPage func(context.Context, ListResult) (ListResult, error)) ListResultPage { + return original.NewListResultPage(getNextPage) +} +func NewLocationListResultIterator(page LocationListResultPage) LocationListResultIterator { + return original.NewLocationListResultIterator(page) +} +func NewLocationListResultPage(getNextPage func(context.Context, LocationListResult) (LocationListResult, error)) LocationListResultPage { + return original.NewLocationListResultPage(getNextPage) +} +func NewLocationsClient(subscriptionID string) LocationsClient { + return original.NewLocationsClient(subscriptionID) +} +func NewLocationsClientWithBaseURI(baseURI string, subscriptionID string) LocationsClient { + return original.NewLocationsClientWithBaseURI(baseURI, subscriptionID) +} +func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator { + return original.NewOperationListResultIterator(page) +} +func NewOperationListResultPage(getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { + return original.NewOperationListResultPage(getNextPage) +} +func NewOperationsClient(subscriptionID string) OperationsClient { + return original.NewOperationsClient(subscriptionID) +} +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID) +} +func NewPeerAsnListResultIterator(page PeerAsnListResultPage) PeerAsnListResultIterator { + return original.NewPeerAsnListResultIterator(page) +} +func NewPeerAsnListResultPage(getNextPage func(context.Context, PeerAsnListResult) (PeerAsnListResult, error)) PeerAsnListResultPage { + return original.NewPeerAsnListResultPage(getNextPage) +} +func NewPeerAsnsClient(subscriptionID string) PeerAsnsClient { + return original.NewPeerAsnsClient(subscriptionID) +} +func NewPeerAsnsClientWithBaseURI(baseURI string, subscriptionID string) PeerAsnsClient { + return original.NewPeerAsnsClientWithBaseURI(baseURI, subscriptionID) +} +func NewPeeringsClient(subscriptionID string) PeeringsClient { + return original.NewPeeringsClient(subscriptionID) +} +func NewPeeringsClientWithBaseURI(baseURI string, subscriptionID string) PeeringsClient { + return original.NewPeeringsClientWithBaseURI(baseURI, subscriptionID) +} +func NewPrefixesClient(subscriptionID string) PrefixesClient { + return original.NewPrefixesClient(subscriptionID) +} +func NewPrefixesClientWithBaseURI(baseURI string, subscriptionID string) PrefixesClient { + return original.NewPrefixesClientWithBaseURI(baseURI, subscriptionID) +} +func NewReceivedRouteListResultIterator(page ReceivedRouteListResultPage) ReceivedRouteListResultIterator { + return original.NewReceivedRouteListResultIterator(page) +} +func NewReceivedRouteListResultPage(getNextPage func(context.Context, ReceivedRouteListResult) (ReceivedRouteListResult, error)) ReceivedRouteListResultPage { + return original.NewReceivedRouteListResultPage(getNextPage) +} +func NewReceivedRoutesClient(subscriptionID string) ReceivedRoutesClient { + return original.NewReceivedRoutesClient(subscriptionID) +} +func NewReceivedRoutesClientWithBaseURI(baseURI string, subscriptionID string) ReceivedRoutesClient { + return original.NewReceivedRoutesClientWithBaseURI(baseURI, subscriptionID) +} +func NewRegisteredAsnListResultIterator(page RegisteredAsnListResultPage) RegisteredAsnListResultIterator { + return original.NewRegisteredAsnListResultIterator(page) +} +func NewRegisteredAsnListResultPage(getNextPage func(context.Context, RegisteredAsnListResult) (RegisteredAsnListResult, error)) RegisteredAsnListResultPage { + return original.NewRegisteredAsnListResultPage(getNextPage) +} +func NewRegisteredAsnsClient(subscriptionID string) RegisteredAsnsClient { + return original.NewRegisteredAsnsClient(subscriptionID) +} +func NewRegisteredAsnsClientWithBaseURI(baseURI string, subscriptionID string) RegisteredAsnsClient { + return original.NewRegisteredAsnsClientWithBaseURI(baseURI, subscriptionID) +} +func NewRegisteredPrefixListResultIterator(page RegisteredPrefixListResultPage) RegisteredPrefixListResultIterator { + return original.NewRegisteredPrefixListResultIterator(page) +} +func NewRegisteredPrefixListResultPage(getNextPage func(context.Context, RegisteredPrefixListResult) (RegisteredPrefixListResult, error)) RegisteredPrefixListResultPage { + return original.NewRegisteredPrefixListResultPage(getNextPage) +} +func NewRegisteredPrefixesClient(subscriptionID string) RegisteredPrefixesClient { + return original.NewRegisteredPrefixesClient(subscriptionID) +} +func NewRegisteredPrefixesClientWithBaseURI(baseURI string, subscriptionID string) RegisteredPrefixesClient { + return original.NewRegisteredPrefixesClientWithBaseURI(baseURI, subscriptionID) +} +func NewServiceCountriesClient(subscriptionID string) ServiceCountriesClient { + return original.NewServiceCountriesClient(subscriptionID) +} +func NewServiceCountriesClientWithBaseURI(baseURI string, subscriptionID string) ServiceCountriesClient { + return original.NewServiceCountriesClientWithBaseURI(baseURI, subscriptionID) +} +func NewServiceCountryListResultIterator(page ServiceCountryListResultPage) ServiceCountryListResultIterator { + return original.NewServiceCountryListResultIterator(page) +} +func NewServiceCountryListResultPage(getNextPage func(context.Context, ServiceCountryListResult) (ServiceCountryListResult, error)) ServiceCountryListResultPage { + return original.NewServiceCountryListResultPage(getNextPage) +} +func NewServiceListResultIterator(page ServiceListResultPage) ServiceListResultIterator { + return original.NewServiceListResultIterator(page) +} +func NewServiceListResultPage(getNextPage func(context.Context, ServiceListResult) (ServiceListResult, error)) ServiceListResultPage { + return original.NewServiceListResultPage(getNextPage) +} +func NewServiceLocationListResultIterator(page ServiceLocationListResultPage) ServiceLocationListResultIterator { + return original.NewServiceLocationListResultIterator(page) +} +func NewServiceLocationListResultPage(getNextPage func(context.Context, ServiceLocationListResult) (ServiceLocationListResult, error)) ServiceLocationListResultPage { + return original.NewServiceLocationListResultPage(getNextPage) +} +func NewServiceLocationsClient(subscriptionID string) ServiceLocationsClient { + return original.NewServiceLocationsClient(subscriptionID) +} +func NewServiceLocationsClientWithBaseURI(baseURI string, subscriptionID string) ServiceLocationsClient { + return original.NewServiceLocationsClientWithBaseURI(baseURI, subscriptionID) +} +func NewServicePrefixListResultIterator(page ServicePrefixListResultPage) ServicePrefixListResultIterator { + return original.NewServicePrefixListResultIterator(page) +} +func NewServicePrefixListResultPage(getNextPage func(context.Context, ServicePrefixListResult) (ServicePrefixListResult, error)) ServicePrefixListResultPage { + return original.NewServicePrefixListResultPage(getNextPage) +} +func NewServiceProviderListResultIterator(page ServiceProviderListResultPage) ServiceProviderListResultIterator { + return original.NewServiceProviderListResultIterator(page) +} +func NewServiceProviderListResultPage(getNextPage func(context.Context, ServiceProviderListResult) (ServiceProviderListResult, error)) ServiceProviderListResultPage { + return original.NewServiceProviderListResultPage(getNextPage) +} +func NewServiceProvidersClient(subscriptionID string) ServiceProvidersClient { + return original.NewServiceProvidersClient(subscriptionID) +} +func NewServiceProvidersClientWithBaseURI(baseURI string, subscriptionID string) ServiceProvidersClient { + return original.NewServiceProvidersClientWithBaseURI(baseURI, subscriptionID) +} +func NewServicesClient(subscriptionID string) ServicesClient { + return original.NewServicesClient(subscriptionID) +} +func NewServicesClientWithBaseURI(baseURI string, subscriptionID string) ServicesClient { + return original.NewServicesClientWithBaseURI(baseURI, subscriptionID) +} +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return original.NewWithBaseURI(baseURI, subscriptionID) +} +func PossibleConnectionStateValues() []ConnectionState { + return original.PossibleConnectionStateValues() +} +func PossibleDirectPeeringTypeValues() []DirectPeeringType { + return original.PossibleDirectPeeringTypeValues() +} +func PossibleFamilyValues() []Family { + return original.PossibleFamilyValues() +} +func PossibleKindValues() []Kind { + return original.PossibleKindValues() +} +func PossibleLearnedTypeValues() []LearnedType { + return original.PossibleLearnedTypeValues() +} +func PossiblePrefixValidationStateValues() []PrefixValidationState { + return original.PossiblePrefixValidationStateValues() +} +func PossibleProvisioningStateValues() []ProvisioningState { + return original.PossibleProvisioningStateValues() +} +func PossibleRoleValues() []Role { + return original.PossibleRoleValues() +} +func PossibleSessionAddressProviderValues() []SessionAddressProvider { + return original.PossibleSessionAddressProviderValues() +} +func PossibleSessionStateV4Values() []SessionStateV4 { + return original.PossibleSessionStateV4Values() +} +func PossibleSessionStateV6Values() []SessionStateV6 { + return original.PossibleSessionStateV6Values() +} +func PossibleSizeValues() []Size { + return original.PossibleSizeValues() +} +func PossibleTierValues() []Tier { + return original.PossibleTierValues() +} +func PossibleValidationStateValues() []ValidationState { + return original.PossibleValidationStateValues() +} +func UserAgent() string { + return original.UserAgent() + " profiles/preview" +} +func Version() string { + return original.Version() +} diff --git a/profiles/preview/peering/mgmt/peering/peeringapi/models.go b/profiles/preview/peering/mgmt/peering/peeringapi/models.go new file mode 100644 index 000000000000..4faad3dcb584 --- /dev/null +++ b/profiles/preview/peering/mgmt/peering/peeringapi/models.go @@ -0,0 +1,37 @@ +// +build go1.9 + +// Copyright 2020 Microsoft Corporation +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +// This code was auto-generated by: +// github.com/Azure/azure-sdk-for-go/tools/profileBuilder + +package peeringapi + +import original "github.com/Azure/azure-sdk-for-go/services/peering/mgmt/2020-04-01/peering/peeringapi" + +type BaseClientAPI = original.BaseClientAPI +type LegacyPeeringsClientAPI = original.LegacyPeeringsClientAPI +type LocationsClientAPI = original.LocationsClientAPI +type OperationsClientAPI = original.OperationsClientAPI +type PeerAsnsClientAPI = original.PeerAsnsClientAPI +type PeeringsClientAPI = original.PeeringsClientAPI +type PrefixesClientAPI = original.PrefixesClientAPI +type ReceivedRoutesClientAPI = original.ReceivedRoutesClientAPI +type RegisteredAsnsClientAPI = original.RegisteredAsnsClientAPI +type RegisteredPrefixesClientAPI = original.RegisteredPrefixesClientAPI +type ServiceCountriesClientAPI = original.ServiceCountriesClientAPI +type ServiceLocationsClientAPI = original.ServiceLocationsClientAPI +type ServiceProvidersClientAPI = original.ServiceProvidersClientAPI +type ServicesClientAPI = original.ServicesClientAPI diff --git a/profiles/preview/policyinsights/mgmt/policyinsights/models.go b/profiles/preview/policyinsights/mgmt/policyinsights/models.go index 784e8727780b..e15e31a961e6 100644 --- a/profiles/preview/policyinsights/mgmt/policyinsights/models.go +++ b/profiles/preview/policyinsights/mgmt/policyinsights/models.go @@ -62,6 +62,8 @@ type PolicyEvaluationDetails = original.PolicyEvaluationDetails type PolicyEvent = original.PolicyEvent type PolicyEventsClient = original.PolicyEventsClient type PolicyEventsQueryResults = original.PolicyEventsQueryResults +type PolicyEventsQueryResultsIterator = original.PolicyEventsQueryResultsIterator +type PolicyEventsQueryResultsPage = original.PolicyEventsQueryResultsPage type PolicyGroupSummary = original.PolicyGroupSummary type PolicyMetadata = original.PolicyMetadata type PolicyMetadataClient = original.PolicyMetadataClient @@ -73,6 +75,8 @@ type PolicyMetadataSlimProperties = original.PolicyMetadataSlimProperties type PolicyState = original.PolicyState type PolicyStatesClient = original.PolicyStatesClient type PolicyStatesQueryResults = original.PolicyStatesQueryResults +type PolicyStatesQueryResultsIterator = original.PolicyStatesQueryResultsIterator +type PolicyStatesQueryResultsPage = original.PolicyStatesQueryResultsPage type PolicyStatesTriggerResourceGroupEvaluationFuture = original.PolicyStatesTriggerResourceGroupEvaluationFuture type PolicyStatesTriggerSubscriptionEvaluationFuture = original.PolicyStatesTriggerSubscriptionEvaluationFuture type PolicyTrackedResource = original.PolicyTrackedResource @@ -95,7 +99,6 @@ type RemediationListResultPage = original.RemediationListResultPage type RemediationProperties = original.RemediationProperties type RemediationsClient = original.RemediationsClient type SlimPolicyMetadata = original.SlimPolicyMetadata -type String = original.String type SummarizeResults = original.SummarizeResults type Summary = original.Summary type SummaryResults = original.SummaryResults @@ -117,6 +120,12 @@ func NewPolicyEventsClient() PolicyEventsClient { func NewPolicyEventsClientWithBaseURI(baseURI string) PolicyEventsClient { return original.NewPolicyEventsClientWithBaseURI(baseURI) } +func NewPolicyEventsQueryResultsIterator(page PolicyEventsQueryResultsPage) PolicyEventsQueryResultsIterator { + return original.NewPolicyEventsQueryResultsIterator(page) +} +func NewPolicyEventsQueryResultsPage(getNextPage func(context.Context, PolicyEventsQueryResults) (PolicyEventsQueryResults, error)) PolicyEventsQueryResultsPage { + return original.NewPolicyEventsQueryResultsPage(getNextPage) +} func NewPolicyMetadataClient() PolicyMetadataClient { return original.NewPolicyMetadataClient() } @@ -135,6 +144,12 @@ func NewPolicyStatesClient() PolicyStatesClient { func NewPolicyStatesClientWithBaseURI(baseURI string) PolicyStatesClient { return original.NewPolicyStatesClientWithBaseURI(baseURI) } +func NewPolicyStatesQueryResultsIterator(page PolicyStatesQueryResultsPage) PolicyStatesQueryResultsIterator { + return original.NewPolicyStatesQueryResultsIterator(page) +} +func NewPolicyStatesQueryResultsPage(getNextPage func(context.Context, PolicyStatesQueryResults) (PolicyStatesQueryResults, error)) PolicyStatesQueryResultsPage { + return original.NewPolicyStatesQueryResultsPage(getNextPage) +} func NewPolicyTrackedResourcesClient() PolicyTrackedResourcesClient { return original.NewPolicyTrackedResourcesClient() } diff --git a/profiles/preview/preview/alertsmanagement/mgmt/alertsmanagement/models.go b/profiles/preview/preview/alertsmanagement/mgmt/alertsmanagement/models.go index fa0b22208755..963004152c29 100644 --- a/profiles/preview/preview/alertsmanagement/mgmt/alertsmanagement/models.go +++ b/profiles/preview/preview/alertsmanagement/mgmt/alertsmanagement/models.go @@ -39,8 +39,14 @@ const ( type AlertModificationEvent = original.AlertModificationEvent const ( + ActionRuleSuppressed AlertModificationEvent = original.ActionRuleSuppressed + ActionRuleTriggered AlertModificationEvent = original.ActionRuleTriggered + ActionsFailed AlertModificationEvent = original.ActionsFailed + ActionsSuppressed AlertModificationEvent = original.ActionsSuppressed + ActionsTriggered AlertModificationEvent = original.ActionsTriggered AlertCreated AlertModificationEvent = original.AlertCreated MonitorConditionChange AlertModificationEvent = original.MonitorConditionChange + SeverityChange AlertModificationEvent = original.SeverityChange StateChange AlertModificationEvent = original.StateChange ) @@ -125,6 +131,7 @@ type ScopeType = original.ScopeType const ( ScopeTypeResource ScopeType = original.ScopeTypeResource ScopeTypeResourceGroup ScopeType = original.ScopeTypeResourceGroup + ScopeTypeSubscription ScopeType = original.ScopeTypeSubscription ) type Severity = original.Severity diff --git a/profiles/preview/preview/appconfiguration/mgmt/appconfiguration/models.go b/profiles/preview/preview/appconfiguration/mgmt/appconfiguration/models.go index 09ce0bf75636..9e6fb1fa61bb 100644 --- a/profiles/preview/preview/appconfiguration/mgmt/appconfiguration/models.go +++ b/profiles/preview/preview/appconfiguration/mgmt/appconfiguration/models.go @@ -65,6 +65,13 @@ const ( Updating ProvisioningState = original.Updating ) +type PublicNetworkAccess = original.PublicNetworkAccess + +const ( + Disabled PublicNetworkAccess = original.Disabled + Enabled PublicNetworkAccess = original.Enabled +) + type APIKey = original.APIKey type APIKeyListResult = original.APIKeyListResult type APIKeyListResultIterator = original.APIKeyListResultIterator @@ -100,6 +107,7 @@ type PrivateEndpointConnectionListResult = original.PrivateEndpointConnectionLis type PrivateEndpointConnectionListResultIterator = original.PrivateEndpointConnectionListResultIterator type PrivateEndpointConnectionListResultPage = original.PrivateEndpointConnectionListResultPage type PrivateEndpointConnectionProperties = original.PrivateEndpointConnectionProperties +type PrivateEndpointConnectionReference = original.PrivateEndpointConnectionReference type PrivateEndpointConnectionsClient = original.PrivateEndpointConnectionsClient type PrivateEndpointConnectionsCreateOrUpdateFuture = original.PrivateEndpointConnectionsCreateOrUpdateFuture type PrivateEndpointConnectionsDeleteFuture = original.PrivateEndpointConnectionsDeleteFuture @@ -188,6 +196,9 @@ func PossibleIdentityTypeValues() []IdentityType { func PossibleProvisioningStateValues() []ProvisioningState { return original.PossibleProvisioningStateValues() } +func PossiblePublicNetworkAccessValues() []PublicNetworkAccess { + return original.PossiblePublicNetworkAccessValues() +} func UserAgent() string { return original.UserAgent() + " profiles/preview" } diff --git a/profiles/preview/preview/appinsights/insights/insightsapi/models.go b/profiles/preview/preview/appinsights/insights/insightsapi/models.go index b3148cd9bba4..f0833755ed7a 100644 --- a/profiles/preview/preview/appinsights/insights/insightsapi/models.go +++ b/profiles/preview/preview/appinsights/insights/insightsapi/models.go @@ -22,7 +22,6 @@ package insightsapi import original "github.com/Azure/azure-sdk-for-go/services/preview/appinsights/v1/insights/insightsapi" type EventsClientAPI = original.EventsClientAPI -type GetClientAPI = original.GetClientAPI +type MetadataClientAPI = original.MetadataClientAPI type MetricsClientAPI = original.MetricsClientAPI -type PostClientAPI = original.PostClientAPI type QueryClientAPI = original.QueryClientAPI diff --git a/profiles/preview/preview/appinsights/insights/models.go b/profiles/preview/preview/appinsights/insights/models.go index 405597dc9832..ee493271fc0d 100644 --- a/profiles/preview/preview/appinsights/insights/models.go +++ b/profiles/preview/preview/appinsights/insights/models.go @@ -180,9 +180,9 @@ type EventsSessionInfo = original.EventsSessionInfo type EventsTraceInfo = original.EventsTraceInfo type EventsTraceResult = original.EventsTraceResult type EventsUserInfo = original.EventsUserInfo -type GetClient = original.GetClient type ListMetricsResultsItem = original.ListMetricsResultsItem type MetadataApplication = original.MetadataApplication +type MetadataClient = original.MetadataClient type MetadataFunction = original.MetadataFunction type MetadataResults = original.MetadataResults type MetadataTable = original.MetadataTable @@ -195,7 +195,6 @@ type MetricsResult = original.MetricsResult type MetricsResultInfo = original.MetricsResultInfo type MetricsResultsItem = original.MetricsResultsItem type MetricsSegmentInfo = original.MetricsSegmentInfo -type PostClient = original.PostClient type QueryBody = original.QueryBody type QueryClient = original.QueryClient type QueryResults = original.QueryResults @@ -211,11 +210,11 @@ func NewEventsClient() EventsClient { func NewEventsClientWithBaseURI(baseURI string) EventsClient { return original.NewEventsClientWithBaseURI(baseURI) } -func NewGetClient() GetClient { - return original.NewGetClient() +func NewMetadataClient() MetadataClient { + return original.NewMetadataClient() } -func NewGetClientWithBaseURI(baseURI string) GetClient { - return original.NewGetClientWithBaseURI(baseURI) +func NewMetadataClientWithBaseURI(baseURI string) MetadataClient { + return original.NewMetadataClientWithBaseURI(baseURI) } func NewMetricsClient() MetricsClient { return original.NewMetricsClient() @@ -223,12 +222,6 @@ func NewMetricsClient() MetricsClient { func NewMetricsClientWithBaseURI(baseURI string) MetricsClient { return original.NewMetricsClientWithBaseURI(baseURI) } -func NewPostClient() PostClient { - return original.NewPostClient() -} -func NewPostClientWithBaseURI(baseURI string) PostClient { - return original.NewPostClientWithBaseURI(baseURI) -} func NewQueryClient() QueryClient { return original.NewQueryClient() } diff --git a/profiles/preview/preview/appplatform/mgmt/appplatform/appplatformapi/models.go b/profiles/preview/preview/appplatform/mgmt/appplatform/appplatformapi/models.go index 8262bfd3c010..1277e6a55add 100644 --- a/profiles/preview/preview/appplatform/mgmt/appplatform/appplatformapi/models.go +++ b/profiles/preview/preview/appplatform/mgmt/appplatform/appplatformapi/models.go @@ -28,3 +28,4 @@ type CustomDomainsClientAPI = original.CustomDomainsClientAPI type DeploymentsClientAPI = original.DeploymentsClientAPI type OperationsClientAPI = original.OperationsClientAPI type ServicesClientAPI = original.ServicesClientAPI +type SkuClientAPI = original.SkuClientAPI diff --git a/profiles/preview/preview/appplatform/mgmt/appplatform/models.go b/profiles/preview/preview/appplatform/mgmt/appplatform/models.go index 6342375fb38d..52c529a3cdd9 100644 --- a/profiles/preview/preview/appplatform/mgmt/appplatform/models.go +++ b/profiles/preview/preview/appplatform/mgmt/appplatform/models.go @@ -69,6 +69,15 @@ const ( DeploymentResourceStatusUpgrading DeploymentResourceStatus = original.DeploymentResourceStatusUpgrading ) +type ManagedIdentityType = original.ManagedIdentityType + +const ( + None ManagedIdentityType = original.None + SystemAssigned ManagedIdentityType = original.SystemAssigned + SystemAssignedUserAssigned ManagedIdentityType = original.SystemAssignedUserAssigned + UserAssigned ManagedIdentityType = original.UserAssigned +) + type ProvisioningState = original.ProvisioningState const ( @@ -83,6 +92,20 @@ const ( ProvisioningStateUpdating ProvisioningState = original.ProvisioningStateUpdating ) +type ResourceSkuRestrictionsReasonCode = original.ResourceSkuRestrictionsReasonCode + +const ( + NotAvailableForSubscription ResourceSkuRestrictionsReasonCode = original.NotAvailableForSubscription + QuotaID ResourceSkuRestrictionsReasonCode = original.QuotaID +) + +type ResourceSkuRestrictionsType = original.ResourceSkuRestrictionsType + +const ( + Location ResourceSkuRestrictionsType = original.Location + Zone ResourceSkuRestrictionsType = original.Zone +) + type RuntimeVersion = original.RuntimeVersion const ( @@ -90,6 +113,14 @@ const ( Java8 RuntimeVersion = original.Java8 ) +type SkuScaleType = original.SkuScaleType + +const ( + SkuScaleTypeAutomatic SkuScaleType = original.SkuScaleTypeAutomatic + SkuScaleTypeManual SkuScaleType = original.SkuScaleTypeManual + SkuScaleTypeNone SkuScaleType = original.SkuScaleTypeNone +) + type TestKeyType = original.TestKeyType const ( @@ -168,6 +199,7 @@ type Error = original.Error type GitPatternRepository = original.GitPatternRepository type LogFileURLResponse = original.LogFileURLResponse type LogSpecification = original.LogSpecification +type ManagedIdentityProperties = original.ManagedIdentityProperties type MetricDimension = original.MetricDimension type MetricSpecification = original.MetricSpecification type NameAvailability = original.NameAvailability @@ -180,6 +212,15 @@ type PersistentDisk = original.PersistentDisk type ProxyResource = original.ProxyResource type RegenerateTestKeyRequestPayload = original.RegenerateTestKeyRequestPayload type Resource = original.Resource +type ResourceSku = original.ResourceSku +type ResourceSkuCapabilities = original.ResourceSkuCapabilities +type ResourceSkuCollection = original.ResourceSkuCollection +type ResourceSkuCollectionIterator = original.ResourceSkuCollectionIterator +type ResourceSkuCollectionPage = original.ResourceSkuCollectionPage +type ResourceSkuLocationInfo = original.ResourceSkuLocationInfo +type ResourceSkuRestrictionInfo = original.ResourceSkuRestrictionInfo +type ResourceSkuRestrictions = original.ResourceSkuRestrictions +type ResourceSkuZoneDetails = original.ResourceSkuZoneDetails type ResourceUploadDefinition = original.ResourceUploadDefinition type ServiceResource = original.ServiceResource type ServiceResourceList = original.ServiceResourceList @@ -190,6 +231,9 @@ type ServicesClient = original.ServicesClient type ServicesCreateOrUpdateFuture = original.ServicesCreateOrUpdateFuture type ServicesDeleteFuture = original.ServicesDeleteFuture type ServicesUpdateFuture = original.ServicesUpdateFuture +type Sku = original.Sku +type SkuCapacity = original.SkuCapacity +type SkuClient = original.SkuClient type TemporaryDisk = original.TemporaryDisk type TestKeys = original.TestKeys type TraceProperties = original.TraceProperties @@ -271,6 +315,12 @@ func NewOperationsClient(subscriptionID string) OperationsClient { func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID) } +func NewResourceSkuCollectionIterator(page ResourceSkuCollectionPage) ResourceSkuCollectionIterator { + return original.NewResourceSkuCollectionIterator(page) +} +func NewResourceSkuCollectionPage(getNextPage func(context.Context, ResourceSkuCollection) (ResourceSkuCollection, error)) ResourceSkuCollectionPage { + return original.NewResourceSkuCollectionPage(getNextPage) +} func NewServiceResourceListIterator(page ServiceResourceListPage) ServiceResourceListIterator { return original.NewServiceResourceListIterator(page) } @@ -283,6 +333,12 @@ func NewServicesClient(subscriptionID string) ServicesClient { func NewServicesClientWithBaseURI(baseURI string, subscriptionID string) ServicesClient { return original.NewServicesClientWithBaseURI(baseURI, subscriptionID) } +func NewSkuClient(subscriptionID string) SkuClient { + return original.NewSkuClient(subscriptionID) +} +func NewSkuClientWithBaseURI(baseURI string, subscriptionID string) SkuClient { + return original.NewSkuClientWithBaseURI(baseURI, subscriptionID) +} func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { return original.NewWithBaseURI(baseURI, subscriptionID) } @@ -298,12 +354,24 @@ func PossibleDeploymentResourceProvisioningStateValues() []DeploymentResourcePro func PossibleDeploymentResourceStatusValues() []DeploymentResourceStatus { return original.PossibleDeploymentResourceStatusValues() } +func PossibleManagedIdentityTypeValues() []ManagedIdentityType { + return original.PossibleManagedIdentityTypeValues() +} func PossibleProvisioningStateValues() []ProvisioningState { return original.PossibleProvisioningStateValues() } +func PossibleResourceSkuRestrictionsReasonCodeValues() []ResourceSkuRestrictionsReasonCode { + return original.PossibleResourceSkuRestrictionsReasonCodeValues() +} +func PossibleResourceSkuRestrictionsTypeValues() []ResourceSkuRestrictionsType { + return original.PossibleResourceSkuRestrictionsTypeValues() +} func PossibleRuntimeVersionValues() []RuntimeVersion { return original.PossibleRuntimeVersionValues() } +func PossibleSkuScaleTypeValues() []SkuScaleType { + return original.PossibleSkuScaleTypeValues() +} func PossibleTestKeyTypeValues() []TestKeyType { return original.PossibleTestKeyTypeValues() } diff --git a/profiles/preview/preview/azuredata/mgmt/azuredata/azuredataapi/models.go b/profiles/preview/preview/azuredata/mgmt/azuredata/azuredataapi/models.go index 4d3b3e13fc5e..0990e6f6e693 100644 --- a/profiles/preview/preview/azuredata/mgmt/azuredata/azuredataapi/models.go +++ b/profiles/preview/preview/azuredata/mgmt/azuredata/azuredataapi/models.go @@ -19,8 +19,12 @@ package azuredataapi -import original "github.com/Azure/azure-sdk-for-go/services/preview/azuredata/mgmt/2017-03-01-preview/azuredata/azuredataapi" +import original "github.com/Azure/azure-sdk-for-go/services/preview/azuredata/mgmt/2019-07-24-preview/azuredata/azuredataapi" +type HybridDataManagersClientAPI = original.HybridDataManagersClientAPI type OperationsClientAPI = original.OperationsClientAPI +type PostgresInstancesClientAPI = original.PostgresInstancesClientAPI +type SQLInstancesClientAPI = original.SQLInstancesClientAPI +type SQLServerInstancesClientAPI = original.SQLServerInstancesClientAPI type SQLServerRegistrationsClientAPI = original.SQLServerRegistrationsClientAPI type SQLServersClientAPI = original.SQLServersClientAPI diff --git a/profiles/preview/preview/azuredata/mgmt/azuredata/models.go b/profiles/preview/preview/azuredata/mgmt/azuredata/models.go index bdb76f50a424..c6bc14aec0ba 100644 --- a/profiles/preview/preview/azuredata/mgmt/azuredata/models.go +++ b/profiles/preview/preview/azuredata/mgmt/azuredata/models.go @@ -22,7 +22,7 @@ package azuredata import ( "context" - original "github.com/Azure/azure-sdk-for-go/services/preview/azuredata/mgmt/2017-03-01-preview/azuredata" + original "github.com/Azure/azure-sdk-for-go/services/preview/azuredata/mgmt/2019-07-24-preview/azuredata" ) const ( @@ -36,16 +36,67 @@ const ( User OperationOrigin = original.User ) +type ResourceIdentityType = original.ResourceIdentityType + +const ( + SystemAssigned ResourceIdentityType = original.SystemAssigned +) + +type SkuTier = original.SkuTier + +const ( + Basic SkuTier = original.Basic + Free SkuTier = original.Free + Premium SkuTier = original.Premium + Standard SkuTier = original.Standard +) + type BaseClient = original.BaseClient +type CloudError = original.CloudError +type CloudErrorBody = original.CloudErrorBody +type HybridDataManager = original.HybridDataManager +type HybridDataManagerListResult = original.HybridDataManagerListResult +type HybridDataManagerListResultIterator = original.HybridDataManagerListResultIterator +type HybridDataManagerListResultPage = original.HybridDataManagerListResultPage +type HybridDataManagerUpdate = original.HybridDataManagerUpdate +type HybridDataManagersClient = original.HybridDataManagersClient +type Identity = original.Identity +type ODataError = original.ODataError type Operation = original.Operation type OperationDisplay = original.OperationDisplay type OperationListResult = original.OperationListResult type OperationListResultIterator = original.OperationListResultIterator type OperationListResultPage = original.OperationListResultPage type OperationsClient = original.OperationsClient +type Plan = original.Plan +type PostgresInstance = original.PostgresInstance +type PostgresInstanceListResult = original.PostgresInstanceListResult +type PostgresInstanceListResultIterator = original.PostgresInstanceListResultIterator +type PostgresInstanceListResultPage = original.PostgresInstanceListResultPage +type PostgresInstanceProperties = original.PostgresInstanceProperties +type PostgresInstanceUpdate = original.PostgresInstanceUpdate +type PostgresInstancesClient = original.PostgresInstancesClient type ProxyResource = original.ProxyResource type Resource = original.Resource +type ResourceModelWithAllowedPropertySet = original.ResourceModelWithAllowedPropertySet +type ResourceModelWithAllowedPropertySetIdentity = original.ResourceModelWithAllowedPropertySetIdentity +type ResourceModelWithAllowedPropertySetPlan = original.ResourceModelWithAllowedPropertySetPlan +type ResourceModelWithAllowedPropertySetSku = original.ResourceModelWithAllowedPropertySetSku +type SQLInstance = original.SQLInstance +type SQLInstanceListResult = original.SQLInstanceListResult +type SQLInstanceListResultIterator = original.SQLInstanceListResultIterator +type SQLInstanceListResultPage = original.SQLInstanceListResultPage +type SQLInstanceProperties = original.SQLInstanceProperties +type SQLInstanceUpdate = original.SQLInstanceUpdate +type SQLInstancesClient = original.SQLInstancesClient type SQLServer = original.SQLServer +type SQLServerInstance = original.SQLServerInstance +type SQLServerInstanceListResult = original.SQLServerInstanceListResult +type SQLServerInstanceListResultIterator = original.SQLServerInstanceListResultIterator +type SQLServerInstanceListResultPage = original.SQLServerInstanceListResultPage +type SQLServerInstanceProperties = original.SQLServerInstanceProperties +type SQLServerInstanceUpdate = original.SQLServerInstanceUpdate +type SQLServerInstancesClient = original.SQLServerInstancesClient type SQLServerListResult = original.SQLServerListResult type SQLServerListResultIterator = original.SQLServerListResultIterator type SQLServerListResultPage = original.SQLServerListResultPage @@ -58,10 +109,23 @@ type SQLServerRegistrationProperties = original.SQLServerRegistrationProperties type SQLServerRegistrationUpdate = original.SQLServerRegistrationUpdate type SQLServerRegistrationsClient = original.SQLServerRegistrationsClient type SQLServersClient = original.SQLServersClient +type Sku = original.Sku type TrackedResource = original.TrackedResource -func New(subscriptionID string) BaseClient { - return original.New(subscriptionID) +func New(subscriptionID string, subscriptionID1 string) BaseClient { + return original.New(subscriptionID, subscriptionID1) +} +func NewHybridDataManagerListResultIterator(page HybridDataManagerListResultPage) HybridDataManagerListResultIterator { + return original.NewHybridDataManagerListResultIterator(page) +} +func NewHybridDataManagerListResultPage(getNextPage func(context.Context, HybridDataManagerListResult) (HybridDataManagerListResult, error)) HybridDataManagerListResultPage { + return original.NewHybridDataManagerListResultPage(getNextPage) +} +func NewHybridDataManagersClient(subscriptionID string, subscriptionID1 string) HybridDataManagersClient { + return original.NewHybridDataManagersClient(subscriptionID, subscriptionID1) +} +func NewHybridDataManagersClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) HybridDataManagersClient { + return original.NewHybridDataManagersClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) } func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator { return original.NewOperationListResultIterator(page) @@ -69,11 +133,47 @@ func NewOperationListResultIterator(page OperationListResultPage) OperationListR func NewOperationListResultPage(getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { return original.NewOperationListResultPage(getNextPage) } -func NewOperationsClient(subscriptionID string) OperationsClient { - return original.NewOperationsClient(subscriptionID) +func NewOperationsClient(subscriptionID string, subscriptionID1 string) OperationsClient { + return original.NewOperationsClient(subscriptionID, subscriptionID1) +} +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) OperationsClient { + return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) } -func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { - return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID) +func NewPostgresInstanceListResultIterator(page PostgresInstanceListResultPage) PostgresInstanceListResultIterator { + return original.NewPostgresInstanceListResultIterator(page) +} +func NewPostgresInstanceListResultPage(getNextPage func(context.Context, PostgresInstanceListResult) (PostgresInstanceListResult, error)) PostgresInstanceListResultPage { + return original.NewPostgresInstanceListResultPage(getNextPage) +} +func NewPostgresInstancesClient(subscriptionID string, subscriptionID1 string) PostgresInstancesClient { + return original.NewPostgresInstancesClient(subscriptionID, subscriptionID1) +} +func NewPostgresInstancesClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) PostgresInstancesClient { + return original.NewPostgresInstancesClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +} +func NewSQLInstanceListResultIterator(page SQLInstanceListResultPage) SQLInstanceListResultIterator { + return original.NewSQLInstanceListResultIterator(page) +} +func NewSQLInstanceListResultPage(getNextPage func(context.Context, SQLInstanceListResult) (SQLInstanceListResult, error)) SQLInstanceListResultPage { + return original.NewSQLInstanceListResultPage(getNextPage) +} +func NewSQLInstancesClient(subscriptionID string, subscriptionID1 string) SQLInstancesClient { + return original.NewSQLInstancesClient(subscriptionID, subscriptionID1) +} +func NewSQLInstancesClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) SQLInstancesClient { + return original.NewSQLInstancesClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +} +func NewSQLServerInstanceListResultIterator(page SQLServerInstanceListResultPage) SQLServerInstanceListResultIterator { + return original.NewSQLServerInstanceListResultIterator(page) +} +func NewSQLServerInstanceListResultPage(getNextPage func(context.Context, SQLServerInstanceListResult) (SQLServerInstanceListResult, error)) SQLServerInstanceListResultPage { + return original.NewSQLServerInstanceListResultPage(getNextPage) +} +func NewSQLServerInstancesClient(subscriptionID string, subscriptionID1 string) SQLServerInstancesClient { + return original.NewSQLServerInstancesClient(subscriptionID, subscriptionID1) +} +func NewSQLServerInstancesClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) SQLServerInstancesClient { + return original.NewSQLServerInstancesClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) } func NewSQLServerListResultIterator(page SQLServerListResultPage) SQLServerListResultIterator { return original.NewSQLServerListResultIterator(page) @@ -87,24 +187,30 @@ func NewSQLServerRegistrationListResultIterator(page SQLServerRegistrationListRe func NewSQLServerRegistrationListResultPage(getNextPage func(context.Context, SQLServerRegistrationListResult) (SQLServerRegistrationListResult, error)) SQLServerRegistrationListResultPage { return original.NewSQLServerRegistrationListResultPage(getNextPage) } -func NewSQLServerRegistrationsClient(subscriptionID string) SQLServerRegistrationsClient { - return original.NewSQLServerRegistrationsClient(subscriptionID) +func NewSQLServerRegistrationsClient(subscriptionID string, subscriptionID1 string) SQLServerRegistrationsClient { + return original.NewSQLServerRegistrationsClient(subscriptionID, subscriptionID1) } -func NewSQLServerRegistrationsClientWithBaseURI(baseURI string, subscriptionID string) SQLServerRegistrationsClient { - return original.NewSQLServerRegistrationsClientWithBaseURI(baseURI, subscriptionID) +func NewSQLServerRegistrationsClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) SQLServerRegistrationsClient { + return original.NewSQLServerRegistrationsClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) } -func NewSQLServersClient(subscriptionID string) SQLServersClient { - return original.NewSQLServersClient(subscriptionID) +func NewSQLServersClient(subscriptionID string, subscriptionID1 string) SQLServersClient { + return original.NewSQLServersClient(subscriptionID, subscriptionID1) } -func NewSQLServersClientWithBaseURI(baseURI string, subscriptionID string) SQLServersClient { - return original.NewSQLServersClientWithBaseURI(baseURI, subscriptionID) +func NewSQLServersClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) SQLServersClient { + return original.NewSQLServersClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) } -func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { - return original.NewWithBaseURI(baseURI, subscriptionID) +func NewWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) BaseClient { + return original.NewWithBaseURI(baseURI, subscriptionID, subscriptionID1) } func PossibleOperationOriginValues() []OperationOrigin { return original.PossibleOperationOriginValues() } +func PossibleResourceIdentityTypeValues() []ResourceIdentityType { + return original.PossibleResourceIdentityTypeValues() +} +func PossibleSkuTierValues() []SkuTier { + return original.PossibleSkuTierValues() +} func UserAgent() string { return original.UserAgent() + " profiles/preview" } diff --git a/profiles/preview/preview/billing/mgmt/billing/billingapi/models.go b/profiles/preview/preview/billing/mgmt/billing/billingapi/models.go index 4b21e65b3e57..dc07a0ee4e53 100644 --- a/profiles/preview/preview/billing/mgmt/billing/billingapi/models.go +++ b/profiles/preview/preview/billing/mgmt/billing/billingapi/models.go @@ -19,29 +19,23 @@ package billingapi -import original "github.com/Azure/azure-sdk-for-go/services/preview/billing/mgmt/2018-11-01-preview/billing/billingapi" +import original "github.com/Azure/azure-sdk-for-go/services/preview/billing/mgmt/2020-05-01-preview/billing/billingapi" type AccountsClientAPI = original.AccountsClientAPI -type AddressesClientAPI = original.AddressesClientAPI +type AddressClientAPI = original.AddressClientAPI type AgreementsClientAPI = original.AgreementsClientAPI type AvailableBalancesClientAPI = original.AvailableBalancesClientAPI type CustomersClientAPI = original.CustomersClientAPI -type DepartmentsClientAPI = original.DepartmentsClientAPI -type EnrollmentAccountsClientAPI = original.EnrollmentAccountsClientAPI +type InstructionsClientAPI = original.InstructionsClientAPI type InvoiceSectionsClientAPI = original.InvoiceSectionsClientAPI type InvoicesClientAPI = original.InvoicesClientAPI -type LineOfCreditsClientAPI = original.LineOfCreditsClientAPI type OperationsClientAPI = original.OperationsClientAPI -type PaymentMethodsClientAPI = original.PaymentMethodsClientAPI type PermissionsClientAPI = original.PermissionsClientAPI type PoliciesClientAPI = original.PoliciesClientAPI -type PriceSheetClientAPI = original.PriceSheetClientAPI type ProductsClientAPI = original.ProductsClientAPI type ProfilesClientAPI = original.ProfilesClientAPI type PropertyClientAPI = original.PropertyClientAPI -type RecipientTransfersClientAPI = original.RecipientTransfersClientAPI type RoleAssignmentsClientAPI = original.RoleAssignmentsClientAPI type RoleDefinitionsClientAPI = original.RoleDefinitionsClientAPI type SubscriptionsClientAPI = original.SubscriptionsClientAPI type TransactionsClientAPI = original.TransactionsClientAPI -type TransfersClientAPI = original.TransfersClientAPI diff --git a/profiles/preview/preview/billing/mgmt/billing/models.go b/profiles/preview/preview/billing/mgmt/billing/models.go index 124dc8f59ec7..e0f0a8628f0f 100644 --- a/profiles/preview/preview/billing/mgmt/billing/models.go +++ b/profiles/preview/preview/billing/mgmt/billing/models.go @@ -22,18 +22,39 @@ package billing import ( "context" - original "github.com/Azure/azure-sdk-for-go/services/preview/billing/mgmt/2018-11-01-preview/billing" + original "github.com/Azure/azure-sdk-for-go/services/preview/billing/mgmt/2020-05-01-preview/billing" ) const ( DefaultBaseURI = original.DefaultBaseURI ) +type AcceptanceMode = original.AcceptanceMode + +const ( + ClickToAccept AcceptanceMode = original.ClickToAccept + ESignEmbedded AcceptanceMode = original.ESignEmbedded + ESignOffline AcceptanceMode = original.ESignOffline +) + +type AccountStatus = original.AccountStatus + +const ( + Active AccountStatus = original.Active + Deleted AccountStatus = original.Deleted + Disabled AccountStatus = original.Disabled + Expired AccountStatus = original.Expired + Extended AccountStatus = original.Extended + Terminated AccountStatus = original.Terminated + Transferred AccountStatus = original.Transferred +) + type AccountType = original.AccountType const ( - AccountTypeEnrollment AccountType = original.AccountTypeEnrollment - AccountTypeOrganization AccountType = original.AccountTypeOrganization + Enterprise AccountType = original.Enterprise + Individual AccountType = original.Individual + Partner AccountType = original.Partner ) type AddressValidationStatus = original.AddressValidationStatus @@ -43,12 +64,44 @@ const ( Valid AddressValidationStatus = original.Valid ) -type EligibleProductType = original.EligibleProductType +type AgreementType = original.AgreementType + +const ( + EnterpriseAgreement AgreementType = original.EnterpriseAgreement + MicrosoftCustomerAgreement AgreementType = original.MicrosoftCustomerAgreement + MicrosoftOnlineServicesProgram AgreementType = original.MicrosoftOnlineServicesProgram + MicrosoftPartnerAgreement AgreementType = original.MicrosoftPartnerAgreement +) + +type AutoRenew = original.AutoRenew + +const ( + Off AutoRenew = original.Off + On AutoRenew = original.On +) + +type Category = original.Category + +const ( + CategoryAffiliatePurchaseTerms Category = original.CategoryAffiliatePurchaseTerms + CategoryMicrosoftCustomerAgreement Category = original.CategoryMicrosoftCustomerAgreement + CategoryOther Category = original.CategoryOther +) + +type DocumentSource = original.DocumentSource + +const ( + DRS DocumentSource = original.DRS + ENF DocumentSource = original.ENF +) + +type DocumentType = original.DocumentType const ( - AzureReservation EligibleProductType = original.AzureReservation - DevTestAzureSubscription EligibleProductType = original.DevTestAzureSubscription - StandardAzureSubscription EligibleProductType = original.StandardAzureSubscription + DocumentTypeCreditNote DocumentType = original.DocumentTypeCreditNote + DocumentTypeInvoice DocumentType = original.DocumentTypeInvoice + DocumentTypeTaxReceipt DocumentType = original.DocumentTypeTaxReceipt + DocumentTypeVoidNote DocumentType = original.DocumentTypeVoidNote ) type Frequency = original.Frequency @@ -59,42 +112,50 @@ const ( UsageBased Frequency = original.UsageBased ) -type Kind = original.Kind +type InvoiceStatus = original.InvoiceStatus const ( - CreditNote Kind = original.CreditNote - Invoice Kind = original.Invoice - Receipt Kind = original.Receipt - VoidNote Kind = original.VoidNote + Due InvoiceStatus = original.Due + OverDue InvoiceStatus = original.OverDue + Paid InvoiceStatus = original.Paid ) -type PaymentMethodType = original.PaymentMethodType +type InvoiceType = original.InvoiceType const ( - ChequeWire PaymentMethodType = original.ChequeWire - Credits PaymentMethodType = original.Credits + AzureMarketplace InvoiceType = original.AzureMarketplace + AzureService InvoiceType = original.AzureService + AzureSupport InvoiceType = original.AzureSupport ) -type ProductStatusType = original.ProductStatusType +type MarketplacePurchasesPolicy = original.MarketplacePurchasesPolicy + +const ( + AllAllowed MarketplacePurchasesPolicy = original.AllAllowed + NotAllowed MarketplacePurchasesPolicy = original.NotAllowed + OnlyFreeAllowed MarketplacePurchasesPolicy = original.OnlyFreeAllowed +) + +type PaymentMethodFamily = original.PaymentMethodFamily const ( - Active ProductStatusType = original.Active - AutoRenew ProductStatusType = original.AutoRenew - Cancelled ProductStatusType = original.Cancelled - Disabled ProductStatusType = original.Disabled - Expired ProductStatusType = original.Expired - Expiring ProductStatusType = original.Expiring - Inactive ProductStatusType = original.Inactive - PastDue ProductStatusType = original.PastDue + CheckWire PaymentMethodFamily = original.CheckWire + CreditCard PaymentMethodFamily = original.CreditCard + Credits PaymentMethodFamily = original.Credits + None PaymentMethodFamily = original.None ) -type ProductTransferStatus = original.ProductTransferStatus +type ProductStatusType = original.ProductStatusType const ( - Completed ProductTransferStatus = original.Completed - Failed ProductTransferStatus = original.Failed - InProgress ProductTransferStatus = original.InProgress - NotStarted ProductTransferStatus = original.NotStarted + ProductStatusTypeActive ProductStatusType = original.ProductStatusTypeActive + ProductStatusTypeAutoRenew ProductStatusType = original.ProductStatusTypeAutoRenew + ProductStatusTypeCancelled ProductStatusType = original.ProductStatusTypeCancelled + ProductStatusTypeDisabled ProductStatusType = original.ProductStatusTypeDisabled + ProductStatusTypeExpired ProductStatusType = original.ProductStatusTypeExpired + ProductStatusTypeExpiring ProductStatusType = original.ProductStatusTypeExpiring + ProductStatusTypeInactive ProductStatusType = original.ProductStatusTypeInactive + ProductStatusTypePastDue ProductStatusType = original.ProductStatusTypePastDue ) type ProductTransferValidationErrorCode = original.ProductTransferValidationErrorCode @@ -111,11 +172,34 @@ const ( ProductTypeNotSupported ProductTransferValidationErrorCode = original.ProductTypeNotSupported ) -type ProductType = original.ProductType +type ProfileSpendingLimit = original.ProfileSpendingLimit + +const ( + ProfileSpendingLimitOff ProfileSpendingLimit = original.ProfileSpendingLimitOff + ProfileSpendingLimitOn ProfileSpendingLimit = original.ProfileSpendingLimitOn +) + +type ProfileStatus = original.ProfileStatus const ( - ProductTypeAzureReservation ProductType = original.ProductTypeAzureReservation - ProductTypeAzureSubscription ProductType = original.ProductTypeAzureSubscription + ProfileStatusActive ProfileStatus = original.ProfileStatusActive + ProfileStatusDisabled ProfileStatus = original.ProfileStatusDisabled + ProfileStatusWarned ProfileStatus = original.ProfileStatusWarned +) + +type ProfileStatusReasonCode = original.ProfileStatusReasonCode + +const ( + PastDue ProfileStatusReasonCode = original.PastDue + SpendingLimitExpired ProfileStatusReasonCode = original.SpendingLimitExpired + SpendingLimitReached ProfileStatusReasonCode = original.SpendingLimitReached +) + +type ReservationPurchasesPolicy = original.ReservationPurchasesPolicy + +const ( + ReservationPurchasesPolicyAllowed ReservationPurchasesPolicy = original.ReservationPurchasesPolicyAllowed + ReservationPurchasesPolicyNotAllowed ReservationPurchasesPolicy = original.ReservationPurchasesPolicyNotAllowed ) type ReservationType = original.ReservationType @@ -125,20 +209,34 @@ const ( UsageCharge ReservationType = original.UsageCharge ) -type Status = original.Status +type SpendingLimit = original.SpendingLimit + +const ( + SpendingLimitOff SpendingLimit = original.SpendingLimitOff + SpendingLimitOn SpendingLimit = original.SpendingLimitOn +) + +type SpendingLimitForBillingProfile = original.SpendingLimitForBillingProfile const ( - Approved Status = original.Approved - Rejected Status = original.Rejected + SpendingLimitForBillingProfileOff SpendingLimitForBillingProfile = original.SpendingLimitForBillingProfileOff + SpendingLimitForBillingProfileOn SpendingLimitForBillingProfile = original.SpendingLimitForBillingProfileOn ) -type Status1 = original.Status1 +type StatusReasonCode = original.StatusReasonCode const ( - Status1Due Status1 = original.Status1Due - Status1Paid Status1 = original.Status1Paid - Status1PastDue Status1 = original.Status1PastDue - Status1Void Status1 = original.Status1Void + StatusReasonCodePastDue StatusReasonCode = original.StatusReasonCodePastDue + StatusReasonCodeSpendingLimitExpired StatusReasonCode = original.StatusReasonCodeSpendingLimitExpired + StatusReasonCodeSpendingLimitReached StatusReasonCode = original.StatusReasonCodeSpendingLimitReached +) + +type StatusReasonCodeForBillingProfile = original.StatusReasonCodeForBillingProfile + +const ( + StatusReasonCodeForBillingProfilePastDue StatusReasonCodeForBillingProfile = original.StatusReasonCodeForBillingProfilePastDue + StatusReasonCodeForBillingProfileSpendingLimitExpired StatusReasonCodeForBillingProfile = original.StatusReasonCodeForBillingProfileSpendingLimitExpired + StatusReasonCodeForBillingProfileSpendingLimitReached StatusReasonCodeForBillingProfile = original.StatusReasonCodeForBillingProfileSpendingLimitReached ) type SubscriptionStatusType = original.SubscriptionStatusType @@ -171,37 +269,30 @@ const ( Reservation TransactionTypeKind = original.Reservation ) -type TransferStatus = original.TransferStatus +type ViewCharges = original.ViewCharges const ( - TransferStatusCanceled TransferStatus = original.TransferStatusCanceled - TransferStatusCompleted TransferStatus = original.TransferStatusCompleted - TransferStatusCompletedWithErrors TransferStatus = original.TransferStatusCompletedWithErrors - TransferStatusDeclined TransferStatus = original.TransferStatusDeclined - TransferStatusFailed TransferStatus = original.TransferStatusFailed - TransferStatusInProgress TransferStatus = original.TransferStatusInProgress - TransferStatusPending TransferStatus = original.TransferStatusPending + ViewChargesAllowed ViewCharges = original.ViewChargesAllowed + ViewChargesNotAllowed ViewCharges = original.ViewChargesNotAllowed ) -type UpdateAutoRenew = original.UpdateAutoRenew +type ViewChargesPolicy = original.ViewChargesPolicy const ( - False UpdateAutoRenew = original.False - True UpdateAutoRenew = original.True + ViewChargesPolicyAllowed ViewChargesPolicy = original.ViewChargesPolicyAllowed + ViewChargesPolicyNotAllowed ViewChargesPolicy = original.ViewChargesPolicyNotAllowed ) -type AcceptTransferProperties = original.AcceptTransferProperties -type AcceptTransferRequest = original.AcceptTransferRequest type Account = original.Account type AccountListResult = original.AccountListResult type AccountListResultIterator = original.AccountListResultIterator type AccountListResultPage = original.AccountListResultPage type AccountProperties = original.AccountProperties -type AccountUpdateProperties = original.AccountUpdateProperties +type AccountUpdateRequest = original.AccountUpdateRequest type AccountsClient = original.AccountsClient type AccountsUpdateFuture = original.AccountsUpdateFuture -type Address = original.Address -type AddressesClient = original.AddressesClient +type AddressClient = original.AddressClient +type AddressDetails = original.AddressDetails type Agreement = original.Agreement type AgreementListResult = original.AgreementListResult type AgreementListResultIterator = original.AgreementListResultIterator @@ -212,142 +303,117 @@ type Amount = original.Amount type AvailableBalance = original.AvailableBalance type AvailableBalanceProperties = original.AvailableBalanceProperties type AvailableBalancesClient = original.AvailableBalancesClient +type AzurePlan = original.AzurePlan type BaseClient = original.BaseClient type Customer = original.Customer type CustomerListResult = original.CustomerListResult type CustomerListResultIterator = original.CustomerListResultIterator type CustomerListResultPage = original.CustomerListResultPage +type CustomerPolicy = original.CustomerPolicy +type CustomerPolicyProperties = original.CustomerPolicyProperties type CustomerProperties = original.CustomerProperties type CustomersClient = original.CustomersClient type Department = original.Department -type DepartmentListResult = original.DepartmentListResult -type DepartmentListResultIterator = original.DepartmentListResultIterator -type DepartmentListResultPage = original.DepartmentListResultPage type DepartmentProperties = original.DepartmentProperties -type DepartmentsClient = original.DepartmentsClient -type DetailedTransferStatus = original.DetailedTransferStatus -type DownloadProperties = original.DownloadProperties +type Document = original.Document type DownloadURL = original.DownloadURL -type EnabledAzureSKUs = original.EnabledAzureSKUs type Enrollment = original.Enrollment type EnrollmentAccount = original.EnrollmentAccount type EnrollmentAccountContext = original.EnrollmentAccountContext -type EnrollmentAccountListResult = original.EnrollmentAccountListResult -type EnrollmentAccountListResultIterator = original.EnrollmentAccountListResultIterator -type EnrollmentAccountListResultPage = original.EnrollmentAccountListResultPage type EnrollmentAccountProperties = original.EnrollmentAccountProperties -type EnrollmentAccountsClient = original.EnrollmentAccountsClient type EnrollmentPolicies = original.EnrollmentPolicies -type Error = original.Error type ErrorDetails = original.ErrorDetails type ErrorResponse = original.ErrorResponse -type InitiateTransferProperties = original.InitiateTransferProperties -type InitiateTransferRequest = original.InitiateTransferRequest +type Instruction = original.Instruction +type InstructionListResult = original.InstructionListResult +type InstructionListResultIterator = original.InstructionListResultIterator +type InstructionListResultPage = original.InstructionListResultPage +type InstructionProperties = original.InstructionProperties +type InstructionsClient = original.InstructionsClient +type Invoice = original.Invoice type InvoiceListResult = original.InvoiceListResult type InvoiceListResultIterator = original.InvoiceListResultIterator type InvoiceListResultPage = original.InvoiceListResultPage +type InvoiceProperties = original.InvoiceProperties type InvoiceSection = original.InvoiceSection type InvoiceSectionCreationRequest = original.InvoiceSectionCreationRequest type InvoiceSectionListResult = original.InvoiceSectionListResult type InvoiceSectionListResultIterator = original.InvoiceSectionListResultIterator type InvoiceSectionListResultPage = original.InvoiceSectionListResultPage +type InvoiceSectionListWithCreateSubPermissionResult = original.InvoiceSectionListWithCreateSubPermissionResult +type InvoiceSectionListWithCreateSubPermissionResultIterator = original.InvoiceSectionListWithCreateSubPermissionResultIterator +type InvoiceSectionListWithCreateSubPermissionResultPage = original.InvoiceSectionListWithCreateSubPermissionResultPage type InvoiceSectionProperties = original.InvoiceSectionProperties +type InvoiceSectionWithCreateSubPermission = original.InvoiceSectionWithCreateSubPermission type InvoiceSectionsClient = original.InvoiceSectionsClient -type InvoiceSectionsCreateFuture = original.InvoiceSectionsCreateFuture -type InvoiceSectionsUpdateFuture = original.InvoiceSectionsUpdateFuture -type InvoiceSummary = original.InvoiceSummary -type InvoiceSummaryProperties = original.InvoiceSummaryProperties +type InvoiceSectionsCreateOrUpdateFuture = original.InvoiceSectionsCreateOrUpdateFuture +type InvoiceSectionsOnExpand = original.InvoiceSectionsOnExpand type InvoicesClient = original.InvoicesClient -type LineOfCredit = original.LineOfCredit -type LineOfCreditProperties = original.LineOfCreditProperties -type LineOfCreditsClient = original.LineOfCreditsClient -type LineOfCreditsUpdateFuture = original.LineOfCreditsUpdateFuture +type InvoicesDownloadBillingSubscriptionInvoiceFuture = original.InvoicesDownloadBillingSubscriptionInvoiceFuture +type InvoicesDownloadInvoiceFuture = original.InvoicesDownloadInvoiceFuture type Operation = original.Operation type OperationDisplay = original.OperationDisplay type OperationListResult = original.OperationListResult type OperationListResultIterator = original.OperationListResultIterator type OperationListResultPage = original.OperationListResultPage -type OperationStatus = original.OperationStatus type OperationsClient = original.OperationsClient type Participants = original.Participants -type PaymentMethod = original.PaymentMethod -type PaymentMethodProperties = original.PaymentMethodProperties -type PaymentMethodsClient = original.PaymentMethodsClient -type PaymentMethodsListResult = original.PaymentMethodsListResult -type PaymentMethodsListResultIterator = original.PaymentMethodsListResultIterator -type PaymentMethodsListResultPage = original.PaymentMethodsListResultPage type PaymentProperties = original.PaymentProperties type PermissionsClient = original.PermissionsClient type PermissionsListResult = original.PermissionsListResult +type PermissionsListResultIterator = original.PermissionsListResultIterator +type PermissionsListResultPage = original.PermissionsListResultPage type PermissionsProperties = original.PermissionsProperties type PoliciesClient = original.PoliciesClient type Policy = original.Policy type PolicyProperties = original.PolicyProperties -type PriceSheetClient = original.PriceSheetClient -type PriceSheetDownloadFuture = original.PriceSheetDownloadFuture -type ProductDetails = original.ProductDetails -type ProductSummary = original.ProductSummary -type ProductSummaryProperties = original.ProductSummaryProperties +type Product = original.Product +type ProductProperties = original.ProductProperties type ProductsClient = original.ProductsClient type ProductsListResult = original.ProductsListResult type ProductsListResultIterator = original.ProductsListResultIterator type ProductsListResultPage = original.ProductsListResultPage type Profile = original.Profile -type ProfileCreationParameters = original.ProfileCreationParameters +type ProfileCreationRequest = original.ProfileCreationRequest type ProfileListResult = original.ProfileListResult type ProfileListResultIterator = original.ProfileListResultIterator type ProfileListResultPage = original.ProfileListResultPage type ProfileProperties = original.ProfileProperties type ProfilesClient = original.ProfilesClient -type ProfilesCreateFuture = original.ProfilesCreateFuture -type ProfilesUpdateFuture = original.ProfilesUpdateFuture +type ProfilesCreateOrUpdateFuture = original.ProfilesCreateOrUpdateFuture +type ProfilesOnExpand = original.ProfilesOnExpand type Property = original.Property type PropertyClient = original.PropertyClient -type PropertySummary = original.PropertySummary -type RecipientTransferDetails = original.RecipientTransferDetails -type RecipientTransferDetailsListResult = original.RecipientTransferDetailsListResult -type RecipientTransferDetailsListResultIterator = original.RecipientTransferDetailsListResultIterator -type RecipientTransferDetailsListResultPage = original.RecipientTransferDetailsListResultPage -type RecipientTransferProperties = original.RecipientTransferProperties -type RecipientTransfersClient = original.RecipientTransfersClient +type PropertyProperties = original.PropertyProperties type Reseller = original.Reseller type Resource = original.Resource type RoleAssignment = original.RoleAssignment type RoleAssignmentListResult = original.RoleAssignmentListResult -type RoleAssignmentPayload = original.RoleAssignmentPayload +type RoleAssignmentListResultIterator = original.RoleAssignmentListResultIterator +type RoleAssignmentListResultPage = original.RoleAssignmentListResultPage type RoleAssignmentProperties = original.RoleAssignmentProperties type RoleAssignmentsClient = original.RoleAssignmentsClient type RoleDefinition = original.RoleDefinition type RoleDefinitionListResult = original.RoleDefinitionListResult +type RoleDefinitionListResultIterator = original.RoleDefinitionListResultIterator +type RoleDefinitionListResultPage = original.RoleDefinitionListResultPage type RoleDefinitionProperties = original.RoleDefinitionProperties type RoleDefinitionsClient = original.RoleDefinitionsClient +type Subscription = original.Subscription type SubscriptionProperties = original.SubscriptionProperties -type SubscriptionSummary = original.SubscriptionSummary type SubscriptionsClient = original.SubscriptionsClient type SubscriptionsListResult = original.SubscriptionsListResult type SubscriptionsListResultIterator = original.SubscriptionsListResultIterator type SubscriptionsListResultPage = original.SubscriptionsListResultPage -type SubscriptionsTransferFuture = original.SubscriptionsTransferFuture +type SubscriptionsMoveFuture = original.SubscriptionsMoveFuture +type Transaction = original.Transaction +type TransactionListResult = original.TransactionListResult +type TransactionListResultIterator = original.TransactionListResultIterator +type TransactionListResultPage = original.TransactionListResultPage +type TransactionProperties = original.TransactionProperties type TransactionsClient = original.TransactionsClient -type TransactionsListResult = original.TransactionsListResult -type TransactionsListResultIterator = original.TransactionsListResultIterator -type TransactionsListResultPage = original.TransactionsListResultPage -type TransactionsSummary = original.TransactionsSummary -type TransactionsSummaryProperties = original.TransactionsSummaryProperties -type TransferBillingSubscriptionRequest = original.TransferBillingSubscriptionRequest type TransferBillingSubscriptionRequestProperties = original.TransferBillingSubscriptionRequestProperties -type TransferBillingSubscriptionResult = original.TransferBillingSubscriptionResult -type TransferBillingSubscriptionResultProperties = original.TransferBillingSubscriptionResultProperties -type TransferDetails = original.TransferDetails -type TransferDetailsListResult = original.TransferDetailsListResult -type TransferDetailsListResultIterator = original.TransferDetailsListResultIterator -type TransferDetailsListResultPage = original.TransferDetailsListResultPage type TransferProductRequestProperties = original.TransferProductRequestProperties -type TransferProperties = original.TransferProperties -type TransfersClient = original.TransfersClient -type UpdateAutoRenewOperationSummary = original.UpdateAutoRenewOperationSummary -type UpdateAutoRenewOperationSummaryProperties = original.UpdateAutoRenewOperationSummaryProperties -type UpdateAutoRenewRequest = original.UpdateAutoRenewRequest type ValidateAddressResponse = original.ValidateAddressResponse type ValidateProductTransferEligibilityError = original.ValidateProductTransferEligibilityError type ValidateProductTransferEligibilityResult = original.ValidateProductTransferEligibilityResult @@ -369,11 +435,11 @@ func NewAccountsClient(subscriptionID string) AccountsClient { func NewAccountsClientWithBaseURI(baseURI string, subscriptionID string) AccountsClient { return original.NewAccountsClientWithBaseURI(baseURI, subscriptionID) } -func NewAddressesClient(subscriptionID string) AddressesClient { - return original.NewAddressesClient(subscriptionID) +func NewAddressClient(subscriptionID string) AddressClient { + return original.NewAddressClient(subscriptionID) } -func NewAddressesClientWithBaseURI(baseURI string, subscriptionID string) AddressesClient { - return original.NewAddressesClientWithBaseURI(baseURI, subscriptionID) +func NewAddressClientWithBaseURI(baseURI string, subscriptionID string) AddressClient { + return original.NewAddressClientWithBaseURI(baseURI, subscriptionID) } func NewAgreementListResultIterator(page AgreementListResultPage) AgreementListResultIterator { return original.NewAgreementListResultIterator(page) @@ -405,29 +471,17 @@ func NewCustomersClient(subscriptionID string) CustomersClient { func NewCustomersClientWithBaseURI(baseURI string, subscriptionID string) CustomersClient { return original.NewCustomersClientWithBaseURI(baseURI, subscriptionID) } -func NewDepartmentListResultIterator(page DepartmentListResultPage) DepartmentListResultIterator { - return original.NewDepartmentListResultIterator(page) -} -func NewDepartmentListResultPage(getNextPage func(context.Context, DepartmentListResult) (DepartmentListResult, error)) DepartmentListResultPage { - return original.NewDepartmentListResultPage(getNextPage) -} -func NewDepartmentsClient(subscriptionID string) DepartmentsClient { - return original.NewDepartmentsClient(subscriptionID) +func NewInstructionListResultIterator(page InstructionListResultPage) InstructionListResultIterator { + return original.NewInstructionListResultIterator(page) } -func NewDepartmentsClientWithBaseURI(baseURI string, subscriptionID string) DepartmentsClient { - return original.NewDepartmentsClientWithBaseURI(baseURI, subscriptionID) +func NewInstructionListResultPage(getNextPage func(context.Context, InstructionListResult) (InstructionListResult, error)) InstructionListResultPage { + return original.NewInstructionListResultPage(getNextPage) } -func NewEnrollmentAccountListResultIterator(page EnrollmentAccountListResultPage) EnrollmentAccountListResultIterator { - return original.NewEnrollmentAccountListResultIterator(page) +func NewInstructionsClient(subscriptionID string) InstructionsClient { + return original.NewInstructionsClient(subscriptionID) } -func NewEnrollmentAccountListResultPage(getNextPage func(context.Context, EnrollmentAccountListResult) (EnrollmentAccountListResult, error)) EnrollmentAccountListResultPage { - return original.NewEnrollmentAccountListResultPage(getNextPage) -} -func NewEnrollmentAccountsClient(subscriptionID string) EnrollmentAccountsClient { - return original.NewEnrollmentAccountsClient(subscriptionID) -} -func NewEnrollmentAccountsClientWithBaseURI(baseURI string, subscriptionID string) EnrollmentAccountsClient { - return original.NewEnrollmentAccountsClientWithBaseURI(baseURI, subscriptionID) +func NewInstructionsClientWithBaseURI(baseURI string, subscriptionID string) InstructionsClient { + return original.NewInstructionsClientWithBaseURI(baseURI, subscriptionID) } func NewInvoiceListResultIterator(page InvoiceListResultPage) InvoiceListResultIterator { return original.NewInvoiceListResultIterator(page) @@ -441,6 +495,12 @@ func NewInvoiceSectionListResultIterator(page InvoiceSectionListResultPage) Invo func NewInvoiceSectionListResultPage(getNextPage func(context.Context, InvoiceSectionListResult) (InvoiceSectionListResult, error)) InvoiceSectionListResultPage { return original.NewInvoiceSectionListResultPage(getNextPage) } +func NewInvoiceSectionListWithCreateSubPermissionResultIterator(page InvoiceSectionListWithCreateSubPermissionResultPage) InvoiceSectionListWithCreateSubPermissionResultIterator { + return original.NewInvoiceSectionListWithCreateSubPermissionResultIterator(page) +} +func NewInvoiceSectionListWithCreateSubPermissionResultPage(getNextPage func(context.Context, InvoiceSectionListWithCreateSubPermissionResult) (InvoiceSectionListWithCreateSubPermissionResult, error)) InvoiceSectionListWithCreateSubPermissionResultPage { + return original.NewInvoiceSectionListWithCreateSubPermissionResultPage(getNextPage) +} func NewInvoiceSectionsClient(subscriptionID string) InvoiceSectionsClient { return original.NewInvoiceSectionsClient(subscriptionID) } @@ -453,12 +513,6 @@ func NewInvoicesClient(subscriptionID string) InvoicesClient { func NewInvoicesClientWithBaseURI(baseURI string, subscriptionID string) InvoicesClient { return original.NewInvoicesClientWithBaseURI(baseURI, subscriptionID) } -func NewLineOfCreditsClient(subscriptionID string) LineOfCreditsClient { - return original.NewLineOfCreditsClient(subscriptionID) -} -func NewLineOfCreditsClientWithBaseURI(baseURI string, subscriptionID string) LineOfCreditsClient { - return original.NewLineOfCreditsClientWithBaseURI(baseURI, subscriptionID) -} func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator { return original.NewOperationListResultIterator(page) } @@ -471,36 +525,24 @@ func NewOperationsClient(subscriptionID string) OperationsClient { func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID) } -func NewPaymentMethodsClient(subscriptionID string) PaymentMethodsClient { - return original.NewPaymentMethodsClient(subscriptionID) -} -func NewPaymentMethodsClientWithBaseURI(baseURI string, subscriptionID string) PaymentMethodsClient { - return original.NewPaymentMethodsClientWithBaseURI(baseURI, subscriptionID) -} -func NewPaymentMethodsListResultIterator(page PaymentMethodsListResultPage) PaymentMethodsListResultIterator { - return original.NewPaymentMethodsListResultIterator(page) -} -func NewPaymentMethodsListResultPage(getNextPage func(context.Context, PaymentMethodsListResult) (PaymentMethodsListResult, error)) PaymentMethodsListResultPage { - return original.NewPaymentMethodsListResultPage(getNextPage) -} func NewPermissionsClient(subscriptionID string) PermissionsClient { return original.NewPermissionsClient(subscriptionID) } func NewPermissionsClientWithBaseURI(baseURI string, subscriptionID string) PermissionsClient { return original.NewPermissionsClientWithBaseURI(baseURI, subscriptionID) } +func NewPermissionsListResultIterator(page PermissionsListResultPage) PermissionsListResultIterator { + return original.NewPermissionsListResultIterator(page) +} +func NewPermissionsListResultPage(getNextPage func(context.Context, PermissionsListResult) (PermissionsListResult, error)) PermissionsListResultPage { + return original.NewPermissionsListResultPage(getNextPage) +} func NewPoliciesClient(subscriptionID string) PoliciesClient { return original.NewPoliciesClient(subscriptionID) } func NewPoliciesClientWithBaseURI(baseURI string, subscriptionID string) PoliciesClient { return original.NewPoliciesClientWithBaseURI(baseURI, subscriptionID) } -func NewPriceSheetClient(subscriptionID string) PriceSheetClient { - return original.NewPriceSheetClient(subscriptionID) -} -func NewPriceSheetClientWithBaseURI(baseURI string, subscriptionID string) PriceSheetClient { - return original.NewPriceSheetClientWithBaseURI(baseURI, subscriptionID) -} func NewProductsClient(subscriptionID string) ProductsClient { return original.NewProductsClient(subscriptionID) } @@ -531,17 +573,11 @@ func NewPropertyClient(subscriptionID string) PropertyClient { func NewPropertyClientWithBaseURI(baseURI string, subscriptionID string) PropertyClient { return original.NewPropertyClientWithBaseURI(baseURI, subscriptionID) } -func NewRecipientTransferDetailsListResultIterator(page RecipientTransferDetailsListResultPage) RecipientTransferDetailsListResultIterator { - return original.NewRecipientTransferDetailsListResultIterator(page) -} -func NewRecipientTransferDetailsListResultPage(getNextPage func(context.Context, RecipientTransferDetailsListResult) (RecipientTransferDetailsListResult, error)) RecipientTransferDetailsListResultPage { - return original.NewRecipientTransferDetailsListResultPage(getNextPage) +func NewRoleAssignmentListResultIterator(page RoleAssignmentListResultPage) RoleAssignmentListResultIterator { + return original.NewRoleAssignmentListResultIterator(page) } -func NewRecipientTransfersClient(subscriptionID string) RecipientTransfersClient { - return original.NewRecipientTransfersClient(subscriptionID) -} -func NewRecipientTransfersClientWithBaseURI(baseURI string, subscriptionID string) RecipientTransfersClient { - return original.NewRecipientTransfersClientWithBaseURI(baseURI, subscriptionID) +func NewRoleAssignmentListResultPage(getNextPage func(context.Context, RoleAssignmentListResult) (RoleAssignmentListResult, error)) RoleAssignmentListResultPage { + return original.NewRoleAssignmentListResultPage(getNextPage) } func NewRoleAssignmentsClient(subscriptionID string) RoleAssignmentsClient { return original.NewRoleAssignmentsClient(subscriptionID) @@ -549,6 +585,12 @@ func NewRoleAssignmentsClient(subscriptionID string) RoleAssignmentsClient { func NewRoleAssignmentsClientWithBaseURI(baseURI string, subscriptionID string) RoleAssignmentsClient { return original.NewRoleAssignmentsClientWithBaseURI(baseURI, subscriptionID) } +func NewRoleDefinitionListResultIterator(page RoleDefinitionListResultPage) RoleDefinitionListResultIterator { + return original.NewRoleDefinitionListResultIterator(page) +} +func NewRoleDefinitionListResultPage(getNextPage func(context.Context, RoleDefinitionListResult) (RoleDefinitionListResult, error)) RoleDefinitionListResultPage { + return original.NewRoleDefinitionListResultPage(getNextPage) +} func NewRoleDefinitionsClient(subscriptionID string) RoleDefinitionsClient { return original.NewRoleDefinitionsClient(subscriptionID) } @@ -567,71 +609,95 @@ func NewSubscriptionsListResultIterator(page SubscriptionsListResultPage) Subscr func NewSubscriptionsListResultPage(getNextPage func(context.Context, SubscriptionsListResult) (SubscriptionsListResult, error)) SubscriptionsListResultPage { return original.NewSubscriptionsListResultPage(getNextPage) } +func NewTransactionListResultIterator(page TransactionListResultPage) TransactionListResultIterator { + return original.NewTransactionListResultIterator(page) +} +func NewTransactionListResultPage(getNextPage func(context.Context, TransactionListResult) (TransactionListResult, error)) TransactionListResultPage { + return original.NewTransactionListResultPage(getNextPage) +} func NewTransactionsClient(subscriptionID string) TransactionsClient { return original.NewTransactionsClient(subscriptionID) } func NewTransactionsClientWithBaseURI(baseURI string, subscriptionID string) TransactionsClient { return original.NewTransactionsClientWithBaseURI(baseURI, subscriptionID) } -func NewTransactionsListResultIterator(page TransactionsListResultPage) TransactionsListResultIterator { - return original.NewTransactionsListResultIterator(page) -} -func NewTransactionsListResultPage(getNextPage func(context.Context, TransactionsListResult) (TransactionsListResult, error)) TransactionsListResultPage { - return original.NewTransactionsListResultPage(getNextPage) -} -func NewTransferDetailsListResultIterator(page TransferDetailsListResultPage) TransferDetailsListResultIterator { - return original.NewTransferDetailsListResultIterator(page) -} -func NewTransferDetailsListResultPage(getNextPage func(context.Context, TransferDetailsListResult) (TransferDetailsListResult, error)) TransferDetailsListResultPage { - return original.NewTransferDetailsListResultPage(getNextPage) -} -func NewTransfersClient(subscriptionID string) TransfersClient { - return original.NewTransfersClient(subscriptionID) -} -func NewTransfersClientWithBaseURI(baseURI string, subscriptionID string) TransfersClient { - return original.NewTransfersClientWithBaseURI(baseURI, subscriptionID) -} func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { return original.NewWithBaseURI(baseURI, subscriptionID) } +func PossibleAcceptanceModeValues() []AcceptanceMode { + return original.PossibleAcceptanceModeValues() +} +func PossibleAccountStatusValues() []AccountStatus { + return original.PossibleAccountStatusValues() +} func PossibleAccountTypeValues() []AccountType { return original.PossibleAccountTypeValues() } func PossibleAddressValidationStatusValues() []AddressValidationStatus { return original.PossibleAddressValidationStatusValues() } -func PossibleEligibleProductTypeValues() []EligibleProductType { - return original.PossibleEligibleProductTypeValues() +func PossibleAgreementTypeValues() []AgreementType { + return original.PossibleAgreementTypeValues() +} +func PossibleAutoRenewValues() []AutoRenew { + return original.PossibleAutoRenewValues() +} +func PossibleCategoryValues() []Category { + return original.PossibleCategoryValues() +} +func PossibleDocumentSourceValues() []DocumentSource { + return original.PossibleDocumentSourceValues() +} +func PossibleDocumentTypeValues() []DocumentType { + return original.PossibleDocumentTypeValues() } func PossibleFrequencyValues() []Frequency { return original.PossibleFrequencyValues() } -func PossibleKindValues() []Kind { - return original.PossibleKindValues() +func PossibleInvoiceStatusValues() []InvoiceStatus { + return original.PossibleInvoiceStatusValues() } -func PossiblePaymentMethodTypeValues() []PaymentMethodType { - return original.PossiblePaymentMethodTypeValues() +func PossibleInvoiceTypeValues() []InvoiceType { + return original.PossibleInvoiceTypeValues() +} +func PossibleMarketplacePurchasesPolicyValues() []MarketplacePurchasesPolicy { + return original.PossibleMarketplacePurchasesPolicyValues() +} +func PossiblePaymentMethodFamilyValues() []PaymentMethodFamily { + return original.PossiblePaymentMethodFamilyValues() } func PossibleProductStatusTypeValues() []ProductStatusType { return original.PossibleProductStatusTypeValues() } -func PossibleProductTransferStatusValues() []ProductTransferStatus { - return original.PossibleProductTransferStatusValues() -} func PossibleProductTransferValidationErrorCodeValues() []ProductTransferValidationErrorCode { return original.PossibleProductTransferValidationErrorCodeValues() } -func PossibleProductTypeValues() []ProductType { - return original.PossibleProductTypeValues() +func PossibleProfileSpendingLimitValues() []ProfileSpendingLimit { + return original.PossibleProfileSpendingLimitValues() +} +func PossibleProfileStatusReasonCodeValues() []ProfileStatusReasonCode { + return original.PossibleProfileStatusReasonCodeValues() +} +func PossibleProfileStatusValues() []ProfileStatus { + return original.PossibleProfileStatusValues() +} +func PossibleReservationPurchasesPolicyValues() []ReservationPurchasesPolicy { + return original.PossibleReservationPurchasesPolicyValues() } func PossibleReservationTypeValues() []ReservationType { return original.PossibleReservationTypeValues() } -func PossibleStatus1Values() []Status1 { - return original.PossibleStatus1Values() +func PossibleSpendingLimitForBillingProfileValues() []SpendingLimitForBillingProfile { + return original.PossibleSpendingLimitForBillingProfileValues() +} +func PossibleSpendingLimitValues() []SpendingLimit { + return original.PossibleSpendingLimitValues() +} +func PossibleStatusReasonCodeForBillingProfileValues() []StatusReasonCodeForBillingProfile { + return original.PossibleStatusReasonCodeForBillingProfileValues() } -func PossibleStatusValues() []Status { - return original.PossibleStatusValues() +func PossibleStatusReasonCodeValues() []StatusReasonCode { + return original.PossibleStatusReasonCodeValues() } func PossibleSubscriptionStatusTypeValues() []SubscriptionStatusType { return original.PossibleSubscriptionStatusTypeValues() @@ -642,11 +708,11 @@ func PossibleSubscriptionTransferValidationErrorCodeValues() []SubscriptionTrans func PossibleTransactionTypeKindValues() []TransactionTypeKind { return original.PossibleTransactionTypeKindValues() } -func PossibleTransferStatusValues() []TransferStatus { - return original.PossibleTransferStatusValues() +func PossibleViewChargesPolicyValues() []ViewChargesPolicy { + return original.PossibleViewChargesPolicyValues() } -func PossibleUpdateAutoRenewValues() []UpdateAutoRenew { - return original.PossibleUpdateAutoRenewValues() +func PossibleViewChargesValues() []ViewCharges { + return original.PossibleViewChargesValues() } func UserAgent() string { return original.UserAgent() + " profiles/preview" diff --git a/profiles/preview/preview/cdn/mgmt/cdn/cdnapi/models.go b/profiles/preview/preview/cdn/mgmt/cdn/cdnapi/models.go index e1cea17c2d7d..0233eb9bd43e 100644 --- a/profiles/preview/preview/cdn/mgmt/cdn/cdnapi/models.go +++ b/profiles/preview/preview/cdn/mgmt/cdn/cdnapi/models.go @@ -19,7 +19,7 @@ package cdnapi -import original "github.com/Azure/azure-sdk-for-go/services/preview/cdn/mgmt/2019-06-15-preview/cdn/cdnapi" +import original "github.com/Azure/azure-sdk-for-go/services/preview/cdn/mgmt/2020-04-15/cdn/cdnapi" type BaseClientAPI = original.BaseClientAPI type CustomDomainsClientAPI = original.CustomDomainsClientAPI @@ -27,6 +27,7 @@ type EdgeNodesClientAPI = original.EdgeNodesClientAPI type EndpointsClientAPI = original.EndpointsClientAPI type ManagedRuleSetsClientAPI = original.ManagedRuleSetsClientAPI type OperationsClientAPI = original.OperationsClientAPI +type OriginGroupsClientAPI = original.OriginGroupsClientAPI type OriginsClientAPI = original.OriginsClientAPI type PoliciesClientAPI = original.PoliciesClientAPI type ProfilesClientAPI = original.ProfilesClientAPI diff --git a/profiles/preview/preview/cdn/mgmt/cdn/models.go b/profiles/preview/preview/cdn/mgmt/cdn/models.go index 63b109b4c1e3..bad6af2b2a3d 100644 --- a/profiles/preview/preview/cdn/mgmt/cdn/models.go +++ b/profiles/preview/preview/cdn/mgmt/cdn/models.go @@ -22,7 +22,7 @@ package cdn import ( "context" - original "github.com/Azure/azure-sdk-for-go/services/preview/cdn/mgmt/2019-06-15-preview/cdn" + original "github.com/Azure/azure-sdk-for-go/services/preview/cdn/mgmt/2020-04-15/cdn" ) const ( @@ -38,6 +38,12 @@ const ( Redirect ActionType = original.Redirect ) +type Algorithm = original.Algorithm + +const ( + SHA256 Algorithm = original.SHA256 +) + type CacheBehavior = original.CacheBehavior const ( @@ -149,6 +155,14 @@ const ( Overwrite HeaderAction = original.Overwrite ) +type HealthProbeRequestType = original.HealthProbeRequestType + +const ( + GET HealthProbeRequestType = original.GET + HEAD HealthProbeRequestType = original.HEAD + NotSet HealthProbeRequestType = original.NotSet +) + type ManagedRuleEnabledState = original.ManagedRuleEnabledState const ( @@ -237,6 +251,14 @@ const ( VideoOnDemandMediaStreaming OptimizationType = original.VideoOnDemandMediaStreaming ) +type OriginGroupResourceState = original.OriginGroupResourceState + +const ( + OriginGroupResourceStateActive OriginGroupResourceState = original.OriginGroupResourceStateActive + OriginGroupResourceStateCreating OriginGroupResourceState = original.OriginGroupResourceStateCreating + OriginGroupResourceStateDeleting OriginGroupResourceState = original.OriginGroupResourceStateDeleting +) + type OriginResourceState = original.OriginResourceState const ( @@ -245,6 +267,14 @@ const ( OriginResourceStateDeleting OriginResourceState = original.OriginResourceStateDeleting ) +type ParamIndicator = original.ParamIndicator + +const ( + Expires ParamIndicator = original.Expires + KeyID ParamIndicator = original.KeyID + Signature ParamIndicator = original.Signature +) + type PolicyEnabledState = original.PolicyEnabledState const ( @@ -284,6 +314,24 @@ const ( PostArgsOperatorLessThanOrEqual PostArgsOperator = original.PostArgsOperatorLessThanOrEqual ) +type PrivateEndpointStatus = original.PrivateEndpointStatus + +const ( + Approved PrivateEndpointStatus = original.Approved + Disconnected PrivateEndpointStatus = original.Disconnected + Pending PrivateEndpointStatus = original.Pending + Rejected PrivateEndpointStatus = original.Rejected + Timeout PrivateEndpointStatus = original.Timeout +) + +type ProbeProtocol = original.ProbeProtocol + +const ( + ProbeProtocolHTTP ProbeProtocol = original.ProbeProtocolHTTP + ProbeProtocolHTTPS ProbeProtocol = original.ProbeProtocolHTTPS + ProbeProtocolNotSet ProbeProtocol = original.ProbeProtocolNotSet +) + type ProfileResourceState = original.ProfileResourceState const ( @@ -320,10 +368,10 @@ const ( type QueryStringCachingBehavior = original.QueryStringCachingBehavior const ( - BypassCaching QueryStringCachingBehavior = original.BypassCaching - IgnoreQueryString QueryStringCachingBehavior = original.IgnoreQueryString - NotSet QueryStringCachingBehavior = original.NotSet - UseQueryString QueryStringCachingBehavior = original.UseQueryString + QueryStringCachingBehaviorBypassCaching QueryStringCachingBehavior = original.QueryStringCachingBehaviorBypassCaching + QueryStringCachingBehaviorIgnoreQueryString QueryStringCachingBehavior = original.QueryStringCachingBehaviorIgnoreQueryString + QueryStringCachingBehaviorNotSet QueryStringCachingBehavior = original.QueryStringCachingBehaviorNotSet + QueryStringCachingBehaviorUseQueryString QueryStringCachingBehavior = original.QueryStringCachingBehaviorUseQueryString ) type QueryStringOperator = original.QueryStringOperator @@ -405,6 +453,14 @@ const ( MicrosoftCdnProfilesEndpoints ResourceType = original.MicrosoftCdnProfilesEndpoints ) +type ResponseBasedDetectedErrorTypes = original.ResponseBasedDetectedErrorTypes + +const ( + ResponseBasedDetectedErrorTypesNone ResponseBasedDetectedErrorTypes = original.ResponseBasedDetectedErrorTypesNone + ResponseBasedDetectedErrorTypesTCPAndHTTPErrors ResponseBasedDetectedErrorTypes = original.ResponseBasedDetectedErrorTypesTCPAndHTTPErrors + ResponseBasedDetectedErrorTypesTCPErrorsOnly ResponseBasedDetectedErrorTypes = original.ResponseBasedDetectedErrorTypesTCPErrorsOnly +) + type SkuName = original.SkuName const ( @@ -503,6 +559,8 @@ type CustomDomainsDeleteFuture = original.CustomDomainsDeleteFuture type CustomRule = original.CustomRule type CustomRuleList = original.CustomRuleList type DeepCreatedOrigin = original.DeepCreatedOrigin +type DeepCreatedOriginGroup = original.DeepCreatedOriginGroup +type DeepCreatedOriginGroupProperties = original.DeepCreatedOriginGroupProperties type DeepCreatedOriginProperties = original.DeepCreatedOriginProperties type DeliveryRule = original.DeliveryRule type DeliveryRuleAction = original.DeliveryRuleAction @@ -551,11 +609,14 @@ type EndpointsStopFuture = original.EndpointsStopFuture type EndpointsUpdateFuture = original.EndpointsUpdateFuture type ErrorResponse = original.ErrorResponse type GeoFilter = original.GeoFilter +type HTTPErrorRangeParameters = original.HTTPErrorRangeParameters type HTTPVersionMatchConditionParameters = original.HTTPVersionMatchConditionParameters type HeaderActionParameters = original.HeaderActionParameters +type HealthProbeParameters = original.HealthProbeParameters type IPAddressGroup = original.IPAddressGroup type IsDeviceMatchConditionParameters = original.IsDeviceMatchConditionParameters type KeyVaultCertificateSourceParameters = original.KeyVaultCertificateSourceParameters +type KeyVaultSigningKeyParameters = original.KeyVaultSigningKeyParameters type LoadParameters = original.LoadParameters type ManagedHTTPSParameters = original.ManagedHTTPSParameters type ManagedRuleDefinition = original.ManagedRuleDefinition @@ -578,13 +639,26 @@ type OperationsListResult = original.OperationsListResult type OperationsListResultIterator = original.OperationsListResultIterator type OperationsListResultPage = original.OperationsListResultPage type Origin = original.Origin +type OriginGroup = original.OriginGroup +type OriginGroupListResult = original.OriginGroupListResult +type OriginGroupListResultIterator = original.OriginGroupListResultIterator +type OriginGroupListResultPage = original.OriginGroupListResultPage +type OriginGroupProperties = original.OriginGroupProperties +type OriginGroupUpdateParameters = original.OriginGroupUpdateParameters +type OriginGroupUpdatePropertiesParameters = original.OriginGroupUpdatePropertiesParameters +type OriginGroupsClient = original.OriginGroupsClient +type OriginGroupsCreateFuture = original.OriginGroupsCreateFuture +type OriginGroupsDeleteFuture = original.OriginGroupsDeleteFuture +type OriginGroupsUpdateFuture = original.OriginGroupsUpdateFuture type OriginListResult = original.OriginListResult type OriginListResultIterator = original.OriginListResultIterator type OriginListResultPage = original.OriginListResultPage type OriginProperties = original.OriginProperties -type OriginPropertiesParameters = original.OriginPropertiesParameters type OriginUpdateParameters = original.OriginUpdateParameters +type OriginUpdatePropertiesParameters = original.OriginUpdatePropertiesParameters type OriginsClient = original.OriginsClient +type OriginsCreateFuture = original.OriginsCreateFuture +type OriginsDeleteFuture = original.OriginsDeleteFuture type OriginsUpdateFuture = original.OriginsUpdateFuture type PoliciesClient = original.PoliciesClient type PoliciesCreateOrUpdateFuture = original.PoliciesCreateOrUpdateFuture @@ -613,11 +687,13 @@ type RequestMethodMatchConditionParameters = original.RequestMethodMatchConditio type RequestSchemeMatchConditionParameters = original.RequestSchemeMatchConditionParameters type RequestURIMatchConditionParameters = original.RequestURIMatchConditionParameters type Resource = original.Resource +type ResourceReference = original.ResourceReference type ResourceUsage = original.ResourceUsage type ResourceUsageClient = original.ResourceUsageClient type ResourceUsageListResult = original.ResourceUsageListResult type ResourceUsageListResultIterator = original.ResourceUsageListResultIterator type ResourceUsageListResultPage = original.ResourceUsageListResultPage +type ResponseBasedOriginErrorDetectionParameters = original.ResponseBasedOriginErrorDetectionParameters type Sku = original.Sku type SsoURI = original.SsoURI type SupportedOptimizationTypesListResult = original.SupportedOptimizationTypesListResult @@ -629,6 +705,9 @@ type URLRedirectAction = original.URLRedirectAction type URLRedirectActionParameters = original.URLRedirectActionParameters type URLRewriteAction = original.URLRewriteAction type URLRewriteActionParameters = original.URLRewriteActionParameters +type URLSigningActionParameters = original.URLSigningActionParameters +type URLSigningKey = original.URLSigningKey +type URLSigningParamIdentifier = original.URLSigningParamIdentifier type UserManagedHTTPSParameters = original.UserManagedHTTPSParameters type ValidateCustomDomainInput = original.ValidateCustomDomainInput type ValidateCustomDomainOutput = original.ValidateCustomDomainOutput @@ -704,6 +783,18 @@ func NewOperationsListResultIterator(page OperationsListResultPage) OperationsLi func NewOperationsListResultPage(getNextPage func(context.Context, OperationsListResult) (OperationsListResult, error)) OperationsListResultPage { return original.NewOperationsListResultPage(getNextPage) } +func NewOriginGroupListResultIterator(page OriginGroupListResultPage) OriginGroupListResultIterator { + return original.NewOriginGroupListResultIterator(page) +} +func NewOriginGroupListResultPage(getNextPage func(context.Context, OriginGroupListResult) (OriginGroupListResult, error)) OriginGroupListResultPage { + return original.NewOriginGroupListResultPage(getNextPage) +} +func NewOriginGroupsClient(subscriptionID string, subscriptionID1 string) OriginGroupsClient { + return original.NewOriginGroupsClient(subscriptionID, subscriptionID1) +} +func NewOriginGroupsClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) OriginGroupsClient { + return original.NewOriginGroupsClientWithBaseURI(baseURI, subscriptionID, subscriptionID1) +} func NewOriginListResultIterator(page OriginListResultPage) OriginListResultIterator { return original.NewOriginListResultIterator(page) } @@ -758,6 +849,9 @@ func NewWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 strin func PossibleActionTypeValues() []ActionType { return original.PossibleActionTypeValues() } +func PossibleAlgorithmValues() []Algorithm { + return original.PossibleAlgorithmValues() +} func PossibleCacheBehaviorValues() []CacheBehavior { return original.PossibleCacheBehaviorValues() } @@ -794,6 +888,9 @@ func PossibleGeoFilterActionsValues() []GeoFilterActions { func PossibleHeaderActionValues() []HeaderAction { return original.PossibleHeaderActionValues() } +func PossibleHealthProbeRequestTypeValues() []HealthProbeRequestType { + return original.PossibleHealthProbeRequestTypeValues() +} func PossibleManagedRuleEnabledStateValues() []ManagedRuleEnabledState { return original.PossibleManagedRuleEnabledStateValues() } @@ -815,9 +912,15 @@ func PossibleOperatorValues() []Operator { func PossibleOptimizationTypeValues() []OptimizationType { return original.PossibleOptimizationTypeValues() } +func PossibleOriginGroupResourceStateValues() []OriginGroupResourceState { + return original.PossibleOriginGroupResourceStateValues() +} func PossibleOriginResourceStateValues() []OriginResourceState { return original.PossibleOriginResourceStateValues() } +func PossibleParamIndicatorValues() []ParamIndicator { + return original.PossibleParamIndicatorValues() +} func PossiblePolicyEnabledStateValues() []PolicyEnabledState { return original.PossiblePolicyEnabledStateValues() } @@ -830,6 +933,12 @@ func PossiblePolicyResourceStateValues() []PolicyResourceState { func PossiblePostArgsOperatorValues() []PostArgsOperator { return original.PossiblePostArgsOperatorValues() } +func PossiblePrivateEndpointStatusValues() []PrivateEndpointStatus { + return original.PossiblePrivateEndpointStatusValues() +} +func PossibleProbeProtocolValues() []ProbeProtocol { + return original.PossibleProbeProtocolValues() +} func PossibleProfileResourceStateValues() []ProfileResourceState { return original.PossibleProfileResourceStateValues() } @@ -866,6 +975,9 @@ func PossibleRequestURIOperatorValues() []RequestURIOperator { func PossibleResourceTypeValues() []ResourceType { return original.PossibleResourceTypeValues() } +func PossibleResponseBasedDetectedErrorTypesValues() []ResponseBasedDetectedErrorTypes { + return original.PossibleResponseBasedDetectedErrorTypesValues() +} func PossibleSkuNameValues() []SkuName { return original.PossibleSkuNameValues() } diff --git a/profiles/preview/preview/cognitiveservices/anomalydetector/models.go b/profiles/preview/preview/cognitiveservices/anomalydetector/models.go index aa8fcf50800c..36e1775610e0 100644 --- a/profiles/preview/preview/cognitiveservices/anomalydetector/models.go +++ b/profiles/preview/preview/cognitiveservices/anomalydetector/models.go @@ -28,6 +28,7 @@ const ( Hourly Granularity = original.Hourly Minutely Granularity = original.Minutely Monthly Granularity = original.Monthly + Secondly Granularity = original.Secondly Weekly Granularity = original.Weekly Yearly Granularity = original.Yearly ) diff --git a/profiles/preview/preview/cognitiveservices/luis/authoring/authoringapi/models.go b/profiles/preview/preview/cognitiveservices/luis/authoring/authoringapi/models.go index 129ce74741c7..c71b06b03b97 100644 --- a/profiles/preview/preview/cognitiveservices/luis/authoring/authoringapi/models.go +++ b/profiles/preview/preview/cognitiveservices/luis/authoring/authoringapi/models.go @@ -27,7 +27,6 @@ type ExamplesClientAPI = original.ExamplesClientAPI type FeaturesClientAPI = original.FeaturesClientAPI type ModelClientAPI = original.ModelClientAPI type PatternClientAPI = original.PatternClientAPI -type PermissionsClientAPI = original.PermissionsClientAPI type SettingsClientAPI = original.SettingsClientAPI type TrainClientAPI = original.TrainClientAPI type VersionsClientAPI = original.VersionsClientAPI diff --git a/profiles/preview/preview/cognitiveservices/luis/authoring/models.go b/profiles/preview/preview/cognitiveservices/luis/authoring/models.go index c4b1f4bac9b0..5ef1a4c610ce 100644 --- a/profiles/preview/preview/cognitiveservices/luis/authoring/models.go +++ b/profiles/preview/preview/cognitiveservices/luis/authoring/models.go @@ -370,7 +370,6 @@ type PatternRule = original.PatternRule type PatternRuleCreateObject = original.PatternRuleCreateObject type PatternRuleInfo = original.PatternRuleInfo type PatternRuleUpdateObject = original.PatternRuleUpdateObject -type PermissionsClient = original.PermissionsClient type PersonalAssistantsResponse = original.PersonalAssistantsResponse type PhraseListFeatureInfo = original.PhraseListFeatureInfo type PhraselistCreateObject = original.PhraselistCreateObject @@ -427,9 +426,6 @@ func NewModelClient(endpoint string) ModelClient { func NewPatternClient(endpoint string) PatternClient { return original.NewPatternClient(endpoint) } -func NewPermissionsClient(endpoint string) PermissionsClient { - return original.NewPermissionsClient(endpoint) -} func NewSettingsClient(endpoint string) SettingsClient { return original.NewSettingsClient(endpoint) } diff --git a/profiles/preview/preview/containerregistry/mgmt/containerregistry/containerregistryapi/models.go b/profiles/preview/preview/containerregistry/mgmt/containerregistry/containerregistryapi/models.go index 8db29fd87aa1..171399a9038e 100644 --- a/profiles/preview/preview/containerregistry/mgmt/containerregistry/containerregistryapi/models.go +++ b/profiles/preview/preview/containerregistry/mgmt/containerregistry/containerregistryapi/models.go @@ -22,7 +22,10 @@ package containerregistryapi import original "github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2019-12-01-preview/containerregistry/containerregistryapi" type AgentPoolsClientAPI = original.AgentPoolsClientAPI +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 diff --git a/profiles/preview/preview/containerregistry/mgmt/containerregistry/models.go b/profiles/preview/preview/containerregistry/mgmt/containerregistry/models.go index a3ca3d9fed18..eeb7efc1ea5c 100644 --- a/profiles/preview/preview/containerregistry/mgmt/containerregistry/models.go +++ b/profiles/preview/preview/containerregistry/mgmt/containerregistry/models.go @@ -110,6 +110,33 @@ const ( Password2 PasswordName = original.Password2 ) +type PipelineOptions = original.PipelineOptions + +const ( + ContinueOnErrors PipelineOptions = original.ContinueOnErrors + DeleteSourceBlobOnSuccess PipelineOptions = original.DeleteSourceBlobOnSuccess + OverwriteBlobs PipelineOptions = original.OverwriteBlobs + OverwriteTags PipelineOptions = original.OverwriteTags +) + +type PipelineRunSourceType = original.PipelineRunSourceType + +const ( + AzureStorageBlob PipelineRunSourceType = original.AzureStorageBlob +) + +type PipelineRunTargetType = original.PipelineRunTargetType + +const ( + PipelineRunTargetTypeAzureStorageBlob PipelineRunTargetType = original.PipelineRunTargetTypeAzureStorageBlob +) + +type PipelineSourceType = original.PipelineSourceType + +const ( + AzureStorageBlobContainer PipelineSourceType = original.AzureStorageBlobContainer +) + type PolicyStatus = original.PolicyStatus const ( @@ -128,6 +155,13 @@ const ( Updating ProvisioningState = original.Updating ) +type PublicNetworkAccess = original.PublicNetworkAccess + +const ( + PublicNetworkAccessDisabled PublicNetworkAccess = original.PublicNetworkAccessDisabled + PublicNetworkAccessEnabled PublicNetworkAccess = original.PublicNetworkAccessEnabled +) + type RegistryUsageUnit = original.RegistryUsageUnit const ( @@ -365,6 +399,15 @@ 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 FileTaskRunRequest = original.FileTaskRunRequest type FileTaskStep = original.FileTaskStep type FileTaskStepUpdateParameters = original.FileTaskStepUpdateParameters @@ -375,6 +418,15 @@ 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 @@ -390,6 +442,22 @@ type OperationPropertiesDefinition = original.OperationPropertiesDefinition type OperationServiceSpecificationDefinition = original.OperationServiceSpecificationDefinition type OperationsClient = original.OperationsClient type OverrideTaskStepProperties = original.OverrideTaskStepProperties +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 PlatformProperties = original.PlatformProperties type PlatformUpdateParameters = original.PlatformUpdateParameters type Policies = original.Policies @@ -408,6 +476,7 @@ 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 @@ -437,6 +506,7 @@ type ReplicationListResultIterator = original.ReplicationListResultIterator type ReplicationListResultPage = original.ReplicationListResultPage type ReplicationProperties = original.ReplicationProperties type ReplicationUpdateParameters = original.ReplicationUpdateParameters +type ReplicationUpdateParametersProperties = original.ReplicationUpdateParametersProperties type ReplicationsClient = original.ReplicationsClient type ReplicationsCreateFuture = original.ReplicationsCreateFuture type ReplicationsDeleteFuture = original.ReplicationsDeleteFuture @@ -563,6 +633,30 @@ func NewEventListResultIterator(page EventListResultPage) EventListResultIterato func NewEventListResultPage(getNextPage func(context.Context, EventListResult) (EventListResult, error)) EventListResultPage { return original.NewEventListResultPage(getNextPage) } +func NewExportPipelineListResultIterator(page ExportPipelineListResultPage) ExportPipelineListResultIterator { + return original.NewExportPipelineListResultIterator(page) +} +func NewExportPipelineListResultPage(getNextPage func(context.Context, ExportPipelineListResult) (ExportPipelineListResult, error)) ExportPipelineListResultPage { + return original.NewExportPipelineListResultPage(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(getNextPage func(context.Context, ImportPipelineListResult) (ImportPipelineListResult, error)) ImportPipelineListResultPage { + return original.NewImportPipelineListResultPage(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) } @@ -575,6 +669,18 @@ 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(getNextPage func(context.Context, PipelineRunListResult) (PipelineRunListResult, error)) PipelineRunListResultPage { + return original.NewPipelineRunListResultPage(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) } @@ -725,12 +831,27 @@ 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() } func PossibleProvisioningStateValues() []ProvisioningState { return original.PossibleProvisioningStateValues() } +func PossiblePublicNetworkAccessValues() []PublicNetworkAccess { + return original.PossiblePublicNetworkAccessValues() +} func PossibleRegistryUsageUnitValues() []RegistryUsageUnit { return original.PossibleRegistryUsageUnitValues() } diff --git a/profiles/preview/preview/desktopvirtualization/mgmt/desktopvirtualization/desktopvirtualizationapi/models.go b/profiles/preview/preview/desktopvirtualization/mgmt/desktopvirtualization/desktopvirtualizationapi/models.go index 4291767e45fb..73251cce86d9 100644 --- a/profiles/preview/preview/desktopvirtualization/mgmt/desktopvirtualization/desktopvirtualizationapi/models.go +++ b/profiles/preview/preview/desktopvirtualization/mgmt/desktopvirtualization/desktopvirtualizationapi/models.go @@ -19,7 +19,7 @@ package desktopvirtualizationapi -import original "github.com/Azure/azure-sdk-for-go/services/preview/desktopvirtualization/mgmt/2019-01-23-preview/desktopvirtualization/desktopvirtualizationapi" +import original "github.com/Azure/azure-sdk-for-go/services/preview/desktopvirtualization/mgmt/2019-12-10-preview/desktopvirtualization/desktopvirtualizationapi" type ActiveApplicationsClientAPI = original.ActiveApplicationsClientAPI type ApplicationGroupAssignmentsClientAPI = original.ApplicationGroupAssignmentsClientAPI diff --git a/profiles/preview/preview/desktopvirtualization/mgmt/desktopvirtualization/models.go b/profiles/preview/preview/desktopvirtualization/mgmt/desktopvirtualization/models.go index fc430c3eb5ae..b1fca89a5f98 100644 --- a/profiles/preview/preview/desktopvirtualization/mgmt/desktopvirtualization/models.go +++ b/profiles/preview/preview/desktopvirtualization/mgmt/desktopvirtualization/models.go @@ -22,7 +22,7 @@ package desktopvirtualization import ( "context" - original "github.com/Azure/azure-sdk-for-go/services/preview/desktopvirtualization/mgmt/2019-01-23-preview/desktopvirtualization" + original "github.com/Azure/azure-sdk-for-go/services/preview/desktopvirtualization/mgmt/2019-12-10-preview/desktopvirtualization" ) const ( @@ -55,7 +55,7 @@ type HostPoolType = original.HostPoolType const ( Personal HostPoolType = original.Personal - Shared HostPoolType = original.Shared + Pooled HostPoolType = original.Pooled ) type LoadBalancerType = original.LoadBalancerType @@ -73,6 +73,14 @@ const ( Direct PersonalDesktopAssignmentType = original.Direct ) +type RegistrationTokenOperation = original.RegistrationTokenOperation + +const ( + Delete RegistrationTokenOperation = original.Delete + None RegistrationTokenOperation = original.None + Update RegistrationTokenOperation = original.Update +) + type SessionState = original.SessionState const ( @@ -123,6 +131,7 @@ type ApplicationPatch = original.ApplicationPatch type ApplicationPatchProperties = original.ApplicationPatchProperties type ApplicationProperties = original.ApplicationProperties type ApplicationsClient = original.ApplicationsClient +type AzureEntityResource = original.AzureEntityResource type BaseClient = original.BaseClient type CloudError = original.CloudError type Desktop = original.Desktop @@ -140,6 +149,7 @@ type HostPoolPatchProperties = original.HostPoolPatchProperties type HostPoolProperties = original.HostPoolProperties type HostPoolsClient = original.HostPoolsClient type OperationsClient = original.OperationsClient +type ProxyResource = original.ProxyResource type RegistrationInfo = original.RegistrationInfo type RegistrationInfoPatch = original.RegistrationInfoPatch type Resource = original.Resource @@ -309,6 +319,9 @@ func PossibleLoadBalancerTypeValues() []LoadBalancerType { func PossiblePersonalDesktopAssignmentTypeValues() []PersonalDesktopAssignmentType { return original.PossiblePersonalDesktopAssignmentTypeValues() } +func PossibleRegistrationTokenOperationValues() []RegistrationTokenOperation { + return original.PossibleRegistrationTokenOperationValues() +} func PossibleSessionStateValues() []SessionState { return original.PossibleSessionStateValues() } diff --git a/profiles/preview/preview/digitaltwins/mgmt/digitaltwins/digitaltwinsapi/models.go b/profiles/preview/preview/digitaltwins/mgmt/digitaltwins/digitaltwinsapi/models.go index d8bee2a478ca..c135cb111ae4 100644 --- a/profiles/preview/preview/digitaltwins/mgmt/digitaltwins/digitaltwinsapi/models.go +++ b/profiles/preview/preview/digitaltwins/mgmt/digitaltwins/digitaltwinsapi/models.go @@ -23,6 +23,4 @@ import original "github.com/Azure/azure-sdk-for-go/services/preview/digitaltwins type ClientAPI = original.ClientAPI type EndpointClientAPI = original.EndpointClientAPI -type IoTHubClientAPI = original.IoTHubClientAPI -type IoTHubsClientAPI = original.IoTHubsClientAPI type OperationsClientAPI = original.OperationsClientAPI diff --git a/profiles/preview/preview/digitaltwins/mgmt/digitaltwins/models.go b/profiles/preview/preview/digitaltwins/mgmt/digitaltwins/models.go index a66435f19224..8df5fe80ea21 100644 --- a/profiles/preview/preview/digitaltwins/mgmt/digitaltwins/models.go +++ b/profiles/preview/preview/digitaltwins/mgmt/digitaltwins/models.go @@ -49,16 +49,6 @@ const ( EndpointTypeServiceBus EndpointType = original.EndpointTypeServiceBus ) -type IntegrationResourceState = original.IntegrationResourceState - -const ( - IntegrationResourceStateCanceled IntegrationResourceState = original.IntegrationResourceStateCanceled - IntegrationResourceStateDeleting IntegrationResourceState = original.IntegrationResourceStateDeleting - IntegrationResourceStateFailed IntegrationResourceState = original.IntegrationResourceStateFailed - IntegrationResourceStateProvisioning IntegrationResourceState = original.IntegrationResourceStateProvisioning - IntegrationResourceStateSucceeded IntegrationResourceState = original.IntegrationResourceStateSucceeded -) - type ProvisioningState = original.ProvisioningState const ( @@ -100,17 +90,6 @@ type ErrorResponse = original.ErrorResponse type EventGrid = original.EventGrid type EventHub = original.EventHub type ExternalResource = original.ExternalResource -type IntegrationResource = original.IntegrationResource -type IntegrationResourceListResult = original.IntegrationResourceListResult -type IntegrationResourceListResultIterator = original.IntegrationResourceListResultIterator -type IntegrationResourceListResultPage = original.IntegrationResourceListResultPage -type IntegrationResourceProperties = original.IntegrationResourceProperties -type IntegrationResourceState1 = original.IntegrationResourceState1 -type IntegrationResourceUpdateInfo = original.IntegrationResourceUpdateInfo -type IntegrationResourceUpdateProperties = original.IntegrationResourceUpdateProperties -type IoTHubClient = original.IoTHubClient -type IoTHubDeleteFuture = original.IoTHubDeleteFuture -type IoTHubsClient = original.IoTHubsClient type Operation = original.Operation type OperationDisplay = original.OperationDisplay type OperationListResult = original.OperationListResult @@ -151,24 +130,6 @@ func NewEndpointResourceListResultIterator(page EndpointResourceListResultPage) func NewEndpointResourceListResultPage(getNextPage func(context.Context, EndpointResourceListResult) (EndpointResourceListResult, error)) EndpointResourceListResultPage { return original.NewEndpointResourceListResultPage(getNextPage) } -func NewIntegrationResourceListResultIterator(page IntegrationResourceListResultPage) IntegrationResourceListResultIterator { - return original.NewIntegrationResourceListResultIterator(page) -} -func NewIntegrationResourceListResultPage(getNextPage func(context.Context, IntegrationResourceListResult) (IntegrationResourceListResult, error)) IntegrationResourceListResultPage { - return original.NewIntegrationResourceListResultPage(getNextPage) -} -func NewIoTHubClient(subscriptionID uuid.UUID) IoTHubClient { - return original.NewIoTHubClient(subscriptionID) -} -func NewIoTHubClientWithBaseURI(baseURI string, subscriptionID uuid.UUID) IoTHubClient { - return original.NewIoTHubClientWithBaseURI(baseURI, subscriptionID) -} -func NewIoTHubsClient(subscriptionID uuid.UUID) IoTHubsClient { - return original.NewIoTHubsClient(subscriptionID) -} -func NewIoTHubsClientWithBaseURI(baseURI string, subscriptionID uuid.UUID) IoTHubsClient { - return original.NewIoTHubsClientWithBaseURI(baseURI, subscriptionID) -} func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator { return original.NewOperationListResultIterator(page) } @@ -190,9 +151,6 @@ func PossibleEndpointProvisioningStateValues() []EndpointProvisioningState { func PossibleEndpointTypeValues() []EndpointType { return original.PossibleEndpointTypeValues() } -func PossibleIntegrationResourceStateValues() []IntegrationResourceState { - return original.PossibleIntegrationResourceStateValues() -} func PossibleProvisioningStateValues() []ProvisioningState { return original.PossibleProvisioningStateValues() } diff --git a/profiles/preview/preview/hdinsight/mgmt/hdinsight/hdinsightapi/models.go b/profiles/preview/preview/hdinsight/mgmt/hdinsight/hdinsightapi/models.go index 4101d0f91ccc..7a259ad2a864 100644 --- a/profiles/preview/preview/hdinsight/mgmt/hdinsight/hdinsightapi/models.go +++ b/profiles/preview/preview/hdinsight/mgmt/hdinsight/hdinsightapi/models.go @@ -29,3 +29,4 @@ type LocationsClientAPI = original.LocationsClientAPI type OperationsClientAPI = original.OperationsClientAPI type ScriptActionsClientAPI = original.ScriptActionsClientAPI type ScriptExecutionHistoryClientAPI = original.ScriptExecutionHistoryClientAPI +type VirtualMachinesClientAPI = original.VirtualMachinesClientAPI diff --git a/profiles/preview/preview/hdinsight/mgmt/hdinsight/models.go b/profiles/preview/preview/hdinsight/mgmt/hdinsight/models.go index 549f9e149506..38102a845204 100644 --- a/profiles/preview/preview/hdinsight/mgmt/hdinsight/models.go +++ b/profiles/preview/preview/hdinsight/mgmt/hdinsight/models.go @@ -167,6 +167,8 @@ type ExtensionsDisableMonitoringFuture = original.ExtensionsDisableMonitoringFut type ExtensionsEnableMonitoringFuture = original.ExtensionsEnableMonitoringFuture type GatewaySettings = original.GatewaySettings type HardwareProfile = original.HardwareProfile +type HostInfo = original.HostInfo +type HostInfoListResult = original.HostInfoListResult type KafkaRestProperties = original.KafkaRestProperties type LinuxOperatingSystemProfile = original.LinuxOperatingSystemProfile type LocalizedName = original.LocalizedName @@ -214,6 +216,8 @@ type VMSizeCompatibilityFilterV2 = original.VMSizeCompatibilityFilterV2 type VMSizesCapability = original.VMSizesCapability type VersionSpec = original.VersionSpec type VersionsCapability = original.VersionsCapability +type VirtualMachinesClient = original.VirtualMachinesClient +type VirtualMachinesRestartHostsFuture = original.VirtualMachinesRestartHostsFuture type VirtualNetworkProfile = original.VirtualNetworkProfile func New(subscriptionID string) BaseClient { @@ -297,6 +301,12 @@ func NewScriptExecutionHistoryClient(subscriptionID string) ScriptExecutionHisto func NewScriptExecutionHistoryClientWithBaseURI(baseURI string, subscriptionID string) ScriptExecutionHistoryClient { return original.NewScriptExecutionHistoryClientWithBaseURI(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) } diff --git a/profiles/preview/preview/kubernetesconfiguration/mgmt/kubernetesconfiguration/models.go b/profiles/preview/preview/kubernetesconfiguration/mgmt/kubernetesconfiguration/models.go index dd92d4cf083d..8121612f0d2d 100644 --- a/profiles/preview/preview/kubernetesconfiguration/mgmt/kubernetesconfiguration/models.go +++ b/profiles/preview/preview/kubernetesconfiguration/mgmt/kubernetesconfiguration/models.go @@ -33,6 +33,8 @@ type ComplianceState = original.ComplianceState const ( Compliant ComplianceState = original.Compliant + Failed ComplianceState = original.Failed + Installed ComplianceState = original.Installed Noncompliant ComplianceState = original.Noncompliant Pending ComplianceState = original.Pending ) @@ -68,11 +70,11 @@ const ( type ProvisioningState = original.ProvisioningState const ( - Accepted ProvisioningState = original.Accepted - Deleting ProvisioningState = original.Deleting - Failed ProvisioningState = original.Failed - Running ProvisioningState = original.Running - Succeeded ProvisioningState = original.Succeeded + ProvisioningStateAccepted ProvisioningState = original.ProvisioningStateAccepted + ProvisioningStateDeleting ProvisioningState = original.ProvisioningStateDeleting + ProvisioningStateFailed ProvisioningState = original.ProvisioningStateFailed + ProvisioningStateRunning ProvisioningState = original.ProvisioningStateRunning + ProvisioningStateSucceeded ProvisioningState = original.ProvisioningStateSucceeded ) type BaseClient = original.BaseClient diff --git a/profiles/preview/preview/migrate/mgmt/migrate/migrateapi/models.go b/profiles/preview/preview/migrate/mgmt/migrate/migrateapi/models.go index 32e358b3acba..968bedfa0152 100644 --- a/profiles/preview/preview/migrate/mgmt/migrate/migrateapi/models.go +++ b/profiles/preview/preview/migrate/mgmt/migrate/migrateapi/models.go @@ -30,6 +30,7 @@ type HyperVRunAsAccountsClientAPI = original.HyperVRunAsAccountsClientAPI type HyperVSitesClientAPI = original.HyperVSitesClientAPI type JobsClientAPI = original.JobsClientAPI type MachinesClientAPI = original.MachinesClientAPI +type OperationsClientAPI = original.OperationsClientAPI type RunAsAccountsClientAPI = original.RunAsAccountsClientAPI type SitesClientAPI = original.SitesClientAPI type VCenterClientAPI = original.VCenterClientAPI diff --git a/profiles/preview/preview/migrate/mgmt/migrate/models.go b/profiles/preview/preview/migrate/mgmt/migrate/models.go index af3b5bc3972a..57ea18007b10 100644 --- a/profiles/preview/preview/migrate/mgmt/migrate/models.go +++ b/profiles/preview/preview/migrate/mgmt/migrate/models.go @@ -182,9 +182,15 @@ type MachinesClient = original.MachinesClient type NetworkConfiguration = original.NetworkConfiguration type OperatingSystem = original.OperatingSystem type OperatingSystemConfiguration = original.OperatingSystemConfiguration +type Operation = original.Operation +type OperationDisplay = original.OperationDisplay +type OperationResultList = original.OperationResultList +type OperationResultListIterator = original.OperationResultListIterator +type OperationResultListPage = original.OperationResultListPage type OperationStatus = original.OperationStatus type OperationStatusError = original.OperationStatusError type OperationStatusProperties = original.OperationStatusProperties +type OperationsClient = original.OperationsClient type OtherDatabase = original.OtherDatabase type RunAsAccountProperties = original.RunAsAccountProperties type RunAsAccountsClient = original.RunAsAccountsClient @@ -314,6 +320,18 @@ func NewMachinesClient() MachinesClient { func NewMachinesClientWithBaseURI(baseURI string) MachinesClient { return original.NewMachinesClientWithBaseURI(baseURI) } +func NewOperationResultListIterator(page OperationResultListPage) OperationResultListIterator { + return original.NewOperationResultListIterator(page) +} +func NewOperationResultListPage(getNextPage func(context.Context, OperationResultList) (OperationResultList, error)) OperationResultListPage { + return original.NewOperationResultListPage(getNextPage) +} +func NewOperationsClient() OperationsClient { + return original.NewOperationsClient() +} +func NewOperationsClientWithBaseURI(baseURI string) OperationsClient { + return original.NewOperationsClientWithBaseURI(baseURI) +} func NewRunAsAccountsClient() RunAsAccountsClient { return original.NewRunAsAccountsClient() } diff --git a/profiles/preview/preview/mixedreality/mgmt/mixedreality/mixedrealityapi/models.go b/profiles/preview/preview/mixedreality/mgmt/mixedreality/mixedrealityapi/models.go index c36162fd0467..6c4b57f14a56 100644 --- a/profiles/preview/preview/mixedreality/mgmt/mixedreality/mixedrealityapi/models.go +++ b/profiles/preview/preview/mixedreality/mgmt/mixedreality/mixedrealityapi/models.go @@ -19,8 +19,9 @@ package mixedrealityapi -import original "github.com/Azure/azure-sdk-for-go/services/preview/mixedreality/mgmt/2019-02-28/mixedreality/mixedrealityapi" +import original "github.com/Azure/azure-sdk-for-go/services/preview/mixedreality/mgmt/2020-05-01-preview/mixedreality/mixedrealityapi" type BaseClientAPI = original.BaseClientAPI type OperationsClientAPI = original.OperationsClientAPI +type RemoteRenderingAccountsClientAPI = original.RemoteRenderingAccountsClientAPI type SpatialAnchorsAccountsClientAPI = original.SpatialAnchorsAccountsClientAPI diff --git a/profiles/preview/preview/mixedreality/mgmt/mixedreality/models.go b/profiles/preview/preview/mixedreality/mgmt/mixedreality/models.go index a04550b8493c..30f7e2f13b74 100644 --- a/profiles/preview/preview/mixedreality/mgmt/mixedreality/models.go +++ b/profiles/preview/preview/mixedreality/mgmt/mixedreality/models.go @@ -22,7 +22,7 @@ package mixedreality import ( "context" - original "github.com/Azure/azure-sdk-for-go/services/preview/mixedreality/mgmt/2019-02-28/mixedreality" + original "github.com/Azure/azure-sdk-for-go/services/preview/mixedreality/mgmt/2020-05-01-preview/mixedreality" ) const ( @@ -43,37 +43,66 @@ const ( Invalid NameUnavailableReason = original.Invalid ) +type ResourceIdentityType = original.ResourceIdentityType + +const ( + SystemAssigned ResourceIdentityType = original.SystemAssigned +) + +type SkuTier = original.SkuTier + +const ( + Basic SkuTier = original.Basic + Free SkuTier = original.Free + Premium SkuTier = original.Premium + Standard SkuTier = original.Standard +) + +type AccountKeyRegenerateRequest = original.AccountKeyRegenerateRequest +type AccountKeys = original.AccountKeys +type AccountProperties = original.AccountProperties type AzureEntityResource = original.AzureEntityResource type BaseClient = original.BaseClient type CheckNameAvailabilityRequest = original.CheckNameAvailabilityRequest type CheckNameAvailabilityResponse = original.CheckNameAvailabilityResponse -type ErrorResponse = original.ErrorResponse +type CloudError = original.CloudError +type CloudErrorBody = original.CloudErrorBody +type Identity = original.Identity type Operation = original.Operation type OperationDisplay = original.OperationDisplay -type OperationList = original.OperationList -type OperationListIterator = original.OperationListIterator -type OperationListPage = original.OperationListPage +type OperationPage = original.OperationPage +type OperationPageIterator = original.OperationPageIterator +type OperationPagePage = original.OperationPagePage type OperationsClient = original.OperationsClient +type Plan = original.Plan type ProxyResource = original.ProxyResource +type RemoteRenderingAccount = original.RemoteRenderingAccount +type RemoteRenderingAccountIdentity = original.RemoteRenderingAccountIdentity +type RemoteRenderingAccountPage = original.RemoteRenderingAccountPage +type RemoteRenderingAccountPageIterator = original.RemoteRenderingAccountPageIterator +type RemoteRenderingAccountPagePage = original.RemoteRenderingAccountPagePage +type RemoteRenderingAccountsClient = original.RemoteRenderingAccountsClient type Resource = original.Resource +type ResourceModelWithAllowedPropertySet = original.ResourceModelWithAllowedPropertySet +type ResourceModelWithAllowedPropertySetIdentity = original.ResourceModelWithAllowedPropertySetIdentity +type ResourceModelWithAllowedPropertySetPlan = original.ResourceModelWithAllowedPropertySetPlan +type ResourceModelWithAllowedPropertySetSku = original.ResourceModelWithAllowedPropertySetSku +type Sku = original.Sku type SpatialAnchorsAccount = original.SpatialAnchorsAccount -type SpatialAnchorsAccountKeyRegenerateRequest = original.SpatialAnchorsAccountKeyRegenerateRequest -type SpatialAnchorsAccountKeys = original.SpatialAnchorsAccountKeys -type SpatialAnchorsAccountList = original.SpatialAnchorsAccountList -type SpatialAnchorsAccountListIterator = original.SpatialAnchorsAccountListIterator -type SpatialAnchorsAccountListPage = original.SpatialAnchorsAccountListPage -type SpatialAnchorsAccountProperties = original.SpatialAnchorsAccountProperties +type SpatialAnchorsAccountPage = original.SpatialAnchorsAccountPage +type SpatialAnchorsAccountPageIterator = original.SpatialAnchorsAccountPageIterator +type SpatialAnchorsAccountPagePage = original.SpatialAnchorsAccountPagePage type SpatialAnchorsAccountsClient = original.SpatialAnchorsAccountsClient type TrackedResource = original.TrackedResource func New(subscriptionID string) BaseClient { return original.New(subscriptionID) } -func NewOperationListIterator(page OperationListPage) OperationListIterator { - return original.NewOperationListIterator(page) +func NewOperationPageIterator(page OperationPagePage) OperationPageIterator { + return original.NewOperationPageIterator(page) } -func NewOperationListPage(getNextPage func(context.Context, OperationList) (OperationList, error)) OperationListPage { - return original.NewOperationListPage(getNextPage) +func NewOperationPagePage(getNextPage func(context.Context, OperationPage) (OperationPage, error)) OperationPagePage { + return original.NewOperationPagePage(getNextPage) } func NewOperationsClient(subscriptionID string) OperationsClient { return original.NewOperationsClient(subscriptionID) @@ -81,11 +110,23 @@ func NewOperationsClient(subscriptionID string) OperationsClient { func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID) } -func NewSpatialAnchorsAccountListIterator(page SpatialAnchorsAccountListPage) SpatialAnchorsAccountListIterator { - return original.NewSpatialAnchorsAccountListIterator(page) +func NewRemoteRenderingAccountPageIterator(page RemoteRenderingAccountPagePage) RemoteRenderingAccountPageIterator { + return original.NewRemoteRenderingAccountPageIterator(page) +} +func NewRemoteRenderingAccountPagePage(getNextPage func(context.Context, RemoteRenderingAccountPage) (RemoteRenderingAccountPage, error)) RemoteRenderingAccountPagePage { + return original.NewRemoteRenderingAccountPagePage(getNextPage) +} +func NewRemoteRenderingAccountsClient(subscriptionID string) RemoteRenderingAccountsClient { + return original.NewRemoteRenderingAccountsClient(subscriptionID) +} +func NewRemoteRenderingAccountsClientWithBaseURI(baseURI string, subscriptionID string) RemoteRenderingAccountsClient { + return original.NewRemoteRenderingAccountsClientWithBaseURI(baseURI, subscriptionID) } -func NewSpatialAnchorsAccountListPage(getNextPage func(context.Context, SpatialAnchorsAccountList) (SpatialAnchorsAccountList, error)) SpatialAnchorsAccountListPage { - return original.NewSpatialAnchorsAccountListPage(getNextPage) +func NewSpatialAnchorsAccountPageIterator(page SpatialAnchorsAccountPagePage) SpatialAnchorsAccountPageIterator { + return original.NewSpatialAnchorsAccountPageIterator(page) +} +func NewSpatialAnchorsAccountPagePage(getNextPage func(context.Context, SpatialAnchorsAccountPage) (SpatialAnchorsAccountPage, error)) SpatialAnchorsAccountPagePage { + return original.NewSpatialAnchorsAccountPagePage(getNextPage) } func NewSpatialAnchorsAccountsClient(subscriptionID string) SpatialAnchorsAccountsClient { return original.NewSpatialAnchorsAccountsClient(subscriptionID) @@ -102,6 +143,12 @@ func PossibleNameAvailabilityValues() []NameAvailability { func PossibleNameUnavailableReasonValues() []NameUnavailableReason { return original.PossibleNameUnavailableReasonValues() } +func PossibleResourceIdentityTypeValues() []ResourceIdentityType { + return original.PossibleResourceIdentityTypeValues() +} +func PossibleSkuTierValues() []SkuTier { + return original.PossibleSkuTierValues() +} func UserAgent() string { return original.UserAgent() + " profiles/preview" } diff --git a/profiles/preview/preview/operationalinsights/mgmt/operationalinsights/models.go b/profiles/preview/preview/operationalinsights/mgmt/operationalinsights/models.go index 1eb754bb6ad2..4bff2c632396 100644 --- a/profiles/preview/preview/operationalinsights/mgmt/operationalinsights/models.go +++ b/profiles/preview/preview/operationalinsights/mgmt/operationalinsights/models.go @@ -22,72 +22,229 @@ package operationalinsights import ( "context" - original "github.com/Azure/azure-sdk-for-go/services/preview/operationalinsights/mgmt/2015-11-01-preview/operationalinsights" + original "github.com/Azure/azure-sdk-for-go/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights" ) const ( DefaultBaseURI = original.DefaultBaseURI ) +type ClusterEntityStatus = original.ClusterEntityStatus + +const ( + Canceled ClusterEntityStatus = original.Canceled + Creating ClusterEntityStatus = original.Creating + Deleting ClusterEntityStatus = original.Deleting + Failed ClusterEntityStatus = original.Failed + ProvisioningAccount ClusterEntityStatus = original.ProvisioningAccount + Succeeded ClusterEntityStatus = original.Succeeded + Updating ClusterEntityStatus = original.Updating +) + +type ClusterSkuNameEnum = original.ClusterSkuNameEnum + +const ( + CapacityReservation ClusterSkuNameEnum = original.CapacityReservation +) + +type DataIngestionStatus = original.DataIngestionStatus + +const ( + ApproachingQuota DataIngestionStatus = original.ApproachingQuota + ForceOff DataIngestionStatus = original.ForceOff + ForceOn DataIngestionStatus = original.ForceOn + OverQuota DataIngestionStatus = original.OverQuota + RespectQuota DataIngestionStatus = original.RespectQuota + SubscriptionSuspended DataIngestionStatus = original.SubscriptionSuspended +) + type DataSourceKind = original.DataSourceKind const ( - AzureActivityLog DataSourceKind = original.AzureActivityLog - ChangeTrackingCustomRegistry DataSourceKind = original.ChangeTrackingCustomRegistry - ChangeTrackingDefaultPath DataSourceKind = original.ChangeTrackingDefaultPath - ChangeTrackingDefaultRegistry DataSourceKind = original.ChangeTrackingDefaultRegistry - ChangeTrackingPath DataSourceKind = original.ChangeTrackingPath - CustomLog DataSourceKind = original.CustomLog - CustomLogCollection DataSourceKind = original.CustomLogCollection - GenericDataSource DataSourceKind = original.GenericDataSource - IISLogs DataSourceKind = original.IISLogs - LinuxPerformanceCollection DataSourceKind = original.LinuxPerformanceCollection - LinuxPerformanceObject DataSourceKind = original.LinuxPerformanceObject - LinuxSyslog DataSourceKind = original.LinuxSyslog - LinuxSyslogCollection DataSourceKind = original.LinuxSyslogCollection - WindowsEvent DataSourceKind = original.WindowsEvent - WindowsPerformanceCounter DataSourceKind = original.WindowsPerformanceCounter + ApplicationInsights DataSourceKind = original.ApplicationInsights + AzureActivityLog DataSourceKind = original.AzureActivityLog + AzureAuditLog DataSourceKind = original.AzureAuditLog + ChangeTrackingContentLocation DataSourceKind = original.ChangeTrackingContentLocation + ChangeTrackingCustomPath DataSourceKind = original.ChangeTrackingCustomPath + ChangeTrackingDataTypeConfiguration DataSourceKind = original.ChangeTrackingDataTypeConfiguration + ChangeTrackingDefaultRegistry DataSourceKind = original.ChangeTrackingDefaultRegistry + ChangeTrackingLinuxPath DataSourceKind = original.ChangeTrackingLinuxPath + ChangeTrackingPath DataSourceKind = original.ChangeTrackingPath + ChangeTrackingRegistry DataSourceKind = original.ChangeTrackingRegistry + ChangeTrackingServices DataSourceKind = original.ChangeTrackingServices + CustomLog DataSourceKind = original.CustomLog + CustomLogCollection DataSourceKind = original.CustomLogCollection + DNSAnalytics DataSourceKind = original.DNSAnalytics + GenericDataSource DataSourceKind = original.GenericDataSource + IISLogs DataSourceKind = original.IISLogs + ImportComputerGroup DataSourceKind = original.ImportComputerGroup + Itsm DataSourceKind = original.Itsm + LinuxChangeTrackingPath DataSourceKind = original.LinuxChangeTrackingPath + LinuxPerformanceCollection DataSourceKind = original.LinuxPerformanceCollection + LinuxPerformanceObject DataSourceKind = original.LinuxPerformanceObject + LinuxSyslog DataSourceKind = original.LinuxSyslog + LinuxSyslogCollection DataSourceKind = original.LinuxSyslogCollection + NetworkMonitoring DataSourceKind = original.NetworkMonitoring + Office365 DataSourceKind = original.Office365 + SecurityCenterSecurityWindowsBaselineConfiguration DataSourceKind = original.SecurityCenterSecurityWindowsBaselineConfiguration + SecurityEventCollectionConfiguration DataSourceKind = original.SecurityEventCollectionConfiguration + SecurityInsightsSecurityEventCollectionConfiguration DataSourceKind = original.SecurityInsightsSecurityEventCollectionConfiguration + SecurityWindowsBaselineConfiguration DataSourceKind = original.SecurityWindowsBaselineConfiguration + SQLDataClassification DataSourceKind = original.SQLDataClassification + WindowsEvent DataSourceKind = original.WindowsEvent + WindowsPerformanceCounter DataSourceKind = original.WindowsPerformanceCounter + WindowsTelemetry DataSourceKind = original.WindowsTelemetry +) + +type DataSourceType = original.DataSourceType + +const ( + AzureWatson DataSourceType = original.AzureWatson + CustomLogs DataSourceType = original.CustomLogs +) + +type IdentityType = original.IdentityType + +const ( + None IdentityType = original.None + SystemAssigned IdentityType = original.SystemAssigned +) + +type LinkedServiceEntityStatus = original.LinkedServiceEntityStatus + +const ( + LinkedServiceEntityStatusDeleting LinkedServiceEntityStatus = original.LinkedServiceEntityStatusDeleting + LinkedServiceEntityStatusProvisioningAccount LinkedServiceEntityStatus = original.LinkedServiceEntityStatusProvisioningAccount + LinkedServiceEntityStatusSucceeded LinkedServiceEntityStatus = original.LinkedServiceEntityStatusSucceeded + LinkedServiceEntityStatusUpdating LinkedServiceEntityStatus = original.LinkedServiceEntityStatusUpdating ) -type EntityStatus = original.EntityStatus +type PublicNetworkAccessType = original.PublicNetworkAccessType const ( - Canceled EntityStatus = original.Canceled - Creating EntityStatus = original.Creating - Deleting EntityStatus = original.Deleting - Failed EntityStatus = original.Failed - ProvisioningAccount EntityStatus = original.ProvisioningAccount - Succeeded EntityStatus = original.Succeeded + Disabled PublicNetworkAccessType = original.Disabled + Enabled PublicNetworkAccessType = original.Enabled +) + +type PurgeState = original.PurgeState + +const ( + Completed PurgeState = original.Completed + Pending PurgeState = original.Pending +) + +type SearchSortEnum = original.SearchSortEnum + +const ( + Asc SearchSortEnum = original.Asc + Desc SearchSortEnum = original.Desc ) type SkuNameEnum = original.SkuNameEnum const ( - CapacityReservation SkuNameEnum = original.CapacityReservation - Free SkuNameEnum = original.Free - PerGB2018 SkuNameEnum = original.PerGB2018 - PerNode SkuNameEnum = original.PerNode - Premium SkuNameEnum = original.Premium - Standalone SkuNameEnum = original.Standalone - Standard SkuNameEnum = original.Standard + SkuNameEnumCapacityReservation SkuNameEnum = original.SkuNameEnumCapacityReservation + SkuNameEnumFree SkuNameEnum = original.SkuNameEnumFree + SkuNameEnumPerGB2018 SkuNameEnum = original.SkuNameEnumPerGB2018 + SkuNameEnumPerNode SkuNameEnum = original.SkuNameEnumPerNode + SkuNameEnumPremium SkuNameEnum = original.SkuNameEnumPremium + SkuNameEnumStandalone SkuNameEnum = original.SkuNameEnumStandalone + SkuNameEnumStandard SkuNameEnum = original.SkuNameEnumStandard +) + +type StorageInsightState = original.StorageInsightState + +const ( + ERROR StorageInsightState = original.ERROR + OK StorageInsightState = original.OK +) + +type Type = original.Type + +const ( + TypeEventHub Type = original.TypeEventHub + TypeStorageAccount Type = original.TypeStorageAccount +) + +type WorkspaceEntityStatus = original.WorkspaceEntityStatus + +const ( + WorkspaceEntityStatusCanceled WorkspaceEntityStatus = original.WorkspaceEntityStatusCanceled + WorkspaceEntityStatusCreating WorkspaceEntityStatus = original.WorkspaceEntityStatusCreating + WorkspaceEntityStatusDeleting WorkspaceEntityStatus = original.WorkspaceEntityStatusDeleting + WorkspaceEntityStatusFailed WorkspaceEntityStatus = original.WorkspaceEntityStatusFailed + WorkspaceEntityStatusProvisioningAccount WorkspaceEntityStatus = original.WorkspaceEntityStatusProvisioningAccount + WorkspaceEntityStatusSucceeded WorkspaceEntityStatus = original.WorkspaceEntityStatusSucceeded + WorkspaceEntityStatusUpdating WorkspaceEntityStatus = original.WorkspaceEntityStatusUpdating +) + +type WorkspaceSkuNameEnum = original.WorkspaceSkuNameEnum + +const ( + WorkspaceSkuNameEnumCapacityReservation WorkspaceSkuNameEnum = original.WorkspaceSkuNameEnumCapacityReservation + WorkspaceSkuNameEnumFree WorkspaceSkuNameEnum = original.WorkspaceSkuNameEnumFree + WorkspaceSkuNameEnumPerGB2018 WorkspaceSkuNameEnum = original.WorkspaceSkuNameEnumPerGB2018 + WorkspaceSkuNameEnumPerNode WorkspaceSkuNameEnum = original.WorkspaceSkuNameEnumPerNode + WorkspaceSkuNameEnumPremium WorkspaceSkuNameEnum = original.WorkspaceSkuNameEnumPremium + WorkspaceSkuNameEnumStandalone WorkspaceSkuNameEnum = original.WorkspaceSkuNameEnumStandalone + WorkspaceSkuNameEnumStandard WorkspaceSkuNameEnum = original.WorkspaceSkuNameEnumStandard ) +type AvailableServiceTier = original.AvailableServiceTier +type AvailableServiceTiersClient = original.AvailableServiceTiersClient +type AzureEntityResource = original.AzureEntityResource type BaseClient = original.BaseClient +type Cluster = original.Cluster +type ClusterErrorResponse = original.ClusterErrorResponse +type ClusterListResult = original.ClusterListResult +type ClusterListResultIterator = original.ClusterListResultIterator +type ClusterListResultPage = original.ClusterListResultPage +type ClusterPatch = original.ClusterPatch +type ClusterPatchProperties = original.ClusterPatchProperties +type ClusterProperties = original.ClusterProperties +type ClusterSku = original.ClusterSku +type ClustersClient = original.ClustersClient +type ClustersCreateOrUpdateFuture = original.ClustersCreateOrUpdateFuture +type ClustersDeleteFuture = original.ClustersDeleteFuture +type CoreSummary = original.CoreSummary +type DataExport = original.DataExport +type DataExportErrorResponse = original.DataExportErrorResponse +type DataExportListResult = original.DataExportListResult +type DataExportProperties = original.DataExportProperties +type DataExportsClient = original.DataExportsClient +type DataExportsCreateOrUpdateFuture = original.DataExportsCreateOrUpdateFuture type DataSource = original.DataSource type DataSourceFilter = original.DataSourceFilter type DataSourceListResult = original.DataSourceListResult type DataSourceListResultIterator = original.DataSourceListResultIterator type DataSourceListResultPage = original.DataSourceListResultPage type DataSourcesClient = original.DataSourcesClient +type DeletedWorkspacesClient = original.DeletedWorkspacesClient +type Destination = original.Destination +type DestinationMetaData = original.DestinationMetaData +type ErrorAdditionalInfo = original.ErrorAdditionalInfo +type ErrorContract = original.ErrorContract type ErrorResponse = original.ErrorResponse +type GatewaysClient = original.GatewaysClient +type Identity = original.Identity type IntelligencePack = original.IntelligencePack +type IntelligencePacksClient = original.IntelligencePacksClient +type KeyVaultProperties = original.KeyVaultProperties type LinkedService = original.LinkedService type LinkedServiceListResult = original.LinkedServiceListResult type LinkedServiceProperties = original.LinkedServiceProperties type LinkedServicesClient = original.LinkedServicesClient +type LinkedServicesCreateOrUpdateFuture = original.LinkedServicesCreateOrUpdateFuture +type LinkedServicesDeleteFuture = original.LinkedServicesDeleteFuture +type LinkedStorageAccountsClient = original.LinkedStorageAccountsClient +type LinkedStorageAccountsListResult = original.LinkedStorageAccountsListResult +type LinkedStorageAccountsProperties = original.LinkedStorageAccountsProperties +type LinkedStorageAccountsResource = original.LinkedStorageAccountsResource +type ListAvailableServiceTier = original.ListAvailableServiceTier type ListIntelligencePack = original.ListIntelligencePack type ManagementGroup = original.ManagementGroup type ManagementGroupProperties = original.ManagementGroupProperties +type ManagementGroupsClient = original.ManagementGroupsClient type MetricName = original.MetricName type Operation = original.Operation type OperationDisplay = original.OperationDisplay @@ -95,23 +252,83 @@ type OperationListResult = original.OperationListResult type OperationListResultIterator = original.OperationListResultIterator type OperationListResultPage = original.OperationListResultPage type OperationStatus = original.OperationStatus +type OperationStatusesClient = original.OperationStatusesClient type OperationsClient = original.OperationsClient +type PrivateLinkScopedResource = original.PrivateLinkScopedResource type ProxyResource = original.ProxyResource type Resource = original.Resource +type SavedSearch = original.SavedSearch +type SavedSearchProperties = original.SavedSearchProperties +type SavedSearchesClient = original.SavedSearchesClient +type SavedSearchesListResult = original.SavedSearchesListResult +type SchemaClient = original.SchemaClient +type SearchGetSchemaResponse = original.SearchGetSchemaResponse +type SearchMetadata = original.SearchMetadata +type SearchMetadataSchema = original.SearchMetadataSchema +type SearchSchemaValue = original.SearchSchemaValue +type SearchSort = original.SearchSort type SharedKeys = original.SharedKeys -type Sku = original.Sku +type SharedKeysClient = original.SharedKeysClient +type StorageAccount = original.StorageAccount +type StorageInsight = original.StorageInsight +type StorageInsightConfigsClient = original.StorageInsightConfigsClient +type StorageInsightListResult = original.StorageInsightListResult +type StorageInsightListResultIterator = original.StorageInsightListResultIterator +type StorageInsightListResultPage = original.StorageInsightListResultPage +type StorageInsightProperties = original.StorageInsightProperties +type StorageInsightStatus = original.StorageInsightStatus +type Table = original.Table +type TableProperties = original.TableProperties +type TablesClient = original.TablesClient +type TablesListResult = original.TablesListResult +type Tag = original.Tag +type TrackedResource = original.TrackedResource type UsageMetric = original.UsageMetric +type UsagesClient = original.UsagesClient type Workspace = original.Workspace +type WorkspaceCapping = original.WorkspaceCapping type WorkspaceListManagementGroupsResult = original.WorkspaceListManagementGroupsResult type WorkspaceListResult = original.WorkspaceListResult type WorkspaceListUsagesResult = original.WorkspaceListUsagesResult +type WorkspacePatch = original.WorkspacePatch type WorkspaceProperties = original.WorkspaceProperties +type WorkspacePurgeBody = original.WorkspacePurgeBody +type WorkspacePurgeBodyFilters = original.WorkspacePurgeBodyFilters +type WorkspacePurgeClient = original.WorkspacePurgeClient +type WorkspacePurgeResponse = original.WorkspacePurgeResponse +type WorkspacePurgeStatusResponse = original.WorkspacePurgeStatusResponse +type WorkspaceSku = original.WorkspaceSku type WorkspacesClient = original.WorkspacesClient type WorkspacesCreateOrUpdateFuture = original.WorkspacesCreateOrUpdateFuture +type WorkspacesDeleteFuture = original.WorkspacesDeleteFuture func New(subscriptionID string) BaseClient { return original.New(subscriptionID) } +func NewAvailableServiceTiersClient(subscriptionID string) AvailableServiceTiersClient { + return original.NewAvailableServiceTiersClient(subscriptionID) +} +func NewAvailableServiceTiersClientWithBaseURI(baseURI string, subscriptionID string) AvailableServiceTiersClient { + return original.NewAvailableServiceTiersClientWithBaseURI(baseURI, subscriptionID) +} +func NewClusterListResultIterator(page ClusterListResultPage) ClusterListResultIterator { + return original.NewClusterListResultIterator(page) +} +func NewClusterListResultPage(getNextPage func(context.Context, ClusterListResult) (ClusterListResult, error)) ClusterListResultPage { + return original.NewClusterListResultPage(getNextPage) +} +func NewClustersClient(subscriptionID string) ClustersClient { + return original.NewClustersClient(subscriptionID) +} +func NewClustersClientWithBaseURI(baseURI string, subscriptionID string) ClustersClient { + return original.NewClustersClientWithBaseURI(baseURI, subscriptionID) +} +func NewDataExportsClient(subscriptionID string) DataExportsClient { + return original.NewDataExportsClient(subscriptionID) +} +func NewDataExportsClientWithBaseURI(baseURI string, subscriptionID string) DataExportsClient { + return original.NewDataExportsClientWithBaseURI(baseURI, subscriptionID) +} func NewDataSourceListResultIterator(page DataSourceListResultPage) DataSourceListResultIterator { return original.NewDataSourceListResultIterator(page) } @@ -124,42 +341,162 @@ func NewDataSourcesClient(subscriptionID string) DataSourcesClient { func NewDataSourcesClientWithBaseURI(baseURI string, subscriptionID string) DataSourcesClient { return original.NewDataSourcesClientWithBaseURI(baseURI, subscriptionID) } +func NewDeletedWorkspacesClient(subscriptionID string) DeletedWorkspacesClient { + return original.NewDeletedWorkspacesClient(subscriptionID) +} +func NewDeletedWorkspacesClientWithBaseURI(baseURI string, subscriptionID string) DeletedWorkspacesClient { + return original.NewDeletedWorkspacesClientWithBaseURI(baseURI, subscriptionID) +} +func NewGatewaysClient(subscriptionID string) GatewaysClient { + return original.NewGatewaysClient(subscriptionID) +} +func NewGatewaysClientWithBaseURI(baseURI string, subscriptionID string) GatewaysClient { + return original.NewGatewaysClientWithBaseURI(baseURI, subscriptionID) +} +func NewIntelligencePacksClient(subscriptionID string) IntelligencePacksClient { + return original.NewIntelligencePacksClient(subscriptionID) +} +func NewIntelligencePacksClientWithBaseURI(baseURI string, subscriptionID string) IntelligencePacksClient { + return original.NewIntelligencePacksClientWithBaseURI(baseURI, subscriptionID) +} func NewLinkedServicesClient(subscriptionID string) LinkedServicesClient { return original.NewLinkedServicesClient(subscriptionID) } func NewLinkedServicesClientWithBaseURI(baseURI string, subscriptionID string) LinkedServicesClient { return original.NewLinkedServicesClientWithBaseURI(baseURI, subscriptionID) } +func NewLinkedStorageAccountsClient(subscriptionID string) LinkedStorageAccountsClient { + return original.NewLinkedStorageAccountsClient(subscriptionID) +} +func NewLinkedStorageAccountsClientWithBaseURI(baseURI string, subscriptionID string) LinkedStorageAccountsClient { + return original.NewLinkedStorageAccountsClientWithBaseURI(baseURI, subscriptionID) +} +func NewManagementGroupsClient(subscriptionID string) ManagementGroupsClient { + return original.NewManagementGroupsClient(subscriptionID) +} +func NewManagementGroupsClientWithBaseURI(baseURI string, subscriptionID string) ManagementGroupsClient { + return original.NewManagementGroupsClientWithBaseURI(baseURI, subscriptionID) +} func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator { return original.NewOperationListResultIterator(page) } func NewOperationListResultPage(getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { return original.NewOperationListResultPage(getNextPage) } +func NewOperationStatusesClient(subscriptionID string) OperationStatusesClient { + return original.NewOperationStatusesClient(subscriptionID) +} +func NewOperationStatusesClientWithBaseURI(baseURI string, subscriptionID string) OperationStatusesClient { + return original.NewOperationStatusesClientWithBaseURI(baseURI, subscriptionID) +} func NewOperationsClient(subscriptionID string) OperationsClient { return original.NewOperationsClient(subscriptionID) } func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID) } +func NewSavedSearchesClient(subscriptionID string) SavedSearchesClient { + return original.NewSavedSearchesClient(subscriptionID) +} +func NewSavedSearchesClientWithBaseURI(baseURI string, subscriptionID string) SavedSearchesClient { + return original.NewSavedSearchesClientWithBaseURI(baseURI, subscriptionID) +} +func NewSchemaClient(subscriptionID string) SchemaClient { + return original.NewSchemaClient(subscriptionID) +} +func NewSchemaClientWithBaseURI(baseURI string, subscriptionID string) SchemaClient { + return original.NewSchemaClientWithBaseURI(baseURI, subscriptionID) +} +func NewSharedKeysClient(subscriptionID string) SharedKeysClient { + return original.NewSharedKeysClient(subscriptionID) +} +func NewSharedKeysClientWithBaseURI(baseURI string, subscriptionID string) SharedKeysClient { + return original.NewSharedKeysClientWithBaseURI(baseURI, subscriptionID) +} +func NewStorageInsightConfigsClient(subscriptionID string) StorageInsightConfigsClient { + return original.NewStorageInsightConfigsClient(subscriptionID) +} +func NewStorageInsightConfigsClientWithBaseURI(baseURI string, subscriptionID string) StorageInsightConfigsClient { + return original.NewStorageInsightConfigsClientWithBaseURI(baseURI, subscriptionID) +} +func NewStorageInsightListResultIterator(page StorageInsightListResultPage) StorageInsightListResultIterator { + return original.NewStorageInsightListResultIterator(page) +} +func NewStorageInsightListResultPage(getNextPage func(context.Context, StorageInsightListResult) (StorageInsightListResult, error)) StorageInsightListResultPage { + return original.NewStorageInsightListResultPage(getNextPage) +} +func NewTablesClient(subscriptionID string) TablesClient { + return original.NewTablesClient(subscriptionID) +} +func NewTablesClientWithBaseURI(baseURI string, subscriptionID string) TablesClient { + return original.NewTablesClientWithBaseURI(baseURI, subscriptionID) +} +func NewUsagesClient(subscriptionID string) UsagesClient { + return original.NewUsagesClient(subscriptionID) +} +func NewUsagesClientWithBaseURI(baseURI string, subscriptionID string) UsagesClient { + return original.NewUsagesClientWithBaseURI(baseURI, subscriptionID) +} func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { return original.NewWithBaseURI(baseURI, subscriptionID) } +func NewWorkspacePurgeClient(subscriptionID string) WorkspacePurgeClient { + return original.NewWorkspacePurgeClient(subscriptionID) +} +func NewWorkspacePurgeClientWithBaseURI(baseURI string, subscriptionID string) WorkspacePurgeClient { + return original.NewWorkspacePurgeClientWithBaseURI(baseURI, subscriptionID) +} func NewWorkspacesClient(subscriptionID string) WorkspacesClient { return original.NewWorkspacesClient(subscriptionID) } func NewWorkspacesClientWithBaseURI(baseURI string, subscriptionID string) WorkspacesClient { return original.NewWorkspacesClientWithBaseURI(baseURI, subscriptionID) } +func PossibleClusterEntityStatusValues() []ClusterEntityStatus { + return original.PossibleClusterEntityStatusValues() +} +func PossibleClusterSkuNameEnumValues() []ClusterSkuNameEnum { + return original.PossibleClusterSkuNameEnumValues() +} +func PossibleDataIngestionStatusValues() []DataIngestionStatus { + return original.PossibleDataIngestionStatusValues() +} func PossibleDataSourceKindValues() []DataSourceKind { return original.PossibleDataSourceKindValues() } -func PossibleEntityStatusValues() []EntityStatus { - return original.PossibleEntityStatusValues() +func PossibleDataSourceTypeValues() []DataSourceType { + return original.PossibleDataSourceTypeValues() +} +func PossibleIdentityTypeValues() []IdentityType { + return original.PossibleIdentityTypeValues() +} +func PossibleLinkedServiceEntityStatusValues() []LinkedServiceEntityStatus { + return original.PossibleLinkedServiceEntityStatusValues() +} +func PossiblePublicNetworkAccessTypeValues() []PublicNetworkAccessType { + return original.PossiblePublicNetworkAccessTypeValues() +} +func PossiblePurgeStateValues() []PurgeState { + return original.PossiblePurgeStateValues() +} +func PossibleSearchSortEnumValues() []SearchSortEnum { + return original.PossibleSearchSortEnumValues() } func PossibleSkuNameEnumValues() []SkuNameEnum { return original.PossibleSkuNameEnumValues() } +func PossibleStorageInsightStateValues() []StorageInsightState { + return original.PossibleStorageInsightStateValues() +} +func PossibleTypeValues() []Type { + return original.PossibleTypeValues() +} +func PossibleWorkspaceEntityStatusValues() []WorkspaceEntityStatus { + return original.PossibleWorkspaceEntityStatusValues() +} +func PossibleWorkspaceSkuNameEnumValues() []WorkspaceSkuNameEnum { + return original.PossibleWorkspaceSkuNameEnumValues() +} func UserAgent() string { return original.UserAgent() + " profiles/preview" } diff --git a/profiles/preview/preview/operationalinsights/mgmt/operationalinsights/operationalinsightsapi/models.go b/profiles/preview/preview/operationalinsights/mgmt/operationalinsights/operationalinsightsapi/models.go index 0a2d04e8e6e8..ce80026f3d00 100644 --- a/profiles/preview/preview/operationalinsights/mgmt/operationalinsights/operationalinsightsapi/models.go +++ b/profiles/preview/preview/operationalinsights/mgmt/operationalinsights/operationalinsightsapi/models.go @@ -19,10 +19,25 @@ package operationalinsightsapi -import original "github.com/Azure/azure-sdk-for-go/services/preview/operationalinsights/mgmt/2015-11-01-preview/operationalinsights/operationalinsightsapi" +import original "github.com/Azure/azure-sdk-for-go/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/operationalinsightsapi" -type BaseClientAPI = original.BaseClientAPI +type AvailableServiceTiersClientAPI = original.AvailableServiceTiersClientAPI +type ClustersClientAPI = original.ClustersClientAPI +type DataExportsClientAPI = original.DataExportsClientAPI type DataSourcesClientAPI = original.DataSourcesClientAPI +type DeletedWorkspacesClientAPI = original.DeletedWorkspacesClientAPI +type GatewaysClientAPI = original.GatewaysClientAPI +type IntelligencePacksClientAPI = original.IntelligencePacksClientAPI type LinkedServicesClientAPI = original.LinkedServicesClientAPI +type LinkedStorageAccountsClientAPI = original.LinkedStorageAccountsClientAPI +type ManagementGroupsClientAPI = original.ManagementGroupsClientAPI +type OperationStatusesClientAPI = original.OperationStatusesClientAPI type OperationsClientAPI = original.OperationsClientAPI +type SavedSearchesClientAPI = original.SavedSearchesClientAPI +type SchemaClientAPI = original.SchemaClientAPI +type SharedKeysClientAPI = original.SharedKeysClientAPI +type StorageInsightConfigsClientAPI = original.StorageInsightConfigsClientAPI +type TablesClientAPI = original.TablesClientAPI +type UsagesClientAPI = original.UsagesClientAPI +type WorkspacePurgeClientAPI = original.WorkspacePurgeClientAPI type WorkspacesClientAPI = original.WorkspacesClientAPI diff --git a/profiles/preview/preview/policyinsights/mgmt/policyinsights/models.go b/profiles/preview/preview/policyinsights/mgmt/policyinsights/models.go index f0b0f248efae..559f78c40a9a 100644 --- a/profiles/preview/preview/policyinsights/mgmt/policyinsights/models.go +++ b/profiles/preview/preview/policyinsights/mgmt/policyinsights/models.go @@ -52,9 +52,13 @@ type PolicyEvaluationDetails = original.PolicyEvaluationDetails type PolicyEvent = original.PolicyEvent type PolicyEventsClient = original.PolicyEventsClient type PolicyEventsQueryResults = original.PolicyEventsQueryResults +type PolicyEventsQueryResultsIterator = original.PolicyEventsQueryResultsIterator +type PolicyEventsQueryResultsPage = original.PolicyEventsQueryResultsPage type PolicyState = original.PolicyState type PolicyStatesClient = original.PolicyStatesClient type PolicyStatesQueryResults = original.PolicyStatesQueryResults +type PolicyStatesQueryResultsIterator = original.PolicyStatesQueryResultsIterator +type PolicyStatesQueryResultsPage = original.PolicyStatesQueryResultsPage type PolicyTrackedResource = original.PolicyTrackedResource type PolicyTrackedResourcesClient = original.PolicyTrackedResourcesClient type PolicyTrackedResourcesQueryResults = original.PolicyTrackedResourcesQueryResults @@ -96,12 +100,24 @@ func NewPolicyEventsClient() PolicyEventsClient { func NewPolicyEventsClientWithBaseURI(baseURI string) PolicyEventsClient { return original.NewPolicyEventsClientWithBaseURI(baseURI) } +func NewPolicyEventsQueryResultsIterator(page PolicyEventsQueryResultsPage) PolicyEventsQueryResultsIterator { + return original.NewPolicyEventsQueryResultsIterator(page) +} +func NewPolicyEventsQueryResultsPage(getNextPage func(context.Context, PolicyEventsQueryResults) (PolicyEventsQueryResults, error)) PolicyEventsQueryResultsPage { + return original.NewPolicyEventsQueryResultsPage(getNextPage) +} func NewPolicyStatesClient() PolicyStatesClient { return original.NewPolicyStatesClient() } func NewPolicyStatesClientWithBaseURI(baseURI string) PolicyStatesClient { return original.NewPolicyStatesClientWithBaseURI(baseURI) } +func NewPolicyStatesQueryResultsIterator(page PolicyStatesQueryResultsPage) PolicyStatesQueryResultsIterator { + return original.NewPolicyStatesQueryResultsIterator(page) +} +func NewPolicyStatesQueryResultsPage(getNextPage func(context.Context, PolicyStatesQueryResults) (PolicyStatesQueryResults, error)) PolicyStatesQueryResultsPage { + return original.NewPolicyStatesQueryResultsPage(getNextPage) +} func NewPolicyTrackedResourcesClient() PolicyTrackedResourcesClient { return original.NewPolicyTrackedResourcesClient() } diff --git a/profiles/preview/preview/reservations/mgmt/reservations/models.go b/profiles/preview/preview/reservations/mgmt/reservations/models.go index 1dbeb6ac26bb..5f2c60b6da98 100644 --- a/profiles/preview/preview/reservations/mgmt/reservations/models.go +++ b/profiles/preview/preview/reservations/mgmt/reservations/models.go @@ -153,6 +153,7 @@ const ( StatusCodeSucceeded StatusCode = original.StatusCodeSucceeded ) +type Actions = original.Actions type AppliedReservationList = original.AppliedReservationList type AppliedReservations = original.AppliedReservations type AppliedReservationsProperties = original.AppliedReservationsProperties @@ -184,9 +185,6 @@ type ListResponse = original.ListResponse type MergeProperties = original.MergeProperties type MergePropertiesType = original.MergePropertiesType type MergeRequest = original.MergeRequest -type OnFailure = original.OnFailure -type OnFailureEmailActions = original.OnFailureEmailActions -type OnFailurePhoneActions = original.OnFailurePhoneActions type OperationClient = original.OperationClient type OperationDisplay = original.OperationDisplay type OperationList = original.OperationList @@ -213,13 +211,12 @@ type PurchaseRequest = original.PurchaseRequest type PurchaseRequestProperties = original.PurchaseRequestProperties type PurchaseRequestPropertiesReservedResourceProperties = original.PurchaseRequestPropertiesReservedResourceProperties type QuotaClient = original.QuotaClient +type QuotaCreateOrUpdateFuture = original.QuotaCreateOrUpdateFuture type QuotaLimits = original.QuotaLimits type QuotaLimitsIterator = original.QuotaLimitsIterator type QuotaLimitsPage = original.QuotaLimitsPage type QuotaLimitsResponse = original.QuotaLimitsResponse type QuotaProperties = original.QuotaProperties -type QuotaRequestClient = original.QuotaRequestClient -type QuotaRequestCreateFuture = original.QuotaRequestCreateFuture type QuotaRequestDetails = original.QuotaRequestDetails type QuotaRequestDetailsList = original.QuotaRequestDetailsList type QuotaRequestDetailsListIterator = original.QuotaRequestDetailsListIterator @@ -227,12 +224,11 @@ type QuotaRequestDetailsListPage = original.QuotaRequestDetailsListPage type QuotaRequestOneResourceProperties = original.QuotaRequestOneResourceProperties type QuotaRequestOneResourceSubmitResponse = original.QuotaRequestOneResourceSubmitResponse type QuotaRequestProperties = original.QuotaRequestProperties +type QuotaRequestStatusClient = original.QuotaRequestStatusClient type QuotaRequestStatusDetails = original.QuotaRequestStatusDetails type QuotaRequestSubmitResponse = original.QuotaRequestSubmitResponse type QuotaRequestSubmitResponse201 = original.QuotaRequestSubmitResponse201 -type QuotaRequestUpdateFuture = original.QuotaRequestUpdateFuture -type QuotaRequestsClient = original.QuotaRequestsClient -type QuotasClient = original.QuotasClient +type QuotaUpdateFuture = original.QuotaUpdateFuture type RenewPropertiesResponse = original.RenewPropertiesResponse type RenewPropertiesResponseBillingCurrencyTotal = original.RenewPropertiesResponseBillingCurrencyTotal type RenewPropertiesResponsePricingCurrencyTotal = original.RenewPropertiesResponsePricingCurrencyTotal @@ -313,29 +309,17 @@ func NewQuotaLimitsIterator(page QuotaLimitsPage) QuotaLimitsIterator { func NewQuotaLimitsPage(getNextPage func(context.Context, QuotaLimits) (QuotaLimits, error)) QuotaLimitsPage { return original.NewQuotaLimitsPage(getNextPage) } -func NewQuotaRequestClient() QuotaRequestClient { - return original.NewQuotaRequestClient() -} -func NewQuotaRequestClientWithBaseURI(baseURI string) QuotaRequestClient { - return original.NewQuotaRequestClientWithBaseURI(baseURI) -} func NewQuotaRequestDetailsListIterator(page QuotaRequestDetailsListPage) QuotaRequestDetailsListIterator { return original.NewQuotaRequestDetailsListIterator(page) } func NewQuotaRequestDetailsListPage(getNextPage func(context.Context, QuotaRequestDetailsList) (QuotaRequestDetailsList, error)) QuotaRequestDetailsListPage { return original.NewQuotaRequestDetailsListPage(getNextPage) } -func NewQuotaRequestsClient() QuotaRequestsClient { - return original.NewQuotaRequestsClient() -} -func NewQuotaRequestsClientWithBaseURI(baseURI string) QuotaRequestsClient { - return original.NewQuotaRequestsClientWithBaseURI(baseURI) -} -func NewQuotasClient() QuotasClient { - return original.NewQuotasClient() +func NewQuotaRequestStatusClient() QuotaRequestStatusClient { + return original.NewQuotaRequestStatusClient() } -func NewQuotasClientWithBaseURI(baseURI string) QuotasClient { - return original.NewQuotasClientWithBaseURI(baseURI) +func NewQuotaRequestStatusClientWithBaseURI(baseURI string) QuotaRequestStatusClient { + return original.NewQuotaRequestStatusClientWithBaseURI(baseURI) } func NewWithBaseURI(baseURI string) BaseClient { return original.NewWithBaseURI(baseURI) diff --git a/profiles/preview/preview/reservations/mgmt/reservations/reservationsapi/models.go b/profiles/preview/preview/reservations/mgmt/reservations/reservationsapi/models.go index bb33ca67529f..fd423c0c43cf 100644 --- a/profiles/preview/preview/reservations/mgmt/reservations/reservationsapi/models.go +++ b/profiles/preview/preview/reservations/mgmt/reservations/reservationsapi/models.go @@ -27,6 +27,4 @@ type ClientAPI = original.ClientAPI type OperationClientAPI = original.OperationClientAPI type OrderClientAPI = original.OrderClientAPI type QuotaClientAPI = original.QuotaClientAPI -type QuotaRequestClientAPI = original.QuotaRequestClientAPI -type QuotaRequestsClientAPI = original.QuotaRequestsClientAPI -type QuotasClientAPI = original.QuotasClientAPI +type QuotaRequestStatusClientAPI = original.QuotaRequestStatusClientAPI diff --git a/profiles/preview/preview/security/mgmt/security/models.go b/profiles/preview/preview/security/mgmt/security/models.go index b6de085578ec..5807740e2682 100644 --- a/profiles/preview/preview/security/mgmt/security/models.go +++ b/profiles/preview/preview/security/mgmt/security/models.go @@ -148,6 +148,13 @@ const ( Internal ConnectionType = original.Internal ) +type ControlType = original.ControlType + +const ( + ControlTypeBuiltIn ControlType = original.ControlTypeBuiltIn + ControlTypeCustom ControlType = original.ControlTypeCustom +) + type DataSource = original.DataSource const ( @@ -200,6 +207,12 @@ const ( ExecutableNone Executable = original.ExecutableNone ) +type ExpandControlsEnum = original.ExpandControlsEnum + +const ( + Definition ExpandControlsEnum = original.Definition +) + type ExpandEnum = original.ExpandEnum const ( @@ -263,10 +276,18 @@ const ( type KindEnum = original.KindEnum const ( - KindAAD KindEnum = original.KindAAD - KindATA KindEnum = original.KindATA - KindCEF KindEnum = original.KindCEF - KindExternalSecuritySolution KindEnum = original.KindExternalSecuritySolution + KindDataExportSettings KindEnum = original.KindDataExportSettings + KindSetting KindEnum = original.KindSetting + KindSettingResource KindEnum = original.KindSettingResource +) + +type KindEnum1 = original.KindEnum1 + +const ( + KindAAD KindEnum1 = original.KindAAD + KindATA KindEnum1 = original.KindATA + KindCEF KindEnum1 = original.KindCEF + KindExternalSecuritySolution KindEnum1 = original.KindExternalSecuritySolution ) type Msi = original.Msi @@ -406,6 +427,14 @@ const ( ResourceStatusOffByPolicy ResourceStatus = original.ResourceStatusOffByPolicy ) +type RuleState = original.RuleState + +const ( + RuleStateDisabled RuleState = original.RuleStateDisabled + RuleStateEnabled RuleState = original.RuleStateEnabled + RuleStateExpired RuleState = original.RuleStateExpired +) + type RuleType = original.RuleType const ( @@ -444,13 +473,6 @@ const ( ScriptNone Script = original.ScriptNone ) -type SettingKind = original.SettingKind - -const ( - SettingKindAlertSuppressionSetting SettingKind = original.SettingKindAlertSuppressionSetting - SettingKindDataExportSetting SettingKind = original.SettingKindDataExportSetting -) - type Severity = original.Severity const ( @@ -594,6 +616,12 @@ type AlertListIterator = original.AlertListIterator type AlertListPage = original.AlertListPage type AlertProperties = original.AlertProperties type AlertsClient = original.AlertsClient +type AlertsSuppressionRule = original.AlertsSuppressionRule +type AlertsSuppressionRuleProperties = original.AlertsSuppressionRuleProperties +type AlertsSuppressionRulesClient = original.AlertsSuppressionRulesClient +type AlertsSuppressionRulesList = original.AlertsSuppressionRulesList +type AlertsSuppressionRulesListIterator = original.AlertsSuppressionRulesListIterator +type AlertsSuppressionRulesListPage = original.AlertsSuppressionRulesListPage type AllowedConnectionsClient = original.AllowedConnectionsClient type AllowedConnectionsList = original.AllowedConnectionsList type AllowedConnectionsListIterator = original.AllowedConnectionsListIterator @@ -652,6 +680,7 @@ type AutomationTriggeringRule = original.AutomationTriggeringRule type AutomationValidationStatus = original.AutomationValidationStatus type AutomationsClient = original.AutomationsClient type AzureResourceDetails = original.AzureResourceDetails +type AzureResourceLink = original.AzureResourceLink type BaseClient = original.BaseClient type BasicAdditionalData = original.BasicAdditionalData type BasicAllowlistCustomAlertRule = original.BasicAllowlistCustomAlertRule @@ -660,6 +689,8 @@ type BasicCustomAlertRule = original.BasicCustomAlertRule type BasicExternalSecuritySolution = original.BasicExternalSecuritySolution type BasicListCustomAlertRule = original.BasicListCustomAlertRule type BasicResourceDetails = original.BasicResourceDetails +type BasicSetting = original.BasicSetting +type BasicSettingResource = original.BasicSettingResource type BasicThresholdCustomAlertRule = original.BasicThresholdCustomAlertRule type BasicTimeWindowCustomAlertRule = original.BasicTimeWindowCustomAlertRule type CVE = original.CVE @@ -693,8 +724,8 @@ type ContactProperties = original.ContactProperties type ContactsClient = original.ContactsClient type ContainerRegistryVulnerabilityProperties = original.ContainerRegistryVulnerabilityProperties type CustomAlertRule = original.CustomAlertRule -type DataExportSetting = original.DataExportSetting type DataExportSettingProperties = original.DataExportSettingProperties +type DataExportSettings = original.DataExportSettings type DenylistCustomAlertRule = original.DenylistCustomAlertRule type DeviceSecurityGroup = original.DeviceSecurityGroup type DeviceSecurityGroupList = original.DeviceSecurityGroupList @@ -821,6 +852,28 @@ type Resource = original.Resource type ResourceDetails = original.ResourceDetails type Rule = original.Rule type SQLServerVulnerabilityProperties = original.SQLServerVulnerabilityProperties +type ScopeElement = original.ScopeElement +type ScoreDetails = original.ScoreDetails +type SecureScoreControlDefinitionItem = original.SecureScoreControlDefinitionItem +type SecureScoreControlDefinitionItemProperties = original.SecureScoreControlDefinitionItemProperties +type SecureScoreControlDefinitionList = original.SecureScoreControlDefinitionList +type SecureScoreControlDefinitionListIterator = original.SecureScoreControlDefinitionListIterator +type SecureScoreControlDefinitionListPage = original.SecureScoreControlDefinitionListPage +type SecureScoreControlDefinitionSource = original.SecureScoreControlDefinitionSource +type SecureScoreControlDefinitionsClient = original.SecureScoreControlDefinitionsClient +type SecureScoreControlDetails = original.SecureScoreControlDetails +type SecureScoreControlList = original.SecureScoreControlList +type SecureScoreControlListIterator = original.SecureScoreControlListIterator +type SecureScoreControlListPage = original.SecureScoreControlListPage +type SecureScoreControlScore = original.SecureScoreControlScore +type SecureScoreControlScoreDetails = original.SecureScoreControlScoreDetails +type SecureScoreControlsClient = original.SecureScoreControlsClient +type SecureScoreItem = original.SecureScoreItem +type SecureScoreItemProperties = original.SecureScoreItemProperties +type SecureScoresClient = original.SecureScoresClient +type SecureScoresList = original.SecureScoresList +type SecureScoresListIterator = original.SecureScoresListIterator +type SecureScoresListPage = original.SecureScoresListPage type SensitivityLabel = original.SensitivityLabel type ServerVulnerabilityAssessment = original.ServerVulnerabilityAssessment type ServerVulnerabilityAssessmentClient = original.ServerVulnerabilityAssessmentClient @@ -840,6 +893,7 @@ type SubAssessmentListPage = original.SubAssessmentListPage type SubAssessmentProperties = original.SubAssessmentProperties type SubAssessmentStatus = original.SubAssessmentStatus type SubAssessmentsClient = original.SubAssessmentsClient +type SuppressionAlertsScope = original.SuppressionAlertsScope type Tags = original.Tags type TagsResource = original.TagsResource type Task = original.Task @@ -915,6 +969,18 @@ func NewAlertsClient(subscriptionID string, ascLocation string) AlertsClient { func NewAlertsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) AlertsClient { return original.NewAlertsClientWithBaseURI(baseURI, subscriptionID, ascLocation) } +func NewAlertsSuppressionRulesClient(subscriptionID string, ascLocation string) AlertsSuppressionRulesClient { + return original.NewAlertsSuppressionRulesClient(subscriptionID, ascLocation) +} +func NewAlertsSuppressionRulesClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) AlertsSuppressionRulesClient { + return original.NewAlertsSuppressionRulesClientWithBaseURI(baseURI, subscriptionID, ascLocation) +} +func NewAlertsSuppressionRulesListIterator(page AlertsSuppressionRulesListPage) AlertsSuppressionRulesListIterator { + return original.NewAlertsSuppressionRulesListIterator(page) +} +func NewAlertsSuppressionRulesListPage(getNextPage func(context.Context, AlertsSuppressionRulesList) (AlertsSuppressionRulesList, error)) AlertsSuppressionRulesListPage { + return original.NewAlertsSuppressionRulesListPage(getNextPage) +} func NewAllowedConnectionsClient(subscriptionID string, ascLocation string) AllowedConnectionsClient { return original.NewAllowedConnectionsClient(subscriptionID, ascLocation) } @@ -1179,6 +1245,42 @@ func NewRegulatoryComplianceStandardsClient(subscriptionID string, ascLocation s func NewRegulatoryComplianceStandardsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) RegulatoryComplianceStandardsClient { return original.NewRegulatoryComplianceStandardsClientWithBaseURI(baseURI, subscriptionID, ascLocation) } +func NewSecureScoreControlDefinitionListIterator(page SecureScoreControlDefinitionListPage) SecureScoreControlDefinitionListIterator { + return original.NewSecureScoreControlDefinitionListIterator(page) +} +func NewSecureScoreControlDefinitionListPage(getNextPage func(context.Context, SecureScoreControlDefinitionList) (SecureScoreControlDefinitionList, error)) SecureScoreControlDefinitionListPage { + return original.NewSecureScoreControlDefinitionListPage(getNextPage) +} +func NewSecureScoreControlDefinitionsClient(subscriptionID string, ascLocation string) SecureScoreControlDefinitionsClient { + return original.NewSecureScoreControlDefinitionsClient(subscriptionID, ascLocation) +} +func NewSecureScoreControlDefinitionsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) SecureScoreControlDefinitionsClient { + return original.NewSecureScoreControlDefinitionsClientWithBaseURI(baseURI, subscriptionID, ascLocation) +} +func NewSecureScoreControlListIterator(page SecureScoreControlListPage) SecureScoreControlListIterator { + return original.NewSecureScoreControlListIterator(page) +} +func NewSecureScoreControlListPage(getNextPage func(context.Context, SecureScoreControlList) (SecureScoreControlList, error)) SecureScoreControlListPage { + return original.NewSecureScoreControlListPage(getNextPage) +} +func NewSecureScoreControlsClient(subscriptionID string, ascLocation string) SecureScoreControlsClient { + return original.NewSecureScoreControlsClient(subscriptionID, ascLocation) +} +func NewSecureScoreControlsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) SecureScoreControlsClient { + return original.NewSecureScoreControlsClientWithBaseURI(baseURI, subscriptionID, ascLocation) +} +func NewSecureScoresClient(subscriptionID string, ascLocation string) SecureScoresClient { + return original.NewSecureScoresClient(subscriptionID, ascLocation) +} +func NewSecureScoresClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) SecureScoresClient { + return original.NewSecureScoresClientWithBaseURI(baseURI, subscriptionID, ascLocation) +} +func NewSecureScoresListIterator(page SecureScoresListPage) SecureScoresListIterator { + return original.NewSecureScoresListIterator(page) +} +func NewSecureScoresListPage(getNextPage func(context.Context, SecureScoresList) (SecureScoresList, error)) SecureScoresListPage { + return original.NewSecureScoresListPage(getNextPage) +} func NewServerVulnerabilityAssessmentClient(subscriptionID string, ascLocation string) ServerVulnerabilityAssessmentClient { return original.NewServerVulnerabilityAssessmentClient(subscriptionID, ascLocation) } @@ -1290,6 +1392,9 @@ func PossibleConfigurationStatusValues() []ConfigurationStatus { func PossibleConnectionTypeValues() []ConnectionType { return original.PossibleConnectionTypeValues() } +func PossibleControlTypeValues() []ControlType { + return original.PossibleControlTypeValues() +} func PossibleDataSourceValues() []DataSource { return original.PossibleDataSourceValues() } @@ -1311,6 +1416,9 @@ func PossibleExeValues() []Exe { func PossibleExecutableValues() []Executable { return original.PossibleExecutableValues() } +func PossibleExpandControlsEnumValues() []ExpandControlsEnum { + return original.PossibleExpandControlsEnumValues() +} func PossibleExpandEnumValues() []ExpandEnum { return original.PossibleExpandEnumValues() } @@ -1332,6 +1440,9 @@ func PossibleImplementationEffortValues() []ImplementationEffort { func PossibleIssueValues() []Issue { return original.PossibleIssueValues() } +func PossibleKindEnum1Values() []KindEnum1 { + return original.PossibleKindEnum1Values() +} func PossibleKindEnumValues() []KindEnum { return original.PossibleKindEnumValues() } @@ -1377,15 +1488,15 @@ func PossibleReportedSeverityValues() []ReportedSeverity { func PossibleResourceStatusValues() []ResourceStatus { return original.PossibleResourceStatusValues() } +func PossibleRuleStateValues() []RuleState { + return original.PossibleRuleStateValues() +} func PossibleRuleTypeValues() []RuleType { return original.PossibleRuleTypeValues() } func PossibleScriptValues() []Script { return original.PossibleScriptValues() } -func PossibleSettingKindValues() []SettingKind { - return original.PossibleSettingKindValues() -} func PossibleSeverityValues() []Severity { return original.PossibleSeverityValues() } diff --git a/profiles/preview/preview/security/mgmt/security/securityapi/models.go b/profiles/preview/preview/security/mgmt/security/securityapi/models.go index bfb8fb4d21cf..2e2d9b02a659 100644 --- a/profiles/preview/preview/security/mgmt/security/securityapi/models.go +++ b/profiles/preview/preview/security/mgmt/security/securityapi/models.go @@ -25,6 +25,7 @@ type AdaptiveApplicationControlsClientAPI = original.AdaptiveApplicationControls type AdaptiveNetworkHardeningsClientAPI = original.AdaptiveNetworkHardeningsClientAPI type AdvancedThreatProtectionClientAPI = original.AdvancedThreatProtectionClientAPI type AlertsClientAPI = original.AlertsClientAPI +type AlertsSuppressionRulesClientAPI = original.AlertsSuppressionRulesClientAPI type AllowedConnectionsClientAPI = original.AllowedConnectionsClientAPI type AssessmentsClientAPI = original.AssessmentsClientAPI type AssessmentsMetadataClientAPI = original.AssessmentsMetadataClientAPI @@ -48,6 +49,9 @@ type PricingsClientAPI = original.PricingsClientAPI type RegulatoryComplianceAssessmentsClientAPI = original.RegulatoryComplianceAssessmentsClientAPI type RegulatoryComplianceControlsClientAPI = original.RegulatoryComplianceControlsClientAPI type RegulatoryComplianceStandardsClientAPI = original.RegulatoryComplianceStandardsClientAPI +type SecureScoreControlDefinitionsClientAPI = original.SecureScoreControlDefinitionsClientAPI +type SecureScoreControlsClientAPI = original.SecureScoreControlsClientAPI +type SecureScoresClientAPI = original.SecureScoresClientAPI type ServerVulnerabilityAssessmentClientAPI = original.ServerVulnerabilityAssessmentClientAPI type SettingsClientAPI = original.SettingsClientAPI type SubAssessmentsClientAPI = original.SubAssessmentsClientAPI diff --git a/profiles/preview/preview/securityinsight/mgmt/securityinsight/models.go b/profiles/preview/preview/securityinsight/mgmt/securityinsight/models.go index a154f7be116b..3e09e5352066 100644 --- a/profiles/preview/preview/securityinsight/mgmt/securityinsight/models.go +++ b/profiles/preview/preview/securityinsight/mgmt/securityinsight/models.go @@ -374,16 +374,8 @@ const ( type KindBasicSettings = original.KindBasicSettings const ( - KindSettings KindBasicSettings = original.KindSettings - KindToggleSettings KindBasicSettings = original.KindToggleSettings - KindUebaSettings KindBasicSettings = original.KindUebaSettings -) - -type LicenseStatus = original.LicenseStatus - -const ( - LicenseStatusDisabled LicenseStatus = original.LicenseStatusDisabled - LicenseStatusEnabled LicenseStatus = original.LicenseStatusEnabled + KindEyesOn KindBasicSettings = original.KindEyesOn + KindSettings KindBasicSettings = original.KindSettings ) type MicrosoftSecurityProductName = original.MicrosoftSecurityProductName @@ -446,20 +438,6 @@ const ( CasesToBookmarks RelationTypes = original.CasesToBookmarks ) -type SettingKind = original.SettingKind - -const ( - SettingKindToggleSettings SettingKind = original.SettingKindToggleSettings - SettingKindUebaSettings SettingKind = original.SettingKindUebaSettings -) - -type StatusInMcas = original.StatusInMcas - -const ( - StatusInMcasDisabled StatusInMcas = original.StatusInMcasDisabled - StatusInMcasEnabled StatusInMcas = original.StatusInMcasEnabled -) - type TemplateStatus = original.TemplateStatus const ( @@ -544,11 +522,6 @@ type BookmarkList = original.BookmarkList type BookmarkListIterator = original.BookmarkListIterator type BookmarkListPage = original.BookmarkListPage type BookmarkProperties = original.BookmarkProperties -type BookmarkRelation = original.BookmarkRelation -type BookmarkRelationList = original.BookmarkRelationList -type BookmarkRelationListIterator = original.BookmarkRelationListIterator -type BookmarkRelationListPage = original.BookmarkRelationListPage -type BookmarkRelationProperties = original.BookmarkRelationProperties type BookmarkRelationsClient = original.BookmarkRelationsClient type BookmarksClient = original.BookmarksClient type Case = original.Case @@ -616,6 +589,8 @@ type EntityQueryProperties = original.EntityQueryProperties type EntityRelationsClient = original.EntityRelationsClient type ExpansionResultAggregation = original.ExpansionResultAggregation type ExpansionResultsMetadata = original.ExpansionResultsMetadata +type EyesOn = original.EyesOn +type EyesOnSettingsProperties = original.EyesOnSettingsProperties type FileEntity = original.FileEntity type FileEntityProperties = original.FileEntityProperties type FileHashEntity = original.FileHashEntity @@ -712,6 +687,7 @@ type SecurityAlertProperties = original.SecurityAlertProperties type SecurityAlertPropertiesConfidenceReasonsItem = original.SecurityAlertPropertiesConfidenceReasonsItem type SecurityGroupEntity = original.SecurityGroupEntity type SecurityGroupEntityProperties = original.SecurityGroupEntityProperties +type SettingList = original.SettingList type Settings = original.Settings type SettingsKind = original.SettingsKind type SettingsModel = original.SettingsModel @@ -728,12 +704,8 @@ type TiTaxiiDataConnector = original.TiTaxiiDataConnector type TiTaxiiDataConnectorDataTypes = original.TiTaxiiDataConnectorDataTypes type TiTaxiiDataConnectorDataTypesTaxiiClient = original.TiTaxiiDataConnectorDataTypesTaxiiClient type TiTaxiiDataConnectorProperties = original.TiTaxiiDataConnectorProperties -type ToggleSettings = original.ToggleSettings -type ToggleSettingsProperties = original.ToggleSettingsProperties type URLEntity = original.URLEntity type URLEntityProperties = original.URLEntityProperties -type UebaSettings = original.UebaSettings -type UebaSettingsProperties = original.UebaSettingsProperties type UserInfo = original.UserInfo func New(subscriptionID string) BaseClient { @@ -787,12 +759,6 @@ func NewBookmarkListIterator(page BookmarkListPage) BookmarkListIterator { func NewBookmarkListPage(getNextPage func(context.Context, BookmarkList) (BookmarkList, error)) BookmarkListPage { return original.NewBookmarkListPage(getNextPage) } -func NewBookmarkRelationListIterator(page BookmarkRelationListPage) BookmarkRelationListIterator { - return original.NewBookmarkRelationListIterator(page) -} -func NewBookmarkRelationListPage(getNextPage func(context.Context, BookmarkRelationList) (BookmarkRelationList, error)) BookmarkRelationListPage { - return original.NewBookmarkRelationListPage(getNextPage) -} func NewBookmarkRelationsClient(subscriptionID string) BookmarkRelationsClient { return original.NewBookmarkRelationsClient(subscriptionID) } @@ -1072,9 +1038,6 @@ func PossibleKindBasicSettingsValues() []KindBasicSettings { func PossibleKindValues() []Kind { return original.PossibleKindValues() } -func PossibleLicenseStatusValues() []LicenseStatus { - return original.PossibleLicenseStatusValues() -} func PossibleMicrosoftSecurityProductNameValues() []MicrosoftSecurityProductName { return original.PossibleMicrosoftSecurityProductNameValues() } @@ -1093,12 +1056,6 @@ func PossibleRelationNodeKindValues() []RelationNodeKind { func PossibleRelationTypesValues() []RelationTypes { return original.PossibleRelationTypesValues() } -func PossibleSettingKindValues() []SettingKind { - return original.PossibleSettingKindValues() -} -func PossibleStatusInMcasValues() []StatusInMcas { - return original.PossibleStatusInMcasValues() -} func PossibleTemplateStatusValues() []TemplateStatus { return original.PossibleTemplateStatusValues() } diff --git a/profiles/preview/preview/synapse/mgmt/synapse/models.go b/profiles/preview/preview/synapse/mgmt/synapse/models.go index 488a78741d00..93595f23628b 100644 --- a/profiles/preview/preview/synapse/mgmt/synapse/models.go +++ b/profiles/preview/preview/synapse/mgmt/synapse/models.go @@ -252,6 +252,13 @@ const ( ProvisioningStateSucceeded ProvisioningState = original.ProvisioningStateSucceeded ) +type ProvisioningState1 = original.ProvisioningState1 + +const ( + ProvisioningState1Failed ProvisioningState1 = original.ProvisioningState1Failed + ProvisioningState1Succeeded ProvisioningState1 = original.ProvisioningState1Succeeded +) + type QueryAggregationFunction = original.QueryAggregationFunction const ( @@ -550,6 +557,13 @@ type PrivateEndpointConnectionProperties = original.PrivateEndpointConnectionPro type PrivateEndpointConnectionsClient = original.PrivateEndpointConnectionsClient type PrivateEndpointConnectionsCreateFuture = original.PrivateEndpointConnectionsCreateFuture type PrivateEndpointConnectionsDeleteFuture = original.PrivateEndpointConnectionsDeleteFuture +type PrivateLinkHub = original.PrivateLinkHub +type PrivateLinkHubInfoListResult = original.PrivateLinkHubInfoListResult +type PrivateLinkHubInfoListResultIterator = original.PrivateLinkHubInfoListResultIterator +type PrivateLinkHubInfoListResultPage = original.PrivateLinkHubInfoListResultPage +type PrivateLinkHubPatchInfo = original.PrivateLinkHubPatchInfo +type PrivateLinkHubProperties = original.PrivateLinkHubProperties +type PrivateLinkHubsClient = original.PrivateLinkHubsClient type PrivateLinkResource = original.PrivateLinkResource type PrivateLinkResourceListResult = original.PrivateLinkResourceListResult type PrivateLinkResourceListResultIterator = original.PrivateLinkResourceListResultIterator @@ -807,6 +821,18 @@ func NewPrivateEndpointConnectionsClient(subscriptionID string) PrivateEndpointC func NewPrivateEndpointConnectionsClientWithBaseURI(baseURI string, subscriptionID string) PrivateEndpointConnectionsClient { return original.NewPrivateEndpointConnectionsClientWithBaseURI(baseURI, subscriptionID) } +func NewPrivateLinkHubInfoListResultIterator(page PrivateLinkHubInfoListResultPage) PrivateLinkHubInfoListResultIterator { + return original.NewPrivateLinkHubInfoListResultIterator(page) +} +func NewPrivateLinkHubInfoListResultPage(getNextPage func(context.Context, PrivateLinkHubInfoListResult) (PrivateLinkHubInfoListResult, error)) PrivateLinkHubInfoListResultPage { + return original.NewPrivateLinkHubInfoListResultPage(getNextPage) +} +func NewPrivateLinkHubsClient(subscriptionID string) PrivateLinkHubsClient { + return original.NewPrivateLinkHubsClient(subscriptionID) +} +func NewPrivateLinkHubsClientWithBaseURI(baseURI string, subscriptionID string) PrivateLinkHubsClient { + return original.NewPrivateLinkHubsClientWithBaseURI(baseURI, subscriptionID) +} func NewPrivateLinkResourceListResultIterator(page PrivateLinkResourceListResultPage) PrivateLinkResourceListResultIterator { return original.NewPrivateLinkResourceListResultIterator(page) } @@ -1098,6 +1124,9 @@ func PossibleNodeSizeValues() []NodeSize { func PossibleOperationStatusValues() []OperationStatus { return original.PossibleOperationStatusValues() } +func PossibleProvisioningState1Values() []ProvisioningState1 { + return original.PossibleProvisioningState1Values() +} func PossibleProvisioningStateValues() []ProvisioningState { return original.PossibleProvisioningStateValues() } diff --git a/profiles/preview/preview/synapse/mgmt/synapse/synapseapi/models.go b/profiles/preview/preview/synapse/mgmt/synapse/synapseapi/models.go index 37925cdeb4c9..fabc9cffb5ce 100644 --- a/profiles/preview/preview/synapse/mgmt/synapse/synapseapi/models.go +++ b/profiles/preview/preview/synapse/mgmt/synapse/synapseapi/models.go @@ -34,6 +34,7 @@ type IntegrationRuntimeStatusClientAPI = original.IntegrationRuntimeStatusClient type IntegrationRuntimesClientAPI = original.IntegrationRuntimesClientAPI type OperationsClientAPI = original.OperationsClientAPI type PrivateEndpointConnectionsClientAPI = original.PrivateEndpointConnectionsClientAPI +type PrivateLinkHubsClientAPI = original.PrivateLinkHubsClientAPI type PrivateLinkResourcesClientAPI = original.PrivateLinkResourcesClientAPI type SQLPoolBlobAuditingPoliciesClientAPI = original.SQLPoolBlobAuditingPoliciesClientAPI type SQLPoolConnectionPoliciesClientAPI = original.SQLPoolConnectionPoliciesClientAPI diff --git a/profiles/preview/preview/timeseriesinsights/mgmt/timeseriesinsights/models.go b/profiles/preview/preview/timeseriesinsights/mgmt/timeseriesinsights/models.go index 0b2611201e82..baa404c7c327 100644 --- a/profiles/preview/preview/timeseriesinsights/mgmt/timeseriesinsights/models.go +++ b/profiles/preview/preview/timeseriesinsights/mgmt/timeseriesinsights/models.go @@ -82,15 +82,13 @@ type KindBasicEventSourceResource = original.KindBasicEventSourceResource const ( KindBasicEventSourceResourceKindEventSourceResource KindBasicEventSourceResource = original.KindBasicEventSourceResourceKindEventSourceResource KindBasicEventSourceResourceKindMicrosoftEventHub KindBasicEventSourceResource = original.KindBasicEventSourceResourceKindMicrosoftEventHub - KindBasicEventSourceResourceKindMicrosoftIotHub KindBasicEventSourceResource = original.KindBasicEventSourceResourceKindMicrosoftIotHub + KindBasicEventSourceResourceKindMicrosoftIoTHub KindBasicEventSourceResource = original.KindBasicEventSourceResourceKindMicrosoftIoTHub ) type LocalTimestampFormat = original.LocalTimestampFormat const ( Embedded LocalTimestampFormat = original.Embedded - Iana LocalTimestampFormat = original.Iana - TimeSpan LocalTimestampFormat = original.TimeSpan ) type PropertyType = original.PropertyType diff --git a/profiles/preview/recoveryservices/mgmt/siterecovery/models.go b/profiles/preview/recoveryservices/mgmt/siterecovery/models.go index 50e9085e0d2c..c0b717d15c1f 100644 --- a/profiles/preview/recoveryservices/mgmt/siterecovery/models.go +++ b/profiles/preview/recoveryservices/mgmt/siterecovery/models.go @@ -361,8 +361,8 @@ const ( type InstanceTypeBasicRecoveryPlanProviderSpecificDetails = original.InstanceTypeBasicRecoveryPlanProviderSpecificDetails const ( - InstanceTypeRecoveryPlanA2ADetails InstanceTypeBasicRecoveryPlanProviderSpecificDetails = original.InstanceTypeRecoveryPlanA2ADetails - InstanceTypeRecoveryPlanProviderSpecificDetails InstanceTypeBasicRecoveryPlanProviderSpecificDetails = original.InstanceTypeRecoveryPlanProviderSpecificDetails + InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A InstanceTypeBasicRecoveryPlanProviderSpecificDetails = original.InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A + InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeRecoveryPlanProviderSpecificDetails InstanceTypeBasicRecoveryPlanProviderSpecificDetails = original.InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeRecoveryPlanProviderSpecificDetails ) type InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput = original.InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput diff --git a/profiles/preview/signalr/mgmt/signalr/models.go b/profiles/preview/signalr/mgmt/signalr/models.go index 21c1c9f23341..9e2b60bc1013 100644 --- a/profiles/preview/signalr/mgmt/signalr/models.go +++ b/profiles/preview/signalr/mgmt/signalr/models.go @@ -22,17 +22,25 @@ package signalr import ( "context" - original "github.com/Azure/azure-sdk-for-go/services/signalr/mgmt/2018-10-01/signalr" + original "github.com/Azure/azure-sdk-for-go/services/signalr/mgmt/2020-05-01/signalr" ) const ( DefaultBaseURI = original.DefaultBaseURI ) +type ACLAction = original.ACLAction + +const ( + Allow ACLAction = original.Allow + Deny ACLAction = original.Deny +) + type FeatureFlags = original.FeatureFlags const ( EnableConnectivityLogs FeatureFlags = original.EnableConnectivityLogs + EnableMessagingLogs FeatureFlags = original.EnableMessagingLogs ServiceMode FeatureFlags = original.ServiceMode ) @@ -43,6 +51,15 @@ const ( Secondary KeyType = original.Secondary ) +type PrivateLinkServiceConnectionStatus = original.PrivateLinkServiceConnectionStatus + +const ( + Approved PrivateLinkServiceConnectionStatus = original.Approved + Disconnected PrivateLinkServiceConnectionStatus = original.Disconnected + Pending PrivateLinkServiceConnectionStatus = original.Pending + Rejected PrivateLinkServiceConnectionStatus = original.Rejected +) + type ProvisioningState = original.ProvisioningState const ( @@ -57,6 +74,21 @@ const ( Updating ProvisioningState = original.Updating ) +type RequestType = original.RequestType + +const ( + ClientConnection RequestType = original.ClientConnection + RESTAPI RequestType = original.RESTAPI + ServerConnection RequestType = original.ServerConnection +) + +type ServiceKind = original.ServiceKind + +const ( + RawWebSockets ServiceKind = original.RawWebSockets + SignalR ServiceKind = original.SignalR +) + type SkuTier = original.SkuTier const ( @@ -71,7 +103,6 @@ type Client = original.Client type CorsSettings = original.CorsSettings type CreateOrUpdateFuture = original.CreateOrUpdateFuture type CreateOrUpdateProperties = original.CreateOrUpdateProperties -type CreateParameters = original.CreateParameters type DeleteFuture = original.DeleteFuture type Dimension = original.Dimension type ErrorResponse = original.ErrorResponse @@ -82,6 +113,8 @@ type LogSpecification = original.LogSpecification type MetricSpecification = original.MetricSpecification type NameAvailability = original.NameAvailability type NameAvailabilityParameters = original.NameAvailabilityParameters +type NetworkACL = original.NetworkACL +type NetworkACLs = original.NetworkACLs type Operation = original.Operation type OperationDisplay = original.OperationDisplay type OperationList = original.OperationList @@ -89,7 +122,21 @@ type OperationListIterator = original.OperationListIterator type OperationListPage = original.OperationListPage type OperationProperties = original.OperationProperties type OperationsClient = original.OperationsClient +type PrivateEndpoint = original.PrivateEndpoint +type PrivateEndpointACL = original.PrivateEndpointACL +type PrivateEndpointConnection = original.PrivateEndpointConnection +type PrivateEndpointConnectionProperties = original.PrivateEndpointConnectionProperties +type PrivateEndpointConnectionsClient = original.PrivateEndpointConnectionsClient +type PrivateEndpointConnectionsDeleteFuture = original.PrivateEndpointConnectionsDeleteFuture +type PrivateLinkResource = original.PrivateLinkResource +type PrivateLinkResourceList = original.PrivateLinkResourceList +type PrivateLinkResourceListIterator = original.PrivateLinkResourceListIterator +type PrivateLinkResourceListPage = original.PrivateLinkResourceListPage +type PrivateLinkResourceProperties = original.PrivateLinkResourceProperties +type PrivateLinkResourcesClient = original.PrivateLinkResourcesClient +type PrivateLinkServiceConnectionState = original.PrivateLinkServiceConnectionState type Properties = original.Properties +type ProxyResource = original.ProxyResource type RegenerateKeyFuture = original.RegenerateKeyFuture type RegenerateKeyParameters = original.RegenerateKeyParameters type Resource = original.Resource @@ -99,10 +146,11 @@ type ResourceListPage = original.ResourceListPage type ResourceSku = original.ResourceSku type ResourceType = original.ResourceType type RestartFuture = original.RestartFuture +type ServerlessUpstreamSettings = original.ServerlessUpstreamSettings type ServiceSpecification = original.ServiceSpecification type TrackedResource = original.TrackedResource type UpdateFuture = original.UpdateFuture -type UpdateParameters = original.UpdateParameters +type UpstreamTemplate = original.UpstreamTemplate type Usage = original.Usage type UsageList = original.UsageList type UsageListIterator = original.UsageListIterator @@ -131,6 +179,24 @@ func NewOperationsClient(subscriptionID string) OperationsClient { func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID) } +func NewPrivateEndpointConnectionsClient(subscriptionID string) PrivateEndpointConnectionsClient { + return original.NewPrivateEndpointConnectionsClient(subscriptionID) +} +func NewPrivateEndpointConnectionsClientWithBaseURI(baseURI string, subscriptionID string) PrivateEndpointConnectionsClient { + return original.NewPrivateEndpointConnectionsClientWithBaseURI(baseURI, subscriptionID) +} +func NewPrivateLinkResourceListIterator(page PrivateLinkResourceListPage) PrivateLinkResourceListIterator { + return original.NewPrivateLinkResourceListIterator(page) +} +func NewPrivateLinkResourceListPage(getNextPage func(context.Context, PrivateLinkResourceList) (PrivateLinkResourceList, error)) PrivateLinkResourceListPage { + return original.NewPrivateLinkResourceListPage(getNextPage) +} +func NewPrivateLinkResourcesClient(subscriptionID string) PrivateLinkResourcesClient { + return original.NewPrivateLinkResourcesClient(subscriptionID) +} +func NewPrivateLinkResourcesClientWithBaseURI(baseURI string, subscriptionID string) PrivateLinkResourcesClient { + return original.NewPrivateLinkResourcesClientWithBaseURI(baseURI, subscriptionID) +} func NewResourceListIterator(page ResourceListPage) ResourceListIterator { return original.NewResourceListIterator(page) } @@ -152,15 +218,27 @@ func NewUsagesClientWithBaseURI(baseURI string, subscriptionID string) UsagesCli func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { return original.NewWithBaseURI(baseURI, subscriptionID) } +func PossibleACLActionValues() []ACLAction { + return original.PossibleACLActionValues() +} func PossibleFeatureFlagsValues() []FeatureFlags { return original.PossibleFeatureFlagsValues() } func PossibleKeyTypeValues() []KeyType { return original.PossibleKeyTypeValues() } +func PossiblePrivateLinkServiceConnectionStatusValues() []PrivateLinkServiceConnectionStatus { + return original.PossiblePrivateLinkServiceConnectionStatusValues() +} func PossibleProvisioningStateValues() []ProvisioningState { return original.PossibleProvisioningStateValues() } +func PossibleRequestTypeValues() []RequestType { + return original.PossibleRequestTypeValues() +} +func PossibleServiceKindValues() []ServiceKind { + return original.PossibleServiceKindValues() +} func PossibleSkuTierValues() []SkuTier { return original.PossibleSkuTierValues() } diff --git a/profiles/preview/signalr/mgmt/signalr/signalrapi/models.go b/profiles/preview/signalr/mgmt/signalr/signalrapi/models.go index a6761c7662e2..0e70654c13f8 100644 --- a/profiles/preview/signalr/mgmt/signalr/signalrapi/models.go +++ b/profiles/preview/signalr/mgmt/signalr/signalrapi/models.go @@ -19,8 +19,10 @@ package signalrapi -import original "github.com/Azure/azure-sdk-for-go/services/signalr/mgmt/2018-10-01/signalr/signalrapi" +import original "github.com/Azure/azure-sdk-for-go/services/signalr/mgmt/2020-05-01/signalr/signalrapi" type ClientAPI = original.ClientAPI type OperationsClientAPI = original.OperationsClientAPI +type PrivateEndpointConnectionsClientAPI = original.PrivateEndpointConnectionsClientAPI +type PrivateLinkResourcesClientAPI = original.PrivateLinkResourcesClientAPI type UsagesClientAPI = original.UsagesClientAPI diff --git a/profiles/preview/storage/mgmt/storage/models.go b/profiles/preview/storage/mgmt/storage/models.go index b03020d5fee8..e986adba95fe 100644 --- a/profiles/preview/storage/mgmt/storage/models.go +++ b/profiles/preview/storage/mgmt/storage/models.go @@ -217,6 +217,12 @@ const ( LeaseStatusUnlocked LeaseStatus = original.LeaseStatusUnlocked ) +type ListContainersInclude = original.ListContainersInclude + +const ( + Deleted ListContainersInclude = original.Deleted +) + type ListKeyExpand = original.ListKeyExpand const ( @@ -226,7 +232,7 @@ const ( type ListSharesExpand = original.ListSharesExpand const ( - Deleted ListSharesExpand = original.Deleted + ListSharesExpandDeleted ListSharesExpand = original.ListSharesExpandDeleted ) type Permissions = original.Permissions @@ -465,7 +471,17 @@ type ListContainerItem = original.ListContainerItem type ListContainerItems = original.ListContainerItems type ListContainerItemsIterator = original.ListContainerItemsIterator type ListContainerItemsPage = original.ListContainerItemsPage +type ListQueue = original.ListQueue +type ListQueueProperties = original.ListQueueProperties +type ListQueueResource = original.ListQueueResource +type ListQueueResourceIterator = original.ListQueueResourceIterator +type ListQueueResourcePage = original.ListQueueResourcePage +type ListQueueServices = original.ListQueueServices type ListServiceSasResponse = original.ListServiceSasResponse +type ListTableResource = original.ListTableResource +type ListTableResourceIterator = original.ListTableResourceIterator +type ListTableResourcePage = original.ListTableResourcePage +type ListTableServices = original.ListTableServices type ManagementPoliciesClient = original.ManagementPoliciesClient type ManagementPolicy = original.ManagementPolicy type ManagementPolicyAction = original.ManagementPolicyAction @@ -491,6 +507,7 @@ type OperationProperties = original.OperationProperties type OperationsClient = original.OperationsClient type PrivateEndpoint = original.PrivateEndpoint type PrivateEndpointConnection = original.PrivateEndpointConnection +type PrivateEndpointConnectionListResult = original.PrivateEndpointConnectionListResult type PrivateEndpointConnectionProperties = original.PrivateEndpointConnectionProperties type PrivateEndpointConnectionsClient = original.PrivateEndpointConnectionsClient type PrivateLinkResource = original.PrivateLinkResource @@ -499,6 +516,12 @@ type PrivateLinkResourceProperties = original.PrivateLinkResourceProperties type PrivateLinkResourcesClient = original.PrivateLinkResourcesClient type PrivateLinkServiceConnectionState = original.PrivateLinkServiceConnectionState type ProxyResource = original.ProxyResource +type Queue = original.Queue +type QueueClient = original.QueueClient +type QueueProperties = original.QueueProperties +type QueueServiceProperties = original.QueueServiceProperties +type QueueServicePropertiesProperties = original.QueueServicePropertiesProperties +type QueueServicesClient = original.QueueServicesClient type Resource = original.Resource type RestorePolicyProperties = original.RestorePolicyProperties type Restriction = original.Restriction @@ -510,6 +533,12 @@ type Sku = original.Sku type SkuInformation = original.SkuInformation type SkuListResult = original.SkuListResult type SkusClient = original.SkusClient +type Table = original.Table +type TableClient = original.TableClient +type TableProperties = original.TableProperties +type TableServiceProperties = original.TableServiceProperties +type TableServicePropertiesProperties = original.TableServicePropertiesProperties +type TableServicesClient = original.TableServicesClient type TagFilter = original.TagFilter type TagProperty = original.TagProperty type TrackedResource = original.TrackedResource @@ -583,6 +612,18 @@ func NewListContainerItemsIterator(page ListContainerItemsPage) ListContainerIte func NewListContainerItemsPage(getNextPage func(context.Context, ListContainerItems) (ListContainerItems, error)) ListContainerItemsPage { return original.NewListContainerItemsPage(getNextPage) } +func NewListQueueResourceIterator(page ListQueueResourcePage) ListQueueResourceIterator { + return original.NewListQueueResourceIterator(page) +} +func NewListQueueResourcePage(getNextPage func(context.Context, ListQueueResource) (ListQueueResource, error)) ListQueueResourcePage { + return original.NewListQueueResourcePage(getNextPage) +} +func NewListTableResourceIterator(page ListTableResourcePage) ListTableResourceIterator { + return original.NewListTableResourceIterator(page) +} +func NewListTableResourcePage(getNextPage func(context.Context, ListTableResource) (ListTableResource, error)) ListTableResourcePage { + return original.NewListTableResourcePage(getNextPage) +} func NewManagementPoliciesClient(subscriptionID string) ManagementPoliciesClient { return original.NewManagementPoliciesClient(subscriptionID) } @@ -613,12 +654,36 @@ func NewPrivateLinkResourcesClient(subscriptionID string) PrivateLinkResourcesCl func NewPrivateLinkResourcesClientWithBaseURI(baseURI string, subscriptionID string) PrivateLinkResourcesClient { return original.NewPrivateLinkResourcesClientWithBaseURI(baseURI, subscriptionID) } +func NewQueueClient(subscriptionID string) QueueClient { + return original.NewQueueClient(subscriptionID) +} +func NewQueueClientWithBaseURI(baseURI string, subscriptionID string) QueueClient { + return original.NewQueueClientWithBaseURI(baseURI, subscriptionID) +} +func NewQueueServicesClient(subscriptionID string) QueueServicesClient { + return original.NewQueueServicesClient(subscriptionID) +} +func NewQueueServicesClientWithBaseURI(baseURI string, subscriptionID string) QueueServicesClient { + return original.NewQueueServicesClientWithBaseURI(baseURI, subscriptionID) +} func NewSkusClient(subscriptionID string) SkusClient { return original.NewSkusClient(subscriptionID) } func NewSkusClientWithBaseURI(baseURI string, subscriptionID string) SkusClient { return original.NewSkusClientWithBaseURI(baseURI, subscriptionID) } +func NewTableClient(subscriptionID string) TableClient { + return original.NewTableClient(subscriptionID) +} +func NewTableClientWithBaseURI(baseURI string, subscriptionID string) TableClient { + return original.NewTableClientWithBaseURI(baseURI, subscriptionID) +} +func NewTableServicesClient(subscriptionID string) TableServicesClient { + return original.NewTableServicesClient(subscriptionID) +} +func NewTableServicesClientWithBaseURI(baseURI string, subscriptionID string) TableServicesClient { + return original.NewTableServicesClientWithBaseURI(baseURI, subscriptionID) +} func NewUsagesClient(subscriptionID string) UsagesClient { return original.NewUsagesClient(subscriptionID) } @@ -703,6 +768,9 @@ func PossibleLeaseStateValues() []LeaseState { func PossibleLeaseStatusValues() []LeaseStatus { return original.PossibleLeaseStatusValues() } +func PossibleListContainersIncludeValues() []ListContainersInclude { + return original.PossibleListContainersIncludeValues() +} func PossibleListKeyExpandValues() []ListKeyExpand { return original.PossibleListKeyExpandValues() } diff --git a/profiles/preview/storage/mgmt/storage/storageapi/models.go b/profiles/preview/storage/mgmt/storage/storageapi/models.go index 7c2858b890d0..2954e02cbc90 100644 --- a/profiles/preview/storage/mgmt/storage/storageapi/models.go +++ b/profiles/preview/storage/mgmt/storage/storageapi/models.go @@ -32,5 +32,9 @@ type ObjectReplicationPoliciesClientAPI = original.ObjectReplicationPoliciesClie type OperationsClientAPI = original.OperationsClientAPI type PrivateEndpointConnectionsClientAPI = original.PrivateEndpointConnectionsClientAPI type PrivateLinkResourcesClientAPI = original.PrivateLinkResourcesClientAPI +type QueueClientAPI = original.QueueClientAPI +type QueueServicesClientAPI = original.QueueServicesClientAPI type SkusClientAPI = original.SkusClientAPI +type TableClientAPI = original.TableClientAPI +type TableServicesClientAPI = original.TableServicesClientAPI type UsagesClientAPI = original.UsagesClientAPI diff --git a/profiles/preview/storagecache/mgmt/storagecache/models.go b/profiles/preview/storagecache/mgmt/storagecache/models.go index 098b8811b6ab..f71ecd2b829e 100644 --- a/profiles/preview/storagecache/mgmt/storagecache/models.go +++ b/profiles/preview/storagecache/mgmt/storagecache/models.go @@ -97,6 +97,8 @@ type APIOperationDisplay = original.APIOperationDisplay type APIOperationListResult = original.APIOperationListResult type APIOperationListResultIterator = original.APIOperationListResultIterator type APIOperationListResultPage = original.APIOperationListResultPage +type AscOperation = original.AscOperation +type AscOperationsClient = original.AscOperationsClient type BaseClient = original.BaseClient type BasicStorageTargetProperties = original.BasicStorageTargetProperties type Cache = original.Cache @@ -122,6 +124,7 @@ type ClfsTarget = original.ClfsTarget type ClfsTargetProperties = original.ClfsTargetProperties type CloudError = original.CloudError type CloudErrorBody = original.CloudErrorBody +type ErrorResponse = original.ErrorResponse type KeyVaultKeyReference = original.KeyVaultKeyReference type KeyVaultKeyReferenceSourceVault = original.KeyVaultKeyReferenceSourceVault type NamespaceJunction = original.NamespaceJunction @@ -164,6 +167,12 @@ func NewAPIOperationListResultIterator(page APIOperationListResultPage) APIOpera func NewAPIOperationListResultPage(getNextPage func(context.Context, APIOperationListResult) (APIOperationListResult, error)) APIOperationListResultPage { return original.NewAPIOperationListResultPage(getNextPage) } +func NewAscOperationsClient(subscriptionID string) AscOperationsClient { + return original.NewAscOperationsClient(subscriptionID) +} +func NewAscOperationsClientWithBaseURI(baseURI string, subscriptionID string) AscOperationsClient { + return original.NewAscOperationsClientWithBaseURI(baseURI, subscriptionID) +} func NewCachesClient(subscriptionID string) CachesClient { return original.NewCachesClient(subscriptionID) } diff --git a/profiles/preview/storagecache/mgmt/storagecache/storagecacheapi/models.go b/profiles/preview/storagecache/mgmt/storagecache/storagecacheapi/models.go index b466f18cbf4a..702d774a2fa0 100644 --- a/profiles/preview/storagecache/mgmt/storagecache/storagecacheapi/models.go +++ b/profiles/preview/storagecache/mgmt/storagecache/storagecacheapi/models.go @@ -21,6 +21,7 @@ package storagecacheapi import original "github.com/Azure/azure-sdk-for-go/services/storagecache/mgmt/2020-03-01/storagecache/storagecacheapi" +type AscOperationsClientAPI = original.AscOperationsClientAPI type CachesClientAPI = original.CachesClientAPI type OperationsClientAPI = original.OperationsClientAPI type SkusClientAPI = original.SkusClientAPI diff --git a/profiles/preview/storagesync/mgmt/storagesync/models.go b/profiles/preview/storagesync/mgmt/storagesync/models.go index 7328d99dfe04..696ce64c19a7 100644 --- a/profiles/preview/storagesync/mgmt/storagesync/models.go +++ b/profiles/preview/storagesync/mgmt/storagesync/models.go @@ -230,8 +230,6 @@ type ServerEndpointFilesNotSyncingError = original.ServerEndpointFilesNotSyncing type ServerEndpointProperties = original.ServerEndpointProperties type ServerEndpointRecallError = original.ServerEndpointRecallError type ServerEndpointRecallStatus = original.ServerEndpointRecallStatus -type ServerEndpointSyncActivityStatus = original.ServerEndpointSyncActivityStatus -type ServerEndpointSyncSessionStatus = original.ServerEndpointSyncSessionStatus type ServerEndpointSyncStatus = original.ServerEndpointSyncStatus type ServerEndpointUpdateParameters = original.ServerEndpointUpdateParameters type ServerEndpointUpdateProperties = original.ServerEndpointUpdateProperties @@ -247,11 +245,13 @@ type ServiceProperties = original.ServiceProperties type ServiceUpdateParameters = original.ServiceUpdateParameters type ServicesClient = original.ServicesClient type SubscriptionState = original.SubscriptionState +type SyncActivityStatus = original.SyncActivityStatus type SyncGroup = original.SyncGroup type SyncGroupArray = original.SyncGroupArray type SyncGroupCreateParameters = original.SyncGroupCreateParameters type SyncGroupProperties = original.SyncGroupProperties type SyncGroupsClient = original.SyncGroupsClient +type SyncSessionStatus = original.SyncSessionStatus type TrackedResource = original.TrackedResource type TriggerChangeDetectionParameters = original.TriggerChangeDetectionParameters type TriggerRolloverRequest = original.TriggerRolloverRequest diff --git a/profiles/preview/web/mgmt/web/models.go b/profiles/preview/web/mgmt/web/models.go index f93a07959d1d..03b38f4ce37c 100644 --- a/profiles/preview/web/mgmt/web/models.go +++ b/profiles/preview/web/mgmt/web/models.go @@ -440,9 +440,10 @@ const ( type ManagedServiceIdentityType = original.ManagedServiceIdentityType const ( - ManagedServiceIdentityTypeNone ManagedServiceIdentityType = original.ManagedServiceIdentityTypeNone - ManagedServiceIdentityTypeSystemAssigned ManagedServiceIdentityType = original.ManagedServiceIdentityTypeSystemAssigned - ManagedServiceIdentityTypeUserAssigned ManagedServiceIdentityType = original.ManagedServiceIdentityTypeUserAssigned + ManagedServiceIdentityTypeNone ManagedServiceIdentityType = original.ManagedServiceIdentityTypeNone + ManagedServiceIdentityTypeSystemAssigned ManagedServiceIdentityType = original.ManagedServiceIdentityTypeSystemAssigned + ManagedServiceIdentityTypeSystemAssignedUserAssigned ManagedServiceIdentityType = original.ManagedServiceIdentityTypeSystemAssignedUserAssigned + ManagedServiceIdentityTypeUserAssigned ManagedServiceIdentityType = original.ManagedServiceIdentityTypeUserAssigned ) type MySQLMigrationType = original.MySQLMigrationType @@ -857,6 +858,10 @@ type CsmOperationCollectionPage = original.CsmOperationCollectionPage type CsmOperationDescription = original.CsmOperationDescription type CsmOperationDescriptionProperties = original.CsmOperationDescriptionProperties type CsmOperationDisplay = original.CsmOperationDisplay +type CsmPublishingCredentialsPoliciesCollection = original.CsmPublishingCredentialsPoliciesCollection +type CsmPublishingCredentialsPoliciesCollectionProperties = original.CsmPublishingCredentialsPoliciesCollectionProperties +type CsmPublishingCredentialsPoliciesEntity = original.CsmPublishingCredentialsPoliciesEntity +type CsmPublishingCredentialsPoliciesEntityProperties = original.CsmPublishingCredentialsPoliciesEntityProperties type CsmPublishingProfileOptions = original.CsmPublishingProfileOptions type CsmSlotEntity = original.CsmSlotEntity type CsmUsageQuota = original.CsmUsageQuota diff --git a/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/accounts.go b/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/accounts.go index a9c37851d168..be6a606448a9 100644 --- a/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/accounts.go +++ b/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/accounts.go @@ -45,7 +45,7 @@ func NewAccountsClientWithBaseURI(baseURI string, subscriptionID string) Account // Create create Cognitive Services Account. Accounts is a resource group wide resource type. It holds the keys for // developer to access intelligent APIs. It's also the resource type for billing. // Parameters: -// resourceGroupName - the name of the resource group within the user's subscription. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - the name of Cognitive Services account. // account - the parameters to provide for the created account. func (client AccountsClient) Create(ctx context.Context, resourceGroupName string, accountName string, account Account) (result Account, err error) { @@ -60,6 +60,10 @@ func (client AccountsClient) Create(ctx context.Context, resourceGroupName strin }() } if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: 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: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 64, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 2, Chain: nil}, @@ -78,7 +82,9 @@ func (client AccountsClient) Create(ctx context.Context, resourceGroupName strin }}, }}, {Target: "account.Sku", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "account.Sku.Name", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + Chain: []validation.Constraint{{Target: "account.Sku.Name", Name: validation.Null, Rule: true, Chain: nil}}}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("cognitiveservices.AccountsClient", "Create", err.Error()) } @@ -151,7 +157,7 @@ func (client AccountsClient) CreateResponder(resp *http.Response) (result Accoun // Delete deletes a Cognitive Services account from the resource group. // Parameters: -// resourceGroupName - the name of the resource group within the user's subscription. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - the name of Cognitive Services account. func (client AccountsClient) Delete(ctx context.Context, resourceGroupName string, accountName string) (result autorest.Response, err error) { if tracing.IsEnabled() { @@ -165,10 +171,16 @@ func (client AccountsClient) Delete(ctx context.Context, resourceGroupName strin }() } if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: 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: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 64, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 2, Chain: nil}, - {Target: "accountName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9_.-]*$`, Chain: nil}}}}); err != nil { + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9_.-]*$`, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("cognitiveservices.AccountsClient", "Delete", err.Error()) } @@ -234,7 +246,7 @@ func (client AccountsClient) DeleteResponder(resp *http.Response) (result autore // GetProperties returns a Cognitive Services account specified by the parameters. // Parameters: -// resourceGroupName - the name of the resource group within the user's subscription. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - the name of Cognitive Services account. func (client AccountsClient) GetProperties(ctx context.Context, resourceGroupName string, accountName string) (result Account, err error) { if tracing.IsEnabled() { @@ -248,10 +260,16 @@ func (client AccountsClient) GetProperties(ctx context.Context, resourceGroupNam }() } if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: 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: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 64, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 2, Chain: nil}, - {Target: "accountName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9_.-]*$`, Chain: nil}}}}); err != nil { + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9_.-]*$`, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("cognitiveservices.AccountsClient", "GetProperties", err.Error()) } @@ -318,7 +336,7 @@ func (client AccountsClient) GetPropertiesResponder(resp *http.Response) (result // GetUsages get usages for the requested Cognitive Services account // Parameters: -// resourceGroupName - the name of the resource group within the user's subscription. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - the name of Cognitive Services account. // filter - an OData filter expression that describes a subset of usages to return. The supported parameter is // name.value (name of the metric, can have an or of multiple names). @@ -334,10 +352,16 @@ func (client AccountsClient) GetUsages(ctx context.Context, resourceGroupName st }() } if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: 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: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 64, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 2, Chain: nil}, - {Target: "accountName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9_.-]*$`, Chain: nil}}}}); err != nil { + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9_.-]*$`, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("cognitiveservices.AccountsClient", "GetUsages", err.Error()) } @@ -417,6 +441,12 @@ func (client AccountsClient) List(ctx context.Context) (result AccountListResult 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("cognitiveservices.AccountsClient", "List", err.Error()) + } + result.fn = client.listNextResults req, err := client.ListPreparer(ctx) if err != nil { @@ -516,7 +546,7 @@ func (client AccountsClient) ListComplete(ctx context.Context) (result AccountLi // ListByResourceGroup returns all the resources of a particular type belonging to a resource group // Parameters: -// resourceGroupName - the name of the resource group within the user's subscription. +// resourceGroupName - the name of the resource group. The name is case insensitive. func (client AccountsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result AccountListResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.ListByResourceGroup") @@ -528,6 +558,16 @@ func (client AccountsClient) ListByResourceGroup(ctx context.Context, resourceGr tracing.EndSpan(ctx, sc, err) }() } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("cognitiveservices.AccountsClient", "ListByResourceGroup", err.Error()) + } + result.fn = client.listByResourceGroupNextResults req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) if err != nil { @@ -628,7 +668,7 @@ func (client AccountsClient) ListByResourceGroupComplete(ctx context.Context, re // ListKeys lists the account keys for the specified Cognitive Services account. // Parameters: -// resourceGroupName - the name of the resource group within the user's subscription. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - the name of Cognitive Services account. func (client AccountsClient) ListKeys(ctx context.Context, resourceGroupName string, accountName string) (result AccountKeys, err error) { if tracing.IsEnabled() { @@ -642,10 +682,16 @@ func (client AccountsClient) ListKeys(ctx context.Context, resourceGroupName str }() } if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: 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: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 64, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 2, Chain: nil}, - {Target: "accountName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9_.-]*$`, Chain: nil}}}}); err != nil { + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9_.-]*$`, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("cognitiveservices.AccountsClient", "ListKeys", err.Error()) } @@ -712,7 +758,7 @@ func (client AccountsClient) ListKeysResponder(resp *http.Response) (result Acco // ListSkus list available SKUs for the requested Cognitive Services account // Parameters: -// resourceGroupName - the name of the resource group within the user's subscription. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - the name of Cognitive Services account. func (client AccountsClient) ListSkus(ctx context.Context, resourceGroupName string, accountName string) (result AccountEnumerateSkusResult, err error) { if tracing.IsEnabled() { @@ -726,10 +772,16 @@ func (client AccountsClient) ListSkus(ctx context.Context, resourceGroupName str }() } if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: 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: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 64, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 2, Chain: nil}, - {Target: "accountName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9_.-]*$`, Chain: nil}}}}); err != nil { + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9_.-]*$`, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("cognitiveservices.AccountsClient", "ListSkus", err.Error()) } @@ -796,7 +848,7 @@ func (client AccountsClient) ListSkusResponder(resp *http.Response) (result Acco // RegenerateKey regenerates the specified account key for the specified Cognitive Services account. // Parameters: -// resourceGroupName - the name of the resource group within the user's subscription. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - the name of Cognitive Services account. // parameters - regenerate key parameters. func (client AccountsClient) RegenerateKey(ctx context.Context, resourceGroupName string, accountName string, parameters RegenerateKeyParameters) (result AccountKeys, err error) { @@ -811,10 +863,16 @@ func (client AccountsClient) RegenerateKey(ctx context.Context, resourceGroupNam }() } if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: 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: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 64, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 2, Chain: nil}, - {Target: "accountName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9_.-]*$`, Chain: nil}}}}); err != nil { + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9_.-]*$`, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("cognitiveservices.AccountsClient", "RegenerateKey", err.Error()) } @@ -883,7 +941,7 @@ func (client AccountsClient) RegenerateKeyResponder(resp *http.Response) (result // Update updates a Cognitive Services account // Parameters: -// resourceGroupName - the name of the resource group within the user's subscription. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - the name of Cognitive Services account. // account - the parameters to provide for the created account. func (client AccountsClient) Update(ctx context.Context, resourceGroupName string, accountName string, account Account) (result Account, err error) { @@ -898,10 +956,16 @@ func (client AccountsClient) Update(ctx context.Context, resourceGroupName strin }() } if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: 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: accountName, Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 64, Chain: nil}, {Target: "accountName", Name: validation.MinLength, Rule: 2, Chain: nil}, - {Target: "accountName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9_.-]*$`, Chain: nil}}}}); err != nil { + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9_.-]*$`, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("cognitiveservices.AccountsClient", "Update", err.Error()) } diff --git a/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/client.go b/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/client.go index ca4982e8870d..8ffdf69abf06 100644 --- a/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/client.go +++ b/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/client.go @@ -71,6 +71,8 @@ func (client BaseClient) CheckDomainAvailability(ctx context.Context, parameters }() } if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.SubdomainName", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.Type", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { @@ -154,6 +156,8 @@ func (client BaseClient) CheckSkuAvailability(ctx context.Context, location stri }() } if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: parameters, Constraints: []validation.Constraint{{Target: "parameters.Skus", Name: validation.Null, Rule: true, Chain: nil}, {Target: "parameters.Kind", Name: validation.Null, Rule: true, Chain: nil}, diff --git a/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/cognitiveservicesapi/interfaces.go b/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/cognitiveservicesapi/interfaces.go index f4aa69dc7c65..48a8d4195f7b 100644 --- a/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/cognitiveservicesapi/interfaces.go +++ b/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/cognitiveservicesapi/interfaces.go @@ -64,3 +64,19 @@ type OperationsClientAPI interface { } var _ OperationsClientAPI = (*cognitiveservices.OperationsClient)(nil) + +// PrivateEndpointConnectionsClientAPI contains the set of methods on the PrivateEndpointConnectionsClient type. +type PrivateEndpointConnectionsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string, properties cognitiveservices.PrivateEndpointConnection) (result cognitiveservices.PrivateEndpointConnection, err error) + Delete(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string) (result cognitiveservices.PrivateEndpointConnection, err error) +} + +var _ PrivateEndpointConnectionsClientAPI = (*cognitiveservices.PrivateEndpointConnectionsClient)(nil) + +// PrivateLinkResourcesClientAPI contains the set of methods on the PrivateLinkResourcesClient type. +type PrivateLinkResourcesClientAPI interface { + List(ctx context.Context, resourceGroupName string, accountName string) (result cognitiveservices.PrivateLinkResourceListResult, err error) +} + +var _ PrivateLinkResourcesClientAPI = (*cognitiveservices.PrivateLinkResourcesClient)(nil) diff --git a/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/models.go b/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/models.go index 76cffd9e5870..63f8ad387087 100644 --- a/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/models.go +++ b/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/models.go @@ -91,6 +91,25 @@ func PossibleNetworkRuleActionValues() []NetworkRuleAction { return []NetworkRuleAction{Allow, Deny} } +// PrivateEndpointServiceConnectionStatus enumerates the values for private endpoint service connection status. +type PrivateEndpointServiceConnectionStatus string + +const ( + // Approved ... + Approved PrivateEndpointServiceConnectionStatus = "Approved" + // Disconnected ... + Disconnected PrivateEndpointServiceConnectionStatus = "Disconnected" + // Pending ... + Pending PrivateEndpointServiceConnectionStatus = "Pending" + // Rejected ... + Rejected PrivateEndpointServiceConnectionStatus = "Rejected" +) + +// PossiblePrivateEndpointServiceConnectionStatusValues returns an array of possible values for the PrivateEndpointServiceConnectionStatus const type. +func PossiblePrivateEndpointServiceConnectionStatusValues() []PrivateEndpointServiceConnectionStatus { + return []PrivateEndpointServiceConnectionStatus{Approved, Disconnected, Pending, Rejected} +} + // ProvisioningState enumerates the values for provisioning state. type ProvisioningState string @@ -114,6 +133,21 @@ func PossibleProvisioningStateValues() []ProvisioningState { return []ProvisioningState{Creating, Deleting, Failed, Moving, ResolvingDNS, Succeeded} } +// PublicNetworkAccess enumerates the values for public network access. +type PublicNetworkAccess string + +const ( + // Disabled ... + Disabled PublicNetworkAccess = "Disabled" + // Enabled ... + Enabled PublicNetworkAccess = "Enabled" +) + +// PossiblePublicNetworkAccessValues returns an array of possible values for the PublicNetworkAccess const type. +func PossiblePublicNetworkAccessValues() []PublicNetworkAccess { + return []PublicNetworkAccess{Disabled, Enabled} +} + // QuotaUsageStatus enumerates the values for quota usage status. type QuotaUsageStatus string @@ -437,6 +471,8 @@ type AccountProperties struct { Endpoint *string `json:"endpoint,omitempty"` // InternalID - READ-ONLY; The internal identifier. InternalID *string `json:"internalId,omitempty"` + // Capabilities - READ-ONLY; Gets the capabilities of the cognitive services account. Each item indicates the capability of a specific feature. The values are read-only and for reference only. + Capabilities *[]SkuCapability `json:"capabilities,omitempty"` // CustomSubDomainName - Optional subdomain name used for token-based authentication. CustomSubDomainName *string `json:"customSubDomainName,omitempty"` // NetworkAcls - A collection of rules governing the accessibility from specific network locations. @@ -445,10 +481,26 @@ type AccountProperties struct { Encryption *Encryption `json:"encryption,omitempty"` // UserOwnedStorage - The storage accounts for this resource. UserOwnedStorage *[]UserOwnedStorage `json:"userOwnedStorage,omitempty"` + // PrivateEndpointConnections - The private endpoint connection associated with the Cognitive Services account. + PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` + // PublicNetworkAccess - Whether or not public endpoint access is allowed for this account. Value is optional but if passed in, must be 'Enabled' or 'Disabled'. Possible values include: 'Enabled', 'Disabled' + PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` // APIProperties - The api properties for special APIs. APIProperties *AccountAPIProperties `json:"apiProperties,omitempty"` } +// AzureEntityResource the resource model definition for a 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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + // CheckDomainAvailabilityParameter check Domain availability parameter. type CheckDomainAvailabilityParameter struct { // SubdomainName - The subdomain name to use. @@ -753,12 +805,104 @@ func NewOperationEntityListResultPage(getNextPage func(context.Context, Operatio return OperationEntityListResultPage{fn: getNextPage} } +// PrivateEndpoint the Private Endpoint resource. +type PrivateEndpoint struct { + // ID - READ-ONLY; The ARM identifier for Private Endpoint + ID *string `json:"id,omitempty"` +} + +// PrivateEndpointConnection the Private Endpoint Connection resource. +type PrivateEndpointConnection struct { + autorest.Response `json:"-"` + // Properties - Resource properties. + Properties *PrivateEndpointConnectionProperties `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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// PrivateEndpointConnectionProperties properties of the PrivateEndpointConnectProperties. +type PrivateEndpointConnectionProperties struct { + // PrivateEndpoint - The resource of private end point. + 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"` + // GroupIds - The private link resource group ids. + GroupIds *[]string `json:"groupIds,omitempty"` +} + +// PrivateLinkResource a private link resource +type PrivateLinkResource struct { + // Properties - Resource properties. + Properties *PrivateLinkResourceProperties `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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// PrivateLinkResourceListResult a list of private link resources +type PrivateLinkResourceListResult struct { + autorest.Response `json:"-"` + // Value - Array of private link resources + Value *[]PrivateLinkResource `json:"value,omitempty"` +} + +// PrivateLinkResourceProperties properties of a private link resource. +type PrivateLinkResourceProperties struct { + // GroupID - READ-ONLY; The private link resource group id. + GroupID *string `json:"groupId,omitempty"` + // DisplayName - READ-ONLY; The private link resource display name. + DisplayName *string `json:"displayName,omitempty"` + // RequiredMembers - READ-ONLY; 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 a collection of information about the state of the connection between +// service consumer and provider. +type PrivateLinkServiceConnectionState struct { + // Status - Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. Possible values include: 'Pending', 'Approved', 'Rejected', 'Disconnected' + Status PrivateEndpointServiceConnectionStatus `json:"status,omitempty"` + // Description - The reason for approval/rejection of the connection. + Description *string `json:"description,omitempty"` + // ActionRequired - A message indicating if changes on the service provider require any updates on the consumer. + ActionRequired *string `json:"actionRequired,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; 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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + // RegenerateKeyParameters regenerate key parameters. type RegenerateKeyParameters struct { // KeyName - key name to generate (Key1|Key2). Possible values include: 'Key1', 'Key2' KeyName KeyName `json:"keyName,omitempty"` } +// Resource ... +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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + // ResourceAndSku cognitive Services resource type and SKU. type ResourceAndSku struct { // ResourceType - Resource Namespace and Type @@ -957,6 +1101,40 @@ type Sku struct { Tier SkuTier `json:"tier,omitempty"` } +// SkuCapability skuCapability indicates the capability of a certain feature. +type SkuCapability struct { + // Name - The name of the SkuCapability. + Name *string `json:"name,omitempty"` + // Value - The value of the SkuCapability. + Value *string `json:"value,omitempty"` +} + +// TrackedResource the resource model definition for a ARM tracked top level resource +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. Ex- 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) +} + // Usage the usage data for a usage request. type Usage struct { // Unit - The unit of the metric. Possible values include: 'Count', 'Bytes', 'Seconds', 'Percent', 'CountPerSecond', 'BytesPerSecond', 'Milliseconds' diff --git a/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/privateendpointconnections.go b/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/privateendpointconnections.go new file mode 100644 index 000000000000..87f9c1db173a --- /dev/null +++ b/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/privateendpointconnections.go @@ -0,0 +1,329 @@ +package cognitiveservices + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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 cognitive Services Management Client +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 Cognitive Services +// account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - the name of Cognitive Services account. +// privateEndpointConnectionName - the name of the private endpoint connection associated with the Cognitive +// Services Account +// properties - the private endpoint connection properties. +func (client PrivateEndpointConnectionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string, properties PrivateEndpointConnection) (result PrivateEndpointConnection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.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}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 2, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9_.-]*$`, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: properties, + Constraints: []validation.Constraint{{Target: "properties.Properties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "properties.Properties.PrivateLinkServiceConnectionState", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("cognitiveservices.PrivateEndpointConnectionsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, accountName, privateEndpointConnectionName, properties) + if err != nil { + err = autorest.NewErrorWithError(err, "cognitiveservices.PrivateEndpointConnectionsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "cognitiveservices.PrivateEndpointConnectionsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "cognitiveservices.PrivateEndpointConnectionsClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client PrivateEndpointConnectionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string, properties PrivateEndpointConnection) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-04-18" + 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.CognitiveServices/accounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), + autorest.WithJSON(properties), + 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) (*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 PrivateEndpointConnectionsClient) CreateOrUpdateResponder(resp *http.Response) (result PrivateEndpointConnection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the specified private endpoint connection associated with the Cognitive Services account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - the name of Cognitive Services account. +// privateEndpointConnectionName - the name of the private endpoint connection associated with the Cognitive +// Services Account +func (client PrivateEndpointConnectionsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.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}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 2, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9_.-]*$`, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("cognitiveservices.PrivateEndpointConnectionsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, privateEndpointConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "cognitiveservices.PrivateEndpointConnectionsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "cognitiveservices.PrivateEndpointConnectionsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "cognitiveservices.PrivateEndpointConnectionsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client PrivateEndpointConnectionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-04-18" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/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) (*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 PrivateEndpointConnectionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the specified private endpoint connection associated with the Cognitive Services account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - the name of Cognitive Services account. +// privateEndpointConnectionName - the name of the private endpoint connection associated with the Cognitive +// Services Account +func (client PrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, accountName 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.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 2, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9_.-]*$`, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("cognitiveservices.PrivateEndpointConnectionsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, accountName, privateEndpointConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "cognitiveservices.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, "cognitiveservices.PrivateEndpointConnectionsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "cognitiveservices.PrivateEndpointConnectionsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client PrivateEndpointConnectionsClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-04-18" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/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, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/privatelinkresources.go b/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/privatelinkresources.go new file mode 100644 index 000000000000..1c77480cca7f --- /dev/null +++ b/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/privatelinkresources.go @@ -0,0 +1,134 @@ +package cognitiveservices + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// PrivateLinkResourcesClient is the cognitive Services Management Client +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)} +} + +// List gets the private link resources that need to be created for a Cognitive Services account. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// accountName - the name of Cognitive Services account. +func (client PrivateLinkResourcesClient) List(ctx context.Context, resourceGroupName string, accountName string) (result PrivateLinkResourceListResult, 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) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: 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: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 2, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9][a-zA-Z0-9_.-]*$`, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("cognitiveservices.PrivateLinkResourcesClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "cognitiveservices.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, "cognitiveservices.PrivateLinkResourcesClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "cognitiveservices.PrivateLinkResourcesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client PrivateLinkResourcesClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-04-18" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CognitiveServices/accounts/{accountName}/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 PrivateLinkResourceListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/resourceskus.go b/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/resourceskus.go index 2db5d0967ef7..951671658f64 100644 --- a/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/resourceskus.go +++ b/services/cognitiveservices/mgmt/2017-04-18/cognitiveservices/resourceskus.go @@ -21,6 +21,7 @@ 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" ) @@ -53,6 +54,12 @@ func (client ResourceSkusClient) List(ctx context.Context) (result ResourceSkusR 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("cognitiveservices.ResourceSkusClient", "List", err.Error()) + } + result.fn = client.listNextResults req, err := client.ListPreparer(ctx) if err != nil { diff --git a/services/cognitiveservices/v1.0/face/face.go b/services/cognitiveservices/v1.0/face/face.go index b6be346f19c6..0f4495282408 100644 --- a/services/cognitiveservices/v1.0/face/face.go +++ b/services/cognitiveservices/v1.0/face/face.go @@ -41,9 +41,9 @@ func NewClient(endpoint string) Client { // attributes.
// * No image will be stored. Only the extracted face feature will be stored on server. The faceId is an identifier of // the face feature and will be used in [Face - -// Identify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395239), [Face - -// Verify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039523a), and [Face - Find -// Similar](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395237). The stored face feature(s) +// Identify](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/identify), [Face - +// Verify](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/verifyfacetoface), and [Face - Find +// Similar](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/findsimilar). The stored face feature(s) // will expire and be deleted 24 hours after the original detection call. // * Optional parameters include faceId, landmarks, and attributes. Attributes include age, gender, headPose, smile, // facialHair, glasses, emotion, hair, makeup, occlusion, accessories, blur, exposure and noise. Some of the results @@ -51,19 +51,19 @@ func NewClient(endpoint string) Client { // * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. // * Up to 100 faces can be returned for an image. Faces are ranked by face rectangle size from large to small. // * For optimal results when querying [Face - -// Identify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395239), [Face - -// Verify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039523a), and [Face - Find -// Similar](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395237) ('returnFaceId' is true), +// Identify](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/identify), [Face - +// Verify](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/verifyfacetoface), and [Face - Find +// Similar](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/findsimilar) ('returnFaceId' is true), // please use faces that are: frontal, clear, and with a minimum size of 200x200 pixels (100 pixels between eyes). // * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with // dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. // * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer to // [How to specify a detection -// model](https://docs.microsoft.com/en-us/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model) +// model](https://docs.microsoft.com/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model) // | Model | Recommended use-case(s) | // | ---------- | -------- | // | 'detection_01': | The default detection model for [Face - -// Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236). Recommend for near frontal +// Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/detectwithurl). Recommend for near frontal // face detection. For scenarios with exceptionally large angle (head-pose) faces, occluded faces or wrong image // orientation, the faces in such cases may not be detected. | // | 'detection_02': | Detection model released in 2019 May with improved accuracy especially on small, side and blurry @@ -74,11 +74,11 @@ func NewClient(endpoint string) Client { // 'recognitionModel' is 'recognition_01', if latest model needed, please explicitly specify the model you need in this // parameter. Once specified, the detected faceIds will be associated with the specified recognition model. More // details, please refer to [How to specify a recognition -// model](https://docs.microsoft.com/en-us/azure/cognitive-services/face/face-api-how-to-topics/specify-recognition-model) +// model](https://docs.microsoft.com/azure/cognitive-services/face/face-api-how-to-topics/specify-recognition-model) // | Model | Recommended use-case(s) | // | ---------- | -------- | // | 'recognition_01': | The default recognition model for [Face - -// Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236). All those faceIds created +// Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/detectwithurl). All those faceIds created // before 2019 March are bonded with this recognition model. | // | 'recognition_02': | Recognition model released in 2019 March. 'recognition_02' is recommended since its overall // accuracy is improved compared with 'recognition_01'. | @@ -202,9 +202,9 @@ func (client Client) DetectWithStreamResponder(resp *http.Response) (result List // attributes.
// * No image will be stored. Only the extracted face feature will be stored on server. The faceId is an identifier of // the face feature and will be used in [Face - -// Identify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395239), [Face - -// Verify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039523a), and [Face - Find -// Similar](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395237). The stored face feature(s) +// Identify](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/identify), [Face - +// Verify](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/verifyfacetoface), and [Face - Find +// Similar](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/findsimilar). The stored face feature(s) // will expire and be deleted 24 hours after the original detection call. // * Optional parameters include faceId, landmarks, and attributes. Attributes include age, gender, headPose, smile, // facialHair, glasses, emotion, hair, makeup, occlusion, accessories, blur, exposure and noise. Some of the results @@ -212,19 +212,19 @@ func (client Client) DetectWithStreamResponder(resp *http.Response) (result List // * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. // * Up to 100 faces can be returned for an image. Faces are ranked by face rectangle size from large to small. // * For optimal results when querying [Face - -// Identify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395239), [Face - -// Verify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039523a), and [Face - Find -// Similar](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395237) ('returnFaceId' is true), +// Identify](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/identify), [Face - +// Verify](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/verifyfacetoface), and [Face - Find +// Similar](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/findsimilar) ('returnFaceId' is true), // please use faces that are: frontal, clear, and with a minimum size of 200x200 pixels (100 pixels between eyes). // * The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with // dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. // * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer to // [How to specify a detection -// model](https://docs.microsoft.com/en-us/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model) +// model](https://docs.microsoft.com/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model) // | Model | Recommended use-case(s) | // | ---------- | -------- | // | 'detection_01': | The default detection model for [Face - -// Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236). Recommend for near frontal +// Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/detectwithurl). Recommend for near frontal // face detection. For scenarios with exceptionally large angle (head-pose) faces, occluded faces or wrong image // orientation, the faces in such cases may not be detected. | // | 'detection_02': | Detection model released in 2019 May with improved accuracy especially on small, side and blurry @@ -235,11 +235,11 @@ func (client Client) DetectWithStreamResponder(resp *http.Response) (result List // 'recognitionModel' is 'recognition_01', if latest model needed, please explicitly specify the model you need in this // parameter. Once specified, the detected faceIds will be associated with the specified recognition model. More // details, please refer to [How to specify a recognition -// model](https://docs.microsoft.com/en-us/azure/cognitive-services/face/face-api-how-to-topics/specify-recognition-model) +// model](https://docs.microsoft.com/azure/cognitive-services/face/face-api-how-to-topics/specify-recognition-model) // | Model | Recommended use-case(s) | // | ---------- | -------- | // | 'recognition_01': | The default recognition model for [Face - -// Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236). All those faceIds created +// Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/detectwithurl). All those faceIds created // before 2019 March are bonded with this recognition model. | // | 'recognition_02': | Recognition model released in 2019 March. 'recognition_02' is recommended since its overall // accuracy is improved compared with 'recognition_01'. | @@ -367,11 +367,11 @@ func (client Client) DetectWithURLResponder(resp *http.Response) (result ListDet // FindSimilar given query face's faceId, to search the similar-looking faces from a faceId array, a face list or a // large face list. faceId array contains the faces created by [Face - -// Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236), which will expire 24 hours +// Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/detectwithurl), which will expire 24 hours // after creation. A "faceListId" is created by [FaceList - -// Create](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039524b) containing persistedFaceIds -// that will not expire. And a "largeFaceListId" is created by [LargeFaceList - -// Create](/docs/services/563879b61984550e40cbbe8d/operations/5a157b68d2de3616c086f2cc) containing persistedFaceIds +// Create](https://docs.microsoft.com/rest/api/cognitiveservices/face/facelist/create) containing persistedFaceIds that +// will not expire. And a "largeFaceListId" is created by [LargeFaceList - +// Create](https://docs.microsoft.com/rest/api/cognitiveservices/face/largefacelist/create) containing persistedFaceIds // that will also not expire. Depending on the input the returned similar faces list contains faceIds or // persistedFaceIds ranked by similarity. //
Find similar has two working modes, "matchPerson" and "matchFace". "matchPerson" is the default mode that it @@ -476,8 +476,8 @@ func (client Client) FindSimilarResponder(resp *http.Response) (result ListSimil // * MessyGroup is a special face group containing faces that cannot find any similar counterpart face from original // faces. The messyGroup will not appear in the result if all faces found their counterparts. // * Group API needs at least 2 candidate faces and 1000 at most. We suggest to try [Face - -// Verify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039523a) when you only have 2 candidate -// faces. +// Verify](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/verifyfacetoface) when you only have 2 +// candidate faces. // * The 'recognitionModel' associated with the query faces' faceIds should be the same. // Parameters: // body - request body for grouping. @@ -560,8 +560,8 @@ func (client Client) GroupResponder(resp *http.Response) (result GroupResult, er // faces in the person group (given by personGroupId) or large person group (given by largePersonGroupId), and return // candidate person(s) for that face ranked by similarity confidence. The person group/large person group should be // trained to make it ready for identification. See more in [PersonGroup - -// Train](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395249) and [LargePersonGroup - -// Train](/docs/services/563879b61984550e40cbbe8d/operations/599ae2d16ac60f11b48b5aa4). +// Train](https://docs.microsoft.com/rest/api/cognitiveservices/face/persongroup/train) and [LargePersonGroup - +// Train](https://docs.microsoft.com/rest/api/cognitiveservices/face/largepersongroup/train). //
// // Remarks:
@@ -572,7 +572,7 @@ func (client Client) GroupResponder(resp *http.Response) (result GroupResult, er // clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. // * Number of candidates returned is restricted by maxNumOfCandidatesReturned and confidenceThreshold. If no person is // identified, the returned candidates will be an empty array. -// * Try [Face - Find Similar](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395237) when you +// * Try [Face - Find Similar](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/findsimilar) when you // need to find similar faces from a face list/large face list instead of a person group/large person group. // * The 'recognitionModel' associated with the query faces' faceIds should be the same as the 'recognitionModel' used // by the target person group or large person group. diff --git a/services/cognitiveservices/v1.0/face/largefacelist.go b/services/cognitiveservices/v1.0/face/largefacelist.go index 0dd44bff3208..a0ee0c6c7a08 100644 --- a/services/cognitiveservices/v1.0/face/largefacelist.go +++ b/services/cognitiveservices/v1.0/face/largefacelist.go @@ -42,17 +42,17 @@ func NewLargeFaceListClient(endpoint string) LargeFaceListClient { //
To deal with an image contains multiple faces, input face can be specified as an image with a targetFace // rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted // face feature will be stored on server until [LargeFaceList Face - -// Delete](/docs/services/563879b61984550e40cbbe8d/operations/5a158c8ad2de3616c086f2d4) or [LargeFaceList - -// Delete](/docs/services/563879b61984550e40cbbe8d/operations/5a1580d5d2de3616c086f2cd) is called. +// Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/largefacelist/deleteface) or [LargeFaceList - +// Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/largefacelist/delete) is called. //
Note persistedFaceId is different from faceId generated by [Face - -// Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236). +// Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/detectwithurl). // * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, clear, // and face size is 200x200 pixels (100 pixels between eyes) or bigger. // * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. // * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the // provided "targetFace" rectangle is not returned from [Face - -// Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236), there’s no guarantee to detect -// and add the face successfully. +// Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/detectwithurl), there’s no guarantee to +// detect and add the face successfully. // * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause failures. // * Adding/deleting faces to/from a same face list are processed sequentially and to/from different face lists are in // parallel. @@ -60,13 +60,13 @@ func NewLargeFaceListClient(endpoint string) LargeFaceListClient { // dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. // * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer to // [How to specify a detection -// model](https://docs.microsoft.com/en-us/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model) +// model](https://docs.microsoft.com/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model) // | Model | Recommended use-case(s) | // | ---------- | -------- | // | 'detection_01': | The default detection model for [LargeFaceList - Add -// Face](/docs/services/563879b61984550e40cbbe8d/operations/5a158c10d2de3616c086f2d3). Recommend for near frontal face -// detection. For scenarios with exceptionally large angle (head-pose) faces, occluded faces or wrong image -// orientation, the faces in such cases may not be detected. | +// Face](https://docs.microsoft.com/rest/api/cognitiveservices/face/largefacelist/addfacefromurl). Recommend for near +// frontal face detection. For scenarios with exceptionally large angle (head-pose) faces, occluded faces or wrong +// image orientation, the faces in such cases may not be detected. | // | 'detection_02': | Detection model released in 2019 May with improved accuracy especially on small, side and blurry // faces. | // @@ -183,17 +183,17 @@ func (client LargeFaceListClient) AddFaceFromStreamResponder(resp *http.Response //
To deal with an image contains multiple faces, input face can be specified as an image with a targetFace // rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted // face feature will be stored on server until [LargeFaceList Face - -// Delete](/docs/services/563879b61984550e40cbbe8d/operations/5a158c8ad2de3616c086f2d4) or [LargeFaceList - -// Delete](/docs/services/563879b61984550e40cbbe8d/operations/5a1580d5d2de3616c086f2cd) is called. +// Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/largefacelist/deleteface) or [LargeFaceList - +// Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/largefacelist/delete) is called. //
Note persistedFaceId is different from faceId generated by [Face - -// Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236). +// Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/detectwithurl). // * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, clear, // and face size is 200x200 pixels (100 pixels between eyes) or bigger. // * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. // * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the // provided "targetFace" rectangle is not returned from [Face - -// Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236), there’s no guarantee to detect -// and add the face successfully. +// Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/detectwithurl), there’s no guarantee to +// detect and add the face successfully. // * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause failures. // * Adding/deleting faces to/from a same face list are processed sequentially and to/from different face lists are in // parallel. @@ -201,13 +201,13 @@ func (client LargeFaceListClient) AddFaceFromStreamResponder(resp *http.Response // dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. // * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer to // [How to specify a detection -// model](https://docs.microsoft.com/en-us/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model) +// model](https://docs.microsoft.com/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model) // | Model | Recommended use-case(s) | // | ---------- | -------- | // | 'detection_01': | The default detection model for [LargeFaceList - Add -// Face](/docs/services/563879b61984550e40cbbe8d/operations/5a158c10d2de3616c086f2d3). Recommend for near frontal face -// detection. For scenarios with exceptionally large angle (head-pose) faces, occluded faces or wrong image -// orientation, the faces in such cases may not be detected. | +// Face](https://docs.microsoft.com/rest/api/cognitiveservices/face/largefacelist/addfacefromurl). Recommend for near +// frontal face detection. For scenarios with exceptionally large angle (head-pose) faces, occluded faces or wrong +// image orientation, the faces in such cases may not be detected. | // | 'detection_02': | Detection model released in 2019 May with improved accuracy especially on small, side and blurry // faces. | // @@ -325,27 +325,27 @@ func (client LargeFaceListClient) AddFaceFromURLResponder(resp *http.Response) ( // Create create an empty large face list with user-specified largeFaceListId, name, an optional userData and // recognitionModel. //
Large face list is a list of faces, up to 1,000,000 faces, and used by [Face - Find -// Similar](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395237). +// Similar](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/findsimilar). //
After creation, user should use [LargeFaceList Face - -// Add](/docs/services/563879b61984550e40cbbe8d/operations/5a158c10d2de3616c086f2d3) to import the faces and -// [LargeFaceList - Train](/docs/services/563879b61984550e40cbbe8d/operations/5a158422d2de3616c086f2d1) to make it -// ready for [Face - Find Similar](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395237). No +// Add](https://docs.microsoft.com/rest/api/cognitiveservices/face/largefacelist/addfacefromurl) to import the faces +// and [LargeFaceList - Train](https://docs.microsoft.com/rest/api/cognitiveservices/face/largefacelist/train) to make +// it ready for [Face - Find Similar](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/findsimilar). No // image will be stored. Only the extracted face features are stored on server until [LargeFaceList - -// Delete](/docs/services/563879b61984550e40cbbe8d/operations/5a1580d5d2de3616c086f2cd) is called. +// Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/largefacelist/delete) is called. //
Find Similar is used for scenario like finding celebrity-like faces, similar face filtering, or as a light // way face identification. But if the actual use is to identify person, please use -// [PersonGroup](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395244) / -// [LargePersonGroup](/docs/services/563879b61984550e40cbbe8d/operations/599acdee6ac60f11b48b5a9d) and [Face - -// Identify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395239). +// [PersonGroup](https://docs.microsoft.com/rest/api/cognitiveservices/face/persongroup) / +// [LargePersonGroup](https://docs.microsoft.com/rest/api/cognitiveservices/face/largepersongroup) and [Face - +// Identify](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/identify). //
'recognitionModel' should be specified to associate with this large face list. The default value for // 'recognitionModel' is 'recognition_01', if the latest model needed, please explicitly specify the model you need in // this parameter. New faces that are added to an existing large face list will use the recognition model that's // already associated with the collection. Existing face features in a large face list can't be updated to features // extracted by another version of recognition model. // * 'recognition_01': The default recognition model for [LargeFaceList- -// Create](/docs/services/563879b61984550e40cbbe8d/operations/5a157b68d2de3616c086f2cc). All those large face lists +// Create](https://docs.microsoft.com/rest/api/cognitiveservices/face/largefacelist/create). All those large face lists // created before 2019 March are bonded with this recognition model. -// * 'recognition_02': Recognition model released in 2019 March. 'recognition_02' is recommended since its overall +// * 'recognition_02': Recognition model released in 2019 March. 'recognition_02' is recommended since its overall // accuracy is improved compared with 'recognition_01'. // // Large face list quota: @@ -837,7 +837,7 @@ func (client LargeFaceListClient) GetTrainingStatusResponder(resp *http.Response // List list large face lists’ information of largeFaceListId, name, userData and recognitionModel.
// To get face information inside largeFaceList use [LargeFaceList Face - -// Get](/docs/services/563879b61984550e40cbbe8d/operations/5a158cf2d2de3616c086f2d5)
+// Get](https://docs.microsoft.com/rest/api/cognitiveservices/face/largefacelist/getface)
// * Large face lists are stored in alphabetical order of largeFaceListId. // * "start" parameter (string, optional) is a user-provided largeFaceListId value that returned entries have larger // ids by string comparison. "start" set to empty to indicate return from the first item. diff --git a/services/cognitiveservices/v1.0/face/largepersongroup.go b/services/cognitiveservices/v1.0/face/largepersongroup.go index edfcb7645e1c..0b21731eb5f4 100644 --- a/services/cognitiveservices/v1.0/face/largepersongroup.go +++ b/services/cognitiveservices/v1.0/face/largepersongroup.go @@ -42,23 +42,24 @@ func NewLargePersonGroupClient(endpoint string) LargePersonGroupClient { // to 1,000,000 // people. //
After creation, use [LargePersonGroup Person - -// Create](/docs/services/563879b61984550e40cbbe8d/operations/599adcba3a7b9412a4d53f40) to add person into the group, -// and call [LargePersonGroup - Train](/docs/services/563879b61984550e40cbbe8d/operations/599ae2d16ac60f11b48b5aa4) to -// get this group ready for [Face - -// Identify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395239). +// Create](https://docs.microsoft.com/rest/api/cognitiveservices/face/largepersongroupperson/create) to add person into +// the group, and call [LargePersonGroup - +// Train](https://docs.microsoft.com/rest/api/cognitiveservices/face/largepersongroup/train) to get this group ready +// for [Face - Identify](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/identify). //
No image will be stored. Only the person's extracted face features and userData will be stored on server // until [LargePersonGroup Person - -// Delete](/docs/services/563879b61984550e40cbbe8d/operations/599ade5c6ac60f11b48b5aa2) or [LargePersonGroup - -// Delete](/docs/services/563879b61984550e40cbbe8d/operations/599adc216ac60f11b48b5a9f) is called. +// Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/largepersongroupperson/delete) or +// [LargePersonGroup - Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/largepersongroup/delete) is +// called. //
'recognitionModel' should be specified to associate with this large person group. The default value for // 'recognitionModel' is 'recognition_01', if the latest model needed, please explicitly specify the model you need in // this parameter. New faces that are added to an existing large person group will use the recognition model that's // already associated with the collection. Existing face features in a large person group can't be updated to features // extracted by another version of recognition model. // * 'recognition_01': The default recognition model for [LargePersonGroup - -// Create](/docs/services/563879b61984550e40cbbe8d/operations/599acdee6ac60f11b48b5a9d). All those large person groups -// created before 2019 March are bonded with this recognition model. -// * 'recognition_02': Recognition model released in 2019 March. 'recognition_02' is recommended since its overall +// Create](https://docs.microsoft.com/rest/api/cognitiveservices/face/largepersongroup/create). All those large person +// groups created before 2019 March are bonded with this recognition model. +// * 'recognition_02': Recognition model released in 2019 March. 'recognition_02' is recommended since its overall // accuracy is improved compared with 'recognition_01'. // // Large person group quota: @@ -223,8 +224,8 @@ func (client LargePersonGroupClient) DeleteResponder(resp *http.Response) (resul // Get retrieve the information of a large person group, including its name, userData and recognitionModel. This API // returns large person group information only, use [LargePersonGroup Person - -// List](/docs/services/563879b61984550e40cbbe8d/operations/599adda06ac60f11b48b5aa1) instead to retrieve person -// information under the large person group. +// List](https://docs.microsoft.com/rest/api/cognitiveservices/face/largepersongroupperson/list) instead to retrieve +// person information under the large person group. // Parameters: // largePersonGroupID - id referencing a particular large person group. // returnRecognitionModel - a value indicating whether the operation should return 'recognitionModel' in diff --git a/services/cognitiveservices/v1.0/face/largepersongroupperson.go b/services/cognitiveservices/v1.0/face/largepersongroupperson.go index f5ec2d8fbf5a..3f2152514a5d 100644 --- a/services/cognitiveservices/v1.0/face/largepersongroupperson.go +++ b/services/cognitiveservices/v1.0/face/largepersongroupperson.go @@ -42,19 +42,21 @@ func NewLargePersonGroupPersonClient(endpoint string) LargePersonGroupPersonClie // with an image contains multiple faces, input face can be specified as an image with a targetFace rectangle. It // returns a persistedFaceId representing the added face. No image will be stored. Only the extracted face feature will // be stored on server until [LargePersonGroup PersonFace - -// Delete](/docs/services/563879b61984550e40cbbe8d/operations/599ae2966ac60f11b48b5aa3), [LargePersonGroup Person - -// Delete](/docs/services/563879b61984550e40cbbe8d/operations/599ade5c6ac60f11b48b5aa2) or [LargePersonGroup - -// Delete](/docs/services/563879b61984550e40cbbe8d/operations/599adc216ac60f11b48b5a9f) is called. +// Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/largepersongroupperson/deleteface), +// [LargePersonGroup Person - +// Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/largepersongroupperson/delete) or +// [LargePersonGroup - Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/largepersongroup/delete) is +// called. //
Note persistedFaceId is different from faceId generated by [Face - -// Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236). +// Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/detectwithurl). // * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, clear, // and face size is 200x200 pixels (100 pixels between eyes) or bigger. // * Each person entry can hold up to 248 faces. // * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. // * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the // provided "targetFace" rectangle is not returned from [Face - -// Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236), there’s no guarantee to detect -// and add the face successfully. +// Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/detectwithurl), there’s no guarantee to +// detect and add the face successfully. // * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause failures. // * Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from // different persons are processed in parallel. @@ -62,13 +64,13 @@ func NewLargePersonGroupPersonClient(endpoint string) LargePersonGroupPersonClie // dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. // * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer to // [How to specify a detection -// model](https://docs.microsoft.com/en-us/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model) +// model](https://docs.microsoft.com/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model) // | Model | Recommended use-case(s) | // | ---------- | -------- | // | 'detection_01': | The default detection model for [LargePersonGroup Person - Add -// Face](/docs/services/563879b61984550e40cbbe8d/operations/599adf2a3a7b9412a4d53f42). Recommend for near frontal face -// detection. For scenarios with exceptionally large angle (head-pose) faces, occluded faces or wrong image -// orientation, the faces in such cases may not be detected. | +// Face](https://docs.microsoft.com/rest/api/cognitiveservices/face/largepersongroupperson/addfacefromurl). Recommend +// for near frontal face detection. For scenarios with exceptionally large angle (head-pose) faces, occluded faces or +// wrong image orientation, the faces in such cases may not be detected. | // | 'detection_02': | Detection model released in 2019 May with improved accuracy especially on small, side and blurry // faces. | // Parameters: @@ -183,19 +185,21 @@ func (client LargePersonGroupPersonClient) AddFaceFromStreamResponder(resp *http // with an image contains multiple faces, input face can be specified as an image with a targetFace rectangle. It // returns a persistedFaceId representing the added face. No image will be stored. Only the extracted face feature will // be stored on server until [LargePersonGroup PersonFace - -// Delete](/docs/services/563879b61984550e40cbbe8d/operations/599ae2966ac60f11b48b5aa3), [LargePersonGroup Person - -// Delete](/docs/services/563879b61984550e40cbbe8d/operations/599ade5c6ac60f11b48b5aa2) or [LargePersonGroup - -// Delete](/docs/services/563879b61984550e40cbbe8d/operations/599adc216ac60f11b48b5a9f) is called. +// Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/largepersongroupperson/deleteface), +// [LargePersonGroup Person - +// Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/largepersongroupperson/delete) or +// [LargePersonGroup - Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/largepersongroup/delete) is +// called. //
Note persistedFaceId is different from faceId generated by [Face - -// Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236). +// Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/detectwithurl). // * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, clear, // and face size is 200x200 pixels (100 pixels between eyes) or bigger. // * Each person entry can hold up to 248 faces. // * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. // * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the // provided "targetFace" rectangle is not returned from [Face - -// Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236), there’s no guarantee to detect -// and add the face successfully. +// Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/detectwithurl), there’s no guarantee to +// detect and add the face successfully. // * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause failures. // * Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from // different persons are processed in parallel. @@ -203,13 +207,13 @@ func (client LargePersonGroupPersonClient) AddFaceFromStreamResponder(resp *http // dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. // * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer to // [How to specify a detection -// model](https://docs.microsoft.com/en-us/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model) +// model](https://docs.microsoft.com/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model) // | Model | Recommended use-case(s) | // | ---------- | -------- | // | 'detection_01': | The default detection model for [LargePersonGroup Person - Add -// Face](/docs/services/563879b61984550e40cbbe8d/operations/599adf2a3a7b9412a4d53f42). Recommend for near frontal face -// detection. For scenarios with exceptionally large angle (head-pose) faces, occluded faces or wrong image -// orientation, the faces in such cases may not be detected. | +// Face](https://docs.microsoft.com/rest/api/cognitiveservices/face/largepersongroupperson/addfacefromurl). Recommend +// for near frontal face detection. For scenarios with exceptionally large angle (head-pose) faces, occluded faces or +// wrong image orientation, the faces in such cases may not be detected. | // | 'detection_02': | Detection model released in 2019 May with improved accuracy especially on small, side and blurry // faces. | // Parameters: diff --git a/services/cognitiveservices/v1.0/face/list.go b/services/cognitiveservices/v1.0/face/list.go index 18e2bd23a136..dfde71213b3e 100644 --- a/services/cognitiveservices/v1.0/face/list.go +++ b/services/cognitiveservices/v1.0/face/list.go @@ -42,17 +42,17 @@ func NewListClient(endpoint string) ListClient { //
To deal with an image contains multiple faces, input face can be specified as an image with a targetFace // rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted // face feature will be stored on server until [FaceList - Delete -// Face](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395251) or [FaceList - -// Delete](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039524f) is called. +// Face](https://docs.microsoft.com/rest/api/cognitiveservices/face/facelist/deleteface) or [FaceList - +// Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/facelist/delete) is called. //
Note persistedFaceId is different from faceId generated by [Face - -// Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236). +// Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/detectwithurl). // * Higher face image quality means better detection and recognition precision. Please consider high-quality faces: // frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. // * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. // * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the // provided "targetFace" rectangle is not returned from [Face - -// Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236), there’s no guarantee to detect -// and add the face successfully. +// Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/detectwithurl), there’s no guarantee to +// detect and add the face successfully. // * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause failures. // * Adding/deleting faces to/from a same face list are processed sequentially and to/from different face lists are in // parallel. @@ -60,13 +60,13 @@ func NewListClient(endpoint string) ListClient { // dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. // * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer to // [How to specify a detection -// model](https://docs.microsoft.com/en-us/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model) +// model](https://docs.microsoft.com/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model) // | Model | Recommended use-case(s) | // | ---------- | -------- | // | 'detection_01': | The default detection model for [FaceList - Add -// Face](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395250). Recommend for near frontal face -// detection. For scenarios with exceptionally large angle (head-pose) faces, occluded faces or wrong image -// orientation, the faces in such cases may not be detected. | +// Face](https://docs.microsoft.com/rest/api/cognitiveservices/face/facelist/addfacefromurl). Recommend for near +// frontal face detection. For scenarios with exceptionally large angle (head-pose) faces, occluded faces or wrong +// image orientation, the faces in such cases may not be detected. | // | 'detection_02': | Detection model released in 2019 May with improved accuracy especially on small, side and blurry // faces. | // Parameters: @@ -179,17 +179,17 @@ func (client ListClient) AddFaceFromStreamResponder(resp *http.Response) (result //
To deal with an image contains multiple faces, input face can be specified as an image with a targetFace // rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted // face feature will be stored on server until [FaceList - Delete -// Face](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395251) or [FaceList - -// Delete](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039524f) is called. +// Face](https://docs.microsoft.com/rest/api/cognitiveservices/face/facelist/deleteface) or [FaceList - +// Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/facelist/delete) is called. //
Note persistedFaceId is different from faceId generated by [Face - -// Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236). +// Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/detectwithurl). // * Higher face image quality means better detection and recognition precision. Please consider high-quality faces: // frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. // * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. // * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the // provided "targetFace" rectangle is not returned from [Face - -// Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236), there’s no guarantee to detect -// and add the face successfully. +// Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/detectwithurl), there’s no guarantee to +// detect and add the face successfully. // * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause failures. // * Adding/deleting faces to/from a same face list are processed sequentially and to/from different face lists are in // parallel. @@ -197,13 +197,13 @@ func (client ListClient) AddFaceFromStreamResponder(resp *http.Response) (result // dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. // * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer to // [How to specify a detection -// model](https://docs.microsoft.com/en-us/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model) +// model](https://docs.microsoft.com/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model) // | Model | Recommended use-case(s) | // | ---------- | -------- | // | 'detection_01': | The default detection model for [FaceList - Add -// Face](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395250). Recommend for near frontal face -// detection. For scenarios with exceptionally large angle (head-pose) faces, occluded faces or wrong image -// orientation, the faces in such cases may not be detected. | +// Face](https://docs.microsoft.com/rest/api/cognitiveservices/face/facelist/addfacefromurl). Recommend for near +// frontal face detection. For scenarios with exceptionally large angle (head-pose) faces, occluded faces or wrong +// image orientation, the faces in such cases may not be detected. | // | 'detection_02': | Detection model released in 2019 May with improved accuracy especially on small, side and blurry // faces. | // Parameters: @@ -317,17 +317,17 @@ func (client ListClient) AddFaceFromURLResponder(resp *http.Response) (result Pe // Create create an empty face list with user-specified faceListId, name, an optional userData and recognitionModel. Up // to 64 face lists are allowed in one subscription. //
Face list is a list of faces, up to 1,000 faces, and used by [Face - Find -// Similar](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395237). +// Similar](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/findsimilar). //
After creation, user should use [FaceList - Add -// Face](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395250) to import the faces. No image -// will be stored. Only the extracted face features are stored on server until [FaceList - -// Delete](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039524f) is called. +// Face](https://docs.microsoft.com/rest/api/cognitiveservices/face/facelist/addfacefromurl) to import the faces. No +// image will be stored. Only the extracted face features are stored on server until [FaceList - +// Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/facelist/delete) is called. //
Find Similar is used for scenario like finding celebrity-like faces, similar face filtering, or as a light // way face identification. But if the actual use is to identify person, please use -// [PersonGroup](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395244) / -// [LargePersonGroup](/docs/services/563879b61984550e40cbbe8d/operations/599acdee6ac60f11b48b5a9d) and [Face - -// Identify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395239). -//
Please consider [LargeFaceList](/docs/services/563879b61984550e40cbbe8d/operations/5a157b68d2de3616c086f2cc) +// [PersonGroup](https://docs.microsoft.com/rest/api/cognitiveservices/face/persongroup) / +// [LargePersonGroup](https://docs.microsoft.com/rest/api/cognitiveservices/face/largepersongroup) and [Face - +// Identify](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/identify). +//
Please consider [LargeFaceList](https://docs.microsoft.com/rest/api/cognitiveservices/face/largefacelist) // when the face number is large. It can support up to 1,000,000 faces. //
'recognitionModel' should be specified to associate with this face list. The default value for // 'recognitionModel' is 'recognition_01', if the latest model needed, please explicitly specify the model you need in @@ -335,9 +335,9 @@ func (client ListClient) AddFaceFromURLResponder(resp *http.Response) (result Pe // associated with the collection. Existing face features in a face list can't be updated to features extracted by // another version of recognition model. // * 'recognition_01': The default recognition model for [FaceList- -// Create](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039524b). All those face lists created +// Create](https://docs.microsoft.com/rest/api/cognitiveservices/face/facelist/create). All those face lists created // before 2019 March are bonded with this recognition model. -// * 'recognition_02': Recognition model released in 2019 March. 'recognition_02' is recommended since its overall +// * 'recognition_02': Recognition model released in 2019 March. 'recognition_02' is recommended since its overall // accuracy is improved compared with 'recognition_01'. // Parameters: // faceListID - id referencing a particular face list. @@ -666,7 +666,7 @@ func (client ListClient) GetResponder(resp *http.Response) (result List, err err // List list face lists’ faceListId, name, userData and recognitionModel.
// To get face information inside faceList use [FaceList - -// Get](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039524c) +// Get](https://docs.microsoft.com/rest/api/cognitiveservices/face/facelist/get) // Parameters: // returnRecognitionModel - a value indicating whether the operation should return 'recognitionModel' in // response. diff --git a/services/cognitiveservices/v1.0/face/persongroup.go b/services/cognitiveservices/v1.0/face/persongroup.go index 4116f2e99a78..eb7f48655979 100644 --- a/services/cognitiveservices/v1.0/face/persongroup.go +++ b/services/cognitiveservices/v1.0/face/persongroup.go @@ -39,29 +39,30 @@ func NewPersonGroupClient(endpoint string) PersonGroupClient { // Create create a new person group with specified personGroupId, name, user-provided userData and recognitionModel. //
A person group is the container of the uploaded person data, including face recognition features. //
After creation, use [PersonGroup Person - -// Create](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039523c) to add persons into the group, -// and then call [PersonGroup - Train](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395249) to -// get this group ready for [Face - -// Identify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395239). +// Create](https://docs.microsoft.com/rest/api/cognitiveservices/face/persongroupperson/create) to add persons into the +// group, and then call [PersonGroup - +// Train](https://docs.microsoft.com/rest/api/cognitiveservices/face/persongroup/train) to get this group ready for +// [Face - Identify](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/identify). //
No image will be stored. Only the person's extracted face features and userData will be stored on server -// until [PersonGroup Person - Delete](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039523d) or -// [PersonGroup - Delete](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395245) is called. +// until [PersonGroup Person - +// Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/persongroupperson/delete) or [PersonGroup - +// Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/persongroup/delete) is called. //
'recognitionModel' should be specified to associate with this person group. The default value for // 'recognitionModel' is 'recognition_01', if the latest model needed, please explicitly specify the model you need in // this parameter. New faces that are added to an existing person group will use the recognition model that's already // associated with the collection. Existing face features in a person group can't be updated to features extracted by // another version of recognition model. // * 'recognition_01': The default recognition model for [PersonGroup - -// Create](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395244). All those person groups +// Create](https://docs.microsoft.com/rest/api/cognitiveservices/face/persongroup/create). All those person groups // created before 2019 March are bonded with this recognition model. -// * 'recognition_02': Recognition model released in 2019 March. 'recognition_02' is recommended since its overall +// * 'recognition_02': Recognition model released in 2019 March. 'recognition_02' is recommended since its overall // accuracy is improved compared with 'recognition_01'. // // Person group quota: // * Free-tier subscription quota: 1,000 person groups. Each holds up to 1,000 persons. // * S0-tier subscription quota: 1,000,000 person groups. Each holds up to 10,000 persons. // * to handle larger scale face identification problem, please consider using -// [LargePersonGroup](/docs/services/563879b61984550e40cbbe8d/operations/599acdee6ac60f11b48b5a9d). +// [LargePersonGroup](https://docs.microsoft.com/rest/api/cognitiveservices/face/largepersongroup). // Parameters: // personGroupID - id referencing a particular person group. // body - request body for creating new person group. @@ -220,7 +221,7 @@ func (client PersonGroupClient) DeleteResponder(resp *http.Response) (result aut } // Get retrieve person group name, userData and recognitionModel. To get person information under this personGroup, use -// [PersonGroup Person - List](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395241). +// [PersonGroup Person - List](https://docs.microsoft.com/rest/api/cognitiveservices/face/persongroupperson/list). // Parameters: // personGroupID - id referencing a particular person group. // returnRecognitionModel - a value indicating whether the operation should return 'recognitionModel' in diff --git a/services/cognitiveservices/v1.0/face/persongroupperson.go b/services/cognitiveservices/v1.0/face/persongroupperson.go index f79938d9a4d8..e1cbfecef596 100644 --- a/services/cognitiveservices/v1.0/face/persongroupperson.go +++ b/services/cognitiveservices/v1.0/face/persongroupperson.go @@ -42,19 +42,19 @@ func NewPersonGroupPersonClient(endpoint string) PersonGroupPersonClient { // an image contains multiple faces, input face can be specified as an image with a targetFace rectangle. It returns a // persistedFaceId representing the added face. No image will be stored. Only the extracted face feature will be stored // on server until [PersonGroup PersonFace - -// Delete](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039523e), [PersonGroup Person - -// Delete](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039523d) or [PersonGroup - -// Delete](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395245) is called. +// Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/persongroupperson/deleteface), [PersonGroup +// Person - Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/persongroupperson/delete) or +// [PersonGroup - Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/persongroup/delete) is called. //
Note persistedFaceId is different from faceId generated by [Face - -// Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236). +// Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/detectwithurl). // * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, // clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. // * Each person entry can hold up to 248 faces. // * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. // * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the // provided "targetFace" rectangle is not returned from [Face - -// Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236), there’s no guarantee to detect -// and add the face successfully. +// Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/detectwithurl), there’s no guarantee to +// detect and add the face successfully. // * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause // failures. // * Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from @@ -63,13 +63,13 @@ func NewPersonGroupPersonClient(endpoint string) PersonGroupPersonClient { // dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. // * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer to // [How to specify a detection -// model](https://docs.microsoft.com/en-us/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model) +// model](https://docs.microsoft.com/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model) // | Model | Recommended use-case(s) | // | ---------- | -------- | // | 'detection_01': | The default detection model for [PersonGroup Person - Add -// Face](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039523b). Recommend for near frontal face -// detection. For scenarios with exceptionally large angle (head-pose) faces, occluded faces or wrong image -// orientation, the faces in such cases may not be detected. | +// Face](https://docs.microsoft.com/rest/api/cognitiveservices/face/persongroupperson/addfacefromurl). Recommend for +// near frontal face detection. For scenarios with exceptionally large angle (head-pose) faces, occluded faces or wrong +// image orientation, the faces in such cases may not be detected. | // | 'detection_02': | Detection model released in 2019 May with improved accuracy especially on small, side and blurry // faces. | // Parameters: @@ -184,19 +184,19 @@ func (client PersonGroupPersonClient) AddFaceFromStreamResponder(resp *http.Resp // image contains multiple faces, input face can be specified as an image with a targetFace rectangle. It returns a // persistedFaceId representing the added face. No image will be stored. Only the extracted face feature will be stored // on server until [PersonGroup PersonFace - -// Delete](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039523e), [PersonGroup Person - -// Delete](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039523d) or [PersonGroup - -// Delete](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395245) is called. +// Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/persongroupperson/deleteface), [PersonGroup +// Person - Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/persongroupperson/delete) or +// [PersonGroup - Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/persongroup/delete) is called. //
Note persistedFaceId is different from faceId generated by [Face - -// Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236). +// Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/detectwithurl). // * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, // clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. // * Each person entry can hold up to 248 faces. // * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. // * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the // provided "targetFace" rectangle is not returned from [Face - -// Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236), there’s no guarantee to detect -// and add the face successfully. +// Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/detectwithurl), there’s no guarantee to +// detect and add the face successfully. // * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause // failures. // * Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from @@ -205,13 +205,13 @@ func (client PersonGroupPersonClient) AddFaceFromStreamResponder(resp *http.Resp // dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size. // * Different 'detectionModel' values can be provided. To use and compare different detection models, please refer to // [How to specify a detection -// model](https://docs.microsoft.com/en-us/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model) +// model](https://docs.microsoft.com/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model) // | Model | Recommended use-case(s) | // | ---------- | -------- | // | 'detection_01': | The default detection model for [PersonGroup Person - Add -// Face](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039523b). Recommend for near frontal face -// detection. For scenarios with exceptionally large angle (head-pose) faces, occluded faces or wrong image -// orientation, the faces in such cases may not be detected. | +// Face](https://docs.microsoft.com/rest/api/cognitiveservices/face/persongroupperson/addfacefromurl). Recommend for +// near frontal face detection. For scenarios with exceptionally large angle (head-pose) faces, occluded faces or wrong +// image orientation, the faces in such cases may not be detected. | // | 'detection_02': | Detection model released in 2019 May with improved accuracy especially on small, side and blurry // faces. | // Parameters: @@ -917,19 +917,19 @@ func (client PersonGroupPersonClient) UpdateResponder(resp *http.Response) (resu // contains multiple faces, input face can be specified as an image with a targetFace rectangle. It returns a // persistedFaceId representing the added face. No image will be stored. Only the extracted face feature will be stored // on server until [PersonGroup PersonFace - -// Delete](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039523e), [PersonGroup Person - -// Delete](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039523d) or [PersonGroup - -// Delete](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395245) is called. +// Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/persongroupperson/deleteface), [PersonGroup +// Person - Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/persongroupperson/delete) or +// [PersonGroup - Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/persongroup/delete) is called. //
Note persistedFaceId is different from faceId generated by [Face - -// Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236). +// Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/detectwithurl). // * Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, clear, // and face size is 200x200 pixels (100 pixels between eyes) or bigger. // * Each person entry can hold up to 248 faces. // * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. // * "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the // provided "targetFace" rectangle is not returned from [Face - -// Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236), there’s no guarantee to detect -// and add the face successfully. +// Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/detectwithurl), there’s no guarantee to +// detect and add the face successfully. // * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause failures. // * Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from // different persons are processed in parallel. diff --git a/services/cognitiveservices/v3.0/computervision/client.go b/services/cognitiveservices/v3.0/computervision/client.go new file mode 100644 index 000000000000..8ac93d2280e5 --- /dev/null +++ b/services/cognitiveservices/v3.0/computervision/client.go @@ -0,0 +1,1840 @@ +// Package computervision implements the Azure ARM Computervision service API version 3.0. +// +// The Computer Vision API provides state-of-the-art algorithms to process images and return information. For example, +// it can be used to determine if an image contains mature content, or it can be used to find all the faces in an +// image. It also has other features like estimating dominant and accent colors, categorizing the content of images, +// and describing an image with complete English sentences. Additionally, it can also intelligently generate images +// thumbnails for displaying large images effectively. +package computervision + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" + "github.com/satori/go.uuid" + "io" + "net/http" +) + +// BaseClient is the base client for Computervision. +type BaseClient struct { + autorest.Client + Endpoint string +} + +// New creates an instance of the BaseClient client. +func New(endpoint string) BaseClient { + return NewWithoutDefaults(endpoint) +} + +// NewWithoutDefaults creates an instance of the BaseClient client. +func NewWithoutDefaults(endpoint string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + Endpoint: endpoint, + } +} + +// AnalyzeImage this operation extracts a rich set of visual features based on the image content. +// Two input methods are supported -- (1) Uploading an image or (2) specifying an image URL. Within your request, there +// is an optional parameter to allow you to choose which features to return. By default, image categories are returned +// in the response. +// A successful response will be returned in JSON. If the request failed, the response will contain an error code and a +// message to help understand what went wrong. +// Parameters: +// imageURL - a JSON document with a URL pointing to the image that is to be analyzed. +// visualFeatures - a string indicating what visual feature types to return. Multiple values should be +// comma-separated. Valid visual feature types include: Categories - categorizes image content according to a +// taxonomy defined in documentation. Tags - tags the image with a detailed list of words related to the image +// content. Description - describes the image content with a complete English sentence. Faces - detects if +// faces are present. If present, generate coordinates, gender and age. ImageType - detects if image is clipart +// or a line drawing. Color - determines the accent color, dominant color, and whether an image is black&white. +// Adult - detects if the image is pornographic in nature (depicts nudity or a sex act), or is gory (depicts +// extreme violence or blood). Sexually suggestive content (aka racy content) is also detected. Objects - +// detects various objects within an image, including the approximate location. The Objects argument is only +// available in English. Brands - detects various brands within an image, including the approximate location. +// The Brands argument is only available in English. +// details - a string indicating which domain-specific details to return. Multiple values should be +// comma-separated. Valid visual feature types include: Celebrities - identifies celebrities if detected in the +// image, Landmarks - identifies notable landmarks in the image. +// language - the desired language for output generation. If this parameter is not specified, the default value +// is "en".Supported languages:en - English, Default. es - Spanish, ja - Japanese, pt - Portuguese, +// zh - Simplified Chinese. +// descriptionExclude - turn off specified domain models when generating the description. +func (client BaseClient) AnalyzeImage(ctx context.Context, imageURL ImageURL, visualFeatures []VisualFeatureTypes, details []Details, language string, descriptionExclude []DescriptionExclude) (result ImageAnalysis, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.AnalyzeImage") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: imageURL, + Constraints: []validation.Constraint{{Target: "imageURL.URL", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("computervision.BaseClient", "AnalyzeImage", err.Error()) + } + + req, err := client.AnalyzeImagePreparer(ctx, imageURL, visualFeatures, details, language, descriptionExclude) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "AnalyzeImage", nil, "Failure preparing request") + return + } + + resp, err := client.AnalyzeImageSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "AnalyzeImage", resp, "Failure sending request") + return + } + + result, err = client.AnalyzeImageResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "AnalyzeImage", resp, "Failure responding to request") + } + + return +} + +// AnalyzeImagePreparer prepares the AnalyzeImage request. +func (client BaseClient) AnalyzeImagePreparer(ctx context.Context, imageURL ImageURL, visualFeatures []VisualFeatureTypes, details []Details, language string, descriptionExclude []DescriptionExclude) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + queryParameters := map[string]interface{}{} + if visualFeatures != nil && len(visualFeatures) > 0 { + queryParameters["visualFeatures"] = autorest.Encode("query", visualFeatures, ",") + } + if details != nil && len(details) > 0 { + queryParameters["details"] = autorest.Encode("query", details, ",") + } + if len(string(language)) > 0 { + queryParameters["language"] = autorest.Encode("query", language) + } else { + queryParameters["language"] = autorest.Encode("query", "en") + } + if descriptionExclude != nil && len(descriptionExclude) > 0 { + queryParameters["descriptionExclude"] = autorest.Encode("query", descriptionExclude, ",") + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithCustomBaseURL("{Endpoint}/vision/v3.0", urlParameters), + autorest.WithPath("/analyze"), + autorest.WithJSON(imageURL), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// AnalyzeImageSender sends the AnalyzeImage request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) AnalyzeImageSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// AnalyzeImageResponder handles the response to the AnalyzeImage request. The method always +// closes the http.Response Body. +func (client BaseClient) AnalyzeImageResponder(resp *http.Response) (result ImageAnalysis, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// AnalyzeImageByDomain this operation recognizes content within an image by applying a domain-specific model. The list +// of domain-specific models that are supported by the Computer Vision API can be retrieved using the /models GET +// request. Currently, the API provides following domain-specific models: celebrities, landmarks. +// Two input methods are supported -- (1) Uploading an image or (2) specifying an image URL. +// A successful response will be returned in JSON. +// If the request failed, the response will contain an error code and a message to help understand what went wrong. +// Parameters: +// model - the domain-specific content to recognize. +// imageURL - a JSON document with a URL pointing to the image that is to be analyzed. +// language - the desired language for output generation. If this parameter is not specified, the default value +// is "en".Supported languages:en - English, Default. es - Spanish, ja - Japanese, pt - Portuguese, +// zh - Simplified Chinese. +func (client BaseClient) AnalyzeImageByDomain(ctx context.Context, model string, imageURL ImageURL, language string) (result DomainModelResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.AnalyzeImageByDomain") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: imageURL, + Constraints: []validation.Constraint{{Target: "imageURL.URL", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("computervision.BaseClient", "AnalyzeImageByDomain", err.Error()) + } + + req, err := client.AnalyzeImageByDomainPreparer(ctx, model, imageURL, language) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "AnalyzeImageByDomain", nil, "Failure preparing request") + return + } + + resp, err := client.AnalyzeImageByDomainSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "AnalyzeImageByDomain", resp, "Failure sending request") + return + } + + result, err = client.AnalyzeImageByDomainResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "AnalyzeImageByDomain", resp, "Failure responding to request") + } + + return +} + +// AnalyzeImageByDomainPreparer prepares the AnalyzeImageByDomain request. +func (client BaseClient) AnalyzeImageByDomainPreparer(ctx context.Context, model string, imageURL ImageURL, language string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "model": autorest.Encode("path", model), + } + + queryParameters := map[string]interface{}{} + if len(string(language)) > 0 { + queryParameters["language"] = autorest.Encode("query", language) + } else { + queryParameters["language"] = autorest.Encode("query", "en") + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithCustomBaseURL("{Endpoint}/vision/v3.0", urlParameters), + autorest.WithPathParameters("/models/{model}/analyze", pathParameters), + autorest.WithJSON(imageURL), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// AnalyzeImageByDomainSender sends the AnalyzeImageByDomain request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) AnalyzeImageByDomainSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// AnalyzeImageByDomainResponder handles the response to the AnalyzeImageByDomain request. The method always +// closes the http.Response Body. +func (client BaseClient) AnalyzeImageByDomainResponder(resp *http.Response) (result DomainModelResults, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// AnalyzeImageByDomainInStream this operation recognizes content within an image by applying a domain-specific model. +// The list of domain-specific models that are supported by the Computer Vision API can be retrieved using the /models +// GET request. Currently, the API provides following domain-specific models: celebrities, landmarks. +// Two input methods are supported -- (1) Uploading an image or (2) specifying an image URL. +// A successful response will be returned in JSON. +// If the request failed, the response will contain an error code and a message to help understand what went wrong. +// Parameters: +// model - the domain-specific content to recognize. +// imageParameter - an image stream. +// language - the desired language for output generation. If this parameter is not specified, the default value +// is "en".Supported languages:en - English, Default. es - Spanish, ja - Japanese, pt - Portuguese, +// zh - Simplified Chinese. +func (client BaseClient) AnalyzeImageByDomainInStream(ctx context.Context, model string, imageParameter io.ReadCloser, language string) (result DomainModelResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.AnalyzeImageByDomainInStream") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.AnalyzeImageByDomainInStreamPreparer(ctx, model, imageParameter, language) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "AnalyzeImageByDomainInStream", nil, "Failure preparing request") + return + } + + resp, err := client.AnalyzeImageByDomainInStreamSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "AnalyzeImageByDomainInStream", resp, "Failure sending request") + return + } + + result, err = client.AnalyzeImageByDomainInStreamResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "AnalyzeImageByDomainInStream", resp, "Failure responding to request") + } + + return +} + +// AnalyzeImageByDomainInStreamPreparer prepares the AnalyzeImageByDomainInStream request. +func (client BaseClient) AnalyzeImageByDomainInStreamPreparer(ctx context.Context, model string, imageParameter io.ReadCloser, language string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "model": autorest.Encode("path", model), + } + + queryParameters := map[string]interface{}{} + if len(string(language)) > 0 { + queryParameters["language"] = autorest.Encode("query", language) + } else { + queryParameters["language"] = autorest.Encode("query", "en") + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/octet-stream"), + autorest.AsPost(), + autorest.WithCustomBaseURL("{Endpoint}/vision/v3.0", urlParameters), + autorest.WithPathParameters("/models/{model}/analyze", pathParameters), + autorest.WithFile(imageParameter), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// AnalyzeImageByDomainInStreamSender sends the AnalyzeImageByDomainInStream request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) AnalyzeImageByDomainInStreamSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// AnalyzeImageByDomainInStreamResponder handles the response to the AnalyzeImageByDomainInStream request. The method always +// closes the http.Response Body. +func (client BaseClient) AnalyzeImageByDomainInStreamResponder(resp *http.Response) (result DomainModelResults, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// AnalyzeImageInStream this operation extracts a rich set of visual features based on the image content. +// Two input methods are supported -- (1) Uploading an image or (2) specifying an image URL. Within your request, there +// is an optional parameter to allow you to choose which features to return. By default, image categories are returned +// in the response. +// A successful response will be returned in JSON. If the request failed, the response will contain an error code and a +// message to help understand what went wrong. +// Parameters: +// imageParameter - an image stream. +// visualFeatures - a string indicating what visual feature types to return. Multiple values should be +// comma-separated. Valid visual feature types include: Categories - categorizes image content according to a +// taxonomy defined in documentation. Tags - tags the image with a detailed list of words related to the image +// content. Description - describes the image content with a complete English sentence. Faces - detects if +// faces are present. If present, generate coordinates, gender and age. ImageType - detects if image is clipart +// or a line drawing. Color - determines the accent color, dominant color, and whether an image is black&white. +// Adult - detects if the image is pornographic in nature (depicts nudity or a sex act), or is gory (depicts +// extreme violence or blood). Sexually suggestive content (aka racy content) is also detected. Objects - +// detects various objects within an image, including the approximate location. The Objects argument is only +// available in English. Brands - detects various brands within an image, including the approximate location. +// The Brands argument is only available in English. +// details - a string indicating which domain-specific details to return. Multiple values should be +// comma-separated. Valid visual feature types include: Celebrities - identifies celebrities if detected in the +// image, Landmarks - identifies notable landmarks in the image. +// language - the desired language for output generation. If this parameter is not specified, the default value +// is "en".Supported languages:en - English, Default. es - Spanish, ja - Japanese, pt - Portuguese, +// zh - Simplified Chinese. +// descriptionExclude - turn off specified domain models when generating the description. +func (client BaseClient) AnalyzeImageInStream(ctx context.Context, imageParameter io.ReadCloser, visualFeatures []VisualFeatureTypes, details []Details, language string, descriptionExclude []DescriptionExclude) (result ImageAnalysis, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.AnalyzeImageInStream") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.AnalyzeImageInStreamPreparer(ctx, imageParameter, visualFeatures, details, language, descriptionExclude) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "AnalyzeImageInStream", nil, "Failure preparing request") + return + } + + resp, err := client.AnalyzeImageInStreamSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "AnalyzeImageInStream", resp, "Failure sending request") + return + } + + result, err = client.AnalyzeImageInStreamResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "AnalyzeImageInStream", resp, "Failure responding to request") + } + + return +} + +// AnalyzeImageInStreamPreparer prepares the AnalyzeImageInStream request. +func (client BaseClient) AnalyzeImageInStreamPreparer(ctx context.Context, imageParameter io.ReadCloser, visualFeatures []VisualFeatureTypes, details []Details, language string, descriptionExclude []DescriptionExclude) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + queryParameters := map[string]interface{}{} + if visualFeatures != nil && len(visualFeatures) > 0 { + queryParameters["visualFeatures"] = autorest.Encode("query", visualFeatures, ",") + } + if details != nil && len(details) > 0 { + queryParameters["details"] = autorest.Encode("query", details, ",") + } + if len(string(language)) > 0 { + queryParameters["language"] = autorest.Encode("query", language) + } else { + queryParameters["language"] = autorest.Encode("query", "en") + } + if descriptionExclude != nil && len(descriptionExclude) > 0 { + queryParameters["descriptionExclude"] = autorest.Encode("query", descriptionExclude, ",") + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/octet-stream"), + autorest.AsPost(), + autorest.WithCustomBaseURL("{Endpoint}/vision/v3.0", urlParameters), + autorest.WithPath("/analyze"), + autorest.WithFile(imageParameter), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// AnalyzeImageInStreamSender sends the AnalyzeImageInStream request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) AnalyzeImageInStreamSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// AnalyzeImageInStreamResponder handles the response to the AnalyzeImageInStream request. The method always +// closes the http.Response Body. +func (client BaseClient) AnalyzeImageInStreamResponder(resp *http.Response) (result ImageAnalysis, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// DescribeImage this operation generates a description of an image in human readable language with complete sentences. +// The description is based on a collection of content tags, which are also returned by the operation. More than one +// description can be generated for each image. Descriptions are ordered by their confidence score. Descriptions may +// include results from celebrity and landmark domain models, if applicable. +// Two input methods are supported -- (1) Uploading an image or (2) specifying an image URL. +// A successful response will be returned in JSON. If the request failed, the response will contain an error code and a +// message to help understand what went wrong. +// Parameters: +// imageURL - a JSON document with a URL pointing to the image that is to be analyzed. +// maxCandidates - maximum number of candidate descriptions to be returned. The default is 1. +// language - the desired language for output generation. If this parameter is not specified, the default value +// is "en".Supported languages:en - English, Default. es - Spanish, ja - Japanese, pt - Portuguese, +// zh - Simplified Chinese. +// descriptionExclude - turn off specified domain models when generating the description. +func (client BaseClient) DescribeImage(ctx context.Context, imageURL ImageURL, maxCandidates *int32, language string, descriptionExclude []DescriptionExclude) (result ImageDescription, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DescribeImage") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: imageURL, + Constraints: []validation.Constraint{{Target: "imageURL.URL", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("computervision.BaseClient", "DescribeImage", err.Error()) + } + + req, err := client.DescribeImagePreparer(ctx, imageURL, maxCandidates, language, descriptionExclude) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "DescribeImage", nil, "Failure preparing request") + return + } + + resp, err := client.DescribeImageSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "DescribeImage", resp, "Failure sending request") + return + } + + result, err = client.DescribeImageResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "DescribeImage", resp, "Failure responding to request") + } + + return +} + +// DescribeImagePreparer prepares the DescribeImage request. +func (client BaseClient) DescribeImagePreparer(ctx context.Context, imageURL ImageURL, maxCandidates *int32, language string, descriptionExclude []DescriptionExclude) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + queryParameters := map[string]interface{}{} + if maxCandidates != nil { + queryParameters["maxCandidates"] = autorest.Encode("query", *maxCandidates) + } else { + queryParameters["maxCandidates"] = autorest.Encode("query", 1) + } + if len(string(language)) > 0 { + queryParameters["language"] = autorest.Encode("query", language) + } else { + queryParameters["language"] = autorest.Encode("query", "en") + } + if descriptionExclude != nil && len(descriptionExclude) > 0 { + queryParameters["descriptionExclude"] = autorest.Encode("query", descriptionExclude, ",") + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithCustomBaseURL("{Endpoint}/vision/v3.0", urlParameters), + autorest.WithPath("/describe"), + autorest.WithJSON(imageURL), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DescribeImageSender sends the DescribeImage request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) DescribeImageSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// DescribeImageResponder handles the response to the DescribeImage request. The method always +// closes the http.Response Body. +func (client BaseClient) DescribeImageResponder(resp *http.Response) (result ImageDescription, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// DescribeImageInStream this operation generates a description of an image in human readable language with complete +// sentences. The description is based on a collection of content tags, which are also returned by the operation. More +// than one description can be generated for each image. Descriptions are ordered by their confidence score. +// Descriptions may include results from celebrity and landmark domain models, if applicable. +// Two input methods are supported -- (1) Uploading an image or (2) specifying an image URL. +// A successful response will be returned in JSON. If the request failed, the response will contain an error code and a +// message to help understand what went wrong. +// Parameters: +// imageParameter - an image stream. +// maxCandidates - maximum number of candidate descriptions to be returned. The default is 1. +// language - the desired language for output generation. If this parameter is not specified, the default value +// is "en".Supported languages:en - English, Default. es - Spanish, ja - Japanese, pt - Portuguese, +// zh - Simplified Chinese. +// descriptionExclude - turn off specified domain models when generating the description. +func (client BaseClient) DescribeImageInStream(ctx context.Context, imageParameter io.ReadCloser, maxCandidates *int32, language string, descriptionExclude []DescriptionExclude) (result ImageDescription, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DescribeImageInStream") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DescribeImageInStreamPreparer(ctx, imageParameter, maxCandidates, language, descriptionExclude) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "DescribeImageInStream", nil, "Failure preparing request") + return + } + + resp, err := client.DescribeImageInStreamSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "DescribeImageInStream", resp, "Failure sending request") + return + } + + result, err = client.DescribeImageInStreamResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "DescribeImageInStream", resp, "Failure responding to request") + } + + return +} + +// DescribeImageInStreamPreparer prepares the DescribeImageInStream request. +func (client BaseClient) DescribeImageInStreamPreparer(ctx context.Context, imageParameter io.ReadCloser, maxCandidates *int32, language string, descriptionExclude []DescriptionExclude) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + queryParameters := map[string]interface{}{} + if maxCandidates != nil { + queryParameters["maxCandidates"] = autorest.Encode("query", *maxCandidates) + } else { + queryParameters["maxCandidates"] = autorest.Encode("query", 1) + } + if len(string(language)) > 0 { + queryParameters["language"] = autorest.Encode("query", language) + } else { + queryParameters["language"] = autorest.Encode("query", "en") + } + if descriptionExclude != nil && len(descriptionExclude) > 0 { + queryParameters["descriptionExclude"] = autorest.Encode("query", descriptionExclude, ",") + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/octet-stream"), + autorest.AsPost(), + autorest.WithCustomBaseURL("{Endpoint}/vision/v3.0", urlParameters), + autorest.WithPath("/describe"), + autorest.WithFile(imageParameter), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DescribeImageInStreamSender sends the DescribeImageInStream request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) DescribeImageInStreamSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// DescribeImageInStreamResponder handles the response to the DescribeImageInStream request. The method always +// closes the http.Response Body. +func (client BaseClient) DescribeImageInStreamResponder(resp *http.Response) (result ImageDescription, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// DetectObjects performs object detection on the specified image. +// Two input methods are supported -- (1) Uploading an image or (2) specifying an image URL. +// A successful response will be returned in JSON. If the request failed, the response will contain an error code and a +// message to help understand what went wrong. +// Parameters: +// imageURL - a JSON document with a URL pointing to the image that is to be analyzed. +func (client BaseClient) DetectObjects(ctx context.Context, imageURL ImageURL) (result DetectResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DetectObjects") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: imageURL, + Constraints: []validation.Constraint{{Target: "imageURL.URL", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("computervision.BaseClient", "DetectObjects", err.Error()) + } + + req, err := client.DetectObjectsPreparer(ctx, imageURL) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "DetectObjects", nil, "Failure preparing request") + return + } + + resp, err := client.DetectObjectsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "DetectObjects", resp, "Failure sending request") + return + } + + result, err = client.DetectObjectsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "DetectObjects", resp, "Failure responding to request") + } + + return +} + +// DetectObjectsPreparer prepares the DetectObjects request. +func (client BaseClient) DetectObjectsPreparer(ctx context.Context, imageURL ImageURL) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithCustomBaseURL("{Endpoint}/vision/v3.0", urlParameters), + autorest.WithPath("/detect"), + autorest.WithJSON(imageURL)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DetectObjectsSender sends the DetectObjects request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) DetectObjectsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// DetectObjectsResponder handles the response to the DetectObjects request. The method always +// closes the http.Response Body. +func (client BaseClient) DetectObjectsResponder(resp *http.Response) (result DetectResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// DetectObjectsInStream performs object detection on the specified image. +// Two input methods are supported -- (1) Uploading an image or (2) specifying an image URL. +// A successful response will be returned in JSON. If the request failed, the response will contain an error code and a +// message to help understand what went wrong. +// Parameters: +// imageParameter - an image stream. +func (client BaseClient) DetectObjectsInStream(ctx context.Context, imageParameter io.ReadCloser) (result DetectResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.DetectObjectsInStream") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DetectObjectsInStreamPreparer(ctx, imageParameter) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "DetectObjectsInStream", nil, "Failure preparing request") + return + } + + resp, err := client.DetectObjectsInStreamSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "DetectObjectsInStream", resp, "Failure sending request") + return + } + + result, err = client.DetectObjectsInStreamResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "DetectObjectsInStream", resp, "Failure responding to request") + } + + return +} + +// DetectObjectsInStreamPreparer prepares the DetectObjectsInStream request. +func (client BaseClient) DetectObjectsInStreamPreparer(ctx context.Context, imageParameter io.ReadCloser) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/octet-stream"), + autorest.AsPost(), + autorest.WithCustomBaseURL("{Endpoint}/vision/v3.0", urlParameters), + autorest.WithPath("/detect"), + autorest.WithFile(imageParameter)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DetectObjectsInStreamSender sends the DetectObjectsInStream request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) DetectObjectsInStreamSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// DetectObjectsInStreamResponder handles the response to the DetectObjectsInStream request. The method always +// closes the http.Response Body. +func (client BaseClient) DetectObjectsInStreamResponder(resp *http.Response) (result DetectResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GenerateThumbnail this operation generates a thumbnail image with the user-specified width and height. By default, +// the service analyzes the image, identifies the region of interest (ROI), and generates smart cropping coordinates +// based on the ROI. Smart cropping helps when you specify an aspect ratio that differs from that of the input image. +// A successful response contains the thumbnail image binary. If the request failed, the response contains an error +// code and a message to help determine what went wrong. +// Upon failure, the error code and an error message are returned. The error code could be one of InvalidImageUrl, +// InvalidImageFormat, InvalidImageSize, InvalidThumbnailSize, NotSupportedImage, FailedToProcess, Timeout, or +// InternalServerError. +// Parameters: +// width - width of the thumbnail, in pixels. It must be between 1 and 1024. Recommended minimum of 50. +// height - height of the thumbnail, in pixels. It must be between 1 and 1024. Recommended minimum of 50. +// imageURL - a JSON document with a URL pointing to the image that is to be analyzed. +// smartCropping - boolean flag for enabling smart cropping. +func (client BaseClient) GenerateThumbnail(ctx context.Context, width int32, height int32, imageURL ImageURL, smartCropping *bool) (result ReadCloser, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GenerateThumbnail") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: width, + Constraints: []validation.Constraint{{Target: "width", Name: validation.InclusiveMaximum, Rule: int64(1024), Chain: nil}, + {Target: "width", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}, + {TargetValue: height, + Constraints: []validation.Constraint{{Target: "height", Name: validation.InclusiveMaximum, Rule: int64(1024), Chain: nil}, + {Target: "height", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}, + {TargetValue: imageURL, + Constraints: []validation.Constraint{{Target: "imageURL.URL", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("computervision.BaseClient", "GenerateThumbnail", err.Error()) + } + + req, err := client.GenerateThumbnailPreparer(ctx, width, height, imageURL, smartCropping) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "GenerateThumbnail", nil, "Failure preparing request") + return + } + + resp, err := client.GenerateThumbnailSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "GenerateThumbnail", resp, "Failure sending request") + return + } + + result, err = client.GenerateThumbnailResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "GenerateThumbnail", resp, "Failure responding to request") + } + + return +} + +// GenerateThumbnailPreparer prepares the GenerateThumbnail request. +func (client BaseClient) GenerateThumbnailPreparer(ctx context.Context, width int32, height int32, imageURL ImageURL, smartCropping *bool) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + queryParameters := map[string]interface{}{ + "height": autorest.Encode("query", height), + "width": autorest.Encode("query", width), + } + if smartCropping != nil { + queryParameters["smartCropping"] = autorest.Encode("query", *smartCropping) + } else { + queryParameters["smartCropping"] = autorest.Encode("query", false) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithCustomBaseURL("{Endpoint}/vision/v3.0", urlParameters), + autorest.WithPath("/generateThumbnail"), + autorest.WithJSON(imageURL), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GenerateThumbnailSender sends the GenerateThumbnail request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GenerateThumbnailSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GenerateThumbnailResponder handles the response to the GenerateThumbnail request. The method always +// closes the http.Response Body. +func (client BaseClient) GenerateThumbnailResponder(resp *http.Response) (result ReadCloser, err error) { + result.Value = &resp.Body + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK)) + result.Response = autorest.Response{Response: resp} + return +} + +// GenerateThumbnailInStream this operation generates a thumbnail image with the user-specified width and height. By +// default, the service analyzes the image, identifies the region of interest (ROI), and generates smart cropping +// coordinates based on the ROI. Smart cropping helps when you specify an aspect ratio that differs from that of the +// input image. +// A successful response contains the thumbnail image binary. If the request failed, the response contains an error +// code and a message to help determine what went wrong. +// Upon failure, the error code and an error message are returned. The error code could be one of InvalidImageUrl, +// InvalidImageFormat, InvalidImageSize, InvalidThumbnailSize, NotSupportedImage, FailedToProcess, Timeout, or +// InternalServerError. +// Parameters: +// width - width of the thumbnail, in pixels. It must be between 1 and 1024. Recommended minimum of 50. +// height - height of the thumbnail, in pixels. It must be between 1 and 1024. Recommended minimum of 50. +// imageParameter - an image stream. +// smartCropping - boolean flag for enabling smart cropping. +func (client BaseClient) GenerateThumbnailInStream(ctx context.Context, width int32, height int32, imageParameter io.ReadCloser, smartCropping *bool) (result ReadCloser, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GenerateThumbnailInStream") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: width, + Constraints: []validation.Constraint{{Target: "width", Name: validation.InclusiveMaximum, Rule: int64(1024), Chain: nil}, + {Target: "width", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}, + {TargetValue: height, + Constraints: []validation.Constraint{{Target: "height", Name: validation.InclusiveMaximum, Rule: int64(1024), Chain: nil}, + {Target: "height", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}}); err != nil { + return result, validation.NewError("computervision.BaseClient", "GenerateThumbnailInStream", err.Error()) + } + + req, err := client.GenerateThumbnailInStreamPreparer(ctx, width, height, imageParameter, smartCropping) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "GenerateThumbnailInStream", nil, "Failure preparing request") + return + } + + resp, err := client.GenerateThumbnailInStreamSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "GenerateThumbnailInStream", resp, "Failure sending request") + return + } + + result, err = client.GenerateThumbnailInStreamResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "GenerateThumbnailInStream", resp, "Failure responding to request") + } + + return +} + +// GenerateThumbnailInStreamPreparer prepares the GenerateThumbnailInStream request. +func (client BaseClient) GenerateThumbnailInStreamPreparer(ctx context.Context, width int32, height int32, imageParameter io.ReadCloser, smartCropping *bool) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + queryParameters := map[string]interface{}{ + "height": autorest.Encode("query", height), + "width": autorest.Encode("query", width), + } + if smartCropping != nil { + queryParameters["smartCropping"] = autorest.Encode("query", *smartCropping) + } else { + queryParameters["smartCropping"] = autorest.Encode("query", false) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/octet-stream"), + autorest.AsPost(), + autorest.WithCustomBaseURL("{Endpoint}/vision/v3.0", urlParameters), + autorest.WithPath("/generateThumbnail"), + autorest.WithFile(imageParameter), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GenerateThumbnailInStreamSender sends the GenerateThumbnailInStream request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GenerateThumbnailInStreamSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GenerateThumbnailInStreamResponder handles the response to the GenerateThumbnailInStream request. The method always +// closes the http.Response Body. +func (client BaseClient) GenerateThumbnailInStreamResponder(resp *http.Response) (result ReadCloser, err error) { + result.Value = &resp.Body + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK)) + result.Response = autorest.Response{Response: resp} + return +} + +// GetAreaOfInterest this operation returns a bounding box around the most important area of the image. +// A successful response will be returned in JSON. If the request failed, the response contains an error code and a +// message to help determine what went wrong. +// Upon failure, the error code and an error message are returned. The error code could be one of InvalidImageUrl, +// InvalidImageFormat, InvalidImageSize, NotSupportedImage, FailedToProcess, Timeout, or InternalServerError. +// Parameters: +// imageURL - a JSON document with a URL pointing to the image that is to be analyzed. +func (client BaseClient) GetAreaOfInterest(ctx context.Context, imageURL ImageURL) (result AreaOfInterestResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetAreaOfInterest") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: imageURL, + Constraints: []validation.Constraint{{Target: "imageURL.URL", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("computervision.BaseClient", "GetAreaOfInterest", err.Error()) + } + + req, err := client.GetAreaOfInterestPreparer(ctx, imageURL) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "GetAreaOfInterest", nil, "Failure preparing request") + return + } + + resp, err := client.GetAreaOfInterestSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "GetAreaOfInterest", resp, "Failure sending request") + return + } + + result, err = client.GetAreaOfInterestResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "GetAreaOfInterest", resp, "Failure responding to request") + } + + return +} + +// GetAreaOfInterestPreparer prepares the GetAreaOfInterest request. +func (client BaseClient) GetAreaOfInterestPreparer(ctx context.Context, imageURL ImageURL) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithCustomBaseURL("{Endpoint}/vision/v3.0", urlParameters), + autorest.WithPath("/areaOfInterest"), + autorest.WithJSON(imageURL)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetAreaOfInterestSender sends the GetAreaOfInterest request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetAreaOfInterestSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetAreaOfInterestResponder handles the response to the GetAreaOfInterest request. The method always +// closes the http.Response Body. +func (client BaseClient) GetAreaOfInterestResponder(resp *http.Response) (result AreaOfInterestResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetAreaOfInterestInStream this operation returns a bounding box around the most important area of the image. +// A successful response will be returned in JSON. If the request failed, the response contains an error code and a +// message to help determine what went wrong. +// Upon failure, the error code and an error message are returned. The error code could be one of InvalidImageUrl, +// InvalidImageFormat, InvalidImageSize, NotSupportedImage, FailedToProcess, Timeout, or InternalServerError. +// Parameters: +// imageParameter - an image stream. +func (client BaseClient) GetAreaOfInterestInStream(ctx context.Context, imageParameter io.ReadCloser) (result AreaOfInterestResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetAreaOfInterestInStream") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetAreaOfInterestInStreamPreparer(ctx, imageParameter) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "GetAreaOfInterestInStream", nil, "Failure preparing request") + return + } + + resp, err := client.GetAreaOfInterestInStreamSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "GetAreaOfInterestInStream", resp, "Failure sending request") + return + } + + result, err = client.GetAreaOfInterestInStreamResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "GetAreaOfInterestInStream", resp, "Failure responding to request") + } + + return +} + +// GetAreaOfInterestInStreamPreparer prepares the GetAreaOfInterestInStream request. +func (client BaseClient) GetAreaOfInterestInStreamPreparer(ctx context.Context, imageParameter io.ReadCloser) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/octet-stream"), + autorest.AsPost(), + autorest.WithCustomBaseURL("{Endpoint}/vision/v3.0", urlParameters), + autorest.WithPath("/areaOfInterest"), + autorest.WithFile(imageParameter)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetAreaOfInterestInStreamSender sends the GetAreaOfInterestInStream request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetAreaOfInterestInStreamSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetAreaOfInterestInStreamResponder handles the response to the GetAreaOfInterestInStream request. The method always +// closes the http.Response Body. +func (client BaseClient) GetAreaOfInterestInStreamResponder(resp *http.Response) (result AreaOfInterestResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetReadResult this interface is used for getting OCR results of Read operation. The URL to this interface should be +// retrieved from 'Operation-Location' field returned from Read interface. +// Parameters: +// operationID - id of read operation returned in the response of the 'Read' interface. +func (client BaseClient) GetReadResult(ctx context.Context, operationID uuid.UUID) (result ReadOperationResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetReadResult") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetReadResultPreparer(ctx, operationID) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "GetReadResult", nil, "Failure preparing request") + return + } + + resp, err := client.GetReadResultSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "GetReadResult", resp, "Failure sending request") + return + } + + result, err = client.GetReadResultResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "GetReadResult", resp, "Failure responding to request") + } + + return +} + +// GetReadResultPreparer prepares the GetReadResult request. +func (client BaseClient) GetReadResultPreparer(ctx context.Context, operationID uuid.UUID) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + pathParameters := map[string]interface{}{ + "operationId": autorest.Encode("path", operationID), + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{Endpoint}/vision/v3.0", urlParameters), + autorest.WithPathParameters("/read/analyzeResults/{operationId}", pathParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetReadResultSender sends the GetReadResult request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetReadResultSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetReadResultResponder handles the response to the GetReadResult request. The method always +// closes the http.Response Body. +func (client BaseClient) GetReadResultResponder(resp *http.Response) (result ReadOperationResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListModels this operation returns the list of domain-specific models that are supported by the Computer Vision API. +// Currently, the API supports following domain-specific models: celebrity recognizer, landmark recognizer. +// A successful response will be returned in JSON. If the request failed, the response will contain an error code and a +// message to help understand what went wrong. +func (client BaseClient) ListModels(ctx context.Context) (result ListModelsResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ListModels") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListModelsPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "ListModels", nil, "Failure preparing request") + return + } + + resp, err := client.ListModelsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "ListModels", resp, "Failure sending request") + return + } + + result, err = client.ListModelsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "ListModels", resp, "Failure responding to request") + } + + return +} + +// ListModelsPreparer prepares the ListModels request. +func (client BaseClient) ListModelsPreparer(ctx context.Context) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithCustomBaseURL("{Endpoint}/vision/v3.0", urlParameters), + autorest.WithPath("/models")) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListModelsSender sends the ListModels request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) ListModelsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListModelsResponder handles the response to the ListModels request. The method always +// closes the http.Response Body. +func (client BaseClient) ListModelsResponder(resp *http.Response) (result ListModelsResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Read use this interface to get the result of a Read operation, employing the state-of-the-art Optical Character +// Recognition (OCR) algorithms optimized for text-heavy documents. When you use the Read interface, the response +// contains a field called 'Operation-Location'. The 'Operation-Location' field contains the URL that you must use for +// your 'GetReadResult' operation to access OCR results.​ +// Parameters: +// imageURL - a JSON document with a URL pointing to the image that is to be analyzed. +// language - the BCP-47 language code of the text in the document. Currently, only English ('en'), Dutch +// (‘nl’), French (‘fr’), German (‘de’), Italian (‘it’), Portuguese (‘pt), and Spanish ('es') are supported. +// Read supports auto language identification and multilanguage documents, so only provide a language code if +// you would like to force the documented to be processed as that specific language. +func (client BaseClient) Read(ctx context.Context, imageURL ImageURL, language OcrDetectionLanguage) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.Read") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: imageURL, + Constraints: []validation.Constraint{{Target: "imageURL.URL", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("computervision.BaseClient", "Read", err.Error()) + } + + req, err := client.ReadPreparer(ctx, imageURL, language) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "Read", nil, "Failure preparing request") + return + } + + resp, err := client.ReadSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "Read", resp, "Failure sending request") + return + } + + result, err = client.ReadResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "Read", resp, "Failure responding to request") + } + + return +} + +// ReadPreparer prepares the Read request. +func (client BaseClient) ReadPreparer(ctx context.Context, imageURL ImageURL, language OcrDetectionLanguage) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + queryParameters := map[string]interface{}{} + if len(string(language)) > 0 { + queryParameters["language"] = autorest.Encode("query", language) + } else { + queryParameters["language"] = autorest.Encode("query", "en") + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithCustomBaseURL("{Endpoint}/vision/v3.0", urlParameters), + autorest.WithPath("/read/analyze"), + autorest.WithJSON(imageURL), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ReadSender sends the Read request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) ReadSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ReadResponder handles the response to the Read request. The method always +// closes the http.Response Body. +func (client BaseClient) ReadResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// ReadInStream use this interface to get the result of a Read operation, employing the state-of-the-art Optical +// Character Recognition (OCR) algorithms optimized for text-heavy documents. When you use the Read interface, the +// response contains a field called 'Operation-Location'. The 'Operation-Location' field contains the URL that you must +// use for your 'GetReadResult' operation to access OCR results.​ +// Parameters: +// imageParameter - an image stream. +// language - the BCP-47 language code of the text in the document. Currently, only English ('en'), Dutch +// (‘nl’), French (‘fr’), German (‘de’), Italian (‘it’), Portuguese (‘pt), and Spanish ('es') are supported. +// Read supports auto language identification and multilanguage documents, so only provide a language code if +// you would like to force the documented to be processed as that specific language. +func (client BaseClient) ReadInStream(ctx context.Context, imageParameter io.ReadCloser, language OcrDetectionLanguage) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ReadInStream") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ReadInStreamPreparer(ctx, imageParameter, language) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "ReadInStream", nil, "Failure preparing request") + return + } + + resp, err := client.ReadInStreamSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "ReadInStream", resp, "Failure sending request") + return + } + + result, err = client.ReadInStreamResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "ReadInStream", resp, "Failure responding to request") + } + + return +} + +// ReadInStreamPreparer prepares the ReadInStream request. +func (client BaseClient) ReadInStreamPreparer(ctx context.Context, imageParameter io.ReadCloser, language OcrDetectionLanguage) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + queryParameters := map[string]interface{}{} + if len(string(language)) > 0 { + queryParameters["language"] = autorest.Encode("query", language) + } else { + queryParameters["language"] = autorest.Encode("query", "en") + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/octet-stream"), + autorest.AsPost(), + autorest.WithCustomBaseURL("{Endpoint}/vision/v3.0", urlParameters), + autorest.WithPath("/read/analyze"), + autorest.WithFile(imageParameter), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ReadInStreamSender sends the ReadInStream request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) ReadInStreamSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ReadInStreamResponder handles the response to the ReadInStream request. The method always +// closes the http.Response Body. +func (client BaseClient) ReadInStreamResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// RecognizePrintedText optical Character Recognition (OCR) detects text in an image and extracts the recognized +// characters into a machine-usable character stream. +// Upon success, the OCR results will be returned. +// Upon failure, the error code together with an error message will be returned. The error code can be one of +// InvalidImageUrl, InvalidImageFormat, InvalidImageSize, NotSupportedImage, NotSupportedLanguage, or +// InternalServerError. +// Parameters: +// detectOrientation - whether detect the text orientation in the image. With detectOrientation=true the OCR +// service tries to detect the image orientation and correct it before further processing (e.g. if it's +// upside-down). +// imageURL - a JSON document with a URL pointing to the image that is to be analyzed. +// language - the BCP-47 language code of the text to be detected in the image. The default value is 'unk'. +func (client BaseClient) RecognizePrintedText(ctx context.Context, detectOrientation bool, imageURL ImageURL, language OcrLanguages) (result OcrResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RecognizePrintedText") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: imageURL, + Constraints: []validation.Constraint{{Target: "imageURL.URL", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("computervision.BaseClient", "RecognizePrintedText", err.Error()) + } + + req, err := client.RecognizePrintedTextPreparer(ctx, detectOrientation, imageURL, language) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "RecognizePrintedText", nil, "Failure preparing request") + return + } + + resp, err := client.RecognizePrintedTextSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "RecognizePrintedText", resp, "Failure sending request") + return + } + + result, err = client.RecognizePrintedTextResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "RecognizePrintedText", resp, "Failure responding to request") + } + + return +} + +// RecognizePrintedTextPreparer prepares the RecognizePrintedText request. +func (client BaseClient) RecognizePrintedTextPreparer(ctx context.Context, detectOrientation bool, imageURL ImageURL, language OcrLanguages) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + queryParameters := map[string]interface{}{ + "detectOrientation": autorest.Encode("query", detectOrientation), + } + if len(string(language)) > 0 { + queryParameters["language"] = autorest.Encode("query", language) + } else { + queryParameters["language"] = autorest.Encode("query", "unk") + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithCustomBaseURL("{Endpoint}/vision/v3.0", urlParameters), + autorest.WithPath("/ocr"), + autorest.WithJSON(imageURL), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RecognizePrintedTextSender sends the RecognizePrintedText request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) RecognizePrintedTextSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// RecognizePrintedTextResponder handles the response to the RecognizePrintedText request. The method always +// closes the http.Response Body. +func (client BaseClient) RecognizePrintedTextResponder(resp *http.Response) (result OcrResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RecognizePrintedTextInStream optical Character Recognition (OCR) detects text in an image and extracts the +// recognized characters into a machine-usable character stream. +// Upon success, the OCR results will be returned. +// Upon failure, the error code together with an error message will be returned. The error code can be one of +// InvalidImageUrl, InvalidImageFormat, InvalidImageSize, NotSupportedImage, NotSupportedLanguage, or +// InternalServerError. +// Parameters: +// detectOrientation - whether detect the text orientation in the image. With detectOrientation=true the OCR +// service tries to detect the image orientation and correct it before further processing (e.g. if it's +// upside-down). +// imageParameter - an image stream. +// language - the BCP-47 language code of the text to be detected in the image. The default value is 'unk'. +func (client BaseClient) RecognizePrintedTextInStream(ctx context.Context, detectOrientation bool, imageParameter io.ReadCloser, language OcrLanguages) (result OcrResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.RecognizePrintedTextInStream") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RecognizePrintedTextInStreamPreparer(ctx, detectOrientation, imageParameter, language) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "RecognizePrintedTextInStream", nil, "Failure preparing request") + return + } + + resp, err := client.RecognizePrintedTextInStreamSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "RecognizePrintedTextInStream", resp, "Failure sending request") + return + } + + result, err = client.RecognizePrintedTextInStreamResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "RecognizePrintedTextInStream", resp, "Failure responding to request") + } + + return +} + +// RecognizePrintedTextInStreamPreparer prepares the RecognizePrintedTextInStream request. +func (client BaseClient) RecognizePrintedTextInStreamPreparer(ctx context.Context, detectOrientation bool, imageParameter io.ReadCloser, language OcrLanguages) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + queryParameters := map[string]interface{}{ + "detectOrientation": autorest.Encode("query", detectOrientation), + } + if len(string(language)) > 0 { + queryParameters["language"] = autorest.Encode("query", language) + } else { + queryParameters["language"] = autorest.Encode("query", "unk") + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/octet-stream"), + autorest.AsPost(), + autorest.WithCustomBaseURL("{Endpoint}/vision/v3.0", urlParameters), + autorest.WithPath("/ocr"), + autorest.WithFile(imageParameter), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RecognizePrintedTextInStreamSender sends the RecognizePrintedTextInStream request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) RecognizePrintedTextInStreamSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// RecognizePrintedTextInStreamResponder handles the response to the RecognizePrintedTextInStream request. The method always +// closes the http.Response Body. +func (client BaseClient) RecognizePrintedTextInStreamResponder(resp *http.Response) (result OcrResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// TagImage this operation generates a list of words, or tags, that are relevant to the content of the supplied image. +// The Computer Vision API can return tags based on objects, living beings, scenery or actions found in images. Unlike +// categories, tags are not organized according to a hierarchical classification system, but correspond to image +// content. Tags may contain hints to avoid ambiguity or provide context, for example the tag "ascomycete" may be +// accompanied by the hint "fungus". +// Two input methods are supported -- (1) Uploading an image or (2) specifying an image URL. +// A successful response will be returned in JSON. If the request failed, the response will contain an error code and a +// message to help understand what went wrong. +// Parameters: +// imageURL - a JSON document with a URL pointing to the image that is to be analyzed. +// language - the desired language for output generation. If this parameter is not specified, the default value +// is "en".Supported languages:en - English, Default. es - Spanish, ja - Japanese, pt - Portuguese, +// zh - Simplified Chinese. +func (client BaseClient) TagImage(ctx context.Context, imageURL ImageURL, language string) (result TagResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.TagImage") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: imageURL, + Constraints: []validation.Constraint{{Target: "imageURL.URL", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("computervision.BaseClient", "TagImage", err.Error()) + } + + req, err := client.TagImagePreparer(ctx, imageURL, language) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "TagImage", nil, "Failure preparing request") + return + } + + resp, err := client.TagImageSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "TagImage", resp, "Failure sending request") + return + } + + result, err = client.TagImageResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "TagImage", resp, "Failure responding to request") + } + + return +} + +// TagImagePreparer prepares the TagImage request. +func (client BaseClient) TagImagePreparer(ctx context.Context, imageURL ImageURL, language string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + queryParameters := map[string]interface{}{} + if len(string(language)) > 0 { + queryParameters["language"] = autorest.Encode("query", language) + } else { + queryParameters["language"] = autorest.Encode("query", "en") + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithCustomBaseURL("{Endpoint}/vision/v3.0", urlParameters), + autorest.WithPath("/tag"), + autorest.WithJSON(imageURL), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TagImageSender sends the TagImage request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) TagImageSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// TagImageResponder handles the response to the TagImage request. The method always +// closes the http.Response Body. +func (client BaseClient) TagImageResponder(resp *http.Response) (result TagResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// TagImageInStream this operation generates a list of words, or tags, that are relevant to the content of the supplied +// image. The Computer Vision API can return tags based on objects, living beings, scenery or actions found in images. +// Unlike categories, tags are not organized according to a hierarchical classification system, but correspond to image +// content. Tags may contain hints to avoid ambiguity or provide context, for example the tag "ascomycete" may be +// accompanied by the hint "fungus". +// Two input methods are supported -- (1) Uploading an image or (2) specifying an image URL. +// A successful response will be returned in JSON. If the request failed, the response will contain an error code and a +// message to help understand what went wrong. +// Parameters: +// imageParameter - an image stream. +// language - the desired language for output generation. If this parameter is not specified, the default value +// is "en".Supported languages:en - English, Default. es - Spanish, ja - Japanese, pt - Portuguese, +// zh - Simplified Chinese. +func (client BaseClient) TagImageInStream(ctx context.Context, imageParameter io.ReadCloser, language string) (result TagResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.TagImageInStream") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.TagImageInStreamPreparer(ctx, imageParameter, language) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "TagImageInStream", nil, "Failure preparing request") + return + } + + resp, err := client.TagImageInStreamSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "TagImageInStream", resp, "Failure sending request") + return + } + + result, err = client.TagImageInStreamResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "computervision.BaseClient", "TagImageInStream", resp, "Failure responding to request") + } + + return +} + +// TagImageInStreamPreparer prepares the TagImageInStream request. +func (client BaseClient) TagImageInStreamPreparer(ctx context.Context, imageParameter io.ReadCloser, language string) (*http.Request, error) { + urlParameters := map[string]interface{}{ + "Endpoint": client.Endpoint, + } + + queryParameters := map[string]interface{}{} + if len(string(language)) > 0 { + queryParameters["language"] = autorest.Encode("query", language) + } else { + queryParameters["language"] = autorest.Encode("query", "en") + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/octet-stream"), + autorest.AsPost(), + autorest.WithCustomBaseURL("{Endpoint}/vision/v3.0", urlParameters), + autorest.WithPath("/tag"), + autorest.WithFile(imageParameter), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TagImageInStreamSender sends the TagImageInStream request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) TagImageInStreamSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// TagImageInStreamResponder handles the response to the TagImageInStream request. The method always +// closes the http.Response Body. +func (client BaseClient) TagImageInStreamResponder(resp *http.Response) (result TagResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/cognitiveservices/v3.0/computervision/computervisionapi/interfaces.go b/services/cognitiveservices/v3.0/computervision/computervisionapi/interfaces.go new file mode 100644 index 000000000000..ee8e204b2817 --- /dev/null +++ b/services/cognitiveservices/v3.0/computervision/computervisionapi/interfaces.go @@ -0,0 +1,52 @@ +package computervisionapi + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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/cognitiveservices/v3.0/computervision" + "github.com/Azure/go-autorest/autorest" + "github.com/satori/go.uuid" + "io" +) + +// BaseClientAPI contains the set of methods on the BaseClient type. +type BaseClientAPI interface { + AnalyzeImage(ctx context.Context, imageURL computervision.ImageURL, visualFeatures []computervision.VisualFeatureTypes, details []computervision.Details, language string, descriptionExclude []computervision.DescriptionExclude) (result computervision.ImageAnalysis, err error) + AnalyzeImageByDomain(ctx context.Context, model string, imageURL computervision.ImageURL, language string) (result computervision.DomainModelResults, err error) + AnalyzeImageByDomainInStream(ctx context.Context, model string, imageParameter io.ReadCloser, language string) (result computervision.DomainModelResults, err error) + AnalyzeImageInStream(ctx context.Context, imageParameter io.ReadCloser, visualFeatures []computervision.VisualFeatureTypes, details []computervision.Details, language string, descriptionExclude []computervision.DescriptionExclude) (result computervision.ImageAnalysis, err error) + DescribeImage(ctx context.Context, imageURL computervision.ImageURL, maxCandidates *int32, language string, descriptionExclude []computervision.DescriptionExclude) (result computervision.ImageDescription, err error) + DescribeImageInStream(ctx context.Context, imageParameter io.ReadCloser, maxCandidates *int32, language string, descriptionExclude []computervision.DescriptionExclude) (result computervision.ImageDescription, err error) + DetectObjects(ctx context.Context, imageURL computervision.ImageURL) (result computervision.DetectResult, err error) + DetectObjectsInStream(ctx context.Context, imageParameter io.ReadCloser) (result computervision.DetectResult, err error) + GenerateThumbnail(ctx context.Context, width int32, height int32, imageURL computervision.ImageURL, smartCropping *bool) (result computervision.ReadCloser, err error) + GenerateThumbnailInStream(ctx context.Context, width int32, height int32, imageParameter io.ReadCloser, smartCropping *bool) (result computervision.ReadCloser, err error) + GetAreaOfInterest(ctx context.Context, imageURL computervision.ImageURL) (result computervision.AreaOfInterestResult, err error) + GetAreaOfInterestInStream(ctx context.Context, imageParameter io.ReadCloser) (result computervision.AreaOfInterestResult, err error) + GetReadResult(ctx context.Context, operationID uuid.UUID) (result computervision.ReadOperationResult, err error) + ListModels(ctx context.Context) (result computervision.ListModelsResult, err error) + Read(ctx context.Context, imageURL computervision.ImageURL, language computervision.OcrDetectionLanguage) (result autorest.Response, err error) + ReadInStream(ctx context.Context, imageParameter io.ReadCloser, language computervision.OcrDetectionLanguage) (result autorest.Response, err error) + RecognizePrintedText(ctx context.Context, detectOrientation bool, imageURL computervision.ImageURL, language computervision.OcrLanguages) (result computervision.OcrResult, err error) + RecognizePrintedTextInStream(ctx context.Context, detectOrientation bool, imageParameter io.ReadCloser, language computervision.OcrLanguages) (result computervision.OcrResult, err error) + TagImage(ctx context.Context, imageURL computervision.ImageURL, language string) (result computervision.TagResult, err error) + TagImageInStream(ctx context.Context, imageParameter io.ReadCloser, language string) (result computervision.TagResult, err error) +} + +var _ BaseClientAPI = (*computervision.BaseClient)(nil) diff --git a/services/cognitiveservices/v3.0/computervision/models.go b/services/cognitiveservices/v3.0/computervision/models.go new file mode 100644 index 000000000000..ed8f9234bdeb --- /dev/null +++ b/services/cognitiveservices/v3.0/computervision/models.go @@ -0,0 +1,692 @@ +package computervision + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// Code generated by Microsoft (R) AutoRest Code Generator. +// Changes may cause incorrect behavior and will be lost if the code is regenerated. + +import ( + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "io" +) + +// The package's fully qualified name. +const fqdn = "github.com/Azure/azure-sdk-for-go/services/cognitiveservices/v3.0/computervision" + +// DescriptionExclude enumerates the values for description exclude. +type DescriptionExclude string + +const ( + // Celebrities ... + Celebrities DescriptionExclude = "Celebrities" + // Landmarks ... + Landmarks DescriptionExclude = "Landmarks" +) + +// PossibleDescriptionExcludeValues returns an array of possible values for the DescriptionExclude const type. +func PossibleDescriptionExcludeValues() []DescriptionExclude { + return []DescriptionExclude{Celebrities, Landmarks} +} + +// Details enumerates the values for details. +type Details string + +const ( + // DetailsCelebrities ... + DetailsCelebrities Details = "Celebrities" + // DetailsLandmarks ... + DetailsLandmarks Details = "Landmarks" +) + +// PossibleDetailsValues returns an array of possible values for the Details const type. +func PossibleDetailsValues() []Details { + return []Details{DetailsCelebrities, DetailsLandmarks} +} + +// Gender enumerates the values for gender. +type Gender string + +const ( + // Female ... + Female Gender = "Female" + // Male ... + Male Gender = "Male" +) + +// PossibleGenderValues returns an array of possible values for the Gender const type. +func PossibleGenderValues() []Gender { + return []Gender{Female, Male} +} + +// OcrDetectionLanguage enumerates the values for ocr detection language. +type OcrDetectionLanguage string + +const ( + // De ... + De OcrDetectionLanguage = "de" + // En ... + En OcrDetectionLanguage = "en" + // Es ... + Es OcrDetectionLanguage = "es" + // Fr ... + Fr OcrDetectionLanguage = "fr" + // It ... + It OcrDetectionLanguage = "it" + // Nl ... + Nl OcrDetectionLanguage = "nl" + // Pt ... + Pt OcrDetectionLanguage = "pt" +) + +// PossibleOcrDetectionLanguageValues returns an array of possible values for the OcrDetectionLanguage const type. +func PossibleOcrDetectionLanguageValues() []OcrDetectionLanguage { + return []OcrDetectionLanguage{De, En, Es, Fr, It, Nl, Pt} +} + +// OcrLanguages enumerates the values for ocr languages. +type OcrLanguages string + +const ( + // OcrLanguagesAr ... + OcrLanguagesAr OcrLanguages = "ar" + // OcrLanguagesCs ... + OcrLanguagesCs OcrLanguages = "cs" + // OcrLanguagesDa ... + OcrLanguagesDa OcrLanguages = "da" + // OcrLanguagesDe ... + OcrLanguagesDe OcrLanguages = "de" + // OcrLanguagesEl ... + OcrLanguagesEl OcrLanguages = "el" + // OcrLanguagesEn ... + OcrLanguagesEn OcrLanguages = "en" + // OcrLanguagesEs ... + OcrLanguagesEs OcrLanguages = "es" + // OcrLanguagesFi ... + OcrLanguagesFi OcrLanguages = "fi" + // OcrLanguagesFr ... + OcrLanguagesFr OcrLanguages = "fr" + // OcrLanguagesHu ... + OcrLanguagesHu OcrLanguages = "hu" + // OcrLanguagesIt ... + OcrLanguagesIt OcrLanguages = "it" + // OcrLanguagesJa ... + OcrLanguagesJa OcrLanguages = "ja" + // OcrLanguagesKo ... + OcrLanguagesKo OcrLanguages = "ko" + // OcrLanguagesNb ... + OcrLanguagesNb OcrLanguages = "nb" + // OcrLanguagesNl ... + OcrLanguagesNl OcrLanguages = "nl" + // OcrLanguagesPl ... + OcrLanguagesPl OcrLanguages = "pl" + // OcrLanguagesPt ... + OcrLanguagesPt OcrLanguages = "pt" + // OcrLanguagesRo ... + OcrLanguagesRo OcrLanguages = "ro" + // OcrLanguagesRu ... + OcrLanguagesRu OcrLanguages = "ru" + // OcrLanguagesSk ... + OcrLanguagesSk OcrLanguages = "sk" + // OcrLanguagesSrCyrl ... + OcrLanguagesSrCyrl OcrLanguages = "sr-Cyrl" + // OcrLanguagesSrLatn ... + OcrLanguagesSrLatn OcrLanguages = "sr-Latn" + // OcrLanguagesSv ... + OcrLanguagesSv OcrLanguages = "sv" + // OcrLanguagesTr ... + OcrLanguagesTr OcrLanguages = "tr" + // OcrLanguagesUnk ... + OcrLanguagesUnk OcrLanguages = "unk" + // OcrLanguagesZhHans ... + OcrLanguagesZhHans OcrLanguages = "zh-Hans" + // OcrLanguagesZhHant ... + OcrLanguagesZhHant OcrLanguages = "zh-Hant" +) + +// PossibleOcrLanguagesValues returns an array of possible values for the OcrLanguages const type. +func PossibleOcrLanguagesValues() []OcrLanguages { + return []OcrLanguages{OcrLanguagesAr, OcrLanguagesCs, OcrLanguagesDa, OcrLanguagesDe, OcrLanguagesEl, OcrLanguagesEn, OcrLanguagesEs, OcrLanguagesFi, OcrLanguagesFr, OcrLanguagesHu, OcrLanguagesIt, OcrLanguagesJa, OcrLanguagesKo, OcrLanguagesNb, OcrLanguagesNl, OcrLanguagesPl, OcrLanguagesPt, OcrLanguagesRo, OcrLanguagesRu, OcrLanguagesSk, OcrLanguagesSrCyrl, OcrLanguagesSrLatn, OcrLanguagesSv, OcrLanguagesTr, OcrLanguagesUnk, OcrLanguagesZhHans, OcrLanguagesZhHant} +} + +// OperationStatusCodes enumerates the values for operation status codes. +type OperationStatusCodes string + +const ( + // Failed ... + Failed OperationStatusCodes = "failed" + // NotStarted ... + NotStarted OperationStatusCodes = "notStarted" + // Running ... + Running OperationStatusCodes = "running" + // Succeeded ... + Succeeded OperationStatusCodes = "succeeded" +) + +// PossibleOperationStatusCodesValues returns an array of possible values for the OperationStatusCodes const type. +func PossibleOperationStatusCodesValues() []OperationStatusCodes { + return []OperationStatusCodes{Failed, NotStarted, Running, Succeeded} +} + +// TextRecognitionResultDimensionUnit enumerates the values for text recognition result dimension unit. +type TextRecognitionResultDimensionUnit string + +const ( + // Inch ... + Inch TextRecognitionResultDimensionUnit = "inch" + // Pixel ... + Pixel TextRecognitionResultDimensionUnit = "pixel" +) + +// PossibleTextRecognitionResultDimensionUnitValues returns an array of possible values for the TextRecognitionResultDimensionUnit const type. +func PossibleTextRecognitionResultDimensionUnitValues() []TextRecognitionResultDimensionUnit { + return []TextRecognitionResultDimensionUnit{Inch, Pixel} +} + +// VisualFeatureTypes enumerates the values for visual feature types. +type VisualFeatureTypes string + +const ( + // VisualFeatureTypesAdult ... + VisualFeatureTypesAdult VisualFeatureTypes = "Adult" + // VisualFeatureTypesBrands ... + VisualFeatureTypesBrands VisualFeatureTypes = "Brands" + // VisualFeatureTypesCategories ... + VisualFeatureTypesCategories VisualFeatureTypes = "Categories" + // VisualFeatureTypesColor ... + VisualFeatureTypesColor VisualFeatureTypes = "Color" + // VisualFeatureTypesDescription ... + VisualFeatureTypesDescription VisualFeatureTypes = "Description" + // VisualFeatureTypesFaces ... + VisualFeatureTypesFaces VisualFeatureTypes = "Faces" + // VisualFeatureTypesImageType ... + VisualFeatureTypesImageType VisualFeatureTypes = "ImageType" + // VisualFeatureTypesObjects ... + VisualFeatureTypesObjects VisualFeatureTypes = "Objects" + // VisualFeatureTypesTags ... + VisualFeatureTypesTags VisualFeatureTypes = "Tags" +) + +// PossibleVisualFeatureTypesValues returns an array of possible values for the VisualFeatureTypes const type. +func PossibleVisualFeatureTypesValues() []VisualFeatureTypes { + return []VisualFeatureTypes{VisualFeatureTypesAdult, VisualFeatureTypesBrands, VisualFeatureTypesCategories, VisualFeatureTypesColor, VisualFeatureTypesDescription, VisualFeatureTypesFaces, VisualFeatureTypesImageType, VisualFeatureTypesObjects, VisualFeatureTypesTags} +} + +// AdultInfo an object describing whether the image contains adult-oriented content and/or is racy. +type AdultInfo struct { + // IsAdultContent - A value indicating if the image contains adult-oriented content. + IsAdultContent *bool `json:"isAdultContent,omitempty"` + // IsRacyContent - A value indicating if the image is racy. + IsRacyContent *bool `json:"isRacyContent,omitempty"` + // IsGoryContent - A value indicating if the image is gory. + IsGoryContent *bool `json:"isGoryContent,omitempty"` + // AdultScore - Score from 0 to 1 that indicates how much the content is considered adult-oriented within the image. + AdultScore *float64 `json:"adultScore,omitempty"` + // RacyScore - Score from 0 to 1 that indicates how suggestive is the image. + RacyScore *float64 `json:"racyScore,omitempty"` + // GoreScore - Score from 0 to 1 that indicates how gory is the image. + GoreScore *float64 `json:"goreScore,omitempty"` +} + +// AnalyzeResults analyze batch operation result. +type AnalyzeResults struct { + // Version - Version of schema used for this result. + Version *string `json:"version,omitempty"` + // ReadResults - Text extracted from the input. + ReadResults *[]ReadResult `json:"readResults,omitempty"` +} + +// AreaOfInterestResult result of AreaOfInterest operation. +type AreaOfInterestResult struct { + autorest.Response `json:"-"` + // AreaOfInterest - READ-ONLY; A bounding box for an area of interest inside an image. + AreaOfInterest *BoundingRect `json:"areaOfInterest,omitempty"` + // RequestID - Id of the REST API request. + RequestID *string `json:"requestId,omitempty"` + Metadata *ImageMetadata `json:"metadata,omitempty"` +} + +// BoundingRect a bounding box for an area inside an image. +type BoundingRect struct { + // X - X-coordinate of the top left point of the area, in pixels. + X *int32 `json:"x,omitempty"` + // Y - Y-coordinate of the top left point of the area, in pixels. + Y *int32 `json:"y,omitempty"` + // W - Width measured from the top-left point of the area, in pixels. + W *int32 `json:"w,omitempty"` + // H - Height measured from the top-left point of the area, in pixels. + H *int32 `json:"h,omitempty"` +} + +// Category an object describing identified category. +type Category struct { + // Name - Name of the category. + Name *string `json:"name,omitempty"` + // Score - Scoring of the category. + Score *float64 `json:"score,omitempty"` + // Detail - Details of the identified category. + Detail *CategoryDetail `json:"detail,omitempty"` +} + +// CategoryDetail an object describing additional category details. +type CategoryDetail struct { + // Celebrities - An array of celebrities if any identified. + Celebrities *[]CelebritiesModel `json:"celebrities,omitempty"` + // Landmarks - An array of landmarks if any identified. + Landmarks *[]LandmarksModel `json:"landmarks,omitempty"` +} + +// CelebritiesModel an object describing possible celebrity identification. +type CelebritiesModel struct { + // Name - Name of the celebrity. + Name *string `json:"name,omitempty"` + // Confidence - Confidence level for the celebrity recognition as a value ranging from 0 to 1. + Confidence *float64 `json:"confidence,omitempty"` + // FaceRectangle - Location of the identified face in the image. + FaceRectangle *FaceRectangle `json:"faceRectangle,omitempty"` +} + +// CelebrityResults result of domain-specific classifications for the domain of celebrities. +type CelebrityResults struct { + // Celebrities - List of celebrities recognized in the image. + Celebrities *[]CelebritiesModel `json:"celebrities,omitempty"` + // RequestID - Id of the REST API request. + RequestID *string `json:"requestId,omitempty"` + Metadata *ImageMetadata `json:"metadata,omitempty"` +} + +// ColorInfo an object providing additional metadata describing color attributes. +type ColorInfo struct { + // DominantColorForeground - Possible dominant foreground color. + DominantColorForeground *string `json:"dominantColorForeground,omitempty"` + // DominantColorBackground - Possible dominant background color. + DominantColorBackground *string `json:"dominantColorBackground,omitempty"` + // DominantColors - An array of possible dominant colors. + DominantColors *[]string `json:"dominantColors,omitempty"` + // AccentColor - Possible accent color. + AccentColor *string `json:"accentColor,omitempty"` + // IsBWImg - A value indicating if the image is black and white. + IsBWImg *bool `json:"isBWImg,omitempty"` +} + +// DetectedBrand a brand detected in an image. +type DetectedBrand struct { + // Name - READ-ONLY; Label for the brand. + Name *string `json:"name,omitempty"` + // Confidence - READ-ONLY; Confidence score of having observed the brand in the image, as a value ranging from 0 to 1. + Confidence *float64 `json:"confidence,omitempty"` + // Rectangle - READ-ONLY; Approximate location of the detected brand. + Rectangle *BoundingRect `json:"rectangle,omitempty"` +} + +// DetectedObject an object detected in an image. +type DetectedObject struct { + // Rectangle - READ-ONLY; Approximate location of the detected object. + Rectangle *BoundingRect `json:"rectangle,omitempty"` + // Object - Label for the object. + Object *string `json:"object,omitempty"` + // Confidence - Confidence score of having observed the object in the image, as a value ranging from 0 to 1. + Confidence *float64 `json:"confidence,omitempty"` + // Parent - The parent object, from a taxonomy perspective. + // The parent object is a more generic form of this object. For example, a 'bulldog' would have a parent of 'dog'. + Parent *ObjectHierarchy `json:"parent,omitempty"` +} + +// DetectResult result of a DetectImage call. +type DetectResult struct { + autorest.Response `json:"-"` + // Objects - READ-ONLY; An array of detected objects. + Objects *[]DetectedObject `json:"objects,omitempty"` + // RequestID - Id of the REST API request. + RequestID *string `json:"requestId,omitempty"` + Metadata *ImageMetadata `json:"metadata,omitempty"` +} + +// DomainModelResults result of image analysis using a specific domain model including additional metadata. +type DomainModelResults struct { + autorest.Response `json:"-"` + // Result - Model-specific response. + Result interface{} `json:"result,omitempty"` + // RequestID - Id of the REST API request. + RequestID *string `json:"requestId,omitempty"` + Metadata *ImageMetadata `json:"metadata,omitempty"` +} + +// Error details about the API request error. +type Error struct { + // Code - The error code. + Code interface{} `json:"code,omitempty"` + // Message - A message explaining the error reported by the service. + Message *string `json:"message,omitempty"` + // RequestID - A unique request identifier. + RequestID *string `json:"requestId,omitempty"` +} + +// FaceDescription an object describing a face identified in the image. +type FaceDescription struct { + // Age - Possible age of the face. + Age *int32 `json:"age,omitempty"` + // Gender - Possible gender of the face. Possible values include: 'Male', 'Female' + Gender Gender `json:"gender,omitempty"` + // FaceRectangle - Rectangle in the image containing the identified face. + FaceRectangle *FaceRectangle `json:"faceRectangle,omitempty"` +} + +// FaceRectangle an object describing face rectangle. +type FaceRectangle struct { + // Left - X-coordinate of the top left point of the face, in pixels. + Left *int32 `json:"left,omitempty"` + // Top - Y-coordinate of the top left point of the face, in pixels. + Top *int32 `json:"top,omitempty"` + // Width - Width measured from the top-left point of the face, in pixels. + Width *int32 `json:"width,omitempty"` + // Height - Height measured from the top-left point of the face, in pixels. + Height *int32 `json:"height,omitempty"` +} + +// ImageAnalysis result of AnalyzeImage operation. +type ImageAnalysis struct { + autorest.Response `json:"-"` + // Categories - An array indicating identified categories. + Categories *[]Category `json:"categories,omitempty"` + // Adult - An object describing whether the image contains adult-oriented content and/or is racy. + Adult *AdultInfo `json:"adult,omitempty"` + // Color - An object providing additional metadata describing color attributes. + Color *ColorInfo `json:"color,omitempty"` + // ImageType - An object providing possible image types and matching confidence levels. + ImageType *ImageType `json:"imageType,omitempty"` + // Tags - A list of tags with confidence level. + Tags *[]ImageTag `json:"tags,omitempty"` + // Description - A collection of content tags, along with a list of captions sorted by confidence level, and image metadata. + Description *ImageDescriptionDetails `json:"description,omitempty"` + // Faces - An array of possible faces within the image. + Faces *[]FaceDescription `json:"faces,omitempty"` + // Objects - Array of objects describing what was detected in the image. + Objects *[]DetectedObject `json:"objects,omitempty"` + // Brands - Array of brands detected in the image. + Brands *[]DetectedBrand `json:"brands,omitempty"` + // RequestID - Id of the REST API request. + RequestID *string `json:"requestId,omitempty"` + Metadata *ImageMetadata `json:"metadata,omitempty"` +} + +// ImageCaption an image caption, i.e. a brief description of what the image depicts. +type ImageCaption struct { + // Text - The text of the caption. + Text *string `json:"text,omitempty"` + // Confidence - The level of confidence the service has in the caption. + Confidence *float64 `json:"confidence,omitempty"` +} + +// ImageDescription a collection of content tags, along with a list of captions sorted by confidence level, +// and image metadata. +type ImageDescription struct { + autorest.Response `json:"-"` + // ImageDescriptionDetails - A collection of content tags, along with a list of captions sorted by confidence level, and image metadata. + *ImageDescriptionDetails `json:"description,omitempty"` + // RequestID - Id of the REST API request. + RequestID *string `json:"requestId,omitempty"` + Metadata *ImageMetadata `json:"metadata,omitempty"` +} + +// MarshalJSON is the custom marshaler for ImageDescription. +func (ID ImageDescription) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ID.ImageDescriptionDetails != nil { + objectMap["description"] = ID.ImageDescriptionDetails + } + if ID.RequestID != nil { + objectMap["requestId"] = ID.RequestID + } + if ID.Metadata != nil { + objectMap["metadata"] = ID.Metadata + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ImageDescription struct. +func (ID *ImageDescription) 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 "description": + if v != nil { + var imageDescriptionDetails ImageDescriptionDetails + err = json.Unmarshal(*v, &imageDescriptionDetails) + if err != nil { + return err + } + ID.ImageDescriptionDetails = &imageDescriptionDetails + } + case "requestId": + if v != nil { + var requestID string + err = json.Unmarshal(*v, &requestID) + if err != nil { + return err + } + ID.RequestID = &requestID + } + case "metadata": + if v != nil { + var metadata ImageMetadata + err = json.Unmarshal(*v, &metadata) + if err != nil { + return err + } + ID.Metadata = &metadata + } + } + } + + return nil +} + +// ImageDescriptionDetails a collection of content tags, along with a list of captions sorted by confidence +// level, and image metadata. +type ImageDescriptionDetails struct { + // Tags - A collection of image tags. + Tags *[]string `json:"tags,omitempty"` + // Captions - A list of captions, sorted by confidence level. + Captions *[]ImageCaption `json:"captions,omitempty"` +} + +// ImageMetadata image metadata. +type ImageMetadata struct { + // Width - Image width, in pixels. + Width *int32 `json:"width,omitempty"` + // Height - Image height, in pixels. + Height *int32 `json:"height,omitempty"` + // Format - Image format. + Format *string `json:"format,omitempty"` +} + +// ImageTag an entity observation in the image, along with the confidence score. +type ImageTag struct { + // Name - Name of the entity. + Name *string `json:"name,omitempty"` + // Confidence - The level of confidence that the entity was observed. + Confidence *float64 `json:"confidence,omitempty"` + // Hint - Optional hint/details for this tag. + Hint *string `json:"hint,omitempty"` +} + +// ImageType an object providing possible image types and matching confidence levels. +type ImageType struct { + // ClipArtType - Confidence level that the image is a clip art. + ClipArtType *int32 `json:"clipArtType,omitempty"` + // LineDrawingType - Confidence level that the image is a line drawing. + LineDrawingType *int32 `json:"lineDrawingType,omitempty"` +} + +// ImageURL ... +type ImageURL struct { + // URL - Publicly reachable URL of an image. + URL *string `json:"url,omitempty"` +} + +// LandmarkResults result of domain-specific classifications for the domain of landmarks. +type LandmarkResults struct { + // Landmarks - List of landmarks recognized in the image. + Landmarks *[]LandmarksModel `json:"landmarks,omitempty"` + // RequestID - Id of the REST API request. + RequestID *string `json:"requestId,omitempty"` + Metadata *ImageMetadata `json:"metadata,omitempty"` +} + +// LandmarksModel a landmark recognized in the image. +type LandmarksModel struct { + // Name - Name of the landmark. + Name *string `json:"name,omitempty"` + // Confidence - Confidence level for the landmark recognition as a value ranging from 0 to 1. + Confidence *float64 `json:"confidence,omitempty"` +} + +// Line an object representing a recognized text line. +type Line struct { + // Language - The BCP-47 language code of the recognized text line. Only provided where the language of the line differs from the page's. + Language *string `json:"language,omitempty"` + // BoundingBox - Bounding box of a recognized line. + BoundingBox *[]float64 `json:"boundingBox,omitempty"` + // Text - The text content of the line. + Text *string `json:"text,omitempty"` + // Words - List of words in the text line. + Words *[]Word `json:"words,omitempty"` +} + +// ListModelsResult result of the List Domain Models operation. +type ListModelsResult struct { + autorest.Response `json:"-"` + // ModelsProperty - READ-ONLY; An array of supported models. + ModelsProperty *[]ModelDescription `json:"models,omitempty"` +} + +// ModelDescription an object describing supported model by name and categories. +type ModelDescription struct { + // Name - The name of the model. + Name *string `json:"name,omitempty"` + // Categories - Categories of the model. + Categories *[]string `json:"categories,omitempty"` +} + +// ObjectHierarchy an object detected inside an image. +type ObjectHierarchy struct { + // Object - Label for the object. + Object *string `json:"object,omitempty"` + // Confidence - Confidence score of having observed the object in the image, as a value ranging from 0 to 1. + Confidence *float64 `json:"confidence,omitempty"` + // Parent - The parent object, from a taxonomy perspective. + // The parent object is a more generic form of this object. For example, a 'bulldog' would have a parent of 'dog'. + Parent *ObjectHierarchy `json:"parent,omitempty"` +} + +// OcrLine an object describing a single recognized line of text. +type OcrLine struct { + // BoundingBox - Bounding box of a recognized line. The four integers represent the x-coordinate of the left edge, the y-coordinate of the top edge, width, and height of the bounding box, in the coordinate system of the input image, after it has been rotated around its center according to the detected text angle (see textAngle property), with the origin at the top-left corner, and the y-axis pointing down. + BoundingBox *string `json:"boundingBox,omitempty"` + // Words - An array of objects, where each object represents a recognized word. + Words *[]OcrWord `json:"words,omitempty"` +} + +// OcrRegion a region consists of multiple lines (e.g. a column of text in a multi-column document). +type OcrRegion struct { + // BoundingBox - Bounding box of a recognized region. The four integers represent the x-coordinate of the left edge, the y-coordinate of the top edge, width, and height of the bounding box, in the coordinate system of the input image, after it has been rotated around its center according to the detected text angle (see textAngle property), with the origin at the top-left corner, and the y-axis pointing down. + BoundingBox *string `json:"boundingBox,omitempty"` + // Lines - An array of recognized lines of text. + Lines *[]OcrLine `json:"lines,omitempty"` +} + +// OcrResult ... +type OcrResult struct { + autorest.Response `json:"-"` + // Language - The BCP-47 language code of the text in the image. + Language *string `json:"language,omitempty"` + // TextAngle - The angle, in radians, of the detected text with respect to the closest horizontal or vertical direction. After rotating the input image clockwise by this angle, the recognized text lines become horizontal or vertical. In combination with the orientation property it can be used to overlay recognition results correctly on the original image, by rotating either the original image or recognition results by a suitable angle around the center of the original image. If the angle cannot be confidently detected, this property is not present. If the image contains text at different angles, only part of the text will be recognized correctly. + TextAngle *float64 `json:"textAngle,omitempty"` + // Orientation - Orientation of the text recognized in the image, if requested. The value (up, down, left, or right) refers to the direction that the top of the recognized text is facing, after the image has been rotated around its center according to the detected text angle (see textAngle property). + // If detection of the orientation was not requested, or no text is detected, the value is 'NotDetected'. + Orientation *string `json:"orientation,omitempty"` + // Regions - An array of objects, where each object represents a region of recognized text. + Regions *[]OcrRegion `json:"regions,omitempty"` +} + +// OcrWord information on a recognized word. +type OcrWord struct { + // BoundingBox - Bounding box of a recognized word. The four integers represent the x-coordinate of the left edge, the y-coordinate of the top edge, width, and height of the bounding box, in the coordinate system of the input image, after it has been rotated around its center according to the detected text angle (see textAngle property), with the origin at the top-left corner, and the y-axis pointing down. + BoundingBox *string `json:"boundingBox,omitempty"` + // Text - String value of a recognized word. + Text *string `json:"text,omitempty"` +} + +// ReadCloser ... +type ReadCloser struct { + autorest.Response `json:"-"` + Value *io.ReadCloser `json:"value,omitempty"` +} + +// ReadOperationResult OCR result of the read operation. +type ReadOperationResult struct { + autorest.Response `json:"-"` + // Status - Status of the read operation. Possible values include: 'NotStarted', 'Running', 'Failed', 'Succeeded' + Status OperationStatusCodes `json:"status,omitempty"` + // CreatedDateTime - Get UTC date time the batch operation was submitted. + CreatedDateTime *string `json:"createdDateTime,omitempty"` + // LastUpdatedDateTime - Get last updated UTC date time of this batch operation. + LastUpdatedDateTime *string `json:"lastUpdatedDateTime,omitempty"` + // AnalyzeResult - Analyze batch operation result. + AnalyzeResult *AnalyzeResults `json:"analyzeResult,omitempty"` +} + +// ReadResult text extracted from a page in the input document. +type ReadResult struct { + // Page - The 1-based page number of the recognition result. + Page *int32 `json:"page,omitempty"` + // Language - The BCP-47 language code of the recognized text page. + Language *string `json:"language,omitempty"` + // Angle - The orientation of the image in degrees in the clockwise direction. Range between [-180, 180). + Angle *float64 `json:"angle,omitempty"` + // Width - The width of the image in pixels or the PDF in inches. + Width *float64 `json:"width,omitempty"` + // Height - The height of the image in pixels or the PDF in inches. + Height *float64 `json:"height,omitempty"` + // Unit - The unit used in the Width, Height and BoundingBox. For images, the unit is 'pixel'. For PDF, the unit is 'inch'. Possible values include: 'Pixel', 'Inch' + Unit TextRecognitionResultDimensionUnit `json:"unit,omitempty"` + // Lines - A list of recognized text lines. + Lines *[]Line `json:"lines,omitempty"` +} + +// TagResult the results of a image tag operation, including any tags and image metadata. +type TagResult struct { + autorest.Response `json:"-"` + // Tags - A list of tags with confidence level. + Tags *[]ImageTag `json:"tags,omitempty"` + // RequestID - Id of the REST API request. + RequestID *string `json:"requestId,omitempty"` + Metadata *ImageMetadata `json:"metadata,omitempty"` +} + +// Word an object representing a recognized word. +type Word struct { + // BoundingBox - Bounding box of a recognized word. + BoundingBox *[]float64 `json:"boundingBox,omitempty"` + // Text - The text content of the word. + Text *string `json:"text,omitempty"` + // Confidence - Qualitative confidence measure. + Confidence *float64 `json:"confidence,omitempty"` +} diff --git a/services/cognitiveservices/v3.0/computervision/version.go b/services/cognitiveservices/v3.0/computervision/version.go new file mode 100644 index 000000000000..d6e31297eafd --- /dev/null +++ b/services/cognitiveservices/v3.0/computervision/version.go @@ -0,0 +1,30 @@ +package computervision + +import "github.com/Azure/azure-sdk-for-go/version" + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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() + " computervision/3.0" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/services/compute/mgmt/2019-03-01/compute/resourceskus.go b/services/compute/mgmt/2019-03-01/compute/resourceskus.go index 6e85ac1cc120..e71328f0c6cc 100644 --- a/services/compute/mgmt/2019-03-01/compute/resourceskus.go +++ b/services/compute/mgmt/2019-03-01/compute/resourceskus.go @@ -43,7 +43,7 @@ func NewResourceSkusClientWithBaseURI(baseURI string, subscriptionID string) Res // List gets the list of Microsoft.Compute SKUs available for your Subscription. // Parameters: -// filter - the filter to apply on the operation. +// filter - the filter to apply on the operation. Only **location** filter is supported currently. func (client ResourceSkusClient) List(ctx context.Context, filter string) (result ResourceSkusResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkusClient.List") diff --git a/services/compute/mgmt/2019-03-01/compute/virtualmachinescalesets.go b/services/compute/mgmt/2019-03-01/compute/virtualmachinescalesets.go index fc1387a97e97..d0720024a94f 100644 --- a/services/compute/mgmt/2019-03-01/compute/virtualmachinescalesets.go +++ b/services/compute/mgmt/2019-03-01/compute/virtualmachinescalesets.go @@ -89,12 +89,18 @@ func (client VirtualMachineScaleSetsClient) ConvertToSinglePlacementGroupPrepare "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } + const APIVersion = "2019-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/convertToSinglePlacementGroup", pathParameters), - autorest.WithJSON(parameters)) + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } diff --git a/services/compute/mgmt/2019-07-01/compute/galleryimageversions.go b/services/compute/mgmt/2019-07-01/compute/galleryimageversions.go index 02f3a946544f..8bc01cbdfc67 100644 --- a/services/compute/mgmt/2019-07-01/compute/galleryimageversions.go +++ b/services/compute/mgmt/2019-07-01/compute/galleryimageversions.go @@ -66,11 +66,7 @@ func (client GalleryImageVersionsClient) CreateOrUpdate(ctx context.Context, res if err := validation.Validate([]validation.Validation{ {TargetValue: galleryImageVersion, Constraints: []validation.Constraint{{Target: "galleryImageVersion.GalleryImageVersionProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "galleryImageVersion.GalleryImageVersionProperties.StorageProfile", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "galleryImageVersion.GalleryImageVersionProperties.StorageProfile.Source", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "galleryImageVersion.GalleryImageVersionProperties.StorageProfile.Source.ID", Name: validation.Null, Rule: true, Chain: nil}}}, - }}, - }}}}}); err != nil { + Chain: []validation.Constraint{{Target: "galleryImageVersion.GalleryImageVersionProperties.StorageProfile", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { return result, validation.NewError("compute.GalleryImageVersionsClient", "CreateOrUpdate", err.Error()) } diff --git a/services/compute/mgmt/2019-07-01/compute/resourceskus.go b/services/compute/mgmt/2019-07-01/compute/resourceskus.go index 6e85ac1cc120..e71328f0c6cc 100644 --- a/services/compute/mgmt/2019-07-01/compute/resourceskus.go +++ b/services/compute/mgmt/2019-07-01/compute/resourceskus.go @@ -43,7 +43,7 @@ func NewResourceSkusClientWithBaseURI(baseURI string, subscriptionID string) Res // List gets the list of Microsoft.Compute SKUs available for your Subscription. // Parameters: -// filter - the filter to apply on the operation. +// filter - the filter to apply on the operation. Only **location** filter is supported currently. func (client ResourceSkusClient) List(ctx context.Context, filter string) (result ResourceSkusResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkusClient.List") diff --git a/services/compute/mgmt/2019-07-01/compute/virtualmachinescalesets.go b/services/compute/mgmt/2019-07-01/compute/virtualmachinescalesets.go index c1260b56a5aa..367b5a9ce229 100644 --- a/services/compute/mgmt/2019-07-01/compute/virtualmachinescalesets.go +++ b/services/compute/mgmt/2019-07-01/compute/virtualmachinescalesets.go @@ -89,12 +89,18 @@ func (client VirtualMachineScaleSetsClient) ConvertToSinglePlacementGroupPrepare "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } + const APIVersion = "2019-07-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/convertToSinglePlacementGroup", pathParameters), - autorest.WithJSON(parameters)) + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } diff --git a/services/compute/mgmt/2019-12-01/compute/galleryimageversions.go b/services/compute/mgmt/2019-12-01/compute/galleryimageversions.go index 223b938ebc62..a81aa50e8414 100644 --- a/services/compute/mgmt/2019-12-01/compute/galleryimageversions.go +++ b/services/compute/mgmt/2019-12-01/compute/galleryimageversions.go @@ -66,11 +66,7 @@ func (client GalleryImageVersionsClient) CreateOrUpdate(ctx context.Context, res if err := validation.Validate([]validation.Validation{ {TargetValue: galleryImageVersion, Constraints: []validation.Constraint{{Target: "galleryImageVersion.GalleryImageVersionProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "galleryImageVersion.GalleryImageVersionProperties.StorageProfile", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "galleryImageVersion.GalleryImageVersionProperties.StorageProfile.Source", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "galleryImageVersion.GalleryImageVersionProperties.StorageProfile.Source.ID", Name: validation.Null, Rule: true, Chain: nil}}}, - }}, - }}}}}); err != nil { + Chain: []validation.Constraint{{Target: "galleryImageVersion.GalleryImageVersionProperties.StorageProfile", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { return result, validation.NewError("compute.GalleryImageVersionsClient", "CreateOrUpdate", err.Error()) } diff --git a/services/compute/mgmt/2019-12-01/compute/resourceskus.go b/services/compute/mgmt/2019-12-01/compute/resourceskus.go index 6e85ac1cc120..e71328f0c6cc 100644 --- a/services/compute/mgmt/2019-12-01/compute/resourceskus.go +++ b/services/compute/mgmt/2019-12-01/compute/resourceskus.go @@ -43,7 +43,7 @@ func NewResourceSkusClientWithBaseURI(baseURI string, subscriptionID string) Res // List gets the list of Microsoft.Compute SKUs available for your Subscription. // Parameters: -// filter - the filter to apply on the operation. +// filter - the filter to apply on the operation. Only **location** filter is supported currently. func (client ResourceSkusClient) List(ctx context.Context, filter string) (result ResourceSkusResultPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkusClient.List") diff --git a/services/compute/mgmt/2019-12-01/compute/virtualmachinescalesets.go b/services/compute/mgmt/2019-12-01/compute/virtualmachinescalesets.go index 0de99343073e..c95a97566950 100644 --- a/services/compute/mgmt/2019-12-01/compute/virtualmachinescalesets.go +++ b/services/compute/mgmt/2019-12-01/compute/virtualmachinescalesets.go @@ -89,12 +89,18 @@ func (client VirtualMachineScaleSetsClient) ConvertToSinglePlacementGroupPrepare "vmScaleSetName": autorest.Encode("path", VMScaleSetName), } + const APIVersion = "2019-12-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.Compute/virtualMachineScaleSets/{vmScaleSetName}/convertToSinglePlacementGroup", pathParameters), - autorest.WithJSON(parameters)) + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } diff --git a/services/containerservice/mgmt/2019-11-01/containerservice/agentpools.go b/services/containerservice/mgmt/2019-11-01/containerservice/agentpools.go index 73a7aa94fd41..6289a4996a25 100644 --- a/services/containerservice/mgmt/2019-11-01/containerservice/agentpools.go +++ b/services/containerservice/mgmt/2019-11-01/containerservice/agentpools.go @@ -65,14 +65,7 @@ func (client AgentPoolsClient) CreateOrUpdate(ctx context.Context, resourceGroup {TargetValue: resourceName, Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}, - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.ManagedClusterAgentPoolProfileProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ManagedClusterAgentPoolProfileProperties.Count", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.ManagedClusterAgentPoolProfileProperties.Count", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, - {Target: "parameters.ManagedClusterAgentPoolProfileProperties.Count", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, - }}, - }}}}}); err != nil { + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { return result, validation.NewError("containerservice.AgentPoolsClient", "CreateOrUpdate", err.Error()) } diff --git a/services/containerservice/mgmt/2020-01-01/containerservice/agentpools.go b/services/containerservice/mgmt/2020-01-01/containerservice/agentpools.go index 54f029262777..5de453fb8e05 100644 --- a/services/containerservice/mgmt/2020-01-01/containerservice/agentpools.go +++ b/services/containerservice/mgmt/2020-01-01/containerservice/agentpools.go @@ -65,14 +65,7 @@ func (client AgentPoolsClient) CreateOrUpdate(ctx context.Context, resourceGroup {TargetValue: resourceName, Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}, - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.ManagedClusterAgentPoolProfileProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ManagedClusterAgentPoolProfileProperties.Count", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.ManagedClusterAgentPoolProfileProperties.Count", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, - {Target: "parameters.ManagedClusterAgentPoolProfileProperties.Count", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, - }}, - }}}}}); err != nil { + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { return result, validation.NewError("containerservice.AgentPoolsClient", "CreateOrUpdate", err.Error()) } diff --git a/services/containerservice/mgmt/2020-02-01/containerservice/agentpools.go b/services/containerservice/mgmt/2020-02-01/containerservice/agentpools.go index a7e112f0d182..312cfb6951d4 100644 --- a/services/containerservice/mgmt/2020-02-01/containerservice/agentpools.go +++ b/services/containerservice/mgmt/2020-02-01/containerservice/agentpools.go @@ -65,14 +65,7 @@ func (client AgentPoolsClient) CreateOrUpdate(ctx context.Context, resourceGroup {TargetValue: resourceName, Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}, - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.ManagedClusterAgentPoolProfileProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ManagedClusterAgentPoolProfileProperties.Count", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.ManagedClusterAgentPoolProfileProperties.Count", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, - {Target: "parameters.ManagedClusterAgentPoolProfileProperties.Count", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, - }}, - }}}}}); err != nil { + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { return result, validation.NewError("containerservice.AgentPoolsClient", "CreateOrUpdate", err.Error()) } diff --git a/services/containerservice/mgmt/2020-03-01/containerservice/agentpools.go b/services/containerservice/mgmt/2020-03-01/containerservice/agentpools.go index 37ff511cff7a..56ea1ed823ca 100644 --- a/services/containerservice/mgmt/2020-03-01/containerservice/agentpools.go +++ b/services/containerservice/mgmt/2020-03-01/containerservice/agentpools.go @@ -65,14 +65,7 @@ func (client AgentPoolsClient) CreateOrUpdate(ctx context.Context, resourceGroup {TargetValue: resourceName, Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}, - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.ManagedClusterAgentPoolProfileProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ManagedClusterAgentPoolProfileProperties.Count", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.ManagedClusterAgentPoolProfileProperties.Count", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, - {Target: "parameters.ManagedClusterAgentPoolProfileProperties.Count", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, - }}, - }}}}}); err != nil { + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { return result, validation.NewError("containerservice.AgentPoolsClient", "CreateOrUpdate", err.Error()) } diff --git a/services/containerservice/mgmt/2020-03-01/containerservice/models.go b/services/containerservice/mgmt/2020-03-01/containerservice/models.go index 6de54428e10a..ae56d83229aa 100644 --- a/services/containerservice/mgmt/2020-03-01/containerservice/models.go +++ b/services/containerservice/mgmt/2020-03-01/containerservice/models.go @@ -1852,7 +1852,7 @@ type ManagedClusterAddonProfileIdentity struct { type ManagedClusterAgentPoolProfile struct { // Name - Unique name of the agent pool profile in the context of the subscription and resource group. Name *string `json:"name,omitempty"` - // Count - Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 100 (inclusive). The default value is 1. + // Count - Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for system pools. The default value is 1. Count *int32 `json:"count,omitempty"` // VMSize - Size of agent VMs. Possible values include: 'VMSizeTypesStandardA1', 'VMSizeTypesStandardA10', 'VMSizeTypesStandardA11', 'VMSizeTypesStandardA1V2', 'VMSizeTypesStandardA2', 'VMSizeTypesStandardA2V2', 'VMSizeTypesStandardA2mV2', 'VMSizeTypesStandardA3', 'VMSizeTypesStandardA4', 'VMSizeTypesStandardA4V2', 'VMSizeTypesStandardA4mV2', 'VMSizeTypesStandardA5', 'VMSizeTypesStandardA6', 'VMSizeTypesStandardA7', 'VMSizeTypesStandardA8', 'VMSizeTypesStandardA8V2', 'VMSizeTypesStandardA8mV2', 'VMSizeTypesStandardA9', 'VMSizeTypesStandardB2ms', 'VMSizeTypesStandardB2s', 'VMSizeTypesStandardB4ms', 'VMSizeTypesStandardB8ms', 'VMSizeTypesStandardD1', 'VMSizeTypesStandardD11', 'VMSizeTypesStandardD11V2', 'VMSizeTypesStandardD11V2Promo', 'VMSizeTypesStandardD12', 'VMSizeTypesStandardD12V2', 'VMSizeTypesStandardD12V2Promo', 'VMSizeTypesStandardD13', 'VMSizeTypesStandardD13V2', 'VMSizeTypesStandardD13V2Promo', 'VMSizeTypesStandardD14', 'VMSizeTypesStandardD14V2', 'VMSizeTypesStandardD14V2Promo', 'VMSizeTypesStandardD15V2', 'VMSizeTypesStandardD16V3', 'VMSizeTypesStandardD16sV3', 'VMSizeTypesStandardD1V2', 'VMSizeTypesStandardD2', 'VMSizeTypesStandardD2V2', 'VMSizeTypesStandardD2V2Promo', 'VMSizeTypesStandardD2V3', 'VMSizeTypesStandardD2sV3', 'VMSizeTypesStandardD3', 'VMSizeTypesStandardD32V3', 'VMSizeTypesStandardD32sV3', 'VMSizeTypesStandardD3V2', 'VMSizeTypesStandardD3V2Promo', 'VMSizeTypesStandardD4', 'VMSizeTypesStandardD4V2', 'VMSizeTypesStandardD4V2Promo', 'VMSizeTypesStandardD4V3', 'VMSizeTypesStandardD4sV3', 'VMSizeTypesStandardD5V2', 'VMSizeTypesStandardD5V2Promo', 'VMSizeTypesStandardD64V3', 'VMSizeTypesStandardD64sV3', 'VMSizeTypesStandardD8V3', 'VMSizeTypesStandardD8sV3', 'VMSizeTypesStandardDS1', 'VMSizeTypesStandardDS11', 'VMSizeTypesStandardDS11V2', 'VMSizeTypesStandardDS11V2Promo', 'VMSizeTypesStandardDS12', 'VMSizeTypesStandardDS12V2', 'VMSizeTypesStandardDS12V2Promo', 'VMSizeTypesStandardDS13', 'VMSizeTypesStandardDS132V2', 'VMSizeTypesStandardDS134V2', 'VMSizeTypesStandardDS13V2', 'VMSizeTypesStandardDS13V2Promo', 'VMSizeTypesStandardDS14', 'VMSizeTypesStandardDS144V2', 'VMSizeTypesStandardDS148V2', 'VMSizeTypesStandardDS14V2', 'VMSizeTypesStandardDS14V2Promo', 'VMSizeTypesStandardDS15V2', 'VMSizeTypesStandardDS1V2', 'VMSizeTypesStandardDS2', 'VMSizeTypesStandardDS2V2', 'VMSizeTypesStandardDS2V2Promo', 'VMSizeTypesStandardDS3', 'VMSizeTypesStandardDS3V2', 'VMSizeTypesStandardDS3V2Promo', 'VMSizeTypesStandardDS4', 'VMSizeTypesStandardDS4V2', 'VMSizeTypesStandardDS4V2Promo', 'VMSizeTypesStandardDS5V2', 'VMSizeTypesStandardDS5V2Promo', 'VMSizeTypesStandardE16V3', 'VMSizeTypesStandardE16sV3', 'VMSizeTypesStandardE2V3', 'VMSizeTypesStandardE2sV3', 'VMSizeTypesStandardE3216sV3', 'VMSizeTypesStandardE328sV3', 'VMSizeTypesStandardE32V3', 'VMSizeTypesStandardE32sV3', 'VMSizeTypesStandardE4V3', 'VMSizeTypesStandardE4sV3', 'VMSizeTypesStandardE6416sV3', 'VMSizeTypesStandardE6432sV3', 'VMSizeTypesStandardE64V3', 'VMSizeTypesStandardE64sV3', 'VMSizeTypesStandardE8V3', 'VMSizeTypesStandardE8sV3', 'VMSizeTypesStandardF1', 'VMSizeTypesStandardF16', 'VMSizeTypesStandardF16s', 'VMSizeTypesStandardF16sV2', 'VMSizeTypesStandardF1s', 'VMSizeTypesStandardF2', 'VMSizeTypesStandardF2s', 'VMSizeTypesStandardF2sV2', 'VMSizeTypesStandardF32sV2', 'VMSizeTypesStandardF4', 'VMSizeTypesStandardF4s', 'VMSizeTypesStandardF4sV2', 'VMSizeTypesStandardF64sV2', 'VMSizeTypesStandardF72sV2', 'VMSizeTypesStandardF8', 'VMSizeTypesStandardF8s', 'VMSizeTypesStandardF8sV2', 'VMSizeTypesStandardG1', 'VMSizeTypesStandardG2', 'VMSizeTypesStandardG3', 'VMSizeTypesStandardG4', 'VMSizeTypesStandardG5', 'VMSizeTypesStandardGS1', 'VMSizeTypesStandardGS2', 'VMSizeTypesStandardGS3', 'VMSizeTypesStandardGS4', 'VMSizeTypesStandardGS44', 'VMSizeTypesStandardGS48', 'VMSizeTypesStandardGS5', 'VMSizeTypesStandardGS516', 'VMSizeTypesStandardGS58', 'VMSizeTypesStandardH16', 'VMSizeTypesStandardH16m', 'VMSizeTypesStandardH16mr', 'VMSizeTypesStandardH16r', 'VMSizeTypesStandardH8', 'VMSizeTypesStandardH8m', 'VMSizeTypesStandardL16s', 'VMSizeTypesStandardL32s', 'VMSizeTypesStandardL4s', 'VMSizeTypesStandardL8s', 'VMSizeTypesStandardM12832ms', 'VMSizeTypesStandardM12864ms', 'VMSizeTypesStandardM128ms', 'VMSizeTypesStandardM128s', 'VMSizeTypesStandardM6416ms', 'VMSizeTypesStandardM6432ms', 'VMSizeTypesStandardM64ms', 'VMSizeTypesStandardM64s', 'VMSizeTypesStandardNC12', 'VMSizeTypesStandardNC12sV2', 'VMSizeTypesStandardNC12sV3', 'VMSizeTypesStandardNC24', 'VMSizeTypesStandardNC24r', 'VMSizeTypesStandardNC24rsV2', 'VMSizeTypesStandardNC24rsV3', 'VMSizeTypesStandardNC24sV2', 'VMSizeTypesStandardNC24sV3', 'VMSizeTypesStandardNC6', 'VMSizeTypesStandardNC6sV2', 'VMSizeTypesStandardNC6sV3', 'VMSizeTypesStandardND12s', 'VMSizeTypesStandardND24rs', 'VMSizeTypesStandardND24s', 'VMSizeTypesStandardND6s', 'VMSizeTypesStandardNV12', 'VMSizeTypesStandardNV24', 'VMSizeTypesStandardNV6' VMSize VMSizeTypes `json:"vmSize,omitempty"` @@ -1967,7 +1967,7 @@ func (mcapp ManagedClusterAgentPoolProfile) MarshalJSON() ([]byte, error) { // ManagedClusterAgentPoolProfileProperties properties for the container service agent pool profile. type ManagedClusterAgentPoolProfileProperties struct { - // Count - Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 100 (inclusive). The default value is 1. + // Count - Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for system pools. The default value is 1. Count *int32 `json:"count,omitempty"` // VMSize - Size of agent VMs. Possible values include: 'VMSizeTypesStandardA1', 'VMSizeTypesStandardA10', 'VMSizeTypesStandardA11', 'VMSizeTypesStandardA1V2', 'VMSizeTypesStandardA2', 'VMSizeTypesStandardA2V2', 'VMSizeTypesStandardA2mV2', 'VMSizeTypesStandardA3', 'VMSizeTypesStandardA4', 'VMSizeTypesStandardA4V2', 'VMSizeTypesStandardA4mV2', 'VMSizeTypesStandardA5', 'VMSizeTypesStandardA6', 'VMSizeTypesStandardA7', 'VMSizeTypesStandardA8', 'VMSizeTypesStandardA8V2', 'VMSizeTypesStandardA8mV2', 'VMSizeTypesStandardA9', 'VMSizeTypesStandardB2ms', 'VMSizeTypesStandardB2s', 'VMSizeTypesStandardB4ms', 'VMSizeTypesStandardB8ms', 'VMSizeTypesStandardD1', 'VMSizeTypesStandardD11', 'VMSizeTypesStandardD11V2', 'VMSizeTypesStandardD11V2Promo', 'VMSizeTypesStandardD12', 'VMSizeTypesStandardD12V2', 'VMSizeTypesStandardD12V2Promo', 'VMSizeTypesStandardD13', 'VMSizeTypesStandardD13V2', 'VMSizeTypesStandardD13V2Promo', 'VMSizeTypesStandardD14', 'VMSizeTypesStandardD14V2', 'VMSizeTypesStandardD14V2Promo', 'VMSizeTypesStandardD15V2', 'VMSizeTypesStandardD16V3', 'VMSizeTypesStandardD16sV3', 'VMSizeTypesStandardD1V2', 'VMSizeTypesStandardD2', 'VMSizeTypesStandardD2V2', 'VMSizeTypesStandardD2V2Promo', 'VMSizeTypesStandardD2V3', 'VMSizeTypesStandardD2sV3', 'VMSizeTypesStandardD3', 'VMSizeTypesStandardD32V3', 'VMSizeTypesStandardD32sV3', 'VMSizeTypesStandardD3V2', 'VMSizeTypesStandardD3V2Promo', 'VMSizeTypesStandardD4', 'VMSizeTypesStandardD4V2', 'VMSizeTypesStandardD4V2Promo', 'VMSizeTypesStandardD4V3', 'VMSizeTypesStandardD4sV3', 'VMSizeTypesStandardD5V2', 'VMSizeTypesStandardD5V2Promo', 'VMSizeTypesStandardD64V3', 'VMSizeTypesStandardD64sV3', 'VMSizeTypesStandardD8V3', 'VMSizeTypesStandardD8sV3', 'VMSizeTypesStandardDS1', 'VMSizeTypesStandardDS11', 'VMSizeTypesStandardDS11V2', 'VMSizeTypesStandardDS11V2Promo', 'VMSizeTypesStandardDS12', 'VMSizeTypesStandardDS12V2', 'VMSizeTypesStandardDS12V2Promo', 'VMSizeTypesStandardDS13', 'VMSizeTypesStandardDS132V2', 'VMSizeTypesStandardDS134V2', 'VMSizeTypesStandardDS13V2', 'VMSizeTypesStandardDS13V2Promo', 'VMSizeTypesStandardDS14', 'VMSizeTypesStandardDS144V2', 'VMSizeTypesStandardDS148V2', 'VMSizeTypesStandardDS14V2', 'VMSizeTypesStandardDS14V2Promo', 'VMSizeTypesStandardDS15V2', 'VMSizeTypesStandardDS1V2', 'VMSizeTypesStandardDS2', 'VMSizeTypesStandardDS2V2', 'VMSizeTypesStandardDS2V2Promo', 'VMSizeTypesStandardDS3', 'VMSizeTypesStandardDS3V2', 'VMSizeTypesStandardDS3V2Promo', 'VMSizeTypesStandardDS4', 'VMSizeTypesStandardDS4V2', 'VMSizeTypesStandardDS4V2Promo', 'VMSizeTypesStandardDS5V2', 'VMSizeTypesStandardDS5V2Promo', 'VMSizeTypesStandardE16V3', 'VMSizeTypesStandardE16sV3', 'VMSizeTypesStandardE2V3', 'VMSizeTypesStandardE2sV3', 'VMSizeTypesStandardE3216sV3', 'VMSizeTypesStandardE328sV3', 'VMSizeTypesStandardE32V3', 'VMSizeTypesStandardE32sV3', 'VMSizeTypesStandardE4V3', 'VMSizeTypesStandardE4sV3', 'VMSizeTypesStandardE6416sV3', 'VMSizeTypesStandardE6432sV3', 'VMSizeTypesStandardE64V3', 'VMSizeTypesStandardE64sV3', 'VMSizeTypesStandardE8V3', 'VMSizeTypesStandardE8sV3', 'VMSizeTypesStandardF1', 'VMSizeTypesStandardF16', 'VMSizeTypesStandardF16s', 'VMSizeTypesStandardF16sV2', 'VMSizeTypesStandardF1s', 'VMSizeTypesStandardF2', 'VMSizeTypesStandardF2s', 'VMSizeTypesStandardF2sV2', 'VMSizeTypesStandardF32sV2', 'VMSizeTypesStandardF4', 'VMSizeTypesStandardF4s', 'VMSizeTypesStandardF4sV2', 'VMSizeTypesStandardF64sV2', 'VMSizeTypesStandardF72sV2', 'VMSizeTypesStandardF8', 'VMSizeTypesStandardF8s', 'VMSizeTypesStandardF8sV2', 'VMSizeTypesStandardG1', 'VMSizeTypesStandardG2', 'VMSizeTypesStandardG3', 'VMSizeTypesStandardG4', 'VMSizeTypesStandardG5', 'VMSizeTypesStandardGS1', 'VMSizeTypesStandardGS2', 'VMSizeTypesStandardGS3', 'VMSizeTypesStandardGS4', 'VMSizeTypesStandardGS44', 'VMSizeTypesStandardGS48', 'VMSizeTypesStandardGS5', 'VMSizeTypesStandardGS516', 'VMSizeTypesStandardGS58', 'VMSizeTypesStandardH16', 'VMSizeTypesStandardH16m', 'VMSizeTypesStandardH16mr', 'VMSizeTypesStandardH16r', 'VMSizeTypesStandardH8', 'VMSizeTypesStandardH8m', 'VMSizeTypesStandardL16s', 'VMSizeTypesStandardL32s', 'VMSizeTypesStandardL4s', 'VMSizeTypesStandardL8s', 'VMSizeTypesStandardM12832ms', 'VMSizeTypesStandardM12864ms', 'VMSizeTypesStandardM128ms', 'VMSizeTypesStandardM128s', 'VMSizeTypesStandardM6416ms', 'VMSizeTypesStandardM6432ms', 'VMSizeTypesStandardM64ms', 'VMSizeTypesStandardM64s', 'VMSizeTypesStandardNC12', 'VMSizeTypesStandardNC12sV2', 'VMSizeTypesStandardNC12sV3', 'VMSizeTypesStandardNC24', 'VMSizeTypesStandardNC24r', 'VMSizeTypesStandardNC24rsV2', 'VMSizeTypesStandardNC24rsV3', 'VMSizeTypesStandardNC24sV2', 'VMSizeTypesStandardNC24sV3', 'VMSizeTypesStandardNC6', 'VMSizeTypesStandardNC6sV2', 'VMSizeTypesStandardNC6sV3', 'VMSizeTypesStandardND12s', 'VMSizeTypesStandardND24rs', 'VMSizeTypesStandardND24s', 'VMSizeTypesStandardND6s', 'VMSizeTypesStandardNV12', 'VMSizeTypesStandardNV24', 'VMSizeTypesStandardNV6' VMSize VMSizeTypes `json:"vmSize,omitempty"` diff --git a/services/containerservice/mgmt/2020-04-01/containerservice/agentpools.go b/services/containerservice/mgmt/2020-04-01/containerservice/agentpools.go new file mode 100644 index 000000000000..65f696ef58ba --- /dev/null +++ b/services/containerservice/mgmt/2020-04-01/containerservice/agentpools.go @@ -0,0 +1,609 @@ +package containerservice + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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 the Container Service Client. +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)} +} + +// CreateOrUpdate creates or updates an agent pool in the specified managed cluster. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the managed cluster resource. +// agentPoolName - the name of the agent pool. +// parameters - parameters supplied to the Create or Update an agent pool operation. +func (client AgentPoolsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, parameters AgentPool) (result AgentPoolsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AgentPoolsClient.CreateOrUpdate") + 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.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.AgentPoolsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, resourceName, agentPoolName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client AgentPoolsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, parameters AgentPool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "agentPoolName": autorest.Encode("path", agentPoolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-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.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}", pathParameters), + autorest.WithJSON(parameters), + 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 AgentPoolsClient) CreateOrUpdateSender(req *http.Request) (future AgentPoolsCreateOrUpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client AgentPoolsClient) CreateOrUpdateResponder(resp *http.Response) (result AgentPool, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the agent pool in the specified managed cluster. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the managed cluster resource. +// agentPoolName - the name of the agent pool. +func (client AgentPoolsClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string) (result AgentPoolsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AgentPoolsClient.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.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.AgentPoolsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, resourceName, agentPoolName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client AgentPoolsClient) DeletePreparer(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "agentPoolName": autorest.Encode("path", agentPoolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-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.ContainerService/managedClusters/{resourceName}/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 + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + 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, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of the agent pool by managed cluster and resource group. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the managed cluster resource. +// agentPoolName - the name of the agent pool. +func (client AgentPoolsClient) Get(ctx context.Context, resourceGroupName string, resourceName 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: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.AgentPoolsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, resourceName, agentPoolName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.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, "containerservice.AgentPoolsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client AgentPoolsClient) GetPreparer(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "agentPoolName": autorest.Encode("path", agentPoolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/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, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetAvailableAgentPoolVersions gets a list of supported versions for the specified agent pool. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the managed cluster resource. +func (client AgentPoolsClient) GetAvailableAgentPoolVersions(ctx context.Context, resourceGroupName string, resourceName string) (result AgentPoolAvailableVersions, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AgentPoolsClient.GetAvailableAgentPoolVersions") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = 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: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.AgentPoolsClient", "GetAvailableAgentPoolVersions", err.Error()) + } + + req, err := client.GetAvailableAgentPoolVersionsPreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "GetAvailableAgentPoolVersions", nil, "Failure preparing request") + return + } + + resp, err := client.GetAvailableAgentPoolVersionsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "GetAvailableAgentPoolVersions", resp, "Failure sending request") + return + } + + result, err = client.GetAvailableAgentPoolVersionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "GetAvailableAgentPoolVersions", resp, "Failure responding to request") + } + + return +} + +// GetAvailableAgentPoolVersionsPreparer prepares the GetAvailableAgentPoolVersions request. +func (client AgentPoolsClient) GetAvailableAgentPoolVersionsPreparer(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 = "2020-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/availableAgentPoolVersions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetAvailableAgentPoolVersionsSender sends the GetAvailableAgentPoolVersions request. The method will close the +// http.Response Body if it receives an error. +func (client AgentPoolsClient) GetAvailableAgentPoolVersionsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetAvailableAgentPoolVersionsResponder handles the response to the GetAvailableAgentPoolVersions request. The method always +// closes the http.Response Body. +func (client AgentPoolsClient) GetAvailableAgentPoolVersionsResponder(resp *http.Response) (result AgentPoolAvailableVersions, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetUpgradeProfile gets the details of the upgrade profile for an agent pool with a specified resource group and +// managed cluster name. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the managed cluster resource. +// agentPoolName - the name of the agent pool. +func (client AgentPoolsClient) GetUpgradeProfile(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string) (result AgentPoolUpgradeProfile, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AgentPoolsClient.GetUpgradeProfile") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = 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: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.AgentPoolsClient", "GetUpgradeProfile", err.Error()) + } + + req, err := client.GetUpgradeProfilePreparer(ctx, resourceGroupName, resourceName, agentPoolName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "GetUpgradeProfile", nil, "Failure preparing request") + return + } + + resp, err := client.GetUpgradeProfileSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "GetUpgradeProfile", resp, "Failure sending request") + return + } + + result, err = client.GetUpgradeProfileResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "GetUpgradeProfile", resp, "Failure responding to request") + } + + return +} + +// GetUpgradeProfilePreparer prepares the GetUpgradeProfile request. +func (client AgentPoolsClient) GetUpgradeProfilePreparer(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "agentPoolName": autorest.Encode("path", agentPoolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/agentPools/{agentPoolName}/upgradeProfiles/default", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetUpgradeProfileSender sends the GetUpgradeProfile request. The method will close the +// http.Response Body if it receives an error. +func (client AgentPoolsClient) GetUpgradeProfileSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetUpgradeProfileResponder handles the response to the GetUpgradeProfile request. The method always +// closes the http.Response Body. +func (client AgentPoolsClient) GetUpgradeProfileResponder(resp *http.Response) (result AgentPoolUpgradeProfile, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets a list of agent pools in the specified managed cluster. The operation returns properties of each agent +// pool. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the managed cluster resource. +func (client AgentPoolsClient) List(ctx context.Context, resourceGroupName string, resourceName 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: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.AgentPoolsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.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, "containerservice.AgentPoolsClient", "List", resp, "Failure sending request") + return + } + + result.aplr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client AgentPoolsClient) 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 = "2020-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/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, + client.ByInspecting(), + 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, "containerservice.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, "containerservice.AgentPoolsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.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, resourceName 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, resourceName) + return +} diff --git a/services/containerservice/mgmt/2020-04-01/containerservice/client.go b/services/containerservice/mgmt/2020-04-01/containerservice/client.go new file mode 100644 index 000000000000..858e168f208f --- /dev/null +++ b/services/containerservice/mgmt/2020-04-01/containerservice/client.go @@ -0,0 +1,52 @@ +// Package containerservice implements the Azure ARM Containerservice service API version . +// +// The Container Service Client. +package containerservice + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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 Containerservice + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Containerservice. +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/containerservice/mgmt/2020-04-01/containerservice/containerserviceapi/interfaces.go b/services/containerservice/mgmt/2020-04-01/containerservice/containerserviceapi/interfaces.go new file mode 100644 index 000000000000..be5741fbcaea --- /dev/null +++ b/services/containerservice/mgmt/2020-04-01/containerservice/containerserviceapi/interfaces.go @@ -0,0 +1,93 @@ +package containerserviceapi + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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/containerservice/mgmt/2020-04-01/containerservice" +) + +// OpenShiftManagedClustersClientAPI contains the set of methods on the OpenShiftManagedClustersClient type. +type OpenShiftManagedClustersClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, parameters containerservice.OpenShiftManagedCluster) (result containerservice.OpenShiftManagedClustersCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, resourceName string) (result containerservice.OpenShiftManagedClustersDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, resourceName string) (result containerservice.OpenShiftManagedCluster, err error) + List(ctx context.Context) (result containerservice.OpenShiftManagedClusterListResultPage, err error) + ListComplete(ctx context.Context) (result containerservice.OpenShiftManagedClusterListResultIterator, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result containerservice.OpenShiftManagedClusterListResultPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result containerservice.OpenShiftManagedClusterListResultIterator, err error) + UpdateTags(ctx context.Context, resourceGroupName string, resourceName string, parameters containerservice.TagsObject) (result containerservice.OpenShiftManagedClustersUpdateTagsFuture, err error) +} + +var _ OpenShiftManagedClustersClientAPI = (*containerservice.OpenShiftManagedClustersClient)(nil) + +// ContainerServicesClientAPI contains the set of methods on the ContainerServicesClient type. +type ContainerServicesClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, containerServiceName string, parameters containerservice.ContainerService) (result containerservice.ContainerServicesCreateOrUpdateFutureType, err error) + Delete(ctx context.Context, resourceGroupName string, containerServiceName string) (result containerservice.ContainerServicesDeleteFutureType, err error) + Get(ctx context.Context, resourceGroupName string, containerServiceName string) (result containerservice.ContainerService, err error) + List(ctx context.Context) (result containerservice.ListResultPage, err error) + ListComplete(ctx context.Context) (result containerservice.ListResultIterator, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result containerservice.ListResultPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result containerservice.ListResultIterator, err error) + ListOrchestrators(ctx context.Context, location string, resourceType string) (result containerservice.OrchestratorVersionProfileListResult, err error) +} + +var _ ContainerServicesClientAPI = (*containerservice.ContainerServicesClient)(nil) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result containerservice.OperationListResult, err error) +} + +var _ OperationsClientAPI = (*containerservice.OperationsClient)(nil) + +// ManagedClustersClientAPI contains the set of methods on the ManagedClustersClient type. +type ManagedClustersClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, parameters containerservice.ManagedCluster) (result containerservice.ManagedClustersCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, resourceName string) (result containerservice.ManagedClustersDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, resourceName string) (result containerservice.ManagedCluster, err error) + GetAccessProfile(ctx context.Context, resourceGroupName string, resourceName string, roleName string) (result containerservice.ManagedClusterAccessProfile, err error) + GetUpgradeProfile(ctx context.Context, resourceGroupName string, resourceName string) (result containerservice.ManagedClusterUpgradeProfile, err error) + List(ctx context.Context) (result containerservice.ManagedClusterListResultPage, err error) + ListComplete(ctx context.Context) (result containerservice.ManagedClusterListResultIterator, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result containerservice.ManagedClusterListResultPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result containerservice.ManagedClusterListResultIterator, err error) + ListClusterAdminCredentials(ctx context.Context, resourceGroupName string, resourceName string) (result containerservice.CredentialResults, err error) + ListClusterMonitoringUserCredentials(ctx context.Context, resourceGroupName string, resourceName string) (result containerservice.CredentialResults, err error) + ListClusterUserCredentials(ctx context.Context, resourceGroupName string, resourceName string) (result containerservice.CredentialResults, err error) + ResetAADProfile(ctx context.Context, resourceGroupName string, resourceName string, parameters containerservice.ManagedClusterAADProfile) (result containerservice.ManagedClustersResetAADProfileFuture, err error) + ResetServicePrincipalProfile(ctx context.Context, resourceGroupName string, resourceName string, parameters containerservice.ManagedClusterServicePrincipalProfile) (result containerservice.ManagedClustersResetServicePrincipalProfileFuture, err error) + RotateClusterCertificates(ctx context.Context, resourceGroupName string, resourceName string) (result containerservice.ManagedClustersRotateClusterCertificatesFuture, err error) + UpdateTags(ctx context.Context, resourceGroupName string, resourceName string, parameters containerservice.TagsObject) (result containerservice.ManagedClustersUpdateTagsFuture, err error) +} + +var _ ManagedClustersClientAPI = (*containerservice.ManagedClustersClient)(nil) + +// AgentPoolsClientAPI contains the set of methods on the AgentPoolsClient type. +type AgentPoolsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string, parameters containerservice.AgentPool) (result containerservice.AgentPoolsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string) (result containerservice.AgentPoolsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string) (result containerservice.AgentPool, err error) + GetAvailableAgentPoolVersions(ctx context.Context, resourceGroupName string, resourceName string) (result containerservice.AgentPoolAvailableVersions, err error) + GetUpgradeProfile(ctx context.Context, resourceGroupName string, resourceName string, agentPoolName string) (result containerservice.AgentPoolUpgradeProfile, err error) + List(ctx context.Context, resourceGroupName string, resourceName string) (result containerservice.AgentPoolListResultPage, err error) + ListComplete(ctx context.Context, resourceGroupName string, resourceName string) (result containerservice.AgentPoolListResultIterator, err error) +} + +var _ AgentPoolsClientAPI = (*containerservice.AgentPoolsClient)(nil) diff --git a/services/containerservice/mgmt/2020-04-01/containerservice/containerservices.go b/services/containerservice/mgmt/2020-04-01/containerservice/containerservices.go new file mode 100644 index 000000000000..c059245f0e0e --- /dev/null +++ b/services/containerservice/mgmt/2020-04-01/containerservice/containerservices.go @@ -0,0 +1,618 @@ +package containerservice + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// ContainerServicesClient is the the Container Service Client. +type ContainerServicesClient struct { + BaseClient +} + +// NewContainerServicesClient creates an instance of the ContainerServicesClient client. +func NewContainerServicesClient(subscriptionID string) ContainerServicesClient { + return NewContainerServicesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewContainerServicesClientWithBaseURI creates an instance of the ContainerServicesClient 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 NewContainerServicesClientWithBaseURI(baseURI string, subscriptionID string) ContainerServicesClient { + return ContainerServicesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a container service with the specified configuration of orchestrator, masters, and +// agents. +// Parameters: +// resourceGroupName - the name of the resource group. +// containerServiceName - the name of the container service in the specified subscription and resource group. +// parameters - parameters supplied to the Create or Update a Container Service operation. +func (client ContainerServicesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, containerServiceName string, parameters ContainerService) (result ContainerServicesCreateOrUpdateFutureType, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServicesClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Properties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Properties.OrchestratorProfile", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.Properties.CustomProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Properties.CustomProfile.Orchestrator", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "parameters.Properties.ServicePrincipalProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Properties.ServicePrincipalProfile.ClientID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.Properties.ServicePrincipalProfile.KeyVaultSecretRef", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Properties.ServicePrincipalProfile.KeyVaultSecretRef.VaultID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.Properties.ServicePrincipalProfile.KeyVaultSecretRef.SecretName", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}, + {Target: "parameters.Properties.MasterProfile", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.Properties.MasterProfile.DNSPrefix", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "parameters.Properties.WindowsProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Properties.WindowsProfile.AdminUsername", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.Properties.WindowsProfile.AdminUsername", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+([._]?[a-zA-Z0-9]+)*$`, Chain: nil}}}, + {Target: "parameters.Properties.WindowsProfile.AdminPassword", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "parameters.Properties.LinuxProfile", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.Properties.LinuxProfile.AdminUsername", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.Properties.LinuxProfile.AdminUsername", Name: validation.Pattern, Rule: `^[A-Za-z][-A-Za-z0-9_]*$`, Chain: nil}}}, + {Target: "parameters.Properties.LinuxProfile.SSH", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.Properties.LinuxProfile.SSH.PublicKeys", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + {Target: "parameters.Properties.DiagnosticsProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Properties.DiagnosticsProfile.VMDiagnostics", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.Properties.DiagnosticsProfile.VMDiagnostics.Enabled", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + }}}}}); err != nil { + return result, validation.NewError("containerservice.ContainerServicesClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, containerServiceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ContainerServicesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, containerServiceName string, parameters ContainerService) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "containerServiceName": autorest.Encode("path", containerServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-07-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.ContainerService/containerServices/{containerServiceName}", pathParameters), + autorest.WithJSON(parameters), + 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 ContainerServicesClient) CreateOrUpdateSender(req *http.Request) (future ContainerServicesCreateOrUpdateFutureType, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client ContainerServicesClient) CreateOrUpdateResponder(resp *http.Response) (result ContainerService, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the specified container service in the specified subscription and resource group. The operation does +// not delete other resources created as part of creating a container service, including storage accounts, VMs, and +// availability sets. All the other resources created with the container service are part of the same resource group +// and can be deleted individually. +// Parameters: +// resourceGroupName - the name of the resource group. +// containerServiceName - the name of the container service in the specified subscription and resource group. +func (client ContainerServicesClient) Delete(ctx context.Context, resourceGroupName string, containerServiceName string) (result ContainerServicesDeleteFutureType, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServicesClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, containerServiceName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ContainerServicesClient) DeletePreparer(ctx context.Context, resourceGroupName string, containerServiceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "containerServiceName": autorest.Encode("path", containerServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-07-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.ContainerService/containerServices/{containerServiceName}", 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 ContainerServicesClient) DeleteSender(req *http.Request) (future ContainerServicesDeleteFutureType, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ContainerServicesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the properties of the specified container service in the specified subscription and resource group. The +// operation returns the properties including state, orchestrator, number of masters and agents, and FQDNs of masters +// and agents. +// Parameters: +// resourceGroupName - the name of the resource group. +// containerServiceName - the name of the container service in the specified subscription and resource group. +func (client ContainerServicesClient) Get(ctx context.Context, resourceGroupName string, containerServiceName string) (result ContainerService, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServicesClient.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, containerServiceName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ContainerServicesClient) GetPreparer(ctx context.Context, resourceGroupName string, containerServiceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "containerServiceName": autorest.Encode("path", containerServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices/{containerServiceName}", 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 ContainerServicesClient) 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 ContainerServicesClient) GetResponder(resp *http.Response) (result ContainerService, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets a list of container services in the specified subscription. The operation returns properties of each +// container service including state, orchestrator, number of masters and agents, and FQDNs of masters and agents. +func (client ContainerServicesClient) List(ctx context.Context) (result ListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServicesClient.List") + defer func() { + sc := -1 + if result.lr.Response.Response != nil { + sc = result.lr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.lr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "List", resp, "Failure sending request") + return + } + + result.lr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client ContainerServicesClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/containerServices", 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 ContainerServicesClient) 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 ContainerServicesClient) ListResponder(resp *http.Response) (result ListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 ContainerServicesClient) listNextResults(ctx context.Context, lastResults ListResult) (result ListResult, err error) { + req, err := lastResults.listResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "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, "containerservice.ContainerServicesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ContainerServicesClient) ListComplete(ctx context.Context) (result ListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServicesClient.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 gets a list of container services in the specified subscription and resource group. The +// operation returns properties of each container service including state, orchestrator, number of masters and agents, +// and FQDNs of masters and agents. +// Parameters: +// resourceGroupName - the name of the resource group. +func (client ContainerServicesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServicesClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.lr.Response.Response != nil { + sc = result.lr.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, "containerservice.ContainerServicesClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.lr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.lr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client ContainerServicesClient) 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 = "2017-07-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/containerServices", 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 ContainerServicesClient) 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 ContainerServicesClient) ListByResourceGroupResponder(resp *http.Response) (result ListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 ContainerServicesClient) listByResourceGroupNextResults(ctx context.Context, lastResults ListResult) (result ListResult, err error) { + req, err := lastResults.listResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "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, "containerservice.ContainerServicesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client ContainerServicesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServicesClient.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 +} + +// ListOrchestrators gets a list of supported orchestrators in the specified subscription. The operation returns +// properties of each orchestrator including version, available upgrades and whether that version or upgrades are in +// preview. +// Parameters: +// location - the name of a supported Azure region. +// resourceType - resource type for which the list of orchestrators needs to be returned +func (client ContainerServicesClient) ListOrchestrators(ctx context.Context, location string, resourceType string) (result OrchestratorVersionProfileListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainerServicesClient.ListOrchestrators") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListOrchestratorsPreparer(ctx, location, resourceType) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "ListOrchestrators", nil, "Failure preparing request") + return + } + + resp, err := client.ListOrchestratorsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "ListOrchestrators", resp, "Failure sending request") + return + } + + result, err = client.ListOrchestratorsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesClient", "ListOrchestrators", resp, "Failure responding to request") + } + + return +} + +// ListOrchestratorsPreparer prepares the ListOrchestrators request. +func (client ContainerServicesClient) ListOrchestratorsPreparer(ctx context.Context, location string, resourceType string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-08-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(resourceType) > 0 { + queryParameters["resource-type"] = autorest.Encode("query", resourceType) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/locations/{location}/orchestrators", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListOrchestratorsSender sends the ListOrchestrators request. The method will close the +// http.Response Body if it receives an error. +func (client ContainerServicesClient) ListOrchestratorsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListOrchestratorsResponder handles the response to the ListOrchestrators request. The method always +// closes the http.Response Body. +func (client ContainerServicesClient) ListOrchestratorsResponder(resp *http.Response) (result OrchestratorVersionProfileListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/containerservice/mgmt/2020-04-01/containerservice/managedclusters.go b/services/containerservice/mgmt/2020-04-01/containerservice/managedclusters.go new file mode 100644 index 000000000000..2e2955fa987e --- /dev/null +++ b/services/containerservice/mgmt/2020-04-01/containerservice/managedclusters.go @@ -0,0 +1,1367 @@ +package containerservice + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// ManagedClustersClient is the the Container Service Client. +type ManagedClustersClient struct { + BaseClient +} + +// NewManagedClustersClient creates an instance of the ManagedClustersClient client. +func NewManagedClustersClient(subscriptionID string) ManagedClustersClient { + return NewManagedClustersClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewManagedClustersClientWithBaseURI creates an instance of the ManagedClustersClient 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 NewManagedClustersClientWithBaseURI(baseURI string, subscriptionID string) ManagedClustersClient { + return ManagedClustersClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a managed cluster with the specified configuration for agents and Kubernetes +// version. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the managed cluster resource. +// parameters - parameters supplied to the Create or Update a Managed Cluster operation. +func (client ManagedClustersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedCluster) (result ManagedClustersCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.CreateOrUpdate") + 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.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.ManagedClusterProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.LinuxProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.LinuxProfile.AdminUsername", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.LinuxProfile.AdminUsername", Name: validation.Pattern, Rule: `^[A-Za-z][-A-Za-z0-9_]*$`, Chain: nil}}}, + {Target: "parameters.ManagedClusterProperties.LinuxProfile.SSH", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.LinuxProfile.SSH.PublicKeys", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + {Target: "parameters.ManagedClusterProperties.WindowsProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.WindowsProfile.AdminUsername", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.WindowsProfile.AdminUsername", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+([._]?[a-zA-Z0-9]+)*$`, Chain: nil}}}, + }}, + {Target: "parameters.ManagedClusterProperties.ServicePrincipalProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.ServicePrincipalProfile.ClientID", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "parameters.ManagedClusterProperties.NetworkProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.NetworkProfile.PodCidr", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.NetworkProfile.PodCidr", Name: validation.Pattern, Rule: `^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$`, Chain: nil}}}, + {Target: "parameters.ManagedClusterProperties.NetworkProfile.ServiceCidr", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.NetworkProfile.ServiceCidr", Name: validation.Pattern, Rule: `^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$`, Chain: nil}}}, + {Target: "parameters.ManagedClusterProperties.NetworkProfile.DNSServiceIP", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.NetworkProfile.DNSServiceIP", Name: validation.Pattern, Rule: `^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$`, Chain: nil}}}, + {Target: "parameters.ManagedClusterProperties.NetworkProfile.DockerBridgeCidr", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.NetworkProfile.DockerBridgeCidr", Name: validation.Pattern, Rule: `^([0-9]{1,3}\.){3}[0-9]{1,3}(\/([0-9]|[1-2][0-9]|3[0-2]))?$`, Chain: nil}}}, + {Target: "parameters.ManagedClusterProperties.NetworkProfile.LoadBalancerProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.NetworkProfile.LoadBalancerProfile.ManagedOutboundIPs", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.NetworkProfile.LoadBalancerProfile.ManagedOutboundIPs.Count", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.NetworkProfile.LoadBalancerProfile.ManagedOutboundIPs.Count", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, + {Target: "parameters.ManagedClusterProperties.NetworkProfile.LoadBalancerProfile.ManagedOutboundIPs.Count", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, + }}, + }}, + {Target: "parameters.ManagedClusterProperties.NetworkProfile.LoadBalancerProfile.AllocatedOutboundPorts", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.NetworkProfile.LoadBalancerProfile.AllocatedOutboundPorts", Name: validation.InclusiveMaximum, Rule: int64(64000), Chain: nil}, + {Target: "parameters.ManagedClusterProperties.NetworkProfile.LoadBalancerProfile.AllocatedOutboundPorts", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, + }}, + {Target: "parameters.ManagedClusterProperties.NetworkProfile.LoadBalancerProfile.IdleTimeoutInMinutes", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ManagedClusterProperties.NetworkProfile.LoadBalancerProfile.IdleTimeoutInMinutes", Name: validation.InclusiveMaximum, Rule: int64(120), Chain: nil}, + {Target: "parameters.ManagedClusterProperties.NetworkProfile.LoadBalancerProfile.IdleTimeoutInMinutes", Name: validation.InclusiveMinimum, Rule: int64(4), Chain: nil}, + }}, + }}, + }}, + }}}}}); err != nil { + return result, validation.NewError("containerservice.ManagedClustersClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, resourceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ManagedClustersClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedCluster) (*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 = "2020-04-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.ContainerService/managedClusters/{resourceName}", pathParameters), + autorest.WithJSON(parameters), + 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 ManagedClustersClient) CreateOrUpdateSender(req *http.Request) (future ManagedClustersCreateOrUpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client ManagedClustersClient) CreateOrUpdateResponder(resp *http.Response) (result ManagedCluster, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the managed cluster with a specified resource group and name. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the managed cluster resource. +func (client ManagedClustersClient) Delete(ctx context.Context, resourceGroupName string, resourceName string) (result ManagedClustersDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.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.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.ManagedClustersClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ManagedClustersClient) 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 = "2020-04-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.ContainerService/managedClusters/{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 ManagedClustersClient) DeleteSender(req *http.Request) (future ManagedClustersDeleteFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ManagedClustersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of the managed cluster with a specified resource group and name. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the managed cluster resource. +func (client ManagedClustersClient) Get(ctx context.Context, resourceGroupName string, resourceName string) (result ManagedCluster, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.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: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.ManagedClustersClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ManagedClustersClient) 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 = "2020-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{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 ManagedClustersClient) 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 ManagedClustersClient) GetResponder(resp *http.Response) (result ManagedCluster, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetAccessProfile gets the accessProfile for the specified role name of the managed cluster with a specified resource +// group and name. **WARNING**: This API will be deprecated. Instead use +// [ListClusterUserCredentials](https://docs.microsoft.com/en-us/rest/api/aks/managedclusters/listclusterusercredentials) +// or +// [ListClusterAdminCredentials](https://docs.microsoft.com/en-us/rest/api/aks/managedclusters/listclusteradmincredentials) +// . +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the managed cluster resource. +// roleName - the name of the role for managed cluster accessProfile resource. +func (client ManagedClustersClient) GetAccessProfile(ctx context.Context, resourceGroupName string, resourceName string, roleName string) (result ManagedClusterAccessProfile, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.GetAccessProfile") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = 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: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.ManagedClustersClient", "GetAccessProfile", err.Error()) + } + + req, err := client.GetAccessProfilePreparer(ctx, resourceGroupName, resourceName, roleName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "GetAccessProfile", nil, "Failure preparing request") + return + } + + resp, err := client.GetAccessProfileSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "GetAccessProfile", resp, "Failure sending request") + return + } + + result, err = client.GetAccessProfileResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "GetAccessProfile", resp, "Failure responding to request") + } + + return +} + +// GetAccessProfilePreparer prepares the GetAccessProfile request. +func (client ManagedClustersClient) GetAccessProfilePreparer(ctx context.Context, resourceGroupName string, resourceName string, roleName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "roleName": autorest.Encode("path", roleName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-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.ContainerService/managedClusters/{resourceName}/accessProfiles/{roleName}/listCredential", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetAccessProfileSender sends the GetAccessProfile request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) GetAccessProfileSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetAccessProfileResponder handles the response to the GetAccessProfile request. The method always +// closes the http.Response Body. +func (client ManagedClustersClient) GetAccessProfileResponder(resp *http.Response) (result ManagedClusterAccessProfile, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetUpgradeProfile gets the details of the upgrade profile for a managed cluster with a specified resource group and +// name. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the managed cluster resource. +func (client ManagedClustersClient) GetUpgradeProfile(ctx context.Context, resourceGroupName string, resourceName string) (result ManagedClusterUpgradeProfile, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.GetUpgradeProfile") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = 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: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.ManagedClustersClient", "GetUpgradeProfile", err.Error()) + } + + req, err := client.GetUpgradeProfilePreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "GetUpgradeProfile", nil, "Failure preparing request") + return + } + + resp, err := client.GetUpgradeProfileSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "GetUpgradeProfile", resp, "Failure sending request") + return + } + + result, err = client.GetUpgradeProfileResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "GetUpgradeProfile", resp, "Failure responding to request") + } + + return +} + +// GetUpgradeProfilePreparer prepares the GetUpgradeProfile request. +func (client ManagedClustersClient) GetUpgradeProfilePreparer(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 = "2020-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters/{resourceName}/upgradeProfiles/default", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetUpgradeProfileSender sends the GetUpgradeProfile request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) GetUpgradeProfileSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetUpgradeProfileResponder handles the response to the GetUpgradeProfile request. The method always +// closes the http.Response Body. +func (client ManagedClustersClient) GetUpgradeProfileResponder(resp *http.Response) (result ManagedClusterUpgradeProfile, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets a list of managed clusters in the specified subscription. The operation returns properties of each managed +// cluster. +func (client ManagedClustersClient) List(ctx context.Context) (result ManagedClusterListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.List") + defer func() { + sc := -1 + if result.mclr.Response.Response != nil { + sc = result.mclr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.mclr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "List", resp, "Failure sending request") + return + } + + result.mclr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client ManagedClustersClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/managedClusters", 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 ManagedClustersClient) 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 ManagedClustersClient) ListResponder(resp *http.Response) (result ManagedClusterListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 ManagedClustersClient) listNextResults(ctx context.Context, lastResults ManagedClusterListResult) (result ManagedClusterListResult, err error) { + req, err := lastResults.managedClusterListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "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, "containerservice.ManagedClustersClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ManagedClustersClient) ListComplete(ctx context.Context) (result ManagedClusterListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.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 managed clusters in the specified subscription and resource group. The operation returns +// properties of each managed cluster. +// Parameters: +// resourceGroupName - the name of the resource group. +func (client ManagedClustersClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ManagedClusterListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.mclr.Response.Response != nil { + sc = result.mclr.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("containerservice.ManagedClustersClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.mclr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.mclr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client ManagedClustersClient) 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 = "2020-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedClusters", 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 ManagedClustersClient) 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 ManagedClustersClient) ListByResourceGroupResponder(resp *http.Response) (result ManagedClusterListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 ManagedClustersClient) listByResourceGroupNextResults(ctx context.Context, lastResults ManagedClusterListResult) (result ManagedClusterListResult, err error) { + req, err := lastResults.managedClusterListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "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, "containerservice.ManagedClustersClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client ManagedClustersClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ManagedClusterListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.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 +} + +// ListClusterAdminCredentials gets cluster admin credential of the managed cluster with a specified resource group and +// name. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the managed cluster resource. +func (client ManagedClustersClient) ListClusterAdminCredentials(ctx context.Context, resourceGroupName string, resourceName string) (result CredentialResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.ListClusterAdminCredentials") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = 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: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.ManagedClustersClient", "ListClusterAdminCredentials", err.Error()) + } + + req, err := client.ListClusterAdminCredentialsPreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ListClusterAdminCredentials", nil, "Failure preparing request") + return + } + + resp, err := client.ListClusterAdminCredentialsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ListClusterAdminCredentials", resp, "Failure sending request") + return + } + + result, err = client.ListClusterAdminCredentialsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ListClusterAdminCredentials", resp, "Failure responding to request") + } + + return +} + +// ListClusterAdminCredentialsPreparer prepares the ListClusterAdminCredentials request. +func (client ManagedClustersClient) ListClusterAdminCredentialsPreparer(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 = "2020-04-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.ContainerService/managedClusters/{resourceName}/listClusterAdminCredential", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListClusterAdminCredentialsSender sends the ListClusterAdminCredentials request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) ListClusterAdminCredentialsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListClusterAdminCredentialsResponder handles the response to the ListClusterAdminCredentials request. The method always +// closes the http.Response Body. +func (client ManagedClustersClient) ListClusterAdminCredentialsResponder(resp *http.Response) (result CredentialResults, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListClusterMonitoringUserCredentials gets cluster monitoring user credential of the managed cluster with a specified +// resource group and name. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the managed cluster resource. +func (client ManagedClustersClient) ListClusterMonitoringUserCredentials(ctx context.Context, resourceGroupName string, resourceName string) (result CredentialResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.ListClusterMonitoringUserCredentials") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = 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: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.ManagedClustersClient", "ListClusterMonitoringUserCredentials", err.Error()) + } + + req, err := client.ListClusterMonitoringUserCredentialsPreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ListClusterMonitoringUserCredentials", nil, "Failure preparing request") + return + } + + resp, err := client.ListClusterMonitoringUserCredentialsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ListClusterMonitoringUserCredentials", resp, "Failure sending request") + return + } + + result, err = client.ListClusterMonitoringUserCredentialsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ListClusterMonitoringUserCredentials", resp, "Failure responding to request") + } + + return +} + +// ListClusterMonitoringUserCredentialsPreparer prepares the ListClusterMonitoringUserCredentials request. +func (client ManagedClustersClient) ListClusterMonitoringUserCredentialsPreparer(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 = "2020-04-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.ContainerService/managedClusters/{resourceName}/listClusterMonitoringUserCredential", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListClusterMonitoringUserCredentialsSender sends the ListClusterMonitoringUserCredentials request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) ListClusterMonitoringUserCredentialsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListClusterMonitoringUserCredentialsResponder handles the response to the ListClusterMonitoringUserCredentials request. The method always +// closes the http.Response Body. +func (client ManagedClustersClient) ListClusterMonitoringUserCredentialsResponder(resp *http.Response) (result CredentialResults, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListClusterUserCredentials gets cluster user credential of the managed cluster with a specified resource group and +// name. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the managed cluster resource. +func (client ManagedClustersClient) ListClusterUserCredentials(ctx context.Context, resourceGroupName string, resourceName string) (result CredentialResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.ListClusterUserCredentials") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = 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: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.ManagedClustersClient", "ListClusterUserCredentials", err.Error()) + } + + req, err := client.ListClusterUserCredentialsPreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ListClusterUserCredentials", nil, "Failure preparing request") + return + } + + resp, err := client.ListClusterUserCredentialsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ListClusterUserCredentials", resp, "Failure sending request") + return + } + + result, err = client.ListClusterUserCredentialsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ListClusterUserCredentials", resp, "Failure responding to request") + } + + return +} + +// ListClusterUserCredentialsPreparer prepares the ListClusterUserCredentials request. +func (client ManagedClustersClient) ListClusterUserCredentialsPreparer(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 = "2020-04-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.ContainerService/managedClusters/{resourceName}/listClusterUserCredential", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListClusterUserCredentialsSender sends the ListClusterUserCredentials request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) ListClusterUserCredentialsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListClusterUserCredentialsResponder handles the response to the ListClusterUserCredentials request. The method always +// closes the http.Response Body. +func (client ManagedClustersClient) ListClusterUserCredentialsResponder(resp *http.Response) (result CredentialResults, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ResetAADProfile update the AAD Profile for a managed cluster. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the managed cluster resource. +// parameters - parameters supplied to the Reset AAD Profile operation for a Managed Cluster. +func (client ManagedClustersClient) ResetAADProfile(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedClusterAADProfile) (result ManagedClustersResetAADProfileFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.ResetAADProfile") + 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.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.ManagedClustersClient", "ResetAADProfile", err.Error()) + } + + req, err := client.ResetAADProfilePreparer(ctx, resourceGroupName, resourceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ResetAADProfile", nil, "Failure preparing request") + return + } + + result, err = client.ResetAADProfileSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ResetAADProfile", result.Response(), "Failure sending request") + return + } + + return +} + +// ResetAADProfilePreparer prepares the ResetAADProfile request. +func (client ManagedClustersClient) ResetAADProfilePreparer(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedClusterAADProfile) (*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 = "2020-04-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.ContainerService/managedClusters/{resourceName}/resetAADProfile", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResetAADProfileSender sends the ResetAADProfile request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) ResetAADProfileSender(req *http.Request) (future ManagedClustersResetAADProfileFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// ResetAADProfileResponder handles the response to the ResetAADProfile request. The method always +// closes the http.Response Body. +func (client ManagedClustersClient) ResetAADProfileResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// ResetServicePrincipalProfile update the service principal Profile for a managed cluster. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the managed cluster resource. +// parameters - parameters supplied to the Reset Service Principal Profile operation for a Managed Cluster. +func (client ManagedClustersClient) ResetServicePrincipalProfile(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedClusterServicePrincipalProfile) (result ManagedClustersResetServicePrincipalProfileFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.ResetServicePrincipalProfile") + 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.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.ClientID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.ManagedClustersClient", "ResetServicePrincipalProfile", err.Error()) + } + + req, err := client.ResetServicePrincipalProfilePreparer(ctx, resourceGroupName, resourceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ResetServicePrincipalProfile", nil, "Failure preparing request") + return + } + + result, err = client.ResetServicePrincipalProfileSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "ResetServicePrincipalProfile", result.Response(), "Failure sending request") + return + } + + return +} + +// ResetServicePrincipalProfilePreparer prepares the ResetServicePrincipalProfile request. +func (client ManagedClustersClient) ResetServicePrincipalProfilePreparer(ctx context.Context, resourceGroupName string, resourceName string, parameters ManagedClusterServicePrincipalProfile) (*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 = "2020-04-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.ContainerService/managedClusters/{resourceName}/resetServicePrincipalProfile", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResetServicePrincipalProfileSender sends the ResetServicePrincipalProfile request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) ResetServicePrincipalProfileSender(req *http.Request) (future ManagedClustersResetServicePrincipalProfileFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// ResetServicePrincipalProfileResponder handles the response to the ResetServicePrincipalProfile request. The method always +// closes the http.Response Body. +func (client ManagedClustersClient) ResetServicePrincipalProfileResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// RotateClusterCertificates rotate certificates of a managed cluster. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the managed cluster resource. +func (client ManagedClustersClient) RotateClusterCertificates(ctx context.Context, resourceGroupName string, resourceName string) (result ManagedClustersRotateClusterCertificatesFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.RotateClusterCertificates") + 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.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.ManagedClustersClient", "RotateClusterCertificates", err.Error()) + } + + req, err := client.RotateClusterCertificatesPreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "RotateClusterCertificates", nil, "Failure preparing request") + return + } + + result, err = client.RotateClusterCertificatesSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "RotateClusterCertificates", result.Response(), "Failure sending request") + return + } + + return +} + +// RotateClusterCertificatesPreparer prepares the RotateClusterCertificates request. +func (client ManagedClustersClient) RotateClusterCertificatesPreparer(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 = "2020-04-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.ContainerService/managedClusters/{resourceName}/rotateClusterCertificates", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RotateClusterCertificatesSender sends the RotateClusterCertificates request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) RotateClusterCertificatesSender(req *http.Request) (future ManagedClustersRotateClusterCertificatesFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// RotateClusterCertificatesResponder handles the response to the RotateClusterCertificates request. The method always +// closes the http.Response Body. +func (client ManagedClustersClient) RotateClusterCertificatesResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// UpdateTags updates a managed cluster with the specified tags. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the managed cluster resource. +// parameters - parameters supplied to the Update Managed Cluster Tags operation. +func (client ManagedClustersClient) UpdateTags(ctx context.Context, resourceGroupName string, resourceName string, parameters TagsObject) (result ManagedClustersUpdateTagsFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClustersClient.UpdateTags") + 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.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceName, + Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.ManagedClustersClient", "UpdateTags", err.Error()) + } + + req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, resourceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "UpdateTags", nil, "Failure preparing request") + return + } + + result, err = client.UpdateTagsSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersClient", "UpdateTags", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdateTagsPreparer prepares the UpdateTags request. +func (client ManagedClustersClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, resourceName string, parameters TagsObject) (*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 = "2020-04-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.ContainerService/managedClusters/{resourceName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateTagsSender sends the UpdateTags request. The method will close the +// http.Response Body if it receives an error. +func (client ManagedClustersClient) UpdateTagsSender(req *http.Request) (future ManagedClustersUpdateTagsFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// UpdateTagsResponder handles the response to the UpdateTags request. The method always +// closes the http.Response Body. +func (client ManagedClustersClient) UpdateTagsResponder(resp *http.Response) (result ManagedCluster, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/containerservice/mgmt/2020-04-01/containerservice/models.go b/services/containerservice/mgmt/2020-04-01/containerservice/models.go new file mode 100644 index 000000000000..3d30ed739bd9 --- /dev/null +++ b/services/containerservice/mgmt/2020-04-01/containerservice/models.go @@ -0,0 +1,3669 @@ +package containerservice + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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/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/containerservice/mgmt/2020-04-01/containerservice" + +// AgentPoolMode enumerates the values for agent pool mode. +type AgentPoolMode string + +const ( + // System ... + System AgentPoolMode = "System" + // User ... + User AgentPoolMode = "User" +) + +// PossibleAgentPoolModeValues returns an array of possible values for the AgentPoolMode const type. +func PossibleAgentPoolModeValues() []AgentPoolMode { + return []AgentPoolMode{System, User} +} + +// AgentPoolType enumerates the values for agent pool type. +type AgentPoolType string + +const ( + // AvailabilitySet ... + AvailabilitySet AgentPoolType = "AvailabilitySet" + // VirtualMachineScaleSets ... + VirtualMachineScaleSets AgentPoolType = "VirtualMachineScaleSets" +) + +// PossibleAgentPoolTypeValues returns an array of possible values for the AgentPoolType const type. +func PossibleAgentPoolTypeValues() []AgentPoolType { + return []AgentPoolType{AvailabilitySet, VirtualMachineScaleSets} +} + +// Kind enumerates the values for kind. +type Kind string + +const ( + // KindAADIdentityProvider ... + KindAADIdentityProvider Kind = "AADIdentityProvider" + // KindOpenShiftManagedClusterBaseIdentityProvider ... + KindOpenShiftManagedClusterBaseIdentityProvider Kind = "OpenShiftManagedClusterBaseIdentityProvider" +) + +// PossibleKindValues returns an array of possible values for the Kind const type. +func PossibleKindValues() []Kind { + return []Kind{KindAADIdentityProvider, KindOpenShiftManagedClusterBaseIdentityProvider} +} + +// LoadBalancerSku enumerates the values for load balancer sku. +type LoadBalancerSku string + +const ( + // Basic ... + Basic LoadBalancerSku = "basic" + // Standard ... + Standard LoadBalancerSku = "standard" +) + +// PossibleLoadBalancerSkuValues returns an array of possible values for the LoadBalancerSku const type. +func PossibleLoadBalancerSkuValues() []LoadBalancerSku { + return []LoadBalancerSku{Basic, Standard} +} + +// ManagedClusterSKUName enumerates the values for managed cluster sku name. +type ManagedClusterSKUName string + +const ( + // ManagedClusterSKUNameBasic ... + ManagedClusterSKUNameBasic ManagedClusterSKUName = "Basic" +) + +// PossibleManagedClusterSKUNameValues returns an array of possible values for the ManagedClusterSKUName const type. +func PossibleManagedClusterSKUNameValues() []ManagedClusterSKUName { + return []ManagedClusterSKUName{ManagedClusterSKUNameBasic} +} + +// ManagedClusterSKUTier enumerates the values for managed cluster sku tier. +type ManagedClusterSKUTier string + +const ( + // Free ... + Free ManagedClusterSKUTier = "Free" + // Paid ... + Paid ManagedClusterSKUTier = "Paid" +) + +// PossibleManagedClusterSKUTierValues returns an array of possible values for the ManagedClusterSKUTier const type. +func PossibleManagedClusterSKUTierValues() []ManagedClusterSKUTier { + return []ManagedClusterSKUTier{Free, Paid} +} + +// NetworkMode enumerates the values for network mode. +type NetworkMode string + +const ( + // Bridge ... + Bridge NetworkMode = "bridge" + // Transparent ... + Transparent NetworkMode = "transparent" +) + +// PossibleNetworkModeValues returns an array of possible values for the NetworkMode const type. +func PossibleNetworkModeValues() []NetworkMode { + return []NetworkMode{Bridge, Transparent} +} + +// NetworkPlugin enumerates the values for network plugin. +type NetworkPlugin string + +const ( + // Azure ... + Azure NetworkPlugin = "azure" + // Kubenet ... + Kubenet NetworkPlugin = "kubenet" +) + +// PossibleNetworkPluginValues returns an array of possible values for the NetworkPlugin const type. +func PossibleNetworkPluginValues() []NetworkPlugin { + return []NetworkPlugin{Azure, Kubenet} +} + +// NetworkPolicy enumerates the values for network policy. +type NetworkPolicy string + +const ( + // NetworkPolicyAzure ... + NetworkPolicyAzure NetworkPolicy = "azure" + // NetworkPolicyCalico ... + NetworkPolicyCalico NetworkPolicy = "calico" +) + +// PossibleNetworkPolicyValues returns an array of possible values for the NetworkPolicy const type. +func PossibleNetworkPolicyValues() []NetworkPolicy { + return []NetworkPolicy{NetworkPolicyAzure, NetworkPolicyCalico} +} + +// OpenShiftAgentPoolProfileRole enumerates the values for open shift agent pool profile role. +type OpenShiftAgentPoolProfileRole string + +const ( + // Compute ... + Compute OpenShiftAgentPoolProfileRole = "compute" + // Infra ... + Infra OpenShiftAgentPoolProfileRole = "infra" +) + +// PossibleOpenShiftAgentPoolProfileRoleValues returns an array of possible values for the OpenShiftAgentPoolProfileRole const type. +func PossibleOpenShiftAgentPoolProfileRoleValues() []OpenShiftAgentPoolProfileRole { + return []OpenShiftAgentPoolProfileRole{Compute, Infra} +} + +// OpenShiftContainerServiceVMSize enumerates the values for open shift container service vm size. +type OpenShiftContainerServiceVMSize string + +const ( + // StandardD16sV3 ... + StandardD16sV3 OpenShiftContainerServiceVMSize = "Standard_D16s_v3" + // StandardD2sV3 ... + StandardD2sV3 OpenShiftContainerServiceVMSize = "Standard_D2s_v3" + // StandardD32sV3 ... + StandardD32sV3 OpenShiftContainerServiceVMSize = "Standard_D32s_v3" + // StandardD4sV3 ... + StandardD4sV3 OpenShiftContainerServiceVMSize = "Standard_D4s_v3" + // StandardD64sV3 ... + StandardD64sV3 OpenShiftContainerServiceVMSize = "Standard_D64s_v3" + // StandardD8sV3 ... + StandardD8sV3 OpenShiftContainerServiceVMSize = "Standard_D8s_v3" + // StandardDS12V2 ... + StandardDS12V2 OpenShiftContainerServiceVMSize = "Standard_DS12_v2" + // StandardDS13V2 ... + StandardDS13V2 OpenShiftContainerServiceVMSize = "Standard_DS13_v2" + // StandardDS14V2 ... + StandardDS14V2 OpenShiftContainerServiceVMSize = "Standard_DS14_v2" + // StandardDS15V2 ... + StandardDS15V2 OpenShiftContainerServiceVMSize = "Standard_DS15_v2" + // StandardDS4V2 ... + StandardDS4V2 OpenShiftContainerServiceVMSize = "Standard_DS4_v2" + // StandardDS5V2 ... + StandardDS5V2 OpenShiftContainerServiceVMSize = "Standard_DS5_v2" + // StandardE16sV3 ... + StandardE16sV3 OpenShiftContainerServiceVMSize = "Standard_E16s_v3" + // StandardE20sV3 ... + StandardE20sV3 OpenShiftContainerServiceVMSize = "Standard_E20s_v3" + // StandardE32sV3 ... + StandardE32sV3 OpenShiftContainerServiceVMSize = "Standard_E32s_v3" + // StandardE4sV3 ... + StandardE4sV3 OpenShiftContainerServiceVMSize = "Standard_E4s_v3" + // StandardE64sV3 ... + StandardE64sV3 OpenShiftContainerServiceVMSize = "Standard_E64s_v3" + // StandardE8sV3 ... + StandardE8sV3 OpenShiftContainerServiceVMSize = "Standard_E8s_v3" + // StandardF16s ... + StandardF16s OpenShiftContainerServiceVMSize = "Standard_F16s" + // StandardF16sV2 ... + StandardF16sV2 OpenShiftContainerServiceVMSize = "Standard_F16s_v2" + // StandardF32sV2 ... + StandardF32sV2 OpenShiftContainerServiceVMSize = "Standard_F32s_v2" + // StandardF64sV2 ... + StandardF64sV2 OpenShiftContainerServiceVMSize = "Standard_F64s_v2" + // StandardF72sV2 ... + StandardF72sV2 OpenShiftContainerServiceVMSize = "Standard_F72s_v2" + // StandardF8s ... + StandardF8s OpenShiftContainerServiceVMSize = "Standard_F8s" + // StandardF8sV2 ... + StandardF8sV2 OpenShiftContainerServiceVMSize = "Standard_F8s_v2" + // StandardGS2 ... + StandardGS2 OpenShiftContainerServiceVMSize = "Standard_GS2" + // StandardGS3 ... + StandardGS3 OpenShiftContainerServiceVMSize = "Standard_GS3" + // StandardGS4 ... + StandardGS4 OpenShiftContainerServiceVMSize = "Standard_GS4" + // StandardGS5 ... + StandardGS5 OpenShiftContainerServiceVMSize = "Standard_GS5" + // StandardL16s ... + StandardL16s OpenShiftContainerServiceVMSize = "Standard_L16s" + // StandardL32s ... + StandardL32s OpenShiftContainerServiceVMSize = "Standard_L32s" + // StandardL4s ... + StandardL4s OpenShiftContainerServiceVMSize = "Standard_L4s" + // StandardL8s ... + StandardL8s OpenShiftContainerServiceVMSize = "Standard_L8s" +) + +// PossibleOpenShiftContainerServiceVMSizeValues returns an array of possible values for the OpenShiftContainerServiceVMSize const type. +func PossibleOpenShiftContainerServiceVMSizeValues() []OpenShiftContainerServiceVMSize { + return []OpenShiftContainerServiceVMSize{StandardD16sV3, StandardD2sV3, StandardD32sV3, StandardD4sV3, StandardD64sV3, StandardD8sV3, StandardDS12V2, StandardDS13V2, StandardDS14V2, StandardDS15V2, StandardDS4V2, StandardDS5V2, StandardE16sV3, StandardE20sV3, StandardE32sV3, StandardE4sV3, StandardE64sV3, StandardE8sV3, StandardF16s, StandardF16sV2, StandardF32sV2, StandardF64sV2, StandardF72sV2, StandardF8s, StandardF8sV2, StandardGS2, StandardGS3, StandardGS4, StandardGS5, StandardL16s, StandardL32s, StandardL4s, StandardL8s} +} + +// OrchestratorTypes enumerates the values for orchestrator types. +type OrchestratorTypes string + +const ( + // Custom ... + Custom OrchestratorTypes = "Custom" + // DCOS ... + DCOS OrchestratorTypes = "DCOS" + // DockerCE ... + DockerCE OrchestratorTypes = "DockerCE" + // Kubernetes ... + Kubernetes OrchestratorTypes = "Kubernetes" + // Swarm ... + Swarm OrchestratorTypes = "Swarm" +) + +// PossibleOrchestratorTypesValues returns an array of possible values for the OrchestratorTypes const type. +func PossibleOrchestratorTypesValues() []OrchestratorTypes { + return []OrchestratorTypes{Custom, DCOS, DockerCE, Kubernetes, Swarm} +} + +// OSType enumerates the values for os type. +type OSType string + +const ( + // Linux ... + Linux OSType = "Linux" + // Windows ... + Windows OSType = "Windows" +) + +// PossibleOSTypeValues returns an array of possible values for the OSType const type. +func PossibleOSTypeValues() []OSType { + return []OSType{Linux, Windows} +} + +// OutboundType enumerates the values for outbound type. +type OutboundType string + +const ( + // LoadBalancer ... + LoadBalancer OutboundType = "loadBalancer" + // UserDefinedRouting ... + UserDefinedRouting OutboundType = "userDefinedRouting" +) + +// PossibleOutboundTypeValues returns an array of possible values for the OutboundType const type. +func PossibleOutboundTypeValues() []OutboundType { + return []OutboundType{LoadBalancer, UserDefinedRouting} +} + +// ResourceIdentityType enumerates the values for resource identity type. +type ResourceIdentityType string + +const ( + // None ... + None ResourceIdentityType = "None" + // SystemAssigned ... + SystemAssigned ResourceIdentityType = "SystemAssigned" +) + +// PossibleResourceIdentityTypeValues returns an array of possible values for the ResourceIdentityType const type. +func PossibleResourceIdentityTypeValues() []ResourceIdentityType { + return []ResourceIdentityType{None, SystemAssigned} +} + +// ScaleSetEvictionPolicy enumerates the values for scale set eviction policy. +type ScaleSetEvictionPolicy string + +const ( + // Deallocate ... + Deallocate ScaleSetEvictionPolicy = "Deallocate" + // Delete ... + Delete ScaleSetEvictionPolicy = "Delete" +) + +// PossibleScaleSetEvictionPolicyValues returns an array of possible values for the ScaleSetEvictionPolicy const type. +func PossibleScaleSetEvictionPolicyValues() []ScaleSetEvictionPolicy { + return []ScaleSetEvictionPolicy{Deallocate, Delete} +} + +// ScaleSetPriority enumerates the values for scale set priority. +type ScaleSetPriority string + +const ( + // Regular ... + Regular ScaleSetPriority = "Regular" + // Spot ... + Spot ScaleSetPriority = "Spot" +) + +// PossibleScaleSetPriorityValues returns an array of possible values for the ScaleSetPriority const type. +func PossibleScaleSetPriorityValues() []ScaleSetPriority { + return []ScaleSetPriority{Regular, Spot} +} + +// StorageProfileTypes enumerates the values for storage profile types. +type StorageProfileTypes string + +const ( + // ManagedDisks ... + ManagedDisks StorageProfileTypes = "ManagedDisks" + // StorageAccount ... + StorageAccount StorageProfileTypes = "StorageAccount" +) + +// PossibleStorageProfileTypesValues returns an array of possible values for the StorageProfileTypes const type. +func PossibleStorageProfileTypesValues() []StorageProfileTypes { + return []StorageProfileTypes{ManagedDisks, StorageAccount} +} + +// VMSizeTypes enumerates the values for vm size types. +type VMSizeTypes string + +const ( + // VMSizeTypesStandardA1 ... + VMSizeTypesStandardA1 VMSizeTypes = "Standard_A1" + // VMSizeTypesStandardA10 ... + VMSizeTypesStandardA10 VMSizeTypes = "Standard_A10" + // VMSizeTypesStandardA11 ... + VMSizeTypesStandardA11 VMSizeTypes = "Standard_A11" + // VMSizeTypesStandardA1V2 ... + VMSizeTypesStandardA1V2 VMSizeTypes = "Standard_A1_v2" + // VMSizeTypesStandardA2 ... + VMSizeTypesStandardA2 VMSizeTypes = "Standard_A2" + // VMSizeTypesStandardA2mV2 ... + VMSizeTypesStandardA2mV2 VMSizeTypes = "Standard_A2m_v2" + // VMSizeTypesStandardA2V2 ... + VMSizeTypesStandardA2V2 VMSizeTypes = "Standard_A2_v2" + // VMSizeTypesStandardA3 ... + VMSizeTypesStandardA3 VMSizeTypes = "Standard_A3" + // VMSizeTypesStandardA4 ... + VMSizeTypesStandardA4 VMSizeTypes = "Standard_A4" + // VMSizeTypesStandardA4mV2 ... + VMSizeTypesStandardA4mV2 VMSizeTypes = "Standard_A4m_v2" + // VMSizeTypesStandardA4V2 ... + VMSizeTypesStandardA4V2 VMSizeTypes = "Standard_A4_v2" + // VMSizeTypesStandardA5 ... + VMSizeTypesStandardA5 VMSizeTypes = "Standard_A5" + // VMSizeTypesStandardA6 ... + VMSizeTypesStandardA6 VMSizeTypes = "Standard_A6" + // VMSizeTypesStandardA7 ... + VMSizeTypesStandardA7 VMSizeTypes = "Standard_A7" + // VMSizeTypesStandardA8 ... + VMSizeTypesStandardA8 VMSizeTypes = "Standard_A8" + // VMSizeTypesStandardA8mV2 ... + VMSizeTypesStandardA8mV2 VMSizeTypes = "Standard_A8m_v2" + // VMSizeTypesStandardA8V2 ... + VMSizeTypesStandardA8V2 VMSizeTypes = "Standard_A8_v2" + // VMSizeTypesStandardA9 ... + VMSizeTypesStandardA9 VMSizeTypes = "Standard_A9" + // VMSizeTypesStandardB2ms ... + VMSizeTypesStandardB2ms VMSizeTypes = "Standard_B2ms" + // VMSizeTypesStandardB2s ... + VMSizeTypesStandardB2s VMSizeTypes = "Standard_B2s" + // VMSizeTypesStandardB4ms ... + VMSizeTypesStandardB4ms VMSizeTypes = "Standard_B4ms" + // VMSizeTypesStandardB8ms ... + VMSizeTypesStandardB8ms VMSizeTypes = "Standard_B8ms" + // VMSizeTypesStandardD1 ... + VMSizeTypesStandardD1 VMSizeTypes = "Standard_D1" + // VMSizeTypesStandardD11 ... + VMSizeTypesStandardD11 VMSizeTypes = "Standard_D11" + // VMSizeTypesStandardD11V2 ... + VMSizeTypesStandardD11V2 VMSizeTypes = "Standard_D11_v2" + // VMSizeTypesStandardD11V2Promo ... + VMSizeTypesStandardD11V2Promo VMSizeTypes = "Standard_D11_v2_Promo" + // VMSizeTypesStandardD12 ... + VMSizeTypesStandardD12 VMSizeTypes = "Standard_D12" + // VMSizeTypesStandardD12V2 ... + VMSizeTypesStandardD12V2 VMSizeTypes = "Standard_D12_v2" + // VMSizeTypesStandardD12V2Promo ... + VMSizeTypesStandardD12V2Promo VMSizeTypes = "Standard_D12_v2_Promo" + // VMSizeTypesStandardD13 ... + VMSizeTypesStandardD13 VMSizeTypes = "Standard_D13" + // VMSizeTypesStandardD13V2 ... + VMSizeTypesStandardD13V2 VMSizeTypes = "Standard_D13_v2" + // VMSizeTypesStandardD13V2Promo ... + VMSizeTypesStandardD13V2Promo VMSizeTypes = "Standard_D13_v2_Promo" + // VMSizeTypesStandardD14 ... + VMSizeTypesStandardD14 VMSizeTypes = "Standard_D14" + // VMSizeTypesStandardD14V2 ... + VMSizeTypesStandardD14V2 VMSizeTypes = "Standard_D14_v2" + // VMSizeTypesStandardD14V2Promo ... + VMSizeTypesStandardD14V2Promo VMSizeTypes = "Standard_D14_v2_Promo" + // VMSizeTypesStandardD15V2 ... + VMSizeTypesStandardD15V2 VMSizeTypes = "Standard_D15_v2" + // VMSizeTypesStandardD16sV3 ... + VMSizeTypesStandardD16sV3 VMSizeTypes = "Standard_D16s_v3" + // VMSizeTypesStandardD16V3 ... + VMSizeTypesStandardD16V3 VMSizeTypes = "Standard_D16_v3" + // VMSizeTypesStandardD1V2 ... + VMSizeTypesStandardD1V2 VMSizeTypes = "Standard_D1_v2" + // VMSizeTypesStandardD2 ... + VMSizeTypesStandardD2 VMSizeTypes = "Standard_D2" + // VMSizeTypesStandardD2sV3 ... + VMSizeTypesStandardD2sV3 VMSizeTypes = "Standard_D2s_v3" + // VMSizeTypesStandardD2V2 ... + VMSizeTypesStandardD2V2 VMSizeTypes = "Standard_D2_v2" + // VMSizeTypesStandardD2V2Promo ... + VMSizeTypesStandardD2V2Promo VMSizeTypes = "Standard_D2_v2_Promo" + // VMSizeTypesStandardD2V3 ... + VMSizeTypesStandardD2V3 VMSizeTypes = "Standard_D2_v3" + // VMSizeTypesStandardD3 ... + VMSizeTypesStandardD3 VMSizeTypes = "Standard_D3" + // VMSizeTypesStandardD32sV3 ... + VMSizeTypesStandardD32sV3 VMSizeTypes = "Standard_D32s_v3" + // VMSizeTypesStandardD32V3 ... + VMSizeTypesStandardD32V3 VMSizeTypes = "Standard_D32_v3" + // VMSizeTypesStandardD3V2 ... + VMSizeTypesStandardD3V2 VMSizeTypes = "Standard_D3_v2" + // VMSizeTypesStandardD3V2Promo ... + VMSizeTypesStandardD3V2Promo VMSizeTypes = "Standard_D3_v2_Promo" + // VMSizeTypesStandardD4 ... + VMSizeTypesStandardD4 VMSizeTypes = "Standard_D4" + // VMSizeTypesStandardD4sV3 ... + VMSizeTypesStandardD4sV3 VMSizeTypes = "Standard_D4s_v3" + // VMSizeTypesStandardD4V2 ... + VMSizeTypesStandardD4V2 VMSizeTypes = "Standard_D4_v2" + // VMSizeTypesStandardD4V2Promo ... + VMSizeTypesStandardD4V2Promo VMSizeTypes = "Standard_D4_v2_Promo" + // VMSizeTypesStandardD4V3 ... + VMSizeTypesStandardD4V3 VMSizeTypes = "Standard_D4_v3" + // VMSizeTypesStandardD5V2 ... + VMSizeTypesStandardD5V2 VMSizeTypes = "Standard_D5_v2" + // VMSizeTypesStandardD5V2Promo ... + VMSizeTypesStandardD5V2Promo VMSizeTypes = "Standard_D5_v2_Promo" + // VMSizeTypesStandardD64sV3 ... + VMSizeTypesStandardD64sV3 VMSizeTypes = "Standard_D64s_v3" + // VMSizeTypesStandardD64V3 ... + VMSizeTypesStandardD64V3 VMSizeTypes = "Standard_D64_v3" + // VMSizeTypesStandardD8sV3 ... + VMSizeTypesStandardD8sV3 VMSizeTypes = "Standard_D8s_v3" + // VMSizeTypesStandardD8V3 ... + VMSizeTypesStandardD8V3 VMSizeTypes = "Standard_D8_v3" + // VMSizeTypesStandardDS1 ... + VMSizeTypesStandardDS1 VMSizeTypes = "Standard_DS1" + // VMSizeTypesStandardDS11 ... + VMSizeTypesStandardDS11 VMSizeTypes = "Standard_DS11" + // VMSizeTypesStandardDS11V2 ... + VMSizeTypesStandardDS11V2 VMSizeTypes = "Standard_DS11_v2" + // VMSizeTypesStandardDS11V2Promo ... + VMSizeTypesStandardDS11V2Promo VMSizeTypes = "Standard_DS11_v2_Promo" + // VMSizeTypesStandardDS12 ... + VMSizeTypesStandardDS12 VMSizeTypes = "Standard_DS12" + // VMSizeTypesStandardDS12V2 ... + VMSizeTypesStandardDS12V2 VMSizeTypes = "Standard_DS12_v2" + // VMSizeTypesStandardDS12V2Promo ... + VMSizeTypesStandardDS12V2Promo VMSizeTypes = "Standard_DS12_v2_Promo" + // VMSizeTypesStandardDS13 ... + VMSizeTypesStandardDS13 VMSizeTypes = "Standard_DS13" + // VMSizeTypesStandardDS132V2 ... + VMSizeTypesStandardDS132V2 VMSizeTypes = "Standard_DS13-2_v2" + // VMSizeTypesStandardDS134V2 ... + VMSizeTypesStandardDS134V2 VMSizeTypes = "Standard_DS13-4_v2" + // VMSizeTypesStandardDS13V2 ... + VMSizeTypesStandardDS13V2 VMSizeTypes = "Standard_DS13_v2" + // VMSizeTypesStandardDS13V2Promo ... + VMSizeTypesStandardDS13V2Promo VMSizeTypes = "Standard_DS13_v2_Promo" + // VMSizeTypesStandardDS14 ... + VMSizeTypesStandardDS14 VMSizeTypes = "Standard_DS14" + // VMSizeTypesStandardDS144V2 ... + VMSizeTypesStandardDS144V2 VMSizeTypes = "Standard_DS14-4_v2" + // VMSizeTypesStandardDS148V2 ... + VMSizeTypesStandardDS148V2 VMSizeTypes = "Standard_DS14-8_v2" + // VMSizeTypesStandardDS14V2 ... + VMSizeTypesStandardDS14V2 VMSizeTypes = "Standard_DS14_v2" + // VMSizeTypesStandardDS14V2Promo ... + VMSizeTypesStandardDS14V2Promo VMSizeTypes = "Standard_DS14_v2_Promo" + // VMSizeTypesStandardDS15V2 ... + VMSizeTypesStandardDS15V2 VMSizeTypes = "Standard_DS15_v2" + // VMSizeTypesStandardDS1V2 ... + VMSizeTypesStandardDS1V2 VMSizeTypes = "Standard_DS1_v2" + // VMSizeTypesStandardDS2 ... + VMSizeTypesStandardDS2 VMSizeTypes = "Standard_DS2" + // VMSizeTypesStandardDS2V2 ... + VMSizeTypesStandardDS2V2 VMSizeTypes = "Standard_DS2_v2" + // VMSizeTypesStandardDS2V2Promo ... + VMSizeTypesStandardDS2V2Promo VMSizeTypes = "Standard_DS2_v2_Promo" + // VMSizeTypesStandardDS3 ... + VMSizeTypesStandardDS3 VMSizeTypes = "Standard_DS3" + // VMSizeTypesStandardDS3V2 ... + VMSizeTypesStandardDS3V2 VMSizeTypes = "Standard_DS3_v2" + // VMSizeTypesStandardDS3V2Promo ... + VMSizeTypesStandardDS3V2Promo VMSizeTypes = "Standard_DS3_v2_Promo" + // VMSizeTypesStandardDS4 ... + VMSizeTypesStandardDS4 VMSizeTypes = "Standard_DS4" + // VMSizeTypesStandardDS4V2 ... + VMSizeTypesStandardDS4V2 VMSizeTypes = "Standard_DS4_v2" + // VMSizeTypesStandardDS4V2Promo ... + VMSizeTypesStandardDS4V2Promo VMSizeTypes = "Standard_DS4_v2_Promo" + // VMSizeTypesStandardDS5V2 ... + VMSizeTypesStandardDS5V2 VMSizeTypes = "Standard_DS5_v2" + // VMSizeTypesStandardDS5V2Promo ... + VMSizeTypesStandardDS5V2Promo VMSizeTypes = "Standard_DS5_v2_Promo" + // VMSizeTypesStandardE16sV3 ... + VMSizeTypesStandardE16sV3 VMSizeTypes = "Standard_E16s_v3" + // VMSizeTypesStandardE16V3 ... + VMSizeTypesStandardE16V3 VMSizeTypes = "Standard_E16_v3" + // VMSizeTypesStandardE2sV3 ... + VMSizeTypesStandardE2sV3 VMSizeTypes = "Standard_E2s_v3" + // VMSizeTypesStandardE2V3 ... + VMSizeTypesStandardE2V3 VMSizeTypes = "Standard_E2_v3" + // VMSizeTypesStandardE3216sV3 ... + VMSizeTypesStandardE3216sV3 VMSizeTypes = "Standard_E32-16s_v3" + // VMSizeTypesStandardE328sV3 ... + VMSizeTypesStandardE328sV3 VMSizeTypes = "Standard_E32-8s_v3" + // VMSizeTypesStandardE32sV3 ... + VMSizeTypesStandardE32sV3 VMSizeTypes = "Standard_E32s_v3" + // VMSizeTypesStandardE32V3 ... + VMSizeTypesStandardE32V3 VMSizeTypes = "Standard_E32_v3" + // VMSizeTypesStandardE4sV3 ... + VMSizeTypesStandardE4sV3 VMSizeTypes = "Standard_E4s_v3" + // VMSizeTypesStandardE4V3 ... + VMSizeTypesStandardE4V3 VMSizeTypes = "Standard_E4_v3" + // VMSizeTypesStandardE6416sV3 ... + VMSizeTypesStandardE6416sV3 VMSizeTypes = "Standard_E64-16s_v3" + // VMSizeTypesStandardE6432sV3 ... + VMSizeTypesStandardE6432sV3 VMSizeTypes = "Standard_E64-32s_v3" + // VMSizeTypesStandardE64sV3 ... + VMSizeTypesStandardE64sV3 VMSizeTypes = "Standard_E64s_v3" + // VMSizeTypesStandardE64V3 ... + VMSizeTypesStandardE64V3 VMSizeTypes = "Standard_E64_v3" + // VMSizeTypesStandardE8sV3 ... + VMSizeTypesStandardE8sV3 VMSizeTypes = "Standard_E8s_v3" + // VMSizeTypesStandardE8V3 ... + VMSizeTypesStandardE8V3 VMSizeTypes = "Standard_E8_v3" + // VMSizeTypesStandardF1 ... + VMSizeTypesStandardF1 VMSizeTypes = "Standard_F1" + // VMSizeTypesStandardF16 ... + VMSizeTypesStandardF16 VMSizeTypes = "Standard_F16" + // VMSizeTypesStandardF16s ... + VMSizeTypesStandardF16s VMSizeTypes = "Standard_F16s" + // VMSizeTypesStandardF16sV2 ... + VMSizeTypesStandardF16sV2 VMSizeTypes = "Standard_F16s_v2" + // VMSizeTypesStandardF1s ... + VMSizeTypesStandardF1s VMSizeTypes = "Standard_F1s" + // VMSizeTypesStandardF2 ... + VMSizeTypesStandardF2 VMSizeTypes = "Standard_F2" + // VMSizeTypesStandardF2s ... + VMSizeTypesStandardF2s VMSizeTypes = "Standard_F2s" + // VMSizeTypesStandardF2sV2 ... + VMSizeTypesStandardF2sV2 VMSizeTypes = "Standard_F2s_v2" + // VMSizeTypesStandardF32sV2 ... + VMSizeTypesStandardF32sV2 VMSizeTypes = "Standard_F32s_v2" + // VMSizeTypesStandardF4 ... + VMSizeTypesStandardF4 VMSizeTypes = "Standard_F4" + // VMSizeTypesStandardF4s ... + VMSizeTypesStandardF4s VMSizeTypes = "Standard_F4s" + // VMSizeTypesStandardF4sV2 ... + VMSizeTypesStandardF4sV2 VMSizeTypes = "Standard_F4s_v2" + // VMSizeTypesStandardF64sV2 ... + VMSizeTypesStandardF64sV2 VMSizeTypes = "Standard_F64s_v2" + // VMSizeTypesStandardF72sV2 ... + VMSizeTypesStandardF72sV2 VMSizeTypes = "Standard_F72s_v2" + // VMSizeTypesStandardF8 ... + VMSizeTypesStandardF8 VMSizeTypes = "Standard_F8" + // VMSizeTypesStandardF8s ... + VMSizeTypesStandardF8s VMSizeTypes = "Standard_F8s" + // VMSizeTypesStandardF8sV2 ... + VMSizeTypesStandardF8sV2 VMSizeTypes = "Standard_F8s_v2" + // VMSizeTypesStandardG1 ... + VMSizeTypesStandardG1 VMSizeTypes = "Standard_G1" + // VMSizeTypesStandardG2 ... + VMSizeTypesStandardG2 VMSizeTypes = "Standard_G2" + // VMSizeTypesStandardG3 ... + VMSizeTypesStandardG3 VMSizeTypes = "Standard_G3" + // VMSizeTypesStandardG4 ... + VMSizeTypesStandardG4 VMSizeTypes = "Standard_G4" + // VMSizeTypesStandardG5 ... + VMSizeTypesStandardG5 VMSizeTypes = "Standard_G5" + // VMSizeTypesStandardGS1 ... + VMSizeTypesStandardGS1 VMSizeTypes = "Standard_GS1" + // VMSizeTypesStandardGS2 ... + VMSizeTypesStandardGS2 VMSizeTypes = "Standard_GS2" + // VMSizeTypesStandardGS3 ... + VMSizeTypesStandardGS3 VMSizeTypes = "Standard_GS3" + // VMSizeTypesStandardGS4 ... + VMSizeTypesStandardGS4 VMSizeTypes = "Standard_GS4" + // VMSizeTypesStandardGS44 ... + VMSizeTypesStandardGS44 VMSizeTypes = "Standard_GS4-4" + // VMSizeTypesStandardGS48 ... + VMSizeTypesStandardGS48 VMSizeTypes = "Standard_GS4-8" + // VMSizeTypesStandardGS5 ... + VMSizeTypesStandardGS5 VMSizeTypes = "Standard_GS5" + // VMSizeTypesStandardGS516 ... + VMSizeTypesStandardGS516 VMSizeTypes = "Standard_GS5-16" + // VMSizeTypesStandardGS58 ... + VMSizeTypesStandardGS58 VMSizeTypes = "Standard_GS5-8" + // VMSizeTypesStandardH16 ... + VMSizeTypesStandardH16 VMSizeTypes = "Standard_H16" + // VMSizeTypesStandardH16m ... + VMSizeTypesStandardH16m VMSizeTypes = "Standard_H16m" + // VMSizeTypesStandardH16mr ... + VMSizeTypesStandardH16mr VMSizeTypes = "Standard_H16mr" + // VMSizeTypesStandardH16r ... + VMSizeTypesStandardH16r VMSizeTypes = "Standard_H16r" + // VMSizeTypesStandardH8 ... + VMSizeTypesStandardH8 VMSizeTypes = "Standard_H8" + // VMSizeTypesStandardH8m ... + VMSizeTypesStandardH8m VMSizeTypes = "Standard_H8m" + // VMSizeTypesStandardL16s ... + VMSizeTypesStandardL16s VMSizeTypes = "Standard_L16s" + // VMSizeTypesStandardL32s ... + VMSizeTypesStandardL32s VMSizeTypes = "Standard_L32s" + // VMSizeTypesStandardL4s ... + VMSizeTypesStandardL4s VMSizeTypes = "Standard_L4s" + // VMSizeTypesStandardL8s ... + VMSizeTypesStandardL8s VMSizeTypes = "Standard_L8s" + // VMSizeTypesStandardM12832ms ... + VMSizeTypesStandardM12832ms VMSizeTypes = "Standard_M128-32ms" + // VMSizeTypesStandardM12864ms ... + VMSizeTypesStandardM12864ms VMSizeTypes = "Standard_M128-64ms" + // VMSizeTypesStandardM128ms ... + VMSizeTypesStandardM128ms VMSizeTypes = "Standard_M128ms" + // VMSizeTypesStandardM128s ... + VMSizeTypesStandardM128s VMSizeTypes = "Standard_M128s" + // VMSizeTypesStandardM6416ms ... + VMSizeTypesStandardM6416ms VMSizeTypes = "Standard_M64-16ms" + // VMSizeTypesStandardM6432ms ... + VMSizeTypesStandardM6432ms VMSizeTypes = "Standard_M64-32ms" + // VMSizeTypesStandardM64ms ... + VMSizeTypesStandardM64ms VMSizeTypes = "Standard_M64ms" + // VMSizeTypesStandardM64s ... + VMSizeTypesStandardM64s VMSizeTypes = "Standard_M64s" + // VMSizeTypesStandardNC12 ... + VMSizeTypesStandardNC12 VMSizeTypes = "Standard_NC12" + // VMSizeTypesStandardNC12sV2 ... + VMSizeTypesStandardNC12sV2 VMSizeTypes = "Standard_NC12s_v2" + // VMSizeTypesStandardNC12sV3 ... + VMSizeTypesStandardNC12sV3 VMSizeTypes = "Standard_NC12s_v3" + // VMSizeTypesStandardNC24 ... + VMSizeTypesStandardNC24 VMSizeTypes = "Standard_NC24" + // VMSizeTypesStandardNC24r ... + VMSizeTypesStandardNC24r VMSizeTypes = "Standard_NC24r" + // VMSizeTypesStandardNC24rsV2 ... + VMSizeTypesStandardNC24rsV2 VMSizeTypes = "Standard_NC24rs_v2" + // VMSizeTypesStandardNC24rsV3 ... + VMSizeTypesStandardNC24rsV3 VMSizeTypes = "Standard_NC24rs_v3" + // VMSizeTypesStandardNC24sV2 ... + VMSizeTypesStandardNC24sV2 VMSizeTypes = "Standard_NC24s_v2" + // VMSizeTypesStandardNC24sV3 ... + VMSizeTypesStandardNC24sV3 VMSizeTypes = "Standard_NC24s_v3" + // VMSizeTypesStandardNC6 ... + VMSizeTypesStandardNC6 VMSizeTypes = "Standard_NC6" + // VMSizeTypesStandardNC6sV2 ... + VMSizeTypesStandardNC6sV2 VMSizeTypes = "Standard_NC6s_v2" + // VMSizeTypesStandardNC6sV3 ... + VMSizeTypesStandardNC6sV3 VMSizeTypes = "Standard_NC6s_v3" + // VMSizeTypesStandardND12s ... + VMSizeTypesStandardND12s VMSizeTypes = "Standard_ND12s" + // VMSizeTypesStandardND24rs ... + VMSizeTypesStandardND24rs VMSizeTypes = "Standard_ND24rs" + // VMSizeTypesStandardND24s ... + VMSizeTypesStandardND24s VMSizeTypes = "Standard_ND24s" + // VMSizeTypesStandardND6s ... + VMSizeTypesStandardND6s VMSizeTypes = "Standard_ND6s" + // VMSizeTypesStandardNV12 ... + VMSizeTypesStandardNV12 VMSizeTypes = "Standard_NV12" + // VMSizeTypesStandardNV24 ... + VMSizeTypesStandardNV24 VMSizeTypes = "Standard_NV24" + // VMSizeTypesStandardNV6 ... + VMSizeTypesStandardNV6 VMSizeTypes = "Standard_NV6" +) + +// PossibleVMSizeTypesValues returns an array of possible values for the VMSizeTypes const type. +func PossibleVMSizeTypesValues() []VMSizeTypes { + return []VMSizeTypes{VMSizeTypesStandardA1, VMSizeTypesStandardA10, VMSizeTypesStandardA11, VMSizeTypesStandardA1V2, VMSizeTypesStandardA2, VMSizeTypesStandardA2mV2, VMSizeTypesStandardA2V2, VMSizeTypesStandardA3, VMSizeTypesStandardA4, VMSizeTypesStandardA4mV2, VMSizeTypesStandardA4V2, VMSizeTypesStandardA5, VMSizeTypesStandardA6, VMSizeTypesStandardA7, VMSizeTypesStandardA8, VMSizeTypesStandardA8mV2, VMSizeTypesStandardA8V2, VMSizeTypesStandardA9, VMSizeTypesStandardB2ms, VMSizeTypesStandardB2s, VMSizeTypesStandardB4ms, VMSizeTypesStandardB8ms, VMSizeTypesStandardD1, VMSizeTypesStandardD11, VMSizeTypesStandardD11V2, VMSizeTypesStandardD11V2Promo, VMSizeTypesStandardD12, VMSizeTypesStandardD12V2, VMSizeTypesStandardD12V2Promo, VMSizeTypesStandardD13, VMSizeTypesStandardD13V2, VMSizeTypesStandardD13V2Promo, VMSizeTypesStandardD14, VMSizeTypesStandardD14V2, VMSizeTypesStandardD14V2Promo, VMSizeTypesStandardD15V2, VMSizeTypesStandardD16sV3, VMSizeTypesStandardD16V3, VMSizeTypesStandardD1V2, VMSizeTypesStandardD2, VMSizeTypesStandardD2sV3, VMSizeTypesStandardD2V2, VMSizeTypesStandardD2V2Promo, VMSizeTypesStandardD2V3, VMSizeTypesStandardD3, VMSizeTypesStandardD32sV3, VMSizeTypesStandardD32V3, VMSizeTypesStandardD3V2, VMSizeTypesStandardD3V2Promo, VMSizeTypesStandardD4, VMSizeTypesStandardD4sV3, VMSizeTypesStandardD4V2, VMSizeTypesStandardD4V2Promo, VMSizeTypesStandardD4V3, VMSizeTypesStandardD5V2, VMSizeTypesStandardD5V2Promo, VMSizeTypesStandardD64sV3, VMSizeTypesStandardD64V3, VMSizeTypesStandardD8sV3, VMSizeTypesStandardD8V3, VMSizeTypesStandardDS1, VMSizeTypesStandardDS11, VMSizeTypesStandardDS11V2, VMSizeTypesStandardDS11V2Promo, VMSizeTypesStandardDS12, VMSizeTypesStandardDS12V2, VMSizeTypesStandardDS12V2Promo, VMSizeTypesStandardDS13, VMSizeTypesStandardDS132V2, VMSizeTypesStandardDS134V2, VMSizeTypesStandardDS13V2, VMSizeTypesStandardDS13V2Promo, VMSizeTypesStandardDS14, VMSizeTypesStandardDS144V2, VMSizeTypesStandardDS148V2, VMSizeTypesStandardDS14V2, VMSizeTypesStandardDS14V2Promo, VMSizeTypesStandardDS15V2, VMSizeTypesStandardDS1V2, VMSizeTypesStandardDS2, VMSizeTypesStandardDS2V2, VMSizeTypesStandardDS2V2Promo, VMSizeTypesStandardDS3, VMSizeTypesStandardDS3V2, VMSizeTypesStandardDS3V2Promo, VMSizeTypesStandardDS4, VMSizeTypesStandardDS4V2, VMSizeTypesStandardDS4V2Promo, VMSizeTypesStandardDS5V2, VMSizeTypesStandardDS5V2Promo, VMSizeTypesStandardE16sV3, VMSizeTypesStandardE16V3, VMSizeTypesStandardE2sV3, VMSizeTypesStandardE2V3, VMSizeTypesStandardE3216sV3, VMSizeTypesStandardE328sV3, VMSizeTypesStandardE32sV3, VMSizeTypesStandardE32V3, VMSizeTypesStandardE4sV3, VMSizeTypesStandardE4V3, VMSizeTypesStandardE6416sV3, VMSizeTypesStandardE6432sV3, VMSizeTypesStandardE64sV3, VMSizeTypesStandardE64V3, VMSizeTypesStandardE8sV3, VMSizeTypesStandardE8V3, VMSizeTypesStandardF1, VMSizeTypesStandardF16, VMSizeTypesStandardF16s, VMSizeTypesStandardF16sV2, VMSizeTypesStandardF1s, VMSizeTypesStandardF2, VMSizeTypesStandardF2s, VMSizeTypesStandardF2sV2, VMSizeTypesStandardF32sV2, VMSizeTypesStandardF4, VMSizeTypesStandardF4s, VMSizeTypesStandardF4sV2, VMSizeTypesStandardF64sV2, VMSizeTypesStandardF72sV2, VMSizeTypesStandardF8, VMSizeTypesStandardF8s, VMSizeTypesStandardF8sV2, VMSizeTypesStandardG1, VMSizeTypesStandardG2, VMSizeTypesStandardG3, VMSizeTypesStandardG4, VMSizeTypesStandardG5, VMSizeTypesStandardGS1, VMSizeTypesStandardGS2, VMSizeTypesStandardGS3, VMSizeTypesStandardGS4, VMSizeTypesStandardGS44, VMSizeTypesStandardGS48, VMSizeTypesStandardGS5, VMSizeTypesStandardGS516, VMSizeTypesStandardGS58, VMSizeTypesStandardH16, VMSizeTypesStandardH16m, VMSizeTypesStandardH16mr, VMSizeTypesStandardH16r, VMSizeTypesStandardH8, VMSizeTypesStandardH8m, VMSizeTypesStandardL16s, VMSizeTypesStandardL32s, VMSizeTypesStandardL4s, VMSizeTypesStandardL8s, VMSizeTypesStandardM12832ms, VMSizeTypesStandardM12864ms, VMSizeTypesStandardM128ms, VMSizeTypesStandardM128s, VMSizeTypesStandardM6416ms, VMSizeTypesStandardM6432ms, VMSizeTypesStandardM64ms, VMSizeTypesStandardM64s, VMSizeTypesStandardNC12, VMSizeTypesStandardNC12sV2, VMSizeTypesStandardNC12sV3, VMSizeTypesStandardNC24, VMSizeTypesStandardNC24r, VMSizeTypesStandardNC24rsV2, VMSizeTypesStandardNC24rsV3, VMSizeTypesStandardNC24sV2, VMSizeTypesStandardNC24sV3, VMSizeTypesStandardNC6, VMSizeTypesStandardNC6sV2, VMSizeTypesStandardNC6sV3, VMSizeTypesStandardND12s, VMSizeTypesStandardND24rs, VMSizeTypesStandardND24s, VMSizeTypesStandardND6s, VMSizeTypesStandardNV12, VMSizeTypesStandardNV24, VMSizeTypesStandardNV6} +} + +// AccessProfile profile for enabling a user to access a managed cluster. +type AccessProfile struct { + // KubeConfig - Base64-encoded Kubernetes configuration file. + KubeConfig *[]byte `json:"kubeConfig,omitempty"` +} + +// AgentPool agent Pool. +type AgentPool struct { + autorest.Response `json:"-"` + // ManagedClusterAgentPoolProfileProperties - Properties of an agent pool. + *ManagedClusterAgentPoolProfileProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AgentPool. +func (ap AgentPool) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ap.ManagedClusterAgentPoolProfileProperties != nil { + objectMap["properties"] = ap.ManagedClusterAgentPoolProfileProperties + } + 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 managedClusterAgentPoolProfileProperties ManagedClusterAgentPoolProfileProperties + err = json.Unmarshal(*v, &managedClusterAgentPoolProfileProperties) + if err != nil { + return err + } + ap.ManagedClusterAgentPoolProfileProperties = &managedClusterAgentPoolProfileProperties + } + 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 + } + } + } + + return nil +} + +// AgentPoolAvailableVersions the list of available versions for an agent pool. +type AgentPoolAvailableVersions struct { + autorest.Response `json:"-"` + // ID - READ-ONLY; Id of the agent pool available versions. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Name of the agent pool available versions. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of the agent pool available versions. + Type *string `json:"type,omitempty"` + // AgentPoolAvailableVersionsProperties - Properties of agent pool available versions. + *AgentPoolAvailableVersionsProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for AgentPoolAvailableVersions. +func (apav AgentPoolAvailableVersions) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if apav.AgentPoolAvailableVersionsProperties != nil { + objectMap["properties"] = apav.AgentPoolAvailableVersionsProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AgentPoolAvailableVersions struct. +func (apav *AgentPoolAvailableVersions) 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 "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + apav.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + apav.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + apav.Type = &typeVar + } + case "properties": + if v != nil { + var agentPoolAvailableVersionsProperties AgentPoolAvailableVersionsProperties + err = json.Unmarshal(*v, &agentPoolAvailableVersionsProperties) + if err != nil { + return err + } + apav.AgentPoolAvailableVersionsProperties = &agentPoolAvailableVersionsProperties + } + } + } + + return nil +} + +// AgentPoolAvailableVersionsProperties the list of available agent pool versions. +type AgentPoolAvailableVersionsProperties struct { + // AgentPoolVersions - List of versions available for agent pool. + AgentPoolVersions *[]AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem `json:"agentPoolVersions,omitempty"` +} + +// AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem ... +type AgentPoolAvailableVersionsPropertiesAgentPoolVersionsItem struct { + // Default - Whether this version is the default agent pool version. + Default *bool `json:"default,omitempty"` + // KubernetesVersion - Kubernetes version (major, minor, patch). + KubernetesVersion *string `json:"kubernetesVersion,omitempty"` + // IsPreview - Whether Kubernetes version is currently in preview. + IsPreview *bool `json:"isPreview,omitempty"` +} + +// AgentPoolListResult the response from the List Agent Pools operation. +type AgentPoolListResult struct { + autorest.Response `json:"-"` + // Value - The list of agent pools. + Value *[]AgentPool `json:"value,omitempty"` + // NextLink - READ-ONLY; The URL to get the next set of agent pool 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 +} + +// 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.NextLink == nil || len(to.String(aplr.NextLink)) < 1 { + 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) + }() + } + next, err := page.fn(ctx, page.aplr) + if err != nil { + return err + } + page.aplr = next + 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(getNextPage func(context.Context, AgentPoolListResult) (AgentPoolListResult, error)) AgentPoolListResultPage { + return AgentPoolListResultPage{fn: getNextPage} +} + +// AgentPoolProfile profile for the container service agent pool. +type AgentPoolProfile struct { + // Name - Unique name of the agent pool profile in the context of the subscription and resource group. + Name *string `json:"name,omitempty"` + // Count - Number of agents (VMs) to host docker containers. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. + Count *int32 `json:"count,omitempty"` + // VMSize - Size of agent VMs. Possible values include: 'VMSizeTypesStandardA1', 'VMSizeTypesStandardA10', 'VMSizeTypesStandardA11', 'VMSizeTypesStandardA1V2', 'VMSizeTypesStandardA2', 'VMSizeTypesStandardA2V2', 'VMSizeTypesStandardA2mV2', 'VMSizeTypesStandardA3', 'VMSizeTypesStandardA4', 'VMSizeTypesStandardA4V2', 'VMSizeTypesStandardA4mV2', 'VMSizeTypesStandardA5', 'VMSizeTypesStandardA6', 'VMSizeTypesStandardA7', 'VMSizeTypesStandardA8', 'VMSizeTypesStandardA8V2', 'VMSizeTypesStandardA8mV2', 'VMSizeTypesStandardA9', 'VMSizeTypesStandardB2ms', 'VMSizeTypesStandardB2s', 'VMSizeTypesStandardB4ms', 'VMSizeTypesStandardB8ms', 'VMSizeTypesStandardD1', 'VMSizeTypesStandardD11', 'VMSizeTypesStandardD11V2', 'VMSizeTypesStandardD11V2Promo', 'VMSizeTypesStandardD12', 'VMSizeTypesStandardD12V2', 'VMSizeTypesStandardD12V2Promo', 'VMSizeTypesStandardD13', 'VMSizeTypesStandardD13V2', 'VMSizeTypesStandardD13V2Promo', 'VMSizeTypesStandardD14', 'VMSizeTypesStandardD14V2', 'VMSizeTypesStandardD14V2Promo', 'VMSizeTypesStandardD15V2', 'VMSizeTypesStandardD16V3', 'VMSizeTypesStandardD16sV3', 'VMSizeTypesStandardD1V2', 'VMSizeTypesStandardD2', 'VMSizeTypesStandardD2V2', 'VMSizeTypesStandardD2V2Promo', 'VMSizeTypesStandardD2V3', 'VMSizeTypesStandardD2sV3', 'VMSizeTypesStandardD3', 'VMSizeTypesStandardD32V3', 'VMSizeTypesStandardD32sV3', 'VMSizeTypesStandardD3V2', 'VMSizeTypesStandardD3V2Promo', 'VMSizeTypesStandardD4', 'VMSizeTypesStandardD4V2', 'VMSizeTypesStandardD4V2Promo', 'VMSizeTypesStandardD4V3', 'VMSizeTypesStandardD4sV3', 'VMSizeTypesStandardD5V2', 'VMSizeTypesStandardD5V2Promo', 'VMSizeTypesStandardD64V3', 'VMSizeTypesStandardD64sV3', 'VMSizeTypesStandardD8V3', 'VMSizeTypesStandardD8sV3', 'VMSizeTypesStandardDS1', 'VMSizeTypesStandardDS11', 'VMSizeTypesStandardDS11V2', 'VMSizeTypesStandardDS11V2Promo', 'VMSizeTypesStandardDS12', 'VMSizeTypesStandardDS12V2', 'VMSizeTypesStandardDS12V2Promo', 'VMSizeTypesStandardDS13', 'VMSizeTypesStandardDS132V2', 'VMSizeTypesStandardDS134V2', 'VMSizeTypesStandardDS13V2', 'VMSizeTypesStandardDS13V2Promo', 'VMSizeTypesStandardDS14', 'VMSizeTypesStandardDS144V2', 'VMSizeTypesStandardDS148V2', 'VMSizeTypesStandardDS14V2', 'VMSizeTypesStandardDS14V2Promo', 'VMSizeTypesStandardDS15V2', 'VMSizeTypesStandardDS1V2', 'VMSizeTypesStandardDS2', 'VMSizeTypesStandardDS2V2', 'VMSizeTypesStandardDS2V2Promo', 'VMSizeTypesStandardDS3', 'VMSizeTypesStandardDS3V2', 'VMSizeTypesStandardDS3V2Promo', 'VMSizeTypesStandardDS4', 'VMSizeTypesStandardDS4V2', 'VMSizeTypesStandardDS4V2Promo', 'VMSizeTypesStandardDS5V2', 'VMSizeTypesStandardDS5V2Promo', 'VMSizeTypesStandardE16V3', 'VMSizeTypesStandardE16sV3', 'VMSizeTypesStandardE2V3', 'VMSizeTypesStandardE2sV3', 'VMSizeTypesStandardE3216sV3', 'VMSizeTypesStandardE328sV3', 'VMSizeTypesStandardE32V3', 'VMSizeTypesStandardE32sV3', 'VMSizeTypesStandardE4V3', 'VMSizeTypesStandardE4sV3', 'VMSizeTypesStandardE6416sV3', 'VMSizeTypesStandardE6432sV3', 'VMSizeTypesStandardE64V3', 'VMSizeTypesStandardE64sV3', 'VMSizeTypesStandardE8V3', 'VMSizeTypesStandardE8sV3', 'VMSizeTypesStandardF1', 'VMSizeTypesStandardF16', 'VMSizeTypesStandardF16s', 'VMSizeTypesStandardF16sV2', 'VMSizeTypesStandardF1s', 'VMSizeTypesStandardF2', 'VMSizeTypesStandardF2s', 'VMSizeTypesStandardF2sV2', 'VMSizeTypesStandardF32sV2', 'VMSizeTypesStandardF4', 'VMSizeTypesStandardF4s', 'VMSizeTypesStandardF4sV2', 'VMSizeTypesStandardF64sV2', 'VMSizeTypesStandardF72sV2', 'VMSizeTypesStandardF8', 'VMSizeTypesStandardF8s', 'VMSizeTypesStandardF8sV2', 'VMSizeTypesStandardG1', 'VMSizeTypesStandardG2', 'VMSizeTypesStandardG3', 'VMSizeTypesStandardG4', 'VMSizeTypesStandardG5', 'VMSizeTypesStandardGS1', 'VMSizeTypesStandardGS2', 'VMSizeTypesStandardGS3', 'VMSizeTypesStandardGS4', 'VMSizeTypesStandardGS44', 'VMSizeTypesStandardGS48', 'VMSizeTypesStandardGS5', 'VMSizeTypesStandardGS516', 'VMSizeTypesStandardGS58', 'VMSizeTypesStandardH16', 'VMSizeTypesStandardH16m', 'VMSizeTypesStandardH16mr', 'VMSizeTypesStandardH16r', 'VMSizeTypesStandardH8', 'VMSizeTypesStandardH8m', 'VMSizeTypesStandardL16s', 'VMSizeTypesStandardL32s', 'VMSizeTypesStandardL4s', 'VMSizeTypesStandardL8s', 'VMSizeTypesStandardM12832ms', 'VMSizeTypesStandardM12864ms', 'VMSizeTypesStandardM128ms', 'VMSizeTypesStandardM128s', 'VMSizeTypesStandardM6416ms', 'VMSizeTypesStandardM6432ms', 'VMSizeTypesStandardM64ms', 'VMSizeTypesStandardM64s', 'VMSizeTypesStandardNC12', 'VMSizeTypesStandardNC12sV2', 'VMSizeTypesStandardNC12sV3', 'VMSizeTypesStandardNC24', 'VMSizeTypesStandardNC24r', 'VMSizeTypesStandardNC24rsV2', 'VMSizeTypesStandardNC24rsV3', 'VMSizeTypesStandardNC24sV2', 'VMSizeTypesStandardNC24sV3', 'VMSizeTypesStandardNC6', 'VMSizeTypesStandardNC6sV2', 'VMSizeTypesStandardNC6sV3', 'VMSizeTypesStandardND12s', 'VMSizeTypesStandardND24rs', 'VMSizeTypesStandardND24s', 'VMSizeTypesStandardND6s', 'VMSizeTypesStandardNV12', 'VMSizeTypesStandardNV24', 'VMSizeTypesStandardNV6' + VMSize VMSizeTypes `json:"vmSize,omitempty"` + // OsDiskSizeGB - OS Disk Size in GB to be used to specify the disk size for every machine in this master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. + OsDiskSizeGB *int32 `json:"osDiskSizeGB,omitempty"` + // DNSPrefix - DNS prefix to be used to create the FQDN for the agent pool. + DNSPrefix *string `json:"dnsPrefix,omitempty"` + // Fqdn - READ-ONLY; FQDN for the agent pool. + Fqdn *string `json:"fqdn,omitempty"` + // Ports - Ports number array used to expose on this agent pool. The default opened ports are different based on your choice of orchestrator. + Ports *[]int32 `json:"ports,omitempty"` + // StorageProfile - Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. Possible values include: 'StorageAccount', 'ManagedDisks' + StorageProfile StorageProfileTypes `json:"storageProfile,omitempty"` + // VnetSubnetID - VNet SubnetID specifies the VNet's subnet identifier. + VnetSubnetID *string `json:"vnetSubnetID,omitempty"` + // OsType - OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: 'Linux', 'Windows' + OsType OSType `json:"osType,omitempty"` +} + +// AgentPoolsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type AgentPoolsCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *AgentPoolsCreateOrUpdateFuture) Result(client AgentPoolsClient) (ap AgentPool, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerservice.AgentPoolsCreateOrUpdateFuture") + 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.CreateOrUpdateResponder(ap.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.AgentPoolsCreateOrUpdateFuture", "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.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +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, "containerservice.AgentPoolsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerservice.AgentPoolsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// AgentPoolUpgradeProfile the list of available upgrades for an agent pool. +type AgentPoolUpgradeProfile struct { + autorest.Response `json:"-"` + // ID - READ-ONLY; Id of the agent pool upgrade profile. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Name of the agent pool upgrade profile. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of the agent pool upgrade profile. + Type *string `json:"type,omitempty"` + // AgentPoolUpgradeProfileProperties - Properties of agent pool upgrade profile. + *AgentPoolUpgradeProfileProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for AgentPoolUpgradeProfile. +func (apup AgentPoolUpgradeProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if apup.AgentPoolUpgradeProfileProperties != nil { + objectMap["properties"] = apup.AgentPoolUpgradeProfileProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AgentPoolUpgradeProfile struct. +func (apup *AgentPoolUpgradeProfile) 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 "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + apup.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + apup.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + apup.Type = &typeVar + } + case "properties": + if v != nil { + var agentPoolUpgradeProfileProperties AgentPoolUpgradeProfileProperties + err = json.Unmarshal(*v, &agentPoolUpgradeProfileProperties) + if err != nil { + return err + } + apup.AgentPoolUpgradeProfileProperties = &agentPoolUpgradeProfileProperties + } + } + } + + return nil +} + +// AgentPoolUpgradeProfileProperties the list of available upgrade versions. +type AgentPoolUpgradeProfileProperties struct { + // KubernetesVersion - Kubernetes version (major, minor, patch). + KubernetesVersion *string `json:"kubernetesVersion,omitempty"` + // OsType - OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: 'Linux', 'Windows' + OsType OSType `json:"osType,omitempty"` + // Upgrades - List of orchestrator types and versions available for upgrade. + Upgrades *[]AgentPoolUpgradeProfilePropertiesUpgradesItem `json:"upgrades,omitempty"` + // LatestNodeImageVersion - LatestNodeImageVersion is the latest AKS supported node image version. + LatestNodeImageVersion *string `json:"latestNodeImageVersion,omitempty"` +} + +// AgentPoolUpgradeProfilePropertiesUpgradesItem ... +type AgentPoolUpgradeProfilePropertiesUpgradesItem struct { + // KubernetesVersion - Kubernetes version (major, minor, patch). + KubernetesVersion *string `json:"kubernetesVersion,omitempty"` + // IsPreview - Whether Kubernetes version is currently in preview. + IsPreview *bool `json:"isPreview,omitempty"` +} + +// AgentPoolUpgradeSettings settings for upgrading an agentpool +type AgentPoolUpgradeSettings struct { + // MaxSurge - Count or percentage of additional nodes to be added during upgrade. If empty uses AKS default + MaxSurge *string `json:"maxSurge,omitempty"` +} + +// CloudError an error response from the Container service. +type CloudError struct { + // Error - Details about the error. + Error *CloudErrorBody `json:"error,omitempty"` +} + +// CloudErrorBody an error response from the Container service. +type CloudErrorBody struct { + // Code - An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + Code *string `json:"code,omitempty"` + // Message - A message describing the error, intended to be suitable for display in a user interface. + Message *string `json:"message,omitempty"` + // Target - The target of the particular error. For example, the name of the property in error. + Target *string `json:"target,omitempty"` + // Details - A list of additional details about the error. + Details *[]CloudErrorBody `json:"details,omitempty"` +} + +// ContainerService container service. +type ContainerService struct { + autorest.Response `json:"-"` + // Properties - Properties of the container service. + *Properties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for ContainerService. +func (cs ContainerService) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cs.Properties != nil { + objectMap["properties"] = cs.Properties + } + if cs.Location != nil { + objectMap["location"] = cs.Location + } + if cs.Tags != nil { + objectMap["tags"] = cs.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ContainerService struct. +func (cs *ContainerService) 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 properties Properties + err = json.Unmarshal(*v, &properties) + if err != nil { + return err + } + cs.Properties = &properties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + cs.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + cs.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + cs.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + cs.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + cs.Tags = tags + } + } + } + + return nil +} + +// ContainerServicesCreateOrUpdateFutureType an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ContainerServicesCreateOrUpdateFutureType struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ContainerServicesCreateOrUpdateFutureType) Result(client ContainerServicesClient) (cs ContainerService, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesCreateOrUpdateFutureType", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerservice.ContainerServicesCreateOrUpdateFutureType") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if cs.Response.Response, err = future.GetResult(sender); err == nil && cs.Response.Response.StatusCode != http.StatusNoContent { + cs, err = client.CreateOrUpdateResponder(cs.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesCreateOrUpdateFutureType", "Result", cs.Response.Response, "Failure responding to request") + } + } + return +} + +// ContainerServicesDeleteFutureType an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ContainerServicesDeleteFutureType struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ContainerServicesDeleteFutureType) Result(client ContainerServicesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ContainerServicesDeleteFutureType", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerservice.ContainerServicesDeleteFutureType") + return + } + ar.Response = future.Response() + return +} + +// CredentialResult the credential result response. +type CredentialResult struct { + // Name - READ-ONLY; The name of the credential. + Name *string `json:"name,omitempty"` + // Value - READ-ONLY; Base64-encoded Kubernetes configuration file. + Value *[]byte `json:"value,omitempty"` +} + +// CredentialResults the list of credential result response. +type CredentialResults struct { + autorest.Response `json:"-"` + // Kubeconfigs - READ-ONLY; Base64-encoded Kubernetes configuration file. + Kubeconfigs *[]CredentialResult `json:"kubeconfigs,omitempty"` +} + +// CustomProfile properties to configure a custom container service cluster. +type CustomProfile struct { + // Orchestrator - The name of the custom orchestrator to use. + Orchestrator *string `json:"orchestrator,omitempty"` +} + +// DiagnosticsProfile profile for diagnostics on the container service cluster. +type DiagnosticsProfile struct { + // VMDiagnostics - Profile for diagnostics on the container service VMs. + VMDiagnostics *VMDiagnostics `json:"vmDiagnostics,omitempty"` +} + +// KeyVaultSecretRef reference to a secret stored in Azure Key Vault. +type KeyVaultSecretRef struct { + // VaultID - Key vault identifier. + VaultID *string `json:"vaultID,omitempty"` + // SecretName - The secret name. + SecretName *string `json:"secretName,omitempty"` + // Version - The secret version. + Version *string `json:"version,omitempty"` +} + +// LinuxProfile profile for Linux VMs in the container service cluster. +type LinuxProfile struct { + // AdminUsername - The administrator username to use for Linux VMs. + AdminUsername *string `json:"adminUsername,omitempty"` + // SSH - SSH configuration for Linux-based VMs running on Azure. + SSH *SSHConfiguration `json:"ssh,omitempty"` +} + +// ListResult the response from the List Container Services operation. +type ListResult struct { + autorest.Response `json:"-"` + // Value - The list of container services. + Value *[]ContainerService `json:"value,omitempty"` + // NextLink - READ-ONLY; The URL to get the next set of container service results. + NextLink *string `json:"nextLink,omitempty"` +} + +// ListResultIterator provides access to a complete listing of ContainerService values. +type ListResultIterator struct { + i int + page ListResultPage +} + +// 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 *ListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ListResultIterator.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 *ListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ListResultIterator) 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 ListResultIterator) Response() ListResult { + 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 ListResultIterator) Value() ContainerService { + if !iter.page.NotDone() { + return ContainerService{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ListResultIterator type. +func NewListResultIterator(page ListResultPage) ListResultIterator { + return ListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (lr ListResult) IsEmpty() bool { + return lr.Value == nil || len(*lr.Value) == 0 +} + +// listResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (lr ListResult) listResultPreparer(ctx context.Context) (*http.Request, error) { + if lr.NextLink == nil || len(to.String(lr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(lr.NextLink))) +} + +// ListResultPage contains a page of ContainerService values. +type ListResultPage struct { + fn func(context.Context, ListResult) (ListResult, error) + lr ListResult +} + +// 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 *ListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.lr) + if err != nil { + return err + } + page.lr = next + 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 *ListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ListResultPage) NotDone() bool { + return !page.lr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ListResultPage) Response() ListResult { + return page.lr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ListResultPage) Values() []ContainerService { + if page.lr.IsEmpty() { + return nil + } + return *page.lr.Value +} + +// Creates a new instance of the ListResultPage type. +func NewListResultPage(getNextPage func(context.Context, ListResult) (ListResult, error)) ListResultPage { + return ListResultPage{fn: getNextPage} +} + +// ManagedCluster managed cluster. +type ManagedCluster struct { + autorest.Response `json:"-"` + // ManagedClusterProperties - Properties of a managed cluster. + *ManagedClusterProperties `json:"properties,omitempty"` + // Identity - The identity of the managed cluster, if configured. + Identity *ManagedClusterIdentity `json:"identity,omitempty"` + // Sku - The managed cluster SKU. + Sku *ManagedClusterSKU `json:"sku,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for ManagedCluster. +func (mc ManagedCluster) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mc.ManagedClusterProperties != nil { + objectMap["properties"] = mc.ManagedClusterProperties + } + if mc.Identity != nil { + objectMap["identity"] = mc.Identity + } + if mc.Sku != nil { + objectMap["sku"] = mc.Sku + } + if mc.Location != nil { + objectMap["location"] = mc.Location + } + if mc.Tags != nil { + objectMap["tags"] = mc.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ManagedCluster struct. +func (mc *ManagedCluster) 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 managedClusterProperties ManagedClusterProperties + err = json.Unmarshal(*v, &managedClusterProperties) + if err != nil { + return err + } + mc.ManagedClusterProperties = &managedClusterProperties + } + case "identity": + if v != nil { + var identity ManagedClusterIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + mc.Identity = &identity + } + case "sku": + if v != nil { + var sku ManagedClusterSKU + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + mc.Sku = &sku + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + mc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mc.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + mc.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + mc.Tags = tags + } + } + } + + return nil +} + +// ManagedClusterAADProfile aADProfile specifies attributes for Azure Active Directory integration. +type ManagedClusterAADProfile struct { + // Managed - Whether to enable managed AAD. + Managed *bool `json:"managed,omitempty"` + // AdminGroupObjectIDs - AAD group object IDs that will have admin role of the cluster. + AdminGroupObjectIDs *[]string `json:"adminGroupObjectIDs,omitempty"` + // ClientAppID - The client AAD application ID. + ClientAppID *string `json:"clientAppID,omitempty"` + // ServerAppID - The server AAD application ID. + ServerAppID *string `json:"serverAppID,omitempty"` + // ServerAppSecret - The server AAD application secret. + ServerAppSecret *string `json:"serverAppSecret,omitempty"` + // TenantID - The AAD tenant ID to use for authentication. If not specified, will use the tenant of the deployment subscription. + TenantID *string `json:"tenantID,omitempty"` +} + +// ManagedClusterAccessProfile managed cluster Access Profile. +type ManagedClusterAccessProfile struct { + autorest.Response `json:"-"` + // AccessProfile - AccessProfile of a managed cluster. + *AccessProfile `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for ManagedClusterAccessProfile. +func (mcap ManagedClusterAccessProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mcap.AccessProfile != nil { + objectMap["properties"] = mcap.AccessProfile + } + if mcap.Location != nil { + objectMap["location"] = mcap.Location + } + if mcap.Tags != nil { + objectMap["tags"] = mcap.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ManagedClusterAccessProfile struct. +func (mcap *ManagedClusterAccessProfile) 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 accessProfile AccessProfile + err = json.Unmarshal(*v, &accessProfile) + if err != nil { + return err + } + mcap.AccessProfile = &accessProfile + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + mcap.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mcap.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mcap.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + mcap.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + mcap.Tags = tags + } + } + } + + return nil +} + +// ManagedClusterAddonProfile a Kubernetes add-on profile for a managed cluster. +type ManagedClusterAddonProfile struct { + // Enabled - Whether the add-on is enabled or not. + Enabled *bool `json:"enabled,omitempty"` + // Config - Key-value pairs for configuring an add-on. + Config map[string]*string `json:"config"` + // Identity - READ-ONLY; Information of user assigned identity used by this add-on. + Identity *ManagedClusterAddonProfileIdentity `json:"identity,omitempty"` +} + +// MarshalJSON is the custom marshaler for ManagedClusterAddonProfile. +func (mcap ManagedClusterAddonProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mcap.Enabled != nil { + objectMap["enabled"] = mcap.Enabled + } + if mcap.Config != nil { + objectMap["config"] = mcap.Config + } + return json.Marshal(objectMap) +} + +// ManagedClusterAddonProfileIdentity information of user assigned identity used by this add-on. +type ManagedClusterAddonProfileIdentity struct { + // ResourceID - The resource id of the user assigned identity. + ResourceID *string `json:"resourceId,omitempty"` + // ClientID - The client id of the user assigned identity. + ClientID *string `json:"clientId,omitempty"` + // ObjectID - The object id of the user assigned identity. + ObjectID *string `json:"objectId,omitempty"` +} + +// ManagedClusterAgentPoolProfile profile for the container service agent pool. +type ManagedClusterAgentPoolProfile struct { + // Name - Unique name of the agent pool profile in the context of the subscription and resource group. + Name *string `json:"name,omitempty"` + // Count - Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for system pools. The default value is 1. + Count *int32 `json:"count,omitempty"` + // VMSize - Size of agent VMs. Possible values include: 'VMSizeTypesStandardA1', 'VMSizeTypesStandardA10', 'VMSizeTypesStandardA11', 'VMSizeTypesStandardA1V2', 'VMSizeTypesStandardA2', 'VMSizeTypesStandardA2V2', 'VMSizeTypesStandardA2mV2', 'VMSizeTypesStandardA3', 'VMSizeTypesStandardA4', 'VMSizeTypesStandardA4V2', 'VMSizeTypesStandardA4mV2', 'VMSizeTypesStandardA5', 'VMSizeTypesStandardA6', 'VMSizeTypesStandardA7', 'VMSizeTypesStandardA8', 'VMSizeTypesStandardA8V2', 'VMSizeTypesStandardA8mV2', 'VMSizeTypesStandardA9', 'VMSizeTypesStandardB2ms', 'VMSizeTypesStandardB2s', 'VMSizeTypesStandardB4ms', 'VMSizeTypesStandardB8ms', 'VMSizeTypesStandardD1', 'VMSizeTypesStandardD11', 'VMSizeTypesStandardD11V2', 'VMSizeTypesStandardD11V2Promo', 'VMSizeTypesStandardD12', 'VMSizeTypesStandardD12V2', 'VMSizeTypesStandardD12V2Promo', 'VMSizeTypesStandardD13', 'VMSizeTypesStandardD13V2', 'VMSizeTypesStandardD13V2Promo', 'VMSizeTypesStandardD14', 'VMSizeTypesStandardD14V2', 'VMSizeTypesStandardD14V2Promo', 'VMSizeTypesStandardD15V2', 'VMSizeTypesStandardD16V3', 'VMSizeTypesStandardD16sV3', 'VMSizeTypesStandardD1V2', 'VMSizeTypesStandardD2', 'VMSizeTypesStandardD2V2', 'VMSizeTypesStandardD2V2Promo', 'VMSizeTypesStandardD2V3', 'VMSizeTypesStandardD2sV3', 'VMSizeTypesStandardD3', 'VMSizeTypesStandardD32V3', 'VMSizeTypesStandardD32sV3', 'VMSizeTypesStandardD3V2', 'VMSizeTypesStandardD3V2Promo', 'VMSizeTypesStandardD4', 'VMSizeTypesStandardD4V2', 'VMSizeTypesStandardD4V2Promo', 'VMSizeTypesStandardD4V3', 'VMSizeTypesStandardD4sV3', 'VMSizeTypesStandardD5V2', 'VMSizeTypesStandardD5V2Promo', 'VMSizeTypesStandardD64V3', 'VMSizeTypesStandardD64sV3', 'VMSizeTypesStandardD8V3', 'VMSizeTypesStandardD8sV3', 'VMSizeTypesStandardDS1', 'VMSizeTypesStandardDS11', 'VMSizeTypesStandardDS11V2', 'VMSizeTypesStandardDS11V2Promo', 'VMSizeTypesStandardDS12', 'VMSizeTypesStandardDS12V2', 'VMSizeTypesStandardDS12V2Promo', 'VMSizeTypesStandardDS13', 'VMSizeTypesStandardDS132V2', 'VMSizeTypesStandardDS134V2', 'VMSizeTypesStandardDS13V2', 'VMSizeTypesStandardDS13V2Promo', 'VMSizeTypesStandardDS14', 'VMSizeTypesStandardDS144V2', 'VMSizeTypesStandardDS148V2', 'VMSizeTypesStandardDS14V2', 'VMSizeTypesStandardDS14V2Promo', 'VMSizeTypesStandardDS15V2', 'VMSizeTypesStandardDS1V2', 'VMSizeTypesStandardDS2', 'VMSizeTypesStandardDS2V2', 'VMSizeTypesStandardDS2V2Promo', 'VMSizeTypesStandardDS3', 'VMSizeTypesStandardDS3V2', 'VMSizeTypesStandardDS3V2Promo', 'VMSizeTypesStandardDS4', 'VMSizeTypesStandardDS4V2', 'VMSizeTypesStandardDS4V2Promo', 'VMSizeTypesStandardDS5V2', 'VMSizeTypesStandardDS5V2Promo', 'VMSizeTypesStandardE16V3', 'VMSizeTypesStandardE16sV3', 'VMSizeTypesStandardE2V3', 'VMSizeTypesStandardE2sV3', 'VMSizeTypesStandardE3216sV3', 'VMSizeTypesStandardE328sV3', 'VMSizeTypesStandardE32V3', 'VMSizeTypesStandardE32sV3', 'VMSizeTypesStandardE4V3', 'VMSizeTypesStandardE4sV3', 'VMSizeTypesStandardE6416sV3', 'VMSizeTypesStandardE6432sV3', 'VMSizeTypesStandardE64V3', 'VMSizeTypesStandardE64sV3', 'VMSizeTypesStandardE8V3', 'VMSizeTypesStandardE8sV3', 'VMSizeTypesStandardF1', 'VMSizeTypesStandardF16', 'VMSizeTypesStandardF16s', 'VMSizeTypesStandardF16sV2', 'VMSizeTypesStandardF1s', 'VMSizeTypesStandardF2', 'VMSizeTypesStandardF2s', 'VMSizeTypesStandardF2sV2', 'VMSizeTypesStandardF32sV2', 'VMSizeTypesStandardF4', 'VMSizeTypesStandardF4s', 'VMSizeTypesStandardF4sV2', 'VMSizeTypesStandardF64sV2', 'VMSizeTypesStandardF72sV2', 'VMSizeTypesStandardF8', 'VMSizeTypesStandardF8s', 'VMSizeTypesStandardF8sV2', 'VMSizeTypesStandardG1', 'VMSizeTypesStandardG2', 'VMSizeTypesStandardG3', 'VMSizeTypesStandardG4', 'VMSizeTypesStandardG5', 'VMSizeTypesStandardGS1', 'VMSizeTypesStandardGS2', 'VMSizeTypesStandardGS3', 'VMSizeTypesStandardGS4', 'VMSizeTypesStandardGS44', 'VMSizeTypesStandardGS48', 'VMSizeTypesStandardGS5', 'VMSizeTypesStandardGS516', 'VMSizeTypesStandardGS58', 'VMSizeTypesStandardH16', 'VMSizeTypesStandardH16m', 'VMSizeTypesStandardH16mr', 'VMSizeTypesStandardH16r', 'VMSizeTypesStandardH8', 'VMSizeTypesStandardH8m', 'VMSizeTypesStandardL16s', 'VMSizeTypesStandardL32s', 'VMSizeTypesStandardL4s', 'VMSizeTypesStandardL8s', 'VMSizeTypesStandardM12832ms', 'VMSizeTypesStandardM12864ms', 'VMSizeTypesStandardM128ms', 'VMSizeTypesStandardM128s', 'VMSizeTypesStandardM6416ms', 'VMSizeTypesStandardM6432ms', 'VMSizeTypesStandardM64ms', 'VMSizeTypesStandardM64s', 'VMSizeTypesStandardNC12', 'VMSizeTypesStandardNC12sV2', 'VMSizeTypesStandardNC12sV3', 'VMSizeTypesStandardNC24', 'VMSizeTypesStandardNC24r', 'VMSizeTypesStandardNC24rsV2', 'VMSizeTypesStandardNC24rsV3', 'VMSizeTypesStandardNC24sV2', 'VMSizeTypesStandardNC24sV3', 'VMSizeTypesStandardNC6', 'VMSizeTypesStandardNC6sV2', 'VMSizeTypesStandardNC6sV3', 'VMSizeTypesStandardND12s', 'VMSizeTypesStandardND24rs', 'VMSizeTypesStandardND24s', 'VMSizeTypesStandardND6s', 'VMSizeTypesStandardNV12', 'VMSizeTypesStandardNV24', 'VMSizeTypesStandardNV6' + VMSize VMSizeTypes `json:"vmSize,omitempty"` + // OsDiskSizeGB - OS Disk Size in GB to be used to specify the disk size for every machine in this master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. + OsDiskSizeGB *int32 `json:"osDiskSizeGB,omitempty"` + // VnetSubnetID - VNet SubnetID specifies the VNet's subnet identifier. + VnetSubnetID *string `json:"vnetSubnetID,omitempty"` + // MaxPods - Maximum number of pods that can run on a node. + MaxPods *int32 `json:"maxPods,omitempty"` + // OsType - OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: 'Linux', 'Windows' + OsType OSType `json:"osType,omitempty"` + // MaxCount - Maximum number of nodes for auto-scaling + MaxCount *int32 `json:"maxCount,omitempty"` + // MinCount - Minimum number of nodes for auto-scaling + MinCount *int32 `json:"minCount,omitempty"` + // EnableAutoScaling - Whether to enable auto-scaler + EnableAutoScaling *bool `json:"enableAutoScaling,omitempty"` + // Type - AgentPoolType represents types of an agent pool. Possible values include: 'VirtualMachineScaleSets', 'AvailabilitySet' + Type AgentPoolType `json:"type,omitempty"` + // Mode - AgentPoolMode represents mode of an agent pool. Possible values include: 'System', 'User' + Mode AgentPoolMode `json:"mode,omitempty"` + // OrchestratorVersion - Version of orchestrator specified when creating the managed cluster. + OrchestratorVersion *string `json:"orchestratorVersion,omitempty"` + // NodeImageVersion - Version of node image + NodeImageVersion *string `json:"nodeImageVersion,omitempty"` + // UpgradeSettings - Settings for upgrading the agentpool + UpgradeSettings *AgentPoolUpgradeSettings `json:"upgradeSettings,omitempty"` + // ProvisioningState - READ-ONLY; The current deployment or provisioning state, which only appears in the response. + ProvisioningState *string `json:"provisioningState,omitempty"` + // AvailabilityZones - Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. + AvailabilityZones *[]string `json:"availabilityZones,omitempty"` + // EnableNodePublicIP - Enable public IP for nodes + EnableNodePublicIP *bool `json:"enableNodePublicIP,omitempty"` + // ScaleSetPriority - ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. Possible values include: 'Spot', 'Regular' + ScaleSetPriority ScaleSetPriority `json:"scaleSetPriority,omitempty"` + // ScaleSetEvictionPolicy - ScaleSetEvictionPolicy to be used to specify eviction policy for Spot virtual machine scale set. Default to Delete. Possible values include: 'Delete', 'Deallocate' + ScaleSetEvictionPolicy ScaleSetEvictionPolicy `json:"scaleSetEvictionPolicy,omitempty"` + // SpotMaxPrice - SpotMaxPrice to be used to specify the maximum price you are willing to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which indicates default price to be up-to on-demand. + SpotMaxPrice *float64 `json:"spotMaxPrice,omitempty"` + // Tags - Agent pool tags to be persisted on the agent pool virtual machine scale set. + Tags map[string]*string `json:"tags"` + // NodeLabels - Agent pool node labels to be persisted across all nodes in agent pool. + NodeLabels map[string]*string `json:"nodeLabels"` + // NodeTaints - Taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. + NodeTaints *[]string `json:"nodeTaints,omitempty"` +} + +// MarshalJSON is the custom marshaler for ManagedClusterAgentPoolProfile. +func (mcapp ManagedClusterAgentPoolProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mcapp.Name != nil { + objectMap["name"] = mcapp.Name + } + if mcapp.Count != nil { + objectMap["count"] = mcapp.Count + } + if mcapp.VMSize != "" { + objectMap["vmSize"] = mcapp.VMSize + } + if mcapp.OsDiskSizeGB != nil { + objectMap["osDiskSizeGB"] = mcapp.OsDiskSizeGB + } + if mcapp.VnetSubnetID != nil { + objectMap["vnetSubnetID"] = mcapp.VnetSubnetID + } + if mcapp.MaxPods != nil { + objectMap["maxPods"] = mcapp.MaxPods + } + if mcapp.OsType != "" { + objectMap["osType"] = mcapp.OsType + } + if mcapp.MaxCount != nil { + objectMap["maxCount"] = mcapp.MaxCount + } + if mcapp.MinCount != nil { + objectMap["minCount"] = mcapp.MinCount + } + if mcapp.EnableAutoScaling != nil { + objectMap["enableAutoScaling"] = mcapp.EnableAutoScaling + } + if mcapp.Type != "" { + objectMap["type"] = mcapp.Type + } + if mcapp.Mode != "" { + objectMap["mode"] = mcapp.Mode + } + if mcapp.OrchestratorVersion != nil { + objectMap["orchestratorVersion"] = mcapp.OrchestratorVersion + } + if mcapp.NodeImageVersion != nil { + objectMap["nodeImageVersion"] = mcapp.NodeImageVersion + } + if mcapp.UpgradeSettings != nil { + objectMap["upgradeSettings"] = mcapp.UpgradeSettings + } + if mcapp.AvailabilityZones != nil { + objectMap["availabilityZones"] = mcapp.AvailabilityZones + } + if mcapp.EnableNodePublicIP != nil { + objectMap["enableNodePublicIP"] = mcapp.EnableNodePublicIP + } + if mcapp.ScaleSetPriority != "" { + objectMap["scaleSetPriority"] = mcapp.ScaleSetPriority + } + if mcapp.ScaleSetEvictionPolicy != "" { + objectMap["scaleSetEvictionPolicy"] = mcapp.ScaleSetEvictionPolicy + } + if mcapp.SpotMaxPrice != nil { + objectMap["spotMaxPrice"] = mcapp.SpotMaxPrice + } + if mcapp.Tags != nil { + objectMap["tags"] = mcapp.Tags + } + if mcapp.NodeLabels != nil { + objectMap["nodeLabels"] = mcapp.NodeLabels + } + if mcapp.NodeTaints != nil { + objectMap["nodeTaints"] = mcapp.NodeTaints + } + return json.Marshal(objectMap) +} + +// ManagedClusterAgentPoolProfileProperties properties for the container service agent pool profile. +type ManagedClusterAgentPoolProfileProperties struct { + // Count - Number of agents (VMs) to host docker containers. Allowed values must be in the range of 0 to 100 (inclusive) for user pools and in the range of 1 to 100 (inclusive) for system pools. The default value is 1. + Count *int32 `json:"count,omitempty"` + // VMSize - Size of agent VMs. Possible values include: 'VMSizeTypesStandardA1', 'VMSizeTypesStandardA10', 'VMSizeTypesStandardA11', 'VMSizeTypesStandardA1V2', 'VMSizeTypesStandardA2', 'VMSizeTypesStandardA2V2', 'VMSizeTypesStandardA2mV2', 'VMSizeTypesStandardA3', 'VMSizeTypesStandardA4', 'VMSizeTypesStandardA4V2', 'VMSizeTypesStandardA4mV2', 'VMSizeTypesStandardA5', 'VMSizeTypesStandardA6', 'VMSizeTypesStandardA7', 'VMSizeTypesStandardA8', 'VMSizeTypesStandardA8V2', 'VMSizeTypesStandardA8mV2', 'VMSizeTypesStandardA9', 'VMSizeTypesStandardB2ms', 'VMSizeTypesStandardB2s', 'VMSizeTypesStandardB4ms', 'VMSizeTypesStandardB8ms', 'VMSizeTypesStandardD1', 'VMSizeTypesStandardD11', 'VMSizeTypesStandardD11V2', 'VMSizeTypesStandardD11V2Promo', 'VMSizeTypesStandardD12', 'VMSizeTypesStandardD12V2', 'VMSizeTypesStandardD12V2Promo', 'VMSizeTypesStandardD13', 'VMSizeTypesStandardD13V2', 'VMSizeTypesStandardD13V2Promo', 'VMSizeTypesStandardD14', 'VMSizeTypesStandardD14V2', 'VMSizeTypesStandardD14V2Promo', 'VMSizeTypesStandardD15V2', 'VMSizeTypesStandardD16V3', 'VMSizeTypesStandardD16sV3', 'VMSizeTypesStandardD1V2', 'VMSizeTypesStandardD2', 'VMSizeTypesStandardD2V2', 'VMSizeTypesStandardD2V2Promo', 'VMSizeTypesStandardD2V3', 'VMSizeTypesStandardD2sV3', 'VMSizeTypesStandardD3', 'VMSizeTypesStandardD32V3', 'VMSizeTypesStandardD32sV3', 'VMSizeTypesStandardD3V2', 'VMSizeTypesStandardD3V2Promo', 'VMSizeTypesStandardD4', 'VMSizeTypesStandardD4V2', 'VMSizeTypesStandardD4V2Promo', 'VMSizeTypesStandardD4V3', 'VMSizeTypesStandardD4sV3', 'VMSizeTypesStandardD5V2', 'VMSizeTypesStandardD5V2Promo', 'VMSizeTypesStandardD64V3', 'VMSizeTypesStandardD64sV3', 'VMSizeTypesStandardD8V3', 'VMSizeTypesStandardD8sV3', 'VMSizeTypesStandardDS1', 'VMSizeTypesStandardDS11', 'VMSizeTypesStandardDS11V2', 'VMSizeTypesStandardDS11V2Promo', 'VMSizeTypesStandardDS12', 'VMSizeTypesStandardDS12V2', 'VMSizeTypesStandardDS12V2Promo', 'VMSizeTypesStandardDS13', 'VMSizeTypesStandardDS132V2', 'VMSizeTypesStandardDS134V2', 'VMSizeTypesStandardDS13V2', 'VMSizeTypesStandardDS13V2Promo', 'VMSizeTypesStandardDS14', 'VMSizeTypesStandardDS144V2', 'VMSizeTypesStandardDS148V2', 'VMSizeTypesStandardDS14V2', 'VMSizeTypesStandardDS14V2Promo', 'VMSizeTypesStandardDS15V2', 'VMSizeTypesStandardDS1V2', 'VMSizeTypesStandardDS2', 'VMSizeTypesStandardDS2V2', 'VMSizeTypesStandardDS2V2Promo', 'VMSizeTypesStandardDS3', 'VMSizeTypesStandardDS3V2', 'VMSizeTypesStandardDS3V2Promo', 'VMSizeTypesStandardDS4', 'VMSizeTypesStandardDS4V2', 'VMSizeTypesStandardDS4V2Promo', 'VMSizeTypesStandardDS5V2', 'VMSizeTypesStandardDS5V2Promo', 'VMSizeTypesStandardE16V3', 'VMSizeTypesStandardE16sV3', 'VMSizeTypesStandardE2V3', 'VMSizeTypesStandardE2sV3', 'VMSizeTypesStandardE3216sV3', 'VMSizeTypesStandardE328sV3', 'VMSizeTypesStandardE32V3', 'VMSizeTypesStandardE32sV3', 'VMSizeTypesStandardE4V3', 'VMSizeTypesStandardE4sV3', 'VMSizeTypesStandardE6416sV3', 'VMSizeTypesStandardE6432sV3', 'VMSizeTypesStandardE64V3', 'VMSizeTypesStandardE64sV3', 'VMSizeTypesStandardE8V3', 'VMSizeTypesStandardE8sV3', 'VMSizeTypesStandardF1', 'VMSizeTypesStandardF16', 'VMSizeTypesStandardF16s', 'VMSizeTypesStandardF16sV2', 'VMSizeTypesStandardF1s', 'VMSizeTypesStandardF2', 'VMSizeTypesStandardF2s', 'VMSizeTypesStandardF2sV2', 'VMSizeTypesStandardF32sV2', 'VMSizeTypesStandardF4', 'VMSizeTypesStandardF4s', 'VMSizeTypesStandardF4sV2', 'VMSizeTypesStandardF64sV2', 'VMSizeTypesStandardF72sV2', 'VMSizeTypesStandardF8', 'VMSizeTypesStandardF8s', 'VMSizeTypesStandardF8sV2', 'VMSizeTypesStandardG1', 'VMSizeTypesStandardG2', 'VMSizeTypesStandardG3', 'VMSizeTypesStandardG4', 'VMSizeTypesStandardG5', 'VMSizeTypesStandardGS1', 'VMSizeTypesStandardGS2', 'VMSizeTypesStandardGS3', 'VMSizeTypesStandardGS4', 'VMSizeTypesStandardGS44', 'VMSizeTypesStandardGS48', 'VMSizeTypesStandardGS5', 'VMSizeTypesStandardGS516', 'VMSizeTypesStandardGS58', 'VMSizeTypesStandardH16', 'VMSizeTypesStandardH16m', 'VMSizeTypesStandardH16mr', 'VMSizeTypesStandardH16r', 'VMSizeTypesStandardH8', 'VMSizeTypesStandardH8m', 'VMSizeTypesStandardL16s', 'VMSizeTypesStandardL32s', 'VMSizeTypesStandardL4s', 'VMSizeTypesStandardL8s', 'VMSizeTypesStandardM12832ms', 'VMSizeTypesStandardM12864ms', 'VMSizeTypesStandardM128ms', 'VMSizeTypesStandardM128s', 'VMSizeTypesStandardM6416ms', 'VMSizeTypesStandardM6432ms', 'VMSizeTypesStandardM64ms', 'VMSizeTypesStandardM64s', 'VMSizeTypesStandardNC12', 'VMSizeTypesStandardNC12sV2', 'VMSizeTypesStandardNC12sV3', 'VMSizeTypesStandardNC24', 'VMSizeTypesStandardNC24r', 'VMSizeTypesStandardNC24rsV2', 'VMSizeTypesStandardNC24rsV3', 'VMSizeTypesStandardNC24sV2', 'VMSizeTypesStandardNC24sV3', 'VMSizeTypesStandardNC6', 'VMSizeTypesStandardNC6sV2', 'VMSizeTypesStandardNC6sV3', 'VMSizeTypesStandardND12s', 'VMSizeTypesStandardND24rs', 'VMSizeTypesStandardND24s', 'VMSizeTypesStandardND6s', 'VMSizeTypesStandardNV12', 'VMSizeTypesStandardNV24', 'VMSizeTypesStandardNV6' + VMSize VMSizeTypes `json:"vmSize,omitempty"` + // OsDiskSizeGB - OS Disk Size in GB to be used to specify the disk size for every machine in this master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. + OsDiskSizeGB *int32 `json:"osDiskSizeGB,omitempty"` + // VnetSubnetID - VNet SubnetID specifies the VNet's subnet identifier. + VnetSubnetID *string `json:"vnetSubnetID,omitempty"` + // MaxPods - Maximum number of pods that can run on a node. + MaxPods *int32 `json:"maxPods,omitempty"` + // OsType - OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: 'Linux', 'Windows' + OsType OSType `json:"osType,omitempty"` + // MaxCount - Maximum number of nodes for auto-scaling + MaxCount *int32 `json:"maxCount,omitempty"` + // MinCount - Minimum number of nodes for auto-scaling + MinCount *int32 `json:"minCount,omitempty"` + // EnableAutoScaling - Whether to enable auto-scaler + EnableAutoScaling *bool `json:"enableAutoScaling,omitempty"` + // Type - AgentPoolType represents types of an agent pool. Possible values include: 'VirtualMachineScaleSets', 'AvailabilitySet' + Type AgentPoolType `json:"type,omitempty"` + // Mode - AgentPoolMode represents mode of an agent pool. Possible values include: 'System', 'User' + Mode AgentPoolMode `json:"mode,omitempty"` + // OrchestratorVersion - Version of orchestrator specified when creating the managed cluster. + OrchestratorVersion *string `json:"orchestratorVersion,omitempty"` + // NodeImageVersion - Version of node image + NodeImageVersion *string `json:"nodeImageVersion,omitempty"` + // UpgradeSettings - Settings for upgrading the agentpool + UpgradeSettings *AgentPoolUpgradeSettings `json:"upgradeSettings,omitempty"` + // ProvisioningState - READ-ONLY; The current deployment or provisioning state, which only appears in the response. + ProvisioningState *string `json:"provisioningState,omitempty"` + // AvailabilityZones - Availability zones for nodes. Must use VirtualMachineScaleSets AgentPoolType. + AvailabilityZones *[]string `json:"availabilityZones,omitempty"` + // EnableNodePublicIP - Enable public IP for nodes + EnableNodePublicIP *bool `json:"enableNodePublicIP,omitempty"` + // ScaleSetPriority - ScaleSetPriority to be used to specify virtual machine scale set priority. Default to regular. Possible values include: 'Spot', 'Regular' + ScaleSetPriority ScaleSetPriority `json:"scaleSetPriority,omitempty"` + // ScaleSetEvictionPolicy - ScaleSetEvictionPolicy to be used to specify eviction policy for Spot virtual machine scale set. Default to Delete. Possible values include: 'Delete', 'Deallocate' + ScaleSetEvictionPolicy ScaleSetEvictionPolicy `json:"scaleSetEvictionPolicy,omitempty"` + // SpotMaxPrice - SpotMaxPrice to be used to specify the maximum price you are willing to pay in US Dollars. Possible values are any decimal value greater than zero or -1 which indicates default price to be up-to on-demand. + SpotMaxPrice *float64 `json:"spotMaxPrice,omitempty"` + // Tags - Agent pool tags to be persisted on the agent pool virtual machine scale set. + Tags map[string]*string `json:"tags"` + // NodeLabels - Agent pool node labels to be persisted across all nodes in agent pool. + NodeLabels map[string]*string `json:"nodeLabels"` + // NodeTaints - Taints added to new nodes during node pool create and scale. For example, key=value:NoSchedule. + NodeTaints *[]string `json:"nodeTaints,omitempty"` +} + +// MarshalJSON is the custom marshaler for ManagedClusterAgentPoolProfileProperties. +func (mcappp ManagedClusterAgentPoolProfileProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mcappp.Count != nil { + objectMap["count"] = mcappp.Count + } + if mcappp.VMSize != "" { + objectMap["vmSize"] = mcappp.VMSize + } + if mcappp.OsDiskSizeGB != nil { + objectMap["osDiskSizeGB"] = mcappp.OsDiskSizeGB + } + if mcappp.VnetSubnetID != nil { + objectMap["vnetSubnetID"] = mcappp.VnetSubnetID + } + if mcappp.MaxPods != nil { + objectMap["maxPods"] = mcappp.MaxPods + } + if mcappp.OsType != "" { + objectMap["osType"] = mcappp.OsType + } + if mcappp.MaxCount != nil { + objectMap["maxCount"] = mcappp.MaxCount + } + if mcappp.MinCount != nil { + objectMap["minCount"] = mcappp.MinCount + } + if mcappp.EnableAutoScaling != nil { + objectMap["enableAutoScaling"] = mcappp.EnableAutoScaling + } + if mcappp.Type != "" { + objectMap["type"] = mcappp.Type + } + if mcappp.Mode != "" { + objectMap["mode"] = mcappp.Mode + } + if mcappp.OrchestratorVersion != nil { + objectMap["orchestratorVersion"] = mcappp.OrchestratorVersion + } + if mcappp.NodeImageVersion != nil { + objectMap["nodeImageVersion"] = mcappp.NodeImageVersion + } + if mcappp.UpgradeSettings != nil { + objectMap["upgradeSettings"] = mcappp.UpgradeSettings + } + if mcappp.AvailabilityZones != nil { + objectMap["availabilityZones"] = mcappp.AvailabilityZones + } + if mcappp.EnableNodePublicIP != nil { + objectMap["enableNodePublicIP"] = mcappp.EnableNodePublicIP + } + if mcappp.ScaleSetPriority != "" { + objectMap["scaleSetPriority"] = mcappp.ScaleSetPriority + } + if mcappp.ScaleSetEvictionPolicy != "" { + objectMap["scaleSetEvictionPolicy"] = mcappp.ScaleSetEvictionPolicy + } + if mcappp.SpotMaxPrice != nil { + objectMap["spotMaxPrice"] = mcappp.SpotMaxPrice + } + if mcappp.Tags != nil { + objectMap["tags"] = mcappp.Tags + } + if mcappp.NodeLabels != nil { + objectMap["nodeLabels"] = mcappp.NodeLabels + } + if mcappp.NodeTaints != nil { + objectMap["nodeTaints"] = mcappp.NodeTaints + } + return json.Marshal(objectMap) +} + +// ManagedClusterAPIServerAccessProfile access profile for managed cluster API server. +type ManagedClusterAPIServerAccessProfile struct { + // AuthorizedIPRanges - Authorized IP Ranges to kubernetes API server. + AuthorizedIPRanges *[]string `json:"authorizedIPRanges,omitempty"` + // EnablePrivateCluster - Whether to create the cluster as a private cluster or not. + EnablePrivateCluster *bool `json:"enablePrivateCluster,omitempty"` +} + +// ManagedClusterIdentity identity for the managed cluster. +type ManagedClusterIdentity struct { + // PrincipalID - READ-ONLY; The principal id of the system assigned identity which is used by master components. + PrincipalID *string `json:"principalId,omitempty"` + // TenantID - READ-ONLY; The tenant id of the system assigned identity which is used by master components. + TenantID *string `json:"tenantId,omitempty"` + // Type - The type of identity used for the managed cluster. Type 'SystemAssigned' will use an implicitly created identity in master components and an auto-created user assigned identity in MC_ resource group in agent nodes. Type 'None' will not use MSI for the managed cluster, service principal will be used instead. Possible values include: 'SystemAssigned', 'None' + Type ResourceIdentityType `json:"type,omitempty"` +} + +// ManagedClusterListResult the response from the List Managed Clusters operation. +type ManagedClusterListResult struct { + autorest.Response `json:"-"` + // Value - The list of managed clusters. + Value *[]ManagedCluster `json:"value,omitempty"` + // NextLink - READ-ONLY; The URL to get the next set of managed cluster results. + NextLink *string `json:"nextLink,omitempty"` +} + +// ManagedClusterListResultIterator provides access to a complete listing of ManagedCluster values. +type ManagedClusterListResultIterator struct { + i int + page ManagedClusterListResultPage +} + +// 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 *ManagedClusterListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClusterListResultIterator.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 *ManagedClusterListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ManagedClusterListResultIterator) 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 ManagedClusterListResultIterator) Response() ManagedClusterListResult { + 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 ManagedClusterListResultIterator) Value() ManagedCluster { + if !iter.page.NotDone() { + return ManagedCluster{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ManagedClusterListResultIterator type. +func NewManagedClusterListResultIterator(page ManagedClusterListResultPage) ManagedClusterListResultIterator { + return ManagedClusterListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (mclr ManagedClusterListResult) IsEmpty() bool { + return mclr.Value == nil || len(*mclr.Value) == 0 +} + +// managedClusterListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (mclr ManagedClusterListResult) managedClusterListResultPreparer(ctx context.Context) (*http.Request, error) { + if mclr.NextLink == nil || len(to.String(mclr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(mclr.NextLink))) +} + +// ManagedClusterListResultPage contains a page of ManagedCluster values. +type ManagedClusterListResultPage struct { + fn func(context.Context, ManagedClusterListResult) (ManagedClusterListResult, error) + mclr ManagedClusterListResult +} + +// 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 *ManagedClusterListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedClusterListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.mclr) + if err != nil { + return err + } + page.mclr = next + 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 *ManagedClusterListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ManagedClusterListResultPage) NotDone() bool { + return !page.mclr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ManagedClusterListResultPage) Response() ManagedClusterListResult { + return page.mclr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ManagedClusterListResultPage) Values() []ManagedCluster { + if page.mclr.IsEmpty() { + return nil + } + return *page.mclr.Value +} + +// Creates a new instance of the ManagedClusterListResultPage type. +func NewManagedClusterListResultPage(getNextPage func(context.Context, ManagedClusterListResult) (ManagedClusterListResult, error)) ManagedClusterListResultPage { + return ManagedClusterListResultPage{fn: getNextPage} +} + +// ManagedClusterLoadBalancerProfile profile of the managed cluster load balancer. +type ManagedClusterLoadBalancerProfile struct { + // ManagedOutboundIPs - Desired managed outbound IPs for the cluster load balancer. + ManagedOutboundIPs *ManagedClusterLoadBalancerProfileManagedOutboundIPs `json:"managedOutboundIPs,omitempty"` + // OutboundIPPrefixes - Desired outbound IP Prefix resources for the cluster load balancer. + OutboundIPPrefixes *ManagedClusterLoadBalancerProfileOutboundIPPrefixes `json:"outboundIPPrefixes,omitempty"` + // OutboundIPs - Desired outbound IP resources for the cluster load balancer. + OutboundIPs *ManagedClusterLoadBalancerProfileOutboundIPs `json:"outboundIPs,omitempty"` + // EffectiveOutboundIPs - The effective outbound IP resources of the cluster load balancer. + EffectiveOutboundIPs *[]ResourceReference `json:"effectiveOutboundIPs,omitempty"` + // AllocatedOutboundPorts - Desired number of allocated SNAT ports per VM. Allowed values must be in the range of 0 to 64000 (inclusive). The default value is 0 which results in Azure dynamically allocating ports. + AllocatedOutboundPorts *int32 `json:"allocatedOutboundPorts,omitempty"` + // IdleTimeoutInMinutes - Desired outbound flow idle timeout in minutes. Allowed values must be in the range of 4 to 120 (inclusive). The default value is 30 minutes. + IdleTimeoutInMinutes *int32 `json:"idleTimeoutInMinutes,omitempty"` +} + +// ManagedClusterLoadBalancerProfileManagedOutboundIPs desired managed outbound IPs for the cluster load +// balancer. +type ManagedClusterLoadBalancerProfileManagedOutboundIPs struct { + // Count - Desired number of outbound IP created/managed by Azure for the cluster load balancer. Allowed values must be in the range of 1 to 100 (inclusive). The default value is 1. + Count *int32 `json:"count,omitempty"` +} + +// ManagedClusterLoadBalancerProfileOutboundIPPrefixes desired outbound IP Prefix resources for the cluster +// load balancer. +type ManagedClusterLoadBalancerProfileOutboundIPPrefixes struct { + // PublicIPPrefixes - A list of public IP prefix resources. + PublicIPPrefixes *[]ResourceReference `json:"publicIPPrefixes,omitempty"` +} + +// ManagedClusterLoadBalancerProfileOutboundIPs desired outbound IP resources for the cluster load +// balancer. +type ManagedClusterLoadBalancerProfileOutboundIPs struct { + // PublicIPs - A list of public IP resources. + PublicIPs *[]ResourceReference `json:"publicIPs,omitempty"` +} + +// ManagedClusterPoolUpgradeProfile the list of available upgrade versions. +type ManagedClusterPoolUpgradeProfile struct { + // KubernetesVersion - Kubernetes version (major, minor, patch). + KubernetesVersion *string `json:"kubernetesVersion,omitempty"` + // Name - Pool name. + Name *string `json:"name,omitempty"` + // OsType - OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: 'Linux', 'Windows' + OsType OSType `json:"osType,omitempty"` + // Upgrades - List of orchestrator types and versions available for upgrade. + Upgrades *[]ManagedClusterPoolUpgradeProfileUpgradesItem `json:"upgrades,omitempty"` +} + +// ManagedClusterPoolUpgradeProfileUpgradesItem ... +type ManagedClusterPoolUpgradeProfileUpgradesItem struct { + // KubernetesVersion - Kubernetes version (major, minor, patch). + KubernetesVersion *string `json:"kubernetesVersion,omitempty"` + // IsPreview - Whether Kubernetes version is currently in preview. + IsPreview *bool `json:"isPreview,omitempty"` +} + +// ManagedClusterProperties properties of the managed cluster. +type ManagedClusterProperties struct { + // ProvisioningState - READ-ONLY; The current deployment or provisioning state, which only appears in the response. + ProvisioningState *string `json:"provisioningState,omitempty"` + // MaxAgentPools - READ-ONLY; The max number of agent pools for the managed cluster. + MaxAgentPools *int32 `json:"maxAgentPools,omitempty"` + // KubernetesVersion - Version of Kubernetes specified when creating the managed cluster. + KubernetesVersion *string `json:"kubernetesVersion,omitempty"` + // DNSPrefix - DNS prefix specified when creating the managed cluster. + DNSPrefix *string `json:"dnsPrefix,omitempty"` + // Fqdn - READ-ONLY; FQDN for the master pool. + Fqdn *string `json:"fqdn,omitempty"` + // PrivateFQDN - READ-ONLY; FQDN of private cluster. + PrivateFQDN *string `json:"privateFQDN,omitempty"` + // AgentPoolProfiles - Properties of the agent pool. + AgentPoolProfiles *[]ManagedClusterAgentPoolProfile `json:"agentPoolProfiles,omitempty"` + // LinuxProfile - Profile for Linux VMs in the container service cluster. + LinuxProfile *LinuxProfile `json:"linuxProfile,omitempty"` + // WindowsProfile - Profile for Windows VMs in the container service cluster. + WindowsProfile *ManagedClusterWindowsProfile `json:"windowsProfile,omitempty"` + // ServicePrincipalProfile - Information about a service principal identity for the cluster to use for manipulating Azure APIs. + ServicePrincipalProfile *ManagedClusterServicePrincipalProfile `json:"servicePrincipalProfile,omitempty"` + // AddonProfiles - Profile of managed cluster add-on. + AddonProfiles map[string]*ManagedClusterAddonProfile `json:"addonProfiles"` + // NodeResourceGroup - Name of the resource group containing agent pool nodes. + NodeResourceGroup *string `json:"nodeResourceGroup,omitempty"` + // EnableRBAC - Whether to enable Kubernetes Role-Based Access Control. + EnableRBAC *bool `json:"enableRBAC,omitempty"` + // EnablePodSecurityPolicy - (PREVIEW) Whether to enable Kubernetes Pod security policy. + EnablePodSecurityPolicy *bool `json:"enablePodSecurityPolicy,omitempty"` + // NetworkProfile - Profile of network configuration. + NetworkProfile *NetworkProfileType `json:"networkProfile,omitempty"` + // AadProfile - Profile of Azure Active Directory configuration. + AadProfile *ManagedClusterAADProfile `json:"aadProfile,omitempty"` + // AutoScalerProfile - Parameters to be applied to the cluster-autoscaler when enabled + AutoScalerProfile *ManagedClusterPropertiesAutoScalerProfile `json:"autoScalerProfile,omitempty"` + // APIServerAccessProfile - Access profile for managed cluster API server. + APIServerAccessProfile *ManagedClusterAPIServerAccessProfile `json:"apiServerAccessProfile,omitempty"` + // DiskEncryptionSetID - ResourceId of the disk encryption set to use for enabling encryption at rest. + DiskEncryptionSetID *string `json:"diskEncryptionSetID,omitempty"` + // IdentityProfile - Identities associated with the cluster. + IdentityProfile map[string]*ManagedClusterPropertiesIdentityProfileValue `json:"identityProfile"` +} + +// MarshalJSON is the custom marshaler for ManagedClusterProperties. +func (mcp ManagedClusterProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mcp.KubernetesVersion != nil { + objectMap["kubernetesVersion"] = mcp.KubernetesVersion + } + if mcp.DNSPrefix != nil { + objectMap["dnsPrefix"] = mcp.DNSPrefix + } + if mcp.AgentPoolProfiles != nil { + objectMap["agentPoolProfiles"] = mcp.AgentPoolProfiles + } + if mcp.LinuxProfile != nil { + objectMap["linuxProfile"] = mcp.LinuxProfile + } + if mcp.WindowsProfile != nil { + objectMap["windowsProfile"] = mcp.WindowsProfile + } + if mcp.ServicePrincipalProfile != nil { + objectMap["servicePrincipalProfile"] = mcp.ServicePrincipalProfile + } + if mcp.AddonProfiles != nil { + objectMap["addonProfiles"] = mcp.AddonProfiles + } + if mcp.NodeResourceGroup != nil { + objectMap["nodeResourceGroup"] = mcp.NodeResourceGroup + } + if mcp.EnableRBAC != nil { + objectMap["enableRBAC"] = mcp.EnableRBAC + } + if mcp.EnablePodSecurityPolicy != nil { + objectMap["enablePodSecurityPolicy"] = mcp.EnablePodSecurityPolicy + } + if mcp.NetworkProfile != nil { + objectMap["networkProfile"] = mcp.NetworkProfile + } + if mcp.AadProfile != nil { + objectMap["aadProfile"] = mcp.AadProfile + } + if mcp.AutoScalerProfile != nil { + objectMap["autoScalerProfile"] = mcp.AutoScalerProfile + } + if mcp.APIServerAccessProfile != nil { + objectMap["apiServerAccessProfile"] = mcp.APIServerAccessProfile + } + if mcp.DiskEncryptionSetID != nil { + objectMap["diskEncryptionSetID"] = mcp.DiskEncryptionSetID + } + if mcp.IdentityProfile != nil { + objectMap["identityProfile"] = mcp.IdentityProfile + } + return json.Marshal(objectMap) +} + +// ManagedClusterPropertiesAutoScalerProfile parameters to be applied to the cluster-autoscaler when +// enabled +type ManagedClusterPropertiesAutoScalerProfile struct { + BalanceSimilarNodeGroups *string `json:"balance-similar-node-groups,omitempty"` + ScanInterval *string `json:"scan-interval,omitempty"` + ScaleDownDelayAfterAdd *string `json:"scale-down-delay-after-add,omitempty"` + ScaleDownDelayAfterDelete *string `json:"scale-down-delay-after-delete,omitempty"` + ScaleDownDelayAfterFailure *string `json:"scale-down-delay-after-failure,omitempty"` + ScaleDownUnneededTime *string `json:"scale-down-unneeded-time,omitempty"` + ScaleDownUnreadyTime *string `json:"scale-down-unready-time,omitempty"` + ScaleDownUtilizationThreshold *string `json:"scale-down-utilization-threshold,omitempty"` + MaxGracefulTerminationSec *string `json:"max-graceful-termination-sec,omitempty"` +} + +// ManagedClusterPropertiesIdentityProfileValue ... +type ManagedClusterPropertiesIdentityProfileValue struct { + // ResourceID - The resource id of the user assigned identity. + ResourceID *string `json:"resourceId,omitempty"` + // ClientID - The client id of the user assigned identity. + ClientID *string `json:"clientId,omitempty"` + // ObjectID - The object id of the user assigned identity. + ObjectID *string `json:"objectId,omitempty"` +} + +// ManagedClustersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ManagedClustersCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ManagedClustersCreateOrUpdateFuture) Result(client ManagedClustersClient) (mc ManagedCluster, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerservice.ManagedClustersCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mc.Response.Response, err = future.GetResult(sender); err == nil && mc.Response.Response.StatusCode != http.StatusNoContent { + mc, err = client.CreateOrUpdateResponder(mc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersCreateOrUpdateFuture", "Result", mc.Response.Response, "Failure responding to request") + } + } + return +} + +// ManagedClustersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ManagedClustersDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ManagedClustersDeleteFuture) Result(client ManagedClustersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerservice.ManagedClustersDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ManagedClusterServicePrincipalProfile information about a service principal identity for the cluster to +// use for manipulating Azure APIs. +type ManagedClusterServicePrincipalProfile struct { + // ClientID - The ID for the service principal. + ClientID *string `json:"clientId,omitempty"` + // Secret - The secret password associated with the service principal in plain text. + Secret *string `json:"secret,omitempty"` +} + +// ManagedClusterSKU ... +type ManagedClusterSKU struct { + // Name - Name of a managed cluster SKU. Possible values include: 'ManagedClusterSKUNameBasic' + Name ManagedClusterSKUName `json:"name,omitempty"` + // Tier - Tier of a managed cluster SKU. Possible values include: 'Paid', 'Free' + Tier ManagedClusterSKUTier `json:"tier,omitempty"` +} + +// ManagedClustersResetAADProfileFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ManagedClustersResetAADProfileFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ManagedClustersResetAADProfileFuture) Result(client ManagedClustersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersResetAADProfileFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerservice.ManagedClustersResetAADProfileFuture") + return + } + ar.Response = future.Response() + return +} + +// ManagedClustersResetServicePrincipalProfileFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type ManagedClustersResetServicePrincipalProfileFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ManagedClustersResetServicePrincipalProfileFuture) Result(client ManagedClustersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersResetServicePrincipalProfileFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerservice.ManagedClustersResetServicePrincipalProfileFuture") + return + } + ar.Response = future.Response() + return +} + +// ManagedClustersRotateClusterCertificatesFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type ManagedClustersRotateClusterCertificatesFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ManagedClustersRotateClusterCertificatesFuture) Result(client ManagedClustersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersRotateClusterCertificatesFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerservice.ManagedClustersRotateClusterCertificatesFuture") + return + } + ar.Response = future.Response() + return +} + +// ManagedClustersUpdateTagsFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ManagedClustersUpdateTagsFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ManagedClustersUpdateTagsFuture) Result(client ManagedClustersClient) (mc ManagedCluster, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersUpdateTagsFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerservice.ManagedClustersUpdateTagsFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mc.Response.Response, err = future.GetResult(sender); err == nil && mc.Response.Response.StatusCode != http.StatusNoContent { + mc, err = client.UpdateTagsResponder(mc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.ManagedClustersUpdateTagsFuture", "Result", mc.Response.Response, "Failure responding to request") + } + } + return +} + +// ManagedClusterUpgradeProfile the list of available upgrades for compute pools. +type ManagedClusterUpgradeProfile struct { + autorest.Response `json:"-"` + // ID - READ-ONLY; Id of upgrade profile. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Name of upgrade profile. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of upgrade profile. + Type *string `json:"type,omitempty"` + // ManagedClusterUpgradeProfileProperties - Properties of upgrade profile. + *ManagedClusterUpgradeProfileProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ManagedClusterUpgradeProfile. +func (mcup ManagedClusterUpgradeProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mcup.ManagedClusterUpgradeProfileProperties != nil { + objectMap["properties"] = mcup.ManagedClusterUpgradeProfileProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ManagedClusterUpgradeProfile struct. +func (mcup *ManagedClusterUpgradeProfile) 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 "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + mcup.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mcup.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mcup.Type = &typeVar + } + case "properties": + if v != nil { + var managedClusterUpgradeProfileProperties ManagedClusterUpgradeProfileProperties + err = json.Unmarshal(*v, &managedClusterUpgradeProfileProperties) + if err != nil { + return err + } + mcup.ManagedClusterUpgradeProfileProperties = &managedClusterUpgradeProfileProperties + } + } + } + + return nil +} + +// ManagedClusterUpgradeProfileProperties control plane and agent pool upgrade profiles. +type ManagedClusterUpgradeProfileProperties struct { + // ControlPlaneProfile - The list of available upgrade versions for the control plane. + ControlPlaneProfile *ManagedClusterPoolUpgradeProfile `json:"controlPlaneProfile,omitempty"` + // AgentPoolProfiles - The list of available upgrade versions for agent pools. + AgentPoolProfiles *[]ManagedClusterPoolUpgradeProfile `json:"agentPoolProfiles,omitempty"` +} + +// ManagedClusterWindowsProfile profile for Windows VMs in the container service cluster. +type ManagedClusterWindowsProfile struct { + // AdminUsername - The administrator username to use for Windows VMs. + AdminUsername *string `json:"adminUsername,omitempty"` + // AdminPassword - The administrator password to use for Windows VMs. + AdminPassword *string `json:"adminPassword,omitempty"` +} + +// MasterProfile profile for the container service master. +type MasterProfile struct { + // Count - Number of masters (VMs) in the container service cluster. Allowed values are 1, 3, and 5. The default value is 1. + Count *int32 `json:"count,omitempty"` + // DNSPrefix - DNS prefix to be used to create the FQDN for the master pool. + DNSPrefix *string `json:"dnsPrefix,omitempty"` + // VMSize - Size of agent VMs. Possible values include: 'VMSizeTypesStandardA1', 'VMSizeTypesStandardA10', 'VMSizeTypesStandardA11', 'VMSizeTypesStandardA1V2', 'VMSizeTypesStandardA2', 'VMSizeTypesStandardA2V2', 'VMSizeTypesStandardA2mV2', 'VMSizeTypesStandardA3', 'VMSizeTypesStandardA4', 'VMSizeTypesStandardA4V2', 'VMSizeTypesStandardA4mV2', 'VMSizeTypesStandardA5', 'VMSizeTypesStandardA6', 'VMSizeTypesStandardA7', 'VMSizeTypesStandardA8', 'VMSizeTypesStandardA8V2', 'VMSizeTypesStandardA8mV2', 'VMSizeTypesStandardA9', 'VMSizeTypesStandardB2ms', 'VMSizeTypesStandardB2s', 'VMSizeTypesStandardB4ms', 'VMSizeTypesStandardB8ms', 'VMSizeTypesStandardD1', 'VMSizeTypesStandardD11', 'VMSizeTypesStandardD11V2', 'VMSizeTypesStandardD11V2Promo', 'VMSizeTypesStandardD12', 'VMSizeTypesStandardD12V2', 'VMSizeTypesStandardD12V2Promo', 'VMSizeTypesStandardD13', 'VMSizeTypesStandardD13V2', 'VMSizeTypesStandardD13V2Promo', 'VMSizeTypesStandardD14', 'VMSizeTypesStandardD14V2', 'VMSizeTypesStandardD14V2Promo', 'VMSizeTypesStandardD15V2', 'VMSizeTypesStandardD16V3', 'VMSizeTypesStandardD16sV3', 'VMSizeTypesStandardD1V2', 'VMSizeTypesStandardD2', 'VMSizeTypesStandardD2V2', 'VMSizeTypesStandardD2V2Promo', 'VMSizeTypesStandardD2V3', 'VMSizeTypesStandardD2sV3', 'VMSizeTypesStandardD3', 'VMSizeTypesStandardD32V3', 'VMSizeTypesStandardD32sV3', 'VMSizeTypesStandardD3V2', 'VMSizeTypesStandardD3V2Promo', 'VMSizeTypesStandardD4', 'VMSizeTypesStandardD4V2', 'VMSizeTypesStandardD4V2Promo', 'VMSizeTypesStandardD4V3', 'VMSizeTypesStandardD4sV3', 'VMSizeTypesStandardD5V2', 'VMSizeTypesStandardD5V2Promo', 'VMSizeTypesStandardD64V3', 'VMSizeTypesStandardD64sV3', 'VMSizeTypesStandardD8V3', 'VMSizeTypesStandardD8sV3', 'VMSizeTypesStandardDS1', 'VMSizeTypesStandardDS11', 'VMSizeTypesStandardDS11V2', 'VMSizeTypesStandardDS11V2Promo', 'VMSizeTypesStandardDS12', 'VMSizeTypesStandardDS12V2', 'VMSizeTypesStandardDS12V2Promo', 'VMSizeTypesStandardDS13', 'VMSizeTypesStandardDS132V2', 'VMSizeTypesStandardDS134V2', 'VMSizeTypesStandardDS13V2', 'VMSizeTypesStandardDS13V2Promo', 'VMSizeTypesStandardDS14', 'VMSizeTypesStandardDS144V2', 'VMSizeTypesStandardDS148V2', 'VMSizeTypesStandardDS14V2', 'VMSizeTypesStandardDS14V2Promo', 'VMSizeTypesStandardDS15V2', 'VMSizeTypesStandardDS1V2', 'VMSizeTypesStandardDS2', 'VMSizeTypesStandardDS2V2', 'VMSizeTypesStandardDS2V2Promo', 'VMSizeTypesStandardDS3', 'VMSizeTypesStandardDS3V2', 'VMSizeTypesStandardDS3V2Promo', 'VMSizeTypesStandardDS4', 'VMSizeTypesStandardDS4V2', 'VMSizeTypesStandardDS4V2Promo', 'VMSizeTypesStandardDS5V2', 'VMSizeTypesStandardDS5V2Promo', 'VMSizeTypesStandardE16V3', 'VMSizeTypesStandardE16sV3', 'VMSizeTypesStandardE2V3', 'VMSizeTypesStandardE2sV3', 'VMSizeTypesStandardE3216sV3', 'VMSizeTypesStandardE328sV3', 'VMSizeTypesStandardE32V3', 'VMSizeTypesStandardE32sV3', 'VMSizeTypesStandardE4V3', 'VMSizeTypesStandardE4sV3', 'VMSizeTypesStandardE6416sV3', 'VMSizeTypesStandardE6432sV3', 'VMSizeTypesStandardE64V3', 'VMSizeTypesStandardE64sV3', 'VMSizeTypesStandardE8V3', 'VMSizeTypesStandardE8sV3', 'VMSizeTypesStandardF1', 'VMSizeTypesStandardF16', 'VMSizeTypesStandardF16s', 'VMSizeTypesStandardF16sV2', 'VMSizeTypesStandardF1s', 'VMSizeTypesStandardF2', 'VMSizeTypesStandardF2s', 'VMSizeTypesStandardF2sV2', 'VMSizeTypesStandardF32sV2', 'VMSizeTypesStandardF4', 'VMSizeTypesStandardF4s', 'VMSizeTypesStandardF4sV2', 'VMSizeTypesStandardF64sV2', 'VMSizeTypesStandardF72sV2', 'VMSizeTypesStandardF8', 'VMSizeTypesStandardF8s', 'VMSizeTypesStandardF8sV2', 'VMSizeTypesStandardG1', 'VMSizeTypesStandardG2', 'VMSizeTypesStandardG3', 'VMSizeTypesStandardG4', 'VMSizeTypesStandardG5', 'VMSizeTypesStandardGS1', 'VMSizeTypesStandardGS2', 'VMSizeTypesStandardGS3', 'VMSizeTypesStandardGS4', 'VMSizeTypesStandardGS44', 'VMSizeTypesStandardGS48', 'VMSizeTypesStandardGS5', 'VMSizeTypesStandardGS516', 'VMSizeTypesStandardGS58', 'VMSizeTypesStandardH16', 'VMSizeTypesStandardH16m', 'VMSizeTypesStandardH16mr', 'VMSizeTypesStandardH16r', 'VMSizeTypesStandardH8', 'VMSizeTypesStandardH8m', 'VMSizeTypesStandardL16s', 'VMSizeTypesStandardL32s', 'VMSizeTypesStandardL4s', 'VMSizeTypesStandardL8s', 'VMSizeTypesStandardM12832ms', 'VMSizeTypesStandardM12864ms', 'VMSizeTypesStandardM128ms', 'VMSizeTypesStandardM128s', 'VMSizeTypesStandardM6416ms', 'VMSizeTypesStandardM6432ms', 'VMSizeTypesStandardM64ms', 'VMSizeTypesStandardM64s', 'VMSizeTypesStandardNC12', 'VMSizeTypesStandardNC12sV2', 'VMSizeTypesStandardNC12sV3', 'VMSizeTypesStandardNC24', 'VMSizeTypesStandardNC24r', 'VMSizeTypesStandardNC24rsV2', 'VMSizeTypesStandardNC24rsV3', 'VMSizeTypesStandardNC24sV2', 'VMSizeTypesStandardNC24sV3', 'VMSizeTypesStandardNC6', 'VMSizeTypesStandardNC6sV2', 'VMSizeTypesStandardNC6sV3', 'VMSizeTypesStandardND12s', 'VMSizeTypesStandardND24rs', 'VMSizeTypesStandardND24s', 'VMSizeTypesStandardND6s', 'VMSizeTypesStandardNV12', 'VMSizeTypesStandardNV24', 'VMSizeTypesStandardNV6' + VMSize VMSizeTypes `json:"vmSize,omitempty"` + // OsDiskSizeGB - OS Disk Size in GB to be used to specify the disk size for every machine in this master/agent pool. If you specify 0, it will apply the default osDisk size according to the vmSize specified. + OsDiskSizeGB *int32 `json:"osDiskSizeGB,omitempty"` + // VnetSubnetID - VNet SubnetID specifies the VNet's subnet identifier. + VnetSubnetID *string `json:"vnetSubnetID,omitempty"` + // FirstConsecutiveStaticIP - FirstConsecutiveStaticIP used to specify the first static ip of masters. + FirstConsecutiveStaticIP *string `json:"firstConsecutiveStaticIP,omitempty"` + // StorageProfile - Storage profile specifies what kind of storage used. Choose from StorageAccount and ManagedDisks. Leave it empty, we will choose for you based on the orchestrator choice. Possible values include: 'StorageAccount', 'ManagedDisks' + StorageProfile StorageProfileTypes `json:"storageProfile,omitempty"` + // Fqdn - READ-ONLY; FQDN for the master pool. + Fqdn *string `json:"fqdn,omitempty"` +} + +// NetworkProfile represents the OpenShift networking configuration +type NetworkProfile struct { + // VnetCidr - CIDR for the OpenShift Vnet. + VnetCidr *string `json:"vnetCidr,omitempty"` + // PeerVnetID - CIDR of the Vnet to peer. + PeerVnetID *string `json:"peerVnetId,omitempty"` + // VnetID - ID of the Vnet created for OSA cluster. + VnetID *string `json:"vnetId,omitempty"` +} + +// NetworkProfileType profile of network configuration. +type NetworkProfileType struct { + // NetworkPlugin - Network plugin used for building Kubernetes network. Possible values include: 'Azure', 'Kubenet' + NetworkPlugin NetworkPlugin `json:"networkPlugin,omitempty"` + // NetworkPolicy - Network policy used for building Kubernetes network. Possible values include: 'NetworkPolicyCalico', 'NetworkPolicyAzure' + NetworkPolicy NetworkPolicy `json:"networkPolicy,omitempty"` + // NetworkMode - Network mode used for building Kubernetes network. Possible values include: 'Transparent', 'Bridge' + NetworkMode NetworkMode `json:"networkMode,omitempty"` + // PodCidr - A CIDR notation IP range from which to assign pod IPs when kubenet is used. + PodCidr *string `json:"podCidr,omitempty"` + // ServiceCidr - A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP ranges. + ServiceCidr *string `json:"serviceCidr,omitempty"` + // DNSServiceIP - An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified in serviceCidr. + DNSServiceIP *string `json:"dnsServiceIP,omitempty"` + // DockerBridgeCidr - A CIDR notation IP range assigned to the Docker bridge network. It must not overlap with any Subnet IP ranges or the Kubernetes service address range. + DockerBridgeCidr *string `json:"dockerBridgeCidr,omitempty"` + // OutboundType - The outbound (egress) routing method. Possible values include: 'LoadBalancer', 'UserDefinedRouting' + OutboundType OutboundType `json:"outboundType,omitempty"` + // LoadBalancerSku - The load balancer sku for the managed cluster. Possible values include: 'Standard', 'Basic' + LoadBalancerSku LoadBalancerSku `json:"loadBalancerSku,omitempty"` + // LoadBalancerProfile - Profile of the cluster load balancer. + LoadBalancerProfile *ManagedClusterLoadBalancerProfile `json:"loadBalancerProfile,omitempty"` +} + +// OpenShiftManagedCluster openShift Managed cluster. +type OpenShiftManagedCluster struct { + autorest.Response `json:"-"` + // Plan - Define the resource plan as required by ARM for billing purposes + Plan *PurchasePlan `json:"plan,omitempty"` + // OpenShiftManagedClusterProperties - Properties of a OpenShift managed cluster. + *OpenShiftManagedClusterProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Location - Resource location + Location *string `json:"location,omitempty"` + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for OpenShiftManagedCluster. +func (osmc OpenShiftManagedCluster) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if osmc.Plan != nil { + objectMap["plan"] = osmc.Plan + } + if osmc.OpenShiftManagedClusterProperties != nil { + objectMap["properties"] = osmc.OpenShiftManagedClusterProperties + } + if osmc.Location != nil { + objectMap["location"] = osmc.Location + } + if osmc.Tags != nil { + objectMap["tags"] = osmc.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for OpenShiftManagedCluster struct. +func (osmc *OpenShiftManagedCluster) 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 "plan": + if v != nil { + var plan PurchasePlan + err = json.Unmarshal(*v, &plan) + if err != nil { + return err + } + osmc.Plan = &plan + } + case "properties": + if v != nil { + var openShiftManagedClusterProperties OpenShiftManagedClusterProperties + err = json.Unmarshal(*v, &openShiftManagedClusterProperties) + if err != nil { + return err + } + osmc.OpenShiftManagedClusterProperties = &openShiftManagedClusterProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + osmc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + osmc.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + osmc.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + osmc.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + osmc.Tags = tags + } + } + } + + return nil +} + +// OpenShiftManagedClusterAADIdentityProvider defines the Identity provider for MS AAD. +type OpenShiftManagedClusterAADIdentityProvider struct { + // ClientID - The clientId password associated with the provider. + ClientID *string `json:"clientId,omitempty"` + // Secret - The secret password associated with the provider. + Secret *string `json:"secret,omitempty"` + // TenantID - The tenantId associated with the provider. + TenantID *string `json:"tenantId,omitempty"` + // CustomerAdminGroupID - The groupId to be granted cluster admin role. + CustomerAdminGroupID *string `json:"customerAdminGroupId,omitempty"` + // Kind - Possible values include: 'KindOpenShiftManagedClusterBaseIdentityProvider', 'KindAADIdentityProvider' + Kind Kind `json:"kind,omitempty"` +} + +// MarshalJSON is the custom marshaler for OpenShiftManagedClusterAADIdentityProvider. +func (osmcaip OpenShiftManagedClusterAADIdentityProvider) MarshalJSON() ([]byte, error) { + osmcaip.Kind = KindAADIdentityProvider + objectMap := make(map[string]interface{}) + if osmcaip.ClientID != nil { + objectMap["clientId"] = osmcaip.ClientID + } + if osmcaip.Secret != nil { + objectMap["secret"] = osmcaip.Secret + } + if osmcaip.TenantID != nil { + objectMap["tenantId"] = osmcaip.TenantID + } + if osmcaip.CustomerAdminGroupID != nil { + objectMap["customerAdminGroupId"] = osmcaip.CustomerAdminGroupID + } + if osmcaip.Kind != "" { + objectMap["kind"] = osmcaip.Kind + } + return json.Marshal(objectMap) +} + +// AsOpenShiftManagedClusterAADIdentityProvider is the BasicOpenShiftManagedClusterBaseIdentityProvider implementation for OpenShiftManagedClusterAADIdentityProvider. +func (osmcaip OpenShiftManagedClusterAADIdentityProvider) AsOpenShiftManagedClusterAADIdentityProvider() (*OpenShiftManagedClusterAADIdentityProvider, bool) { + return &osmcaip, true +} + +// AsOpenShiftManagedClusterBaseIdentityProvider is the BasicOpenShiftManagedClusterBaseIdentityProvider implementation for OpenShiftManagedClusterAADIdentityProvider. +func (osmcaip OpenShiftManagedClusterAADIdentityProvider) AsOpenShiftManagedClusterBaseIdentityProvider() (*OpenShiftManagedClusterBaseIdentityProvider, bool) { + return nil, false +} + +// AsBasicOpenShiftManagedClusterBaseIdentityProvider is the BasicOpenShiftManagedClusterBaseIdentityProvider implementation for OpenShiftManagedClusterAADIdentityProvider. +func (osmcaip OpenShiftManagedClusterAADIdentityProvider) AsBasicOpenShiftManagedClusterBaseIdentityProvider() (BasicOpenShiftManagedClusterBaseIdentityProvider, bool) { + return &osmcaip, true +} + +// OpenShiftManagedClusterAgentPoolProfile defines the configuration of the OpenShift cluster VMs. +type OpenShiftManagedClusterAgentPoolProfile struct { + // Name - Unique name of the pool profile in the context of the subscription and resource group. + Name *string `json:"name,omitempty"` + // Count - Number of agents (VMs) to host docker containers. + Count *int32 `json:"count,omitempty"` + // VMSize - Size of agent VMs. Possible values include: 'StandardD2sV3', 'StandardD4sV3', 'StandardD8sV3', 'StandardD16sV3', 'StandardD32sV3', 'StandardD64sV3', 'StandardDS4V2', 'StandardDS5V2', 'StandardF8sV2', 'StandardF16sV2', 'StandardF32sV2', 'StandardF64sV2', 'StandardF72sV2', 'StandardF8s', 'StandardF16s', 'StandardE4sV3', 'StandardE8sV3', 'StandardE16sV3', 'StandardE20sV3', 'StandardE32sV3', 'StandardE64sV3', 'StandardGS2', 'StandardGS3', 'StandardGS4', 'StandardGS5', 'StandardDS12V2', 'StandardDS13V2', 'StandardDS14V2', 'StandardDS15V2', 'StandardL4s', 'StandardL8s', 'StandardL16s', 'StandardL32s' + VMSize OpenShiftContainerServiceVMSize `json:"vmSize,omitempty"` + // SubnetCidr - Subnet CIDR for the peering. + SubnetCidr *string `json:"subnetCidr,omitempty"` + // OsType - OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: 'Linux', 'Windows' + OsType OSType `json:"osType,omitempty"` + // Role - Define the role of the AgentPoolProfile. Possible values include: 'Compute', 'Infra' + Role OpenShiftAgentPoolProfileRole `json:"role,omitempty"` +} + +// OpenShiftManagedClusterAuthProfile defines all possible authentication profiles for the OpenShift +// cluster. +type OpenShiftManagedClusterAuthProfile struct { + // IdentityProviders - Type of authentication profile to use. + IdentityProviders *[]OpenShiftManagedClusterIdentityProvider `json:"identityProviders,omitempty"` +} + +// BasicOpenShiftManagedClusterBaseIdentityProvider structure for any Identity provider. +type BasicOpenShiftManagedClusterBaseIdentityProvider interface { + AsOpenShiftManagedClusterAADIdentityProvider() (*OpenShiftManagedClusterAADIdentityProvider, bool) + AsOpenShiftManagedClusterBaseIdentityProvider() (*OpenShiftManagedClusterBaseIdentityProvider, bool) +} + +// OpenShiftManagedClusterBaseIdentityProvider structure for any Identity provider. +type OpenShiftManagedClusterBaseIdentityProvider struct { + // Kind - Possible values include: 'KindOpenShiftManagedClusterBaseIdentityProvider', 'KindAADIdentityProvider' + Kind Kind `json:"kind,omitempty"` +} + +func unmarshalBasicOpenShiftManagedClusterBaseIdentityProvider(body []byte) (BasicOpenShiftManagedClusterBaseIdentityProvider, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["kind"] { + case string(KindAADIdentityProvider): + var osmcaip OpenShiftManagedClusterAADIdentityProvider + err := json.Unmarshal(body, &osmcaip) + return osmcaip, err + default: + var osmcbip OpenShiftManagedClusterBaseIdentityProvider + err := json.Unmarshal(body, &osmcbip) + return osmcbip, err + } +} +func unmarshalBasicOpenShiftManagedClusterBaseIdentityProviderArray(body []byte) ([]BasicOpenShiftManagedClusterBaseIdentityProvider, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + osmcbipArray := make([]BasicOpenShiftManagedClusterBaseIdentityProvider, len(rawMessages)) + + for index, rawMessage := range rawMessages { + osmcbip, err := unmarshalBasicOpenShiftManagedClusterBaseIdentityProvider(*rawMessage) + if err != nil { + return nil, err + } + osmcbipArray[index] = osmcbip + } + return osmcbipArray, nil +} + +// MarshalJSON is the custom marshaler for OpenShiftManagedClusterBaseIdentityProvider. +func (osmcbip OpenShiftManagedClusterBaseIdentityProvider) MarshalJSON() ([]byte, error) { + osmcbip.Kind = KindOpenShiftManagedClusterBaseIdentityProvider + objectMap := make(map[string]interface{}) + if osmcbip.Kind != "" { + objectMap["kind"] = osmcbip.Kind + } + return json.Marshal(objectMap) +} + +// AsOpenShiftManagedClusterAADIdentityProvider is the BasicOpenShiftManagedClusterBaseIdentityProvider implementation for OpenShiftManagedClusterBaseIdentityProvider. +func (osmcbip OpenShiftManagedClusterBaseIdentityProvider) AsOpenShiftManagedClusterAADIdentityProvider() (*OpenShiftManagedClusterAADIdentityProvider, bool) { + return nil, false +} + +// AsOpenShiftManagedClusterBaseIdentityProvider is the BasicOpenShiftManagedClusterBaseIdentityProvider implementation for OpenShiftManagedClusterBaseIdentityProvider. +func (osmcbip OpenShiftManagedClusterBaseIdentityProvider) AsOpenShiftManagedClusterBaseIdentityProvider() (*OpenShiftManagedClusterBaseIdentityProvider, bool) { + return &osmcbip, true +} + +// AsBasicOpenShiftManagedClusterBaseIdentityProvider is the BasicOpenShiftManagedClusterBaseIdentityProvider implementation for OpenShiftManagedClusterBaseIdentityProvider. +func (osmcbip OpenShiftManagedClusterBaseIdentityProvider) AsBasicOpenShiftManagedClusterBaseIdentityProvider() (BasicOpenShiftManagedClusterBaseIdentityProvider, bool) { + return &osmcbip, true +} + +// OpenShiftManagedClusterIdentityProvider defines the configuration of the identity providers to be used +// in the OpenShift cluster. +type OpenShiftManagedClusterIdentityProvider struct { + // Name - Name of the provider. + Name *string `json:"name,omitempty"` + // Provider - Configuration of the provider. + Provider BasicOpenShiftManagedClusterBaseIdentityProvider `json:"provider,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for OpenShiftManagedClusterIdentityProvider struct. +func (osmcip *OpenShiftManagedClusterIdentityProvider) 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 + } + osmcip.Name = &name + } + case "provider": + if v != nil { + provider, err := unmarshalBasicOpenShiftManagedClusterBaseIdentityProvider(*v) + if err != nil { + return err + } + osmcip.Provider = provider + } + } + } + + return nil +} + +// OpenShiftManagedClusterListResult the response from the List OpenShift Managed Clusters operation. +type OpenShiftManagedClusterListResult struct { + autorest.Response `json:"-"` + // Value - The list of OpenShift managed clusters. + Value *[]OpenShiftManagedCluster `json:"value,omitempty"` + // NextLink - READ-ONLY; The URL to get the next set of OpenShift managed cluster results. + NextLink *string `json:"nextLink,omitempty"` +} + +// OpenShiftManagedClusterListResultIterator provides access to a complete listing of +// OpenShiftManagedCluster values. +type OpenShiftManagedClusterListResultIterator struct { + i int + page OpenShiftManagedClusterListResultPage +} + +// 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 *OpenShiftManagedClusterListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OpenShiftManagedClusterListResultIterator.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 *OpenShiftManagedClusterListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter OpenShiftManagedClusterListResultIterator) 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 OpenShiftManagedClusterListResultIterator) Response() OpenShiftManagedClusterListResult { + 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 OpenShiftManagedClusterListResultIterator) Value() OpenShiftManagedCluster { + if !iter.page.NotDone() { + return OpenShiftManagedCluster{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the OpenShiftManagedClusterListResultIterator type. +func NewOpenShiftManagedClusterListResultIterator(page OpenShiftManagedClusterListResultPage) OpenShiftManagedClusterListResultIterator { + return OpenShiftManagedClusterListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (osmclr OpenShiftManagedClusterListResult) IsEmpty() bool { + return osmclr.Value == nil || len(*osmclr.Value) == 0 +} + +// openShiftManagedClusterListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (osmclr OpenShiftManagedClusterListResult) openShiftManagedClusterListResultPreparer(ctx context.Context) (*http.Request, error) { + if osmclr.NextLink == nil || len(to.String(osmclr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(osmclr.NextLink))) +} + +// OpenShiftManagedClusterListResultPage contains a page of OpenShiftManagedCluster values. +type OpenShiftManagedClusterListResultPage struct { + fn func(context.Context, OpenShiftManagedClusterListResult) (OpenShiftManagedClusterListResult, error) + osmclr OpenShiftManagedClusterListResult +} + +// 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 *OpenShiftManagedClusterListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OpenShiftManagedClusterListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.osmclr) + if err != nil { + return err + } + page.osmclr = next + 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 *OpenShiftManagedClusterListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page OpenShiftManagedClusterListResultPage) NotDone() bool { + return !page.osmclr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page OpenShiftManagedClusterListResultPage) Response() OpenShiftManagedClusterListResult { + return page.osmclr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page OpenShiftManagedClusterListResultPage) Values() []OpenShiftManagedCluster { + if page.osmclr.IsEmpty() { + return nil + } + return *page.osmclr.Value +} + +// Creates a new instance of the OpenShiftManagedClusterListResultPage type. +func NewOpenShiftManagedClusterListResultPage(getNextPage func(context.Context, OpenShiftManagedClusterListResult) (OpenShiftManagedClusterListResult, error)) OpenShiftManagedClusterListResultPage { + return OpenShiftManagedClusterListResultPage{fn: getNextPage} +} + +// OpenShiftManagedClusterMasterPoolProfile openShiftManagedClusterMaterPoolProfile contains configuration +// for OpenShift master VMs. +type OpenShiftManagedClusterMasterPoolProfile struct { + // Name - Unique name of the master pool profile in the context of the subscription and resource group. + Name *string `json:"name,omitempty"` + // Count - Number of masters (VMs) to host docker containers. The default value is 3. + Count *int32 `json:"count,omitempty"` + // VMSize - Size of agent VMs. Possible values include: 'StandardD2sV3', 'StandardD4sV3', 'StandardD8sV3', 'StandardD16sV3', 'StandardD32sV3', 'StandardD64sV3', 'StandardDS4V2', 'StandardDS5V2', 'StandardF8sV2', 'StandardF16sV2', 'StandardF32sV2', 'StandardF64sV2', 'StandardF72sV2', 'StandardF8s', 'StandardF16s', 'StandardE4sV3', 'StandardE8sV3', 'StandardE16sV3', 'StandardE20sV3', 'StandardE32sV3', 'StandardE64sV3', 'StandardGS2', 'StandardGS3', 'StandardGS4', 'StandardGS5', 'StandardDS12V2', 'StandardDS13V2', 'StandardDS14V2', 'StandardDS15V2', 'StandardL4s', 'StandardL8s', 'StandardL16s', 'StandardL32s' + VMSize OpenShiftContainerServiceVMSize `json:"vmSize,omitempty"` + // SubnetCidr - Subnet CIDR for the peering. + SubnetCidr *string `json:"subnetCidr,omitempty"` + // OsType - OsType to be used to specify os type. Choose from Linux and Windows. Default to Linux. Possible values include: 'Linux', 'Windows' + OsType OSType `json:"osType,omitempty"` +} + +// OpenShiftManagedClusterProperties properties of the OpenShift managed cluster. +type OpenShiftManagedClusterProperties struct { + // ProvisioningState - READ-ONLY; The current deployment or provisioning state, which only appears in the response. + ProvisioningState *string `json:"provisioningState,omitempty"` + // OpenShiftVersion - Version of OpenShift specified when creating the cluster. + OpenShiftVersion *string `json:"openShiftVersion,omitempty"` + // ClusterVersion - READ-ONLY; Version of OpenShift specified when creating the cluster. + ClusterVersion *string `json:"clusterVersion,omitempty"` + // PublicHostname - READ-ONLY; Service generated FQDN for OpenShift API server. + PublicHostname *string `json:"publicHostname,omitempty"` + // Fqdn - READ-ONLY; Service generated FQDN for OpenShift API server loadbalancer internal hostname. + Fqdn *string `json:"fqdn,omitempty"` + // NetworkProfile - Configuration for OpenShift networking. + NetworkProfile *NetworkProfile `json:"networkProfile,omitempty"` + // RouterProfiles - Configuration for OpenShift router(s). + RouterProfiles *[]OpenShiftRouterProfile `json:"routerProfiles,omitempty"` + // MasterPoolProfile - Configuration for OpenShift master VMs. + MasterPoolProfile *OpenShiftManagedClusterMasterPoolProfile `json:"masterPoolProfile,omitempty"` + // AgentPoolProfiles - Configuration of OpenShift cluster VMs. + AgentPoolProfiles *[]OpenShiftManagedClusterAgentPoolProfile `json:"agentPoolProfiles,omitempty"` + // AuthProfile - Configures OpenShift authentication. + AuthProfile *OpenShiftManagedClusterAuthProfile `json:"authProfile,omitempty"` +} + +// OpenShiftManagedClustersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type OpenShiftManagedClustersCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *OpenShiftManagedClustersCreateOrUpdateFuture) Result(client OpenShiftManagedClustersClient) (osmc OpenShiftManagedCluster, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerservice.OpenShiftManagedClustersCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if osmc.Response.Response, err = future.GetResult(sender); err == nil && osmc.Response.Response.StatusCode != http.StatusNoContent { + osmc, err = client.CreateOrUpdateResponder(osmc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersCreateOrUpdateFuture", "Result", osmc.Response.Response, "Failure responding to request") + } + } + return +} + +// OpenShiftManagedClustersDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type OpenShiftManagedClustersDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *OpenShiftManagedClustersDeleteFuture) Result(client OpenShiftManagedClustersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerservice.OpenShiftManagedClustersDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// OpenShiftManagedClustersUpdateTagsFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type OpenShiftManagedClustersUpdateTagsFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *OpenShiftManagedClustersUpdateTagsFuture) Result(client OpenShiftManagedClustersClient) (osmc OpenShiftManagedCluster, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersUpdateTagsFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerservice.OpenShiftManagedClustersUpdateTagsFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if osmc.Response.Response, err = future.GetResult(sender); err == nil && osmc.Response.Response.StatusCode != http.StatusNoContent { + osmc, err = client.UpdateTagsResponder(osmc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersUpdateTagsFuture", "Result", osmc.Response.Response, "Failure responding to request") + } + } + return +} + +// OpenShiftRouterProfile represents an OpenShift router +type OpenShiftRouterProfile struct { + // Name - Name of the router profile. + Name *string `json:"name,omitempty"` + // PublicSubdomain - READ-ONLY; DNS subdomain for OpenShift router. + PublicSubdomain *string `json:"publicSubdomain,omitempty"` + // Fqdn - READ-ONLY; Auto-allocated FQDN for the OpenShift router. + Fqdn *string `json:"fqdn,omitempty"` +} + +// OperationListResult the List Compute Operation operation response. +type OperationListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of compute operations + Value *[]OperationValue `json:"value,omitempty"` +} + +// OperationValue describes the properties of a Compute Operation value. +type OperationValue struct { + // Origin - READ-ONLY; The origin of the compute operation. + Origin *string `json:"origin,omitempty"` + // Name - READ-ONLY; The name of the compute operation. + Name *string `json:"name,omitempty"` + // OperationValueDisplay - Describes the properties of a Compute Operation Value Display. + *OperationValueDisplay `json:"display,omitempty"` +} + +// MarshalJSON is the custom marshaler for OperationValue. +func (ov OperationValue) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ov.OperationValueDisplay != nil { + objectMap["display"] = ov.OperationValueDisplay + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for OperationValue struct. +func (ov *OperationValue) 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 + } + ov.Origin = &origin + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ov.Name = &name + } + case "display": + if v != nil { + var operationValueDisplay OperationValueDisplay + err = json.Unmarshal(*v, &operationValueDisplay) + if err != nil { + return err + } + ov.OperationValueDisplay = &operationValueDisplay + } + } + } + + return nil +} + +// OperationValueDisplay describes the properties of a Compute Operation Value Display. +type OperationValueDisplay struct { + // Operation - READ-ONLY; The display name of the compute operation. + Operation *string `json:"operation,omitempty"` + // Resource - READ-ONLY; The display name of the resource the operation applies to. + Resource *string `json:"resource,omitempty"` + // Description - READ-ONLY; The description of the operation. + Description *string `json:"description,omitempty"` + // Provider - READ-ONLY; The resource provider for the operation. + Provider *string `json:"provider,omitempty"` +} + +// OrchestratorProfile contains information about orchestrator. +type OrchestratorProfile struct { + // OrchestratorType - Orchestrator type. + OrchestratorType *string `json:"orchestratorType,omitempty"` + // OrchestratorVersion - Orchestrator version (major, minor, patch). + OrchestratorVersion *string `json:"orchestratorVersion,omitempty"` + // IsPreview - Whether Kubernetes version is currently in preview. + IsPreview *bool `json:"isPreview,omitempty"` +} + +// OrchestratorProfileType profile for the container service orchestrator. +type OrchestratorProfileType struct { + // OrchestratorType - The orchestrator to use to manage container service cluster resources. Valid values are Kubernetes, Swarm, DCOS, DockerCE and Custom. Possible values include: 'Kubernetes', 'Swarm', 'DCOS', 'DockerCE', 'Custom' + OrchestratorType OrchestratorTypes `json:"orchestratorType,omitempty"` + // OrchestratorVersion - The version of the orchestrator to use. You can specify the major.minor.patch part of the actual version.For example, you can specify version as "1.6.11". + OrchestratorVersion *string `json:"orchestratorVersion,omitempty"` +} + +// OrchestratorVersionProfile the profile of an orchestrator and its available versions. +type OrchestratorVersionProfile struct { + // OrchestratorType - Orchestrator type. + OrchestratorType *string `json:"orchestratorType,omitempty"` + // OrchestratorVersion - Orchestrator version (major, minor, patch). + OrchestratorVersion *string `json:"orchestratorVersion,omitempty"` + // Default - Installed by default if version is not specified. + Default *bool `json:"default,omitempty"` + // IsPreview - Whether Kubernetes version is currently in preview. + IsPreview *bool `json:"isPreview,omitempty"` + // Upgrades - The list of available upgrade versions. + Upgrades *[]OrchestratorProfile `json:"upgrades,omitempty"` +} + +// OrchestratorVersionProfileListResult the list of versions for supported orchestrators. +type OrchestratorVersionProfileListResult struct { + autorest.Response `json:"-"` + // ID - READ-ONLY; Id of the orchestrator version profile list result. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Name of the orchestrator version profile list result. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of the orchestrator version profile list result. + Type *string `json:"type,omitempty"` + // OrchestratorVersionProfileProperties - The properties of an orchestrator version profile. + *OrchestratorVersionProfileProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for OrchestratorVersionProfileListResult. +func (ovplr OrchestratorVersionProfileListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ovplr.OrchestratorVersionProfileProperties != nil { + objectMap["properties"] = ovplr.OrchestratorVersionProfileProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for OrchestratorVersionProfileListResult struct. +func (ovplr *OrchestratorVersionProfileListResult) 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 "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ovplr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ovplr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ovplr.Type = &typeVar + } + case "properties": + if v != nil { + var orchestratorVersionProfileProperties OrchestratorVersionProfileProperties + err = json.Unmarshal(*v, &orchestratorVersionProfileProperties) + if err != nil { + return err + } + ovplr.OrchestratorVersionProfileProperties = &orchestratorVersionProfileProperties + } + } + } + + return nil +} + +// OrchestratorVersionProfileProperties the properties of an orchestrator version profile. +type OrchestratorVersionProfileProperties struct { + // Orchestrators - List of orchestrator version profiles. + Orchestrators *[]OrchestratorVersionProfile `json:"orchestrators,omitempty"` +} + +// Properties properties of the container service. +type Properties struct { + // ProvisioningState - READ-ONLY; The current deployment or provisioning state, which only appears in the response. + ProvisioningState *string `json:"provisioningState,omitempty"` + // OrchestratorProfile - Profile for the container service orchestrator. + OrchestratorProfile *OrchestratorProfileType `json:"orchestratorProfile,omitempty"` + // CustomProfile - Properties to configure a custom container service cluster. + CustomProfile *CustomProfile `json:"customProfile,omitempty"` + // ServicePrincipalProfile - Information about a service principal identity for the cluster to use for manipulating Azure APIs. Exact one of secret or keyVaultSecretRef need to be specified. + ServicePrincipalProfile *ServicePrincipalProfile `json:"servicePrincipalProfile,omitempty"` + // MasterProfile - Profile for the container service master. + MasterProfile *MasterProfile `json:"masterProfile,omitempty"` + // AgentPoolProfiles - Properties of the agent pool. + AgentPoolProfiles *[]AgentPoolProfile `json:"agentPoolProfiles,omitempty"` + // WindowsProfile - Profile for Windows VMs in the container service cluster. + WindowsProfile *WindowsProfile `json:"windowsProfile,omitempty"` + // LinuxProfile - Profile for Linux VMs in the container service cluster. + LinuxProfile *LinuxProfile `json:"linuxProfile,omitempty"` + // DiagnosticsProfile - Profile for diagnostics in the container service cluster. + DiagnosticsProfile *DiagnosticsProfile `json:"diagnosticsProfile,omitempty"` +} + +// PurchasePlan used for establishing the purchase context of any 3rd Party artifact through MarketPlace. +type PurchasePlan struct { + // Name - The plan ID. + Name *string `json:"name,omitempty"` + // Product - Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element. + Product *string `json:"product,omitempty"` + // PromotionCode - The promotion code. + PromotionCode *string `json:"promotionCode,omitempty"` + // Publisher - The plan ID. + Publisher *string `json:"publisher,omitempty"` +} + +// Resource the Resource model definition. +type Resource struct { + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` + // Location - Resource location + Location *string `json:"location,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.Location != nil { + objectMap["location"] = r.Location + } + if r.Tags != nil { + objectMap["tags"] = r.Tags + } + return json.Marshal(objectMap) +} + +// ResourceReference a reference to an Azure resource. +type ResourceReference struct { + // ID - The fully qualified Azure resource id. + ID *string `json:"id,omitempty"` +} + +// ServicePrincipalProfile information about a service principal identity for the cluster to use for +// manipulating Azure APIs. Either secret or keyVaultSecretRef must be specified. +type ServicePrincipalProfile struct { + // ClientID - The ID for the service principal. + ClientID *string `json:"clientId,omitempty"` + // Secret - The secret password associated with the service principal in plain text. + Secret *string `json:"secret,omitempty"` + // KeyVaultSecretRef - Reference to a secret stored in Azure Key Vault. + KeyVaultSecretRef *KeyVaultSecretRef `json:"keyVaultSecretRef,omitempty"` +} + +// SSHConfiguration SSH configuration for Linux-based VMs running on Azure. +type SSHConfiguration struct { + // PublicKeys - The list of SSH public keys used to authenticate with Linux-based VMs. Only expect one key specified. + PublicKeys *[]SSHPublicKey `json:"publicKeys,omitempty"` +} + +// SSHPublicKey contains information about SSH certificate public key data. +type SSHPublicKey struct { + // KeyData - Certificate public key used to authenticate with VMs through SSH. The certificate must be in PEM format with or without headers. + KeyData *string `json:"keyData,omitempty"` +} + +// SubResource reference to another subresource. +type SubResource struct { + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource that is unique within a resource group. This name can be used to access the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` +} + +// TagsObject tags object for patch operations. +type TagsObject struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for TagsObject. +func (toVar TagsObject) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if toVar.Tags != nil { + objectMap["tags"] = toVar.Tags + } + return json.Marshal(objectMap) +} + +// UserAssignedIdentity ... +type UserAssignedIdentity struct { + // ResourceID - The resource id of the user assigned identity. + ResourceID *string `json:"resourceId,omitempty"` + // ClientID - The client id of the user assigned identity. + ClientID *string `json:"clientId,omitempty"` + // ObjectID - The object id of the user assigned identity. + ObjectID *string `json:"objectId,omitempty"` +} + +// VMDiagnostics profile for diagnostics on the container service VMs. +type VMDiagnostics struct { + // Enabled - Whether the VM diagnostic agent is provisioned on the VM. + Enabled *bool `json:"enabled,omitempty"` + // StorageURI - READ-ONLY; The URI of the storage account where diagnostics are stored. + StorageURI *string `json:"storageUri,omitempty"` +} + +// WindowsProfile profile for Windows VMs in the container service cluster. +type WindowsProfile struct { + // AdminUsername - The administrator username to use for Windows VMs. + AdminUsername *string `json:"adminUsername,omitempty"` + // AdminPassword - The administrator password to use for Windows VMs. + AdminPassword *string `json:"adminPassword,omitempty"` +} diff --git a/services/containerservice/mgmt/2020-04-01/containerservice/openshiftmanagedclusters.go b/services/containerservice/mgmt/2020-04-01/containerservice/openshiftmanagedclusters.go new file mode 100644 index 000000000000..bec338c6523b --- /dev/null +++ b/services/containerservice/mgmt/2020-04-01/containerservice/openshiftmanagedclusters.go @@ -0,0 +1,613 @@ +package containerservice + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// OpenShiftManagedClustersClient is the the Container Service Client. +type OpenShiftManagedClustersClient struct { + BaseClient +} + +// NewOpenShiftManagedClustersClient creates an instance of the OpenShiftManagedClustersClient client. +func NewOpenShiftManagedClustersClient(subscriptionID string) OpenShiftManagedClustersClient { + return NewOpenShiftManagedClustersClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewOpenShiftManagedClustersClientWithBaseURI creates an instance of the OpenShiftManagedClustersClient 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 NewOpenShiftManagedClustersClientWithBaseURI(baseURI string, subscriptionID string) OpenShiftManagedClustersClient { + return OpenShiftManagedClustersClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a OpenShift managed cluster with the specified configuration for agents and +// OpenShift version. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the OpenShift managed cluster resource. +// parameters - parameters supplied to the Create or Update an OpenShift Managed Cluster operation. +func (client OpenShiftManagedClustersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, parameters OpenShiftManagedCluster) (result OpenShiftManagedClustersCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OpenShiftManagedClustersClient.CreateOrUpdate") + 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.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.OpenShiftManagedClusterProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.OpenShiftManagedClusterProperties.OpenShiftVersion", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.OpenShiftManagedClusterProperties.MasterPoolProfile", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.OpenShiftManagedClusterProperties.MasterPoolProfile.Count", Name: validation.Null, Rule: true, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("containerservice.OpenShiftManagedClustersClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, resourceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client OpenShiftManagedClustersClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, resourceName string, parameters OpenShiftManagedCluster) (*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 = "2019-04-30" + 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.ContainerService/openShiftManagedClusters/{resourceName}", pathParameters), + autorest.WithJSON(parameters), + 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 OpenShiftManagedClustersClient) CreateOrUpdateSender(req *http.Request) (future OpenShiftManagedClustersCreateOrUpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client OpenShiftManagedClustersClient) CreateOrUpdateResponder(resp *http.Response) (result OpenShiftManagedCluster, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the OpenShift managed cluster with a specified resource group and name. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the OpenShift managed cluster resource. +func (client OpenShiftManagedClustersClient) Delete(ctx context.Context, resourceGroupName string, resourceName string) (result OpenShiftManagedClustersDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OpenShiftManagedClustersClient.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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.OpenShiftManagedClustersClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client OpenShiftManagedClustersClient) 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 = "2019-04-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{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 OpenShiftManagedClustersClient) DeleteSender(req *http.Request) (future OpenShiftManagedClustersDeleteFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client OpenShiftManagedClustersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the details of the managed OpenShift cluster with a specified resource group and name. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the OpenShift managed cluster resource. +func (client OpenShiftManagedClustersClient) Get(ctx context.Context, resourceGroupName string, resourceName string) (result OpenShiftManagedCluster, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OpenShiftManagedClustersClient.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}}}}); err != nil { + return result, validation.NewError("containerservice.OpenShiftManagedClustersClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client OpenShiftManagedClustersClient) 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 = "2019-04-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters/{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 OpenShiftManagedClustersClient) 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 OpenShiftManagedClustersClient) GetResponder(resp *http.Response) (result OpenShiftManagedCluster, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets a list of OpenShift managed clusters in the specified subscription. The operation returns properties of +// each OpenShift managed cluster. +func (client OpenShiftManagedClustersClient) List(ctx context.Context) (result OpenShiftManagedClusterListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OpenShiftManagedClustersClient.List") + defer func() { + sc := -1 + if result.osmclr.Response.Response != nil { + sc = result.osmclr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.osmclr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "List", resp, "Failure sending request") + return + } + + result.osmclr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client OpenShiftManagedClustersClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-04-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerService/openShiftManagedClusters", 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 OpenShiftManagedClustersClient) 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 OpenShiftManagedClustersClient) ListResponder(resp *http.Response) (result OpenShiftManagedClusterListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 OpenShiftManagedClustersClient) listNextResults(ctx context.Context, lastResults OpenShiftManagedClusterListResult) (result OpenShiftManagedClusterListResult, err error) { + req, err := lastResults.openShiftManagedClusterListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "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, "containerservice.OpenShiftManagedClustersClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client OpenShiftManagedClustersClient) ListComplete(ctx context.Context) (result OpenShiftManagedClusterListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OpenShiftManagedClustersClient.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 OpenShift managed clusters in the specified subscription and resource group. The operation +// returns properties of each OpenShift managed cluster. +// Parameters: +// resourceGroupName - the name of the resource group. +func (client OpenShiftManagedClustersClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result OpenShiftManagedClusterListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OpenShiftManagedClustersClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.osmclr.Response.Response != nil { + sc = result.osmclr.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("containerservice.OpenShiftManagedClustersClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.osmclr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.osmclr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client OpenShiftManagedClustersClient) 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 = "2019-04-30" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/openShiftManagedClusters", 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 OpenShiftManagedClustersClient) 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 OpenShiftManagedClustersClient) ListByResourceGroupResponder(resp *http.Response) (result OpenShiftManagedClusterListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 OpenShiftManagedClustersClient) listByResourceGroupNextResults(ctx context.Context, lastResults OpenShiftManagedClusterListResult) (result OpenShiftManagedClusterListResult, err error) { + req, err := lastResults.openShiftManagedClusterListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "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, "containerservice.OpenShiftManagedClustersClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client OpenShiftManagedClustersClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result OpenShiftManagedClusterListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OpenShiftManagedClustersClient.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 +} + +// UpdateTags updates an OpenShift managed cluster with the specified tags. +// Parameters: +// resourceGroupName - the name of the resource group. +// resourceName - the name of the OpenShift managed cluster resource. +// parameters - parameters supplied to the Update OpenShift Managed Cluster Tags operation. +func (client OpenShiftManagedClustersClient) UpdateTags(ctx context.Context, resourceGroupName string, resourceName string, parameters TagsObject) (result OpenShiftManagedClustersUpdateTagsFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OpenShiftManagedClustersClient.UpdateTags") + 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.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerservice.OpenShiftManagedClustersClient", "UpdateTags", err.Error()) + } + + req, err := client.UpdateTagsPreparer(ctx, resourceGroupName, resourceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "UpdateTags", nil, "Failure preparing request") + return + } + + result, err = client.UpdateTagsSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OpenShiftManagedClustersClient", "UpdateTags", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdateTagsPreparer prepares the UpdateTags request. +func (client OpenShiftManagedClustersClient) UpdateTagsPreparer(ctx context.Context, resourceGroupName string, resourceName string, parameters TagsObject) (*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 = "2019-04-30" + 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.ContainerService/openShiftManagedClusters/{resourceName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateTagsSender sends the UpdateTags request. The method will close the +// http.Response Body if it receives an error. +func (client OpenShiftManagedClustersClient) UpdateTagsSender(req *http.Request) (future OpenShiftManagedClustersUpdateTagsFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// UpdateTagsResponder handles the response to the UpdateTags request. The method always +// closes the http.Response Body. +func (client OpenShiftManagedClustersClient) UpdateTagsResponder(resp *http.Response) (result OpenShiftManagedCluster, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/containerservice/mgmt/2020-04-01/containerservice/operations.go b/services/containerservice/mgmt/2020-04-01/containerservice/operations.go new file mode 100644 index 000000000000..a090960e690d --- /dev/null +++ b/services/containerservice/mgmt/2020-04-01/containerservice/operations.go @@ -0,0 +1,109 @@ +package containerservice + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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 the Container Service Client. +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 gets a list of compute operations. +func (client OperationsClient) List(ctx context.Context) (result OperationListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.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) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OperationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerservice.OperationsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerservice.OperationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2020-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.ContainerService/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, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/containerservice/mgmt/2020-04-01/containerservice/version.go b/services/containerservice/mgmt/2020-04-01/containerservice/version.go new file mode 100644 index 000000000000..57f38f2e70bc --- /dev/null +++ b/services/containerservice/mgmt/2020-04-01/containerservice/version.go @@ -0,0 +1,30 @@ +package containerservice + +import "github.com/Azure/azure-sdk-for-go/version" + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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() + " containerservice/2020-04-01" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/services/cosmos-db/mgmt/2019-08-01/documentdb/cassandraresources.go b/services/cosmos-db/mgmt/2019-08-01/documentdb/cassandraresources.go index cacf67d14875..ba81355b6ed9 100644 --- a/services/cosmos-db/mgmt/2019-08-01/documentdb/cassandraresources.go +++ b/services/cosmos-db/mgmt/2019-08-01/documentdb/cassandraresources.go @@ -32,15 +32,15 @@ type CassandraResourcesClient struct { } // NewCassandraResourcesClient creates an instance of the CassandraResourcesClient client. -func NewCassandraResourcesClient(subscriptionID string) CassandraResourcesClient { - return NewCassandraResourcesClientWithBaseURI(DefaultBaseURI, subscriptionID) +func NewCassandraResourcesClient(subscriptionID string, subscriptionID1 string) CassandraResourcesClient { + return NewCassandraResourcesClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) } // NewCassandraResourcesClientWithBaseURI creates an instance of the CassandraResourcesClient 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 NewCassandraResourcesClientWithBaseURI(baseURI string, subscriptionID string) CassandraResourcesClient { - return CassandraResourcesClient{NewWithBaseURI(baseURI, subscriptionID)} +func NewCassandraResourcesClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) CassandraResourcesClient { + return CassandraResourcesClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} } // CreateUpdateCassandraKeyspace create or update an Azure Cosmos DB Cassandra keyspace diff --git a/services/cosmos-db/mgmt/2019-08-01/documentdb/client.go b/services/cosmos-db/mgmt/2019-08-01/documentdb/client.go index 126e99bc5f6a..d30db604dc01 100644 --- a/services/cosmos-db/mgmt/2019-08-01/documentdb/client.go +++ b/services/cosmos-db/mgmt/2019-08-01/documentdb/client.go @@ -32,21 +32,23 @@ const ( // BaseClient is the base client for Documentdb. type BaseClient struct { autorest.Client - BaseURI string - SubscriptionID string + BaseURI string + SubscriptionID string + SubscriptionID1 string } // New creates an instance of the BaseClient client. -func New(subscriptionID string) BaseClient { - return NewWithBaseURI(DefaultBaseURI, subscriptionID) +func New(subscriptionID string, subscriptionID1 string) BaseClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) } // 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 { +func NewWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) BaseClient { return BaseClient{ - Client: autorest.NewClientWithUserAgent(UserAgent()), - BaseURI: baseURI, - SubscriptionID: subscriptionID, + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + SubscriptionID: subscriptionID, + SubscriptionID1: subscriptionID1, } } diff --git a/services/cosmos-db/mgmt/2019-08-01/documentdb/collection.go b/services/cosmos-db/mgmt/2019-08-01/documentdb/collection.go index d36deaf81efe..01912d5e1137 100644 --- a/services/cosmos-db/mgmt/2019-08-01/documentdb/collection.go +++ b/services/cosmos-db/mgmt/2019-08-01/documentdb/collection.go @@ -32,14 +32,14 @@ type CollectionClient struct { } // NewCollectionClient creates an instance of the CollectionClient client. -func NewCollectionClient(subscriptionID string) CollectionClient { - return NewCollectionClientWithBaseURI(DefaultBaseURI, subscriptionID) +func NewCollectionClient(subscriptionID string, subscriptionID1 string) CollectionClient { + return NewCollectionClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) } // NewCollectionClientWithBaseURI creates an instance of the CollectionClient 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 NewCollectionClientWithBaseURI(baseURI string, subscriptionID string) CollectionClient { - return CollectionClient{NewWithBaseURI(baseURI, subscriptionID)} +func NewCollectionClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) CollectionClient { + return CollectionClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} } // ListMetricDefinitions retrieves metric definitions for the given collection. diff --git a/services/cosmos-db/mgmt/2019-08-01/documentdb/collectionpartition.go b/services/cosmos-db/mgmt/2019-08-01/documentdb/collectionpartition.go index cd991a2b0c0e..5d99d6f25ca8 100644 --- a/services/cosmos-db/mgmt/2019-08-01/documentdb/collectionpartition.go +++ b/services/cosmos-db/mgmt/2019-08-01/documentdb/collectionpartition.go @@ -32,15 +32,15 @@ type CollectionPartitionClient struct { } // NewCollectionPartitionClient creates an instance of the CollectionPartitionClient client. -func NewCollectionPartitionClient(subscriptionID string) CollectionPartitionClient { - return NewCollectionPartitionClientWithBaseURI(DefaultBaseURI, subscriptionID) +func NewCollectionPartitionClient(subscriptionID string, subscriptionID1 string) CollectionPartitionClient { + return NewCollectionPartitionClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) } // NewCollectionPartitionClientWithBaseURI creates an instance of the CollectionPartitionClient 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 NewCollectionPartitionClientWithBaseURI(baseURI string, subscriptionID string) CollectionPartitionClient { - return CollectionPartitionClient{NewWithBaseURI(baseURI, subscriptionID)} +func NewCollectionPartitionClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) CollectionPartitionClient { + return CollectionPartitionClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} } // ListMetrics retrieves the metrics determined by the given filter for the given collection, split by partition. diff --git a/services/cosmos-db/mgmt/2019-08-01/documentdb/collectionpartitionregion.go b/services/cosmos-db/mgmt/2019-08-01/documentdb/collectionpartitionregion.go index 802442d243ca..7ac91edb1b1f 100644 --- a/services/cosmos-db/mgmt/2019-08-01/documentdb/collectionpartitionregion.go +++ b/services/cosmos-db/mgmt/2019-08-01/documentdb/collectionpartitionregion.go @@ -32,15 +32,15 @@ type CollectionPartitionRegionClient struct { } // NewCollectionPartitionRegionClient creates an instance of the CollectionPartitionRegionClient client. -func NewCollectionPartitionRegionClient(subscriptionID string) CollectionPartitionRegionClient { - return NewCollectionPartitionRegionClientWithBaseURI(DefaultBaseURI, subscriptionID) +func NewCollectionPartitionRegionClient(subscriptionID string, subscriptionID1 string) CollectionPartitionRegionClient { + return NewCollectionPartitionRegionClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) } // NewCollectionPartitionRegionClientWithBaseURI creates an instance of the CollectionPartitionRegionClient 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 NewCollectionPartitionRegionClientWithBaseURI(baseURI string, subscriptionID string) CollectionPartitionRegionClient { - return CollectionPartitionRegionClient{NewWithBaseURI(baseURI, subscriptionID)} +func NewCollectionPartitionRegionClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) CollectionPartitionRegionClient { + return CollectionPartitionRegionClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} } // ListMetrics retrieves the metrics determined by the given filter for the given collection and region, split by diff --git a/services/cosmos-db/mgmt/2019-08-01/documentdb/collectionregion.go b/services/cosmos-db/mgmt/2019-08-01/documentdb/collectionregion.go index 30fba6b398e1..53146b52042c 100644 --- a/services/cosmos-db/mgmt/2019-08-01/documentdb/collectionregion.go +++ b/services/cosmos-db/mgmt/2019-08-01/documentdb/collectionregion.go @@ -32,15 +32,15 @@ type CollectionRegionClient struct { } // NewCollectionRegionClient creates an instance of the CollectionRegionClient client. -func NewCollectionRegionClient(subscriptionID string) CollectionRegionClient { - return NewCollectionRegionClientWithBaseURI(DefaultBaseURI, subscriptionID) +func NewCollectionRegionClient(subscriptionID string, subscriptionID1 string) CollectionRegionClient { + return NewCollectionRegionClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) } // NewCollectionRegionClientWithBaseURI creates an instance of the CollectionRegionClient 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 NewCollectionRegionClientWithBaseURI(baseURI string, subscriptionID string) CollectionRegionClient { - return CollectionRegionClient{NewWithBaseURI(baseURI, subscriptionID)} +func NewCollectionRegionClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) CollectionRegionClient { + return CollectionRegionClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} } // ListMetrics retrieves the metrics determined by the given filter for the given database account, collection and diff --git a/services/cosmos-db/mgmt/2019-08-01/documentdb/database.go b/services/cosmos-db/mgmt/2019-08-01/documentdb/database.go index 502fb2d6e6af..c9dc527ac274 100644 --- a/services/cosmos-db/mgmt/2019-08-01/documentdb/database.go +++ b/services/cosmos-db/mgmt/2019-08-01/documentdb/database.go @@ -32,14 +32,14 @@ type DatabaseClient struct { } // NewDatabaseClient creates an instance of the DatabaseClient client. -func NewDatabaseClient(subscriptionID string) DatabaseClient { - return NewDatabaseClientWithBaseURI(DefaultBaseURI, subscriptionID) +func NewDatabaseClient(subscriptionID string, subscriptionID1 string) DatabaseClient { + return NewDatabaseClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) } // NewDatabaseClientWithBaseURI creates an instance of the DatabaseClient 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 NewDatabaseClientWithBaseURI(baseURI string, subscriptionID string) DatabaseClient { - return DatabaseClient{NewWithBaseURI(baseURI, subscriptionID)} +func NewDatabaseClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) DatabaseClient { + return DatabaseClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} } // ListMetricDefinitions retrieves metric definitions for the given database. diff --git a/services/cosmos-db/mgmt/2019-08-01/documentdb/databaseaccountregion.go b/services/cosmos-db/mgmt/2019-08-01/documentdb/databaseaccountregion.go index 3a1fc6bac8d8..4fb4ee8ae004 100644 --- a/services/cosmos-db/mgmt/2019-08-01/documentdb/databaseaccountregion.go +++ b/services/cosmos-db/mgmt/2019-08-01/documentdb/databaseaccountregion.go @@ -32,15 +32,15 @@ type DatabaseAccountRegionClient struct { } // NewDatabaseAccountRegionClient creates an instance of the DatabaseAccountRegionClient client. -func NewDatabaseAccountRegionClient(subscriptionID string) DatabaseAccountRegionClient { - return NewDatabaseAccountRegionClientWithBaseURI(DefaultBaseURI, subscriptionID) +func NewDatabaseAccountRegionClient(subscriptionID string, subscriptionID1 string) DatabaseAccountRegionClient { + return NewDatabaseAccountRegionClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) } // NewDatabaseAccountRegionClientWithBaseURI creates an instance of the DatabaseAccountRegionClient 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 NewDatabaseAccountRegionClientWithBaseURI(baseURI string, subscriptionID string) DatabaseAccountRegionClient { - return DatabaseAccountRegionClient{NewWithBaseURI(baseURI, subscriptionID)} +func NewDatabaseAccountRegionClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) DatabaseAccountRegionClient { + return DatabaseAccountRegionClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} } // ListMetrics retrieves the metrics determined by the given filter for the given database account and region. diff --git a/services/cosmos-db/mgmt/2019-08-01/documentdb/databaseaccounts.go b/services/cosmos-db/mgmt/2019-08-01/documentdb/databaseaccounts.go index 26566425c949..80bfbe5adfd3 100644 --- a/services/cosmos-db/mgmt/2019-08-01/documentdb/databaseaccounts.go +++ b/services/cosmos-db/mgmt/2019-08-01/documentdb/databaseaccounts.go @@ -32,15 +32,15 @@ type DatabaseAccountsClient struct { } // NewDatabaseAccountsClient creates an instance of the DatabaseAccountsClient client. -func NewDatabaseAccountsClient(subscriptionID string) DatabaseAccountsClient { - return NewDatabaseAccountsClientWithBaseURI(DefaultBaseURI, subscriptionID) +func NewDatabaseAccountsClient(subscriptionID string, subscriptionID1 string) DatabaseAccountsClient { + return NewDatabaseAccountsClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) } // NewDatabaseAccountsClientWithBaseURI creates an instance of the DatabaseAccountsClient 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 NewDatabaseAccountsClientWithBaseURI(baseURI string, subscriptionID string) DatabaseAccountsClient { - return DatabaseAccountsClient{NewWithBaseURI(baseURI, subscriptionID)} +func NewDatabaseAccountsClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) DatabaseAccountsClient { + return DatabaseAccountsClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} } // CheckNameExists checks that the Azure Cosmos DB account name already exists. A valid account name may contain only diff --git a/services/cosmos-db/mgmt/2019-08-01/documentdb/gremlinresources.go b/services/cosmos-db/mgmt/2019-08-01/documentdb/gremlinresources.go index fb44b2063a95..0a56504a7fea 100644 --- a/services/cosmos-db/mgmt/2019-08-01/documentdb/gremlinresources.go +++ b/services/cosmos-db/mgmt/2019-08-01/documentdb/gremlinresources.go @@ -32,15 +32,15 @@ type GremlinResourcesClient struct { } // NewGremlinResourcesClient creates an instance of the GremlinResourcesClient client. -func NewGremlinResourcesClient(subscriptionID string) GremlinResourcesClient { - return NewGremlinResourcesClientWithBaseURI(DefaultBaseURI, subscriptionID) +func NewGremlinResourcesClient(subscriptionID string, subscriptionID1 string) GremlinResourcesClient { + return NewGremlinResourcesClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) } // NewGremlinResourcesClientWithBaseURI creates an instance of the GremlinResourcesClient 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 NewGremlinResourcesClientWithBaseURI(baseURI string, subscriptionID string) GremlinResourcesClient { - return GremlinResourcesClient{NewWithBaseURI(baseURI, subscriptionID)} +func NewGremlinResourcesClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) GremlinResourcesClient { + return GremlinResourcesClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} } // CreateUpdateGremlinDatabase create or update an Azure Cosmos DB Gremlin database diff --git a/services/cosmos-db/mgmt/2019-08-01/documentdb/mongodbresources.go b/services/cosmos-db/mgmt/2019-08-01/documentdb/mongodbresources.go index b873fe6e0e6e..8ce34329d88a 100644 --- a/services/cosmos-db/mgmt/2019-08-01/documentdb/mongodbresources.go +++ b/services/cosmos-db/mgmt/2019-08-01/documentdb/mongodbresources.go @@ -32,15 +32,15 @@ type MongoDBResourcesClient struct { } // NewMongoDBResourcesClient creates an instance of the MongoDBResourcesClient client. -func NewMongoDBResourcesClient(subscriptionID string) MongoDBResourcesClient { - return NewMongoDBResourcesClientWithBaseURI(DefaultBaseURI, subscriptionID) +func NewMongoDBResourcesClient(subscriptionID string, subscriptionID1 string) MongoDBResourcesClient { + return NewMongoDBResourcesClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) } // NewMongoDBResourcesClientWithBaseURI creates an instance of the MongoDBResourcesClient 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 NewMongoDBResourcesClientWithBaseURI(baseURI string, subscriptionID string) MongoDBResourcesClient { - return MongoDBResourcesClient{NewWithBaseURI(baseURI, subscriptionID)} +func NewMongoDBResourcesClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) MongoDBResourcesClient { + return MongoDBResourcesClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} } // CreateUpdateMongoDBCollection create or update an Azure Cosmos DB MongoDB Collection diff --git a/services/cosmos-db/mgmt/2019-08-01/documentdb/notebookworkspaces.go b/services/cosmos-db/mgmt/2019-08-01/documentdb/notebookworkspaces.go index 21bb267e6fe8..ef2a4cac2827 100644 --- a/services/cosmos-db/mgmt/2019-08-01/documentdb/notebookworkspaces.go +++ b/services/cosmos-db/mgmt/2019-08-01/documentdb/notebookworkspaces.go @@ -32,20 +32,20 @@ type NotebookWorkspacesClient struct { } // NewNotebookWorkspacesClient creates an instance of the NotebookWorkspacesClient client. -func NewNotebookWorkspacesClient(subscriptionID string) NotebookWorkspacesClient { - return NewNotebookWorkspacesClientWithBaseURI(DefaultBaseURI, subscriptionID) +func NewNotebookWorkspacesClient(subscriptionID string, subscriptionID1 string) NotebookWorkspacesClient { + return NewNotebookWorkspacesClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) } // NewNotebookWorkspacesClientWithBaseURI creates an instance of the NotebookWorkspacesClient 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 NewNotebookWorkspacesClientWithBaseURI(baseURI string, subscriptionID string) NotebookWorkspacesClient { - return NotebookWorkspacesClient{NewWithBaseURI(baseURI, subscriptionID)} +func NewNotebookWorkspacesClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) NotebookWorkspacesClient { + return NotebookWorkspacesClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} } // CreateOrUpdate creates the notebook workspace for a Cosmos DB account. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // notebookCreateUpdateParameters - the notebook workspace to create for the current database account. func (client NotebookWorkspacesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, notebookCreateUpdateParameters NotebookWorkspaceCreateUpdateParameters) (result NotebookWorkspacesCreateOrUpdateFuture, err error) { @@ -60,6 +60,8 @@ func (client NotebookWorkspacesClient) CreateOrUpdate(ctx context.Context, resou }() } 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}, @@ -137,7 +139,7 @@ func (client NotebookWorkspacesClient) CreateOrUpdateResponder(resp *http.Respon // Delete deletes the notebook workspace for a Cosmos DB account. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. func (client NotebookWorkspacesClient) Delete(ctx context.Context, resourceGroupName string, accountName string) (result NotebookWorkspacesDeleteFuture, err error) { if tracing.IsEnabled() { @@ -151,6 +153,8 @@ func (client NotebookWorkspacesClient) Delete(ctx context.Context, resourceGroup }() } 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}, @@ -225,7 +229,7 @@ func (client NotebookWorkspacesClient) DeleteResponder(resp *http.Response) (res // Get gets the notebook workspace for a Cosmos DB account. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. func (client NotebookWorkspacesClient) Get(ctx context.Context, resourceGroupName string, accountName string) (result NotebookWorkspace, err error) { if tracing.IsEnabled() { @@ -239,6 +243,8 @@ func (client NotebookWorkspacesClient) Get(ctx context.Context, resourceGroupNam }() } 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}, @@ -314,7 +320,7 @@ func (client NotebookWorkspacesClient) GetResponder(resp *http.Response) (result // ListByDatabaseAccount gets the notebook workspace resources of an existing Cosmos DB account. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. func (client NotebookWorkspacesClient) ListByDatabaseAccount(ctx context.Context, resourceGroupName string, accountName string) (result NotebookWorkspaceListResult, err error) { if tracing.IsEnabled() { @@ -328,6 +334,8 @@ func (client NotebookWorkspacesClient) ListByDatabaseAccount(ctx context.Context }() } 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}, @@ -402,7 +410,7 @@ func (client NotebookWorkspacesClient) ListByDatabaseAccountResponder(resp *http // ListConnectionInfo retrieves the connection info for the notebook workspace // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. func (client NotebookWorkspacesClient) ListConnectionInfo(ctx context.Context, resourceGroupName string, accountName string) (result NotebookWorkspaceConnectionInfoResult, err error) { if tracing.IsEnabled() { @@ -416,6 +424,8 @@ func (client NotebookWorkspacesClient) ListConnectionInfo(ctx context.Context, r }() } 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}, @@ -491,7 +501,7 @@ func (client NotebookWorkspacesClient) ListConnectionInfoResponder(resp *http.Re // RegenerateAuthToken regenerates the auth token for the notebook workspace // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. func (client NotebookWorkspacesClient) RegenerateAuthToken(ctx context.Context, resourceGroupName string, accountName string) (result NotebookWorkspacesRegenerateAuthTokenFuture, err error) { if tracing.IsEnabled() { @@ -505,6 +515,8 @@ func (client NotebookWorkspacesClient) RegenerateAuthToken(ctx context.Context, }() } 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}, @@ -579,7 +591,7 @@ func (client NotebookWorkspacesClient) RegenerateAuthTokenResponder(resp *http.R // Start starts the notebook workspace // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. func (client NotebookWorkspacesClient) Start(ctx context.Context, resourceGroupName string, accountName string) (result NotebookWorkspacesStartFuture, err error) { if tracing.IsEnabled() { @@ -593,6 +605,8 @@ func (client NotebookWorkspacesClient) Start(ctx context.Context, resourceGroupN }() } 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}, diff --git a/services/cosmos-db/mgmt/2019-08-01/documentdb/operations.go b/services/cosmos-db/mgmt/2019-08-01/documentdb/operations.go index e269ee99a422..d8bcdd1c073c 100644 --- a/services/cosmos-db/mgmt/2019-08-01/documentdb/operations.go +++ b/services/cosmos-db/mgmt/2019-08-01/documentdb/operations.go @@ -31,14 +31,14 @@ type OperationsClient struct { } // NewOperationsClient creates an instance of the OperationsClient client. -func NewOperationsClient(subscriptionID string) OperationsClient { - return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +func NewOperationsClient(subscriptionID string, subscriptionID1 string) OperationsClient { + return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) } // 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)} +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) OperationsClient { + return OperationsClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} } // List lists all of the available Cosmos DB Resource Provider operations. diff --git a/services/cosmos-db/mgmt/2019-08-01/documentdb/partitionkeyrangeid.go b/services/cosmos-db/mgmt/2019-08-01/documentdb/partitionkeyrangeid.go index e1d641a90662..de631fc5aa51 100644 --- a/services/cosmos-db/mgmt/2019-08-01/documentdb/partitionkeyrangeid.go +++ b/services/cosmos-db/mgmt/2019-08-01/documentdb/partitionkeyrangeid.go @@ -32,15 +32,15 @@ type PartitionKeyRangeIDClient struct { } // NewPartitionKeyRangeIDClient creates an instance of the PartitionKeyRangeIDClient client. -func NewPartitionKeyRangeIDClient(subscriptionID string) PartitionKeyRangeIDClient { - return NewPartitionKeyRangeIDClientWithBaseURI(DefaultBaseURI, subscriptionID) +func NewPartitionKeyRangeIDClient(subscriptionID string, subscriptionID1 string) PartitionKeyRangeIDClient { + return NewPartitionKeyRangeIDClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) } // NewPartitionKeyRangeIDClientWithBaseURI creates an instance of the PartitionKeyRangeIDClient 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 NewPartitionKeyRangeIDClientWithBaseURI(baseURI string, subscriptionID string) PartitionKeyRangeIDClient { - return PartitionKeyRangeIDClient{NewWithBaseURI(baseURI, subscriptionID)} +func NewPartitionKeyRangeIDClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) PartitionKeyRangeIDClient { + return PartitionKeyRangeIDClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} } // ListMetrics retrieves the metrics determined by the given filter for the given partition key range id. diff --git a/services/cosmos-db/mgmt/2019-08-01/documentdb/partitionkeyrangeidregion.go b/services/cosmos-db/mgmt/2019-08-01/documentdb/partitionkeyrangeidregion.go index e18638b68c4a..baf377862609 100644 --- a/services/cosmos-db/mgmt/2019-08-01/documentdb/partitionkeyrangeidregion.go +++ b/services/cosmos-db/mgmt/2019-08-01/documentdb/partitionkeyrangeidregion.go @@ -32,15 +32,15 @@ type PartitionKeyRangeIDRegionClient struct { } // NewPartitionKeyRangeIDRegionClient creates an instance of the PartitionKeyRangeIDRegionClient client. -func NewPartitionKeyRangeIDRegionClient(subscriptionID string) PartitionKeyRangeIDRegionClient { - return NewPartitionKeyRangeIDRegionClientWithBaseURI(DefaultBaseURI, subscriptionID) +func NewPartitionKeyRangeIDRegionClient(subscriptionID string, subscriptionID1 string) PartitionKeyRangeIDRegionClient { + return NewPartitionKeyRangeIDRegionClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) } // NewPartitionKeyRangeIDRegionClientWithBaseURI creates an instance of the PartitionKeyRangeIDRegionClient 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 NewPartitionKeyRangeIDRegionClientWithBaseURI(baseURI string, subscriptionID string) PartitionKeyRangeIDRegionClient { - return PartitionKeyRangeIDRegionClient{NewWithBaseURI(baseURI, subscriptionID)} +func NewPartitionKeyRangeIDRegionClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) PartitionKeyRangeIDRegionClient { + return PartitionKeyRangeIDRegionClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} } // ListMetrics retrieves the metrics determined by the given filter for the given partition key range id and region. diff --git a/services/cosmos-db/mgmt/2019-08-01/documentdb/percentile.go b/services/cosmos-db/mgmt/2019-08-01/documentdb/percentile.go index cb43554c2176..0133b3cde0e8 100644 --- a/services/cosmos-db/mgmt/2019-08-01/documentdb/percentile.go +++ b/services/cosmos-db/mgmt/2019-08-01/documentdb/percentile.go @@ -32,14 +32,14 @@ type PercentileClient struct { } // NewPercentileClient creates an instance of the PercentileClient client. -func NewPercentileClient(subscriptionID string) PercentileClient { - return NewPercentileClientWithBaseURI(DefaultBaseURI, subscriptionID) +func NewPercentileClient(subscriptionID string, subscriptionID1 string) PercentileClient { + return NewPercentileClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) } // NewPercentileClientWithBaseURI creates an instance of the PercentileClient 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 NewPercentileClientWithBaseURI(baseURI string, subscriptionID string) PercentileClient { - return PercentileClient{NewWithBaseURI(baseURI, subscriptionID)} +func NewPercentileClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) PercentileClient { + return PercentileClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} } // ListMetrics retrieves the metrics determined by the given filter for the given database account. This url is only diff --git a/services/cosmos-db/mgmt/2019-08-01/documentdb/percentilesourcetarget.go b/services/cosmos-db/mgmt/2019-08-01/documentdb/percentilesourcetarget.go index 34c7d35f7653..d21557a1ca1a 100644 --- a/services/cosmos-db/mgmt/2019-08-01/documentdb/percentilesourcetarget.go +++ b/services/cosmos-db/mgmt/2019-08-01/documentdb/percentilesourcetarget.go @@ -32,15 +32,15 @@ type PercentileSourceTargetClient struct { } // NewPercentileSourceTargetClient creates an instance of the PercentileSourceTargetClient client. -func NewPercentileSourceTargetClient(subscriptionID string) PercentileSourceTargetClient { - return NewPercentileSourceTargetClientWithBaseURI(DefaultBaseURI, subscriptionID) +func NewPercentileSourceTargetClient(subscriptionID string, subscriptionID1 string) PercentileSourceTargetClient { + return NewPercentileSourceTargetClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) } // NewPercentileSourceTargetClientWithBaseURI creates an instance of the PercentileSourceTargetClient 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 NewPercentileSourceTargetClientWithBaseURI(baseURI string, subscriptionID string) PercentileSourceTargetClient { - return PercentileSourceTargetClient{NewWithBaseURI(baseURI, subscriptionID)} +func NewPercentileSourceTargetClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) PercentileSourceTargetClient { + return PercentileSourceTargetClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} } // ListMetrics retrieves the metrics determined by the given filter for the given account, source and target region. diff --git a/services/cosmos-db/mgmt/2019-08-01/documentdb/percentiletarget.go b/services/cosmos-db/mgmt/2019-08-01/documentdb/percentiletarget.go index d08daa8c56de..03d63b1ba433 100644 --- a/services/cosmos-db/mgmt/2019-08-01/documentdb/percentiletarget.go +++ b/services/cosmos-db/mgmt/2019-08-01/documentdb/percentiletarget.go @@ -32,15 +32,15 @@ type PercentileTargetClient struct { } // NewPercentileTargetClient creates an instance of the PercentileTargetClient client. -func NewPercentileTargetClient(subscriptionID string) PercentileTargetClient { - return NewPercentileTargetClientWithBaseURI(DefaultBaseURI, subscriptionID) +func NewPercentileTargetClient(subscriptionID string, subscriptionID1 string) PercentileTargetClient { + return NewPercentileTargetClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) } // NewPercentileTargetClientWithBaseURI creates an instance of the PercentileTargetClient 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 NewPercentileTargetClientWithBaseURI(baseURI string, subscriptionID string) PercentileTargetClient { - return PercentileTargetClient{NewWithBaseURI(baseURI, subscriptionID)} +func NewPercentileTargetClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) PercentileTargetClient { + return PercentileTargetClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} } // ListMetrics retrieves the metrics determined by the given filter for the given account target region. This url is diff --git a/services/cosmos-db/mgmt/2019-08-01/documentdb/sqlresources.go b/services/cosmos-db/mgmt/2019-08-01/documentdb/sqlresources.go index 99339e0b4f34..10b8b54d142f 100644 --- a/services/cosmos-db/mgmt/2019-08-01/documentdb/sqlresources.go +++ b/services/cosmos-db/mgmt/2019-08-01/documentdb/sqlresources.go @@ -32,14 +32,14 @@ type SQLResourcesClient struct { } // NewSQLResourcesClient creates an instance of the SQLResourcesClient client. -func NewSQLResourcesClient(subscriptionID string) SQLResourcesClient { - return NewSQLResourcesClientWithBaseURI(DefaultBaseURI, subscriptionID) +func NewSQLResourcesClient(subscriptionID string, subscriptionID1 string) SQLResourcesClient { + return NewSQLResourcesClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) } // NewSQLResourcesClientWithBaseURI creates an instance of the SQLResourcesClient 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 NewSQLResourcesClientWithBaseURI(baseURI string, subscriptionID string) SQLResourcesClient { - return SQLResourcesClient{NewWithBaseURI(baseURI, subscriptionID)} +func NewSQLResourcesClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) SQLResourcesClient { + return SQLResourcesClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} } // CreateUpdateSQLContainer create or update an Azure Cosmos DB SQL container diff --git a/services/cosmos-db/mgmt/2019-08-01/documentdb/tableresources.go b/services/cosmos-db/mgmt/2019-08-01/documentdb/tableresources.go index 39e09cf9445d..df72cae4d050 100644 --- a/services/cosmos-db/mgmt/2019-08-01/documentdb/tableresources.go +++ b/services/cosmos-db/mgmt/2019-08-01/documentdb/tableresources.go @@ -32,14 +32,14 @@ type TableResourcesClient struct { } // NewTableResourcesClient creates an instance of the TableResourcesClient client. -func NewTableResourcesClient(subscriptionID string) TableResourcesClient { - return NewTableResourcesClientWithBaseURI(DefaultBaseURI, subscriptionID) +func NewTableResourcesClient(subscriptionID string, subscriptionID1 string) TableResourcesClient { + return NewTableResourcesClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) } // NewTableResourcesClientWithBaseURI creates an instance of the TableResourcesClient 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 NewTableResourcesClientWithBaseURI(baseURI string, subscriptionID string) TableResourcesClient { - return TableResourcesClient{NewWithBaseURI(baseURI, subscriptionID)} +func NewTableResourcesClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) TableResourcesClient { + return TableResourcesClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} } // CreateUpdateTable create or update an Azure Cosmos DB Table diff --git a/services/cosmos-db/mgmt/2019-12-12/documentdb/notebookworkspaces.go b/services/cosmos-db/mgmt/2019-12-12/documentdb/notebookworkspaces.go index b7f9cc1a3ed1..cef7d92b3303 100644 --- a/services/cosmos-db/mgmt/2019-12-12/documentdb/notebookworkspaces.go +++ b/services/cosmos-db/mgmt/2019-12-12/documentdb/notebookworkspaces.go @@ -45,7 +45,7 @@ func NewNotebookWorkspacesClientWithBaseURI(baseURI string, subscriptionID strin // CreateOrUpdate creates the notebook workspace for a Cosmos DB account. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // notebookCreateUpdateParameters - the notebook workspace to create for the current database account. func (client NotebookWorkspacesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, notebookCreateUpdateParameters NotebookWorkspaceCreateUpdateParameters) (result NotebookWorkspacesCreateOrUpdateFuture, err error) { @@ -60,6 +60,8 @@ func (client NotebookWorkspacesClient) CreateOrUpdate(ctx context.Context, resou }() } 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}, @@ -95,7 +97,7 @@ func (client NotebookWorkspacesClient) CreateOrUpdatePreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-08-01" + const APIVersion = "2019-12-12" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -137,7 +139,7 @@ func (client NotebookWorkspacesClient) CreateOrUpdateResponder(resp *http.Respon // Delete deletes the notebook workspace for a Cosmos DB account. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. func (client NotebookWorkspacesClient) Delete(ctx context.Context, resourceGroupName string, accountName string) (result NotebookWorkspacesDeleteFuture, err error) { if tracing.IsEnabled() { @@ -151,6 +153,8 @@ func (client NotebookWorkspacesClient) Delete(ctx context.Context, resourceGroup }() } 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}, @@ -186,7 +190,7 @@ func (client NotebookWorkspacesClient) DeletePreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-08-01" + const APIVersion = "2019-12-12" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -225,7 +229,7 @@ func (client NotebookWorkspacesClient) DeleteResponder(resp *http.Response) (res // Get gets the notebook workspace for a Cosmos DB account. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. func (client NotebookWorkspacesClient) Get(ctx context.Context, resourceGroupName string, accountName string) (result NotebookWorkspace, err error) { if tracing.IsEnabled() { @@ -239,6 +243,8 @@ func (client NotebookWorkspacesClient) Get(ctx context.Context, resourceGroupNam }() } 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}, @@ -280,7 +286,7 @@ func (client NotebookWorkspacesClient) GetPreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-08-01" + const APIVersion = "2019-12-12" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -314,7 +320,7 @@ func (client NotebookWorkspacesClient) GetResponder(resp *http.Response) (result // ListByDatabaseAccount gets the notebook workspace resources of an existing Cosmos DB account. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. func (client NotebookWorkspacesClient) ListByDatabaseAccount(ctx context.Context, resourceGroupName string, accountName string) (result NotebookWorkspaceListResult, err error) { if tracing.IsEnabled() { @@ -328,6 +334,8 @@ func (client NotebookWorkspacesClient) ListByDatabaseAccount(ctx context.Context }() } 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}, @@ -368,7 +376,7 @@ func (client NotebookWorkspacesClient) ListByDatabaseAccountPreparer(ctx context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-08-01" + const APIVersion = "2019-12-12" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -402,7 +410,7 @@ func (client NotebookWorkspacesClient) ListByDatabaseAccountResponder(resp *http // ListConnectionInfo retrieves the connection info for the notebook workspace // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. func (client NotebookWorkspacesClient) ListConnectionInfo(ctx context.Context, resourceGroupName string, accountName string) (result NotebookWorkspaceConnectionInfoResult, err error) { if tracing.IsEnabled() { @@ -416,6 +424,8 @@ func (client NotebookWorkspacesClient) ListConnectionInfo(ctx context.Context, r }() } 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}, @@ -457,7 +467,7 @@ func (client NotebookWorkspacesClient) ListConnectionInfoPreparer(ctx context.Co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-08-01" + const APIVersion = "2019-12-12" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -491,7 +501,7 @@ func (client NotebookWorkspacesClient) ListConnectionInfoResponder(resp *http.Re // RegenerateAuthToken regenerates the auth token for the notebook workspace // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. func (client NotebookWorkspacesClient) RegenerateAuthToken(ctx context.Context, resourceGroupName string, accountName string) (result NotebookWorkspacesRegenerateAuthTokenFuture, err error) { if tracing.IsEnabled() { @@ -505,6 +515,8 @@ func (client NotebookWorkspacesClient) RegenerateAuthToken(ctx context.Context, }() } 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}, @@ -540,7 +552,7 @@ func (client NotebookWorkspacesClient) RegenerateAuthTokenPreparer(ctx context.C "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-08-01" + const APIVersion = "2019-12-12" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -579,7 +591,7 @@ func (client NotebookWorkspacesClient) RegenerateAuthTokenResponder(resp *http.R // Start starts the notebook workspace // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. func (client NotebookWorkspacesClient) Start(ctx context.Context, resourceGroupName string, accountName string) (result NotebookWorkspacesStartFuture, err error) { if tracing.IsEnabled() { @@ -593,6 +605,8 @@ func (client NotebookWorkspacesClient) Start(ctx context.Context, resourceGroupN }() } 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}, @@ -628,7 +642,7 @@ func (client NotebookWorkspacesClient) StartPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-08-01" + const APIVersion = "2019-12-12" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/cosmos-db/mgmt/2019-12-12/documentdb/privatelinkresources.go b/services/cosmos-db/mgmt/2019-12-12/documentdb/privatelinkresources.go index a13e3bddebd2..215288ea9a8e 100644 --- a/services/cosmos-db/mgmt/2019-12-12/documentdb/privatelinkresources.go +++ b/services/cosmos-db/mgmt/2019-12-12/documentdb/privatelinkresources.go @@ -45,7 +45,7 @@ func NewPrivateLinkResourcesClientWithBaseURI(baseURI string, subscriptionID str // Get gets the private link resources that need to be created for a Cosmos DB account. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // groupName - the name of the private link resource. func (client PrivateLinkResourcesClient) Get(ctx context.Context, resourceGroupName string, accountName string, groupName string) (result PrivateLinkResource, err error) { @@ -60,6 +60,8 @@ func (client PrivateLinkResourcesClient) Get(ctx context.Context, resourceGroupN }() } 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}, @@ -135,7 +137,7 @@ func (client PrivateLinkResourcesClient) GetResponder(resp *http.Response) (resu // ListByDatabaseAccount gets the private link resources that need to be created for a Cosmos DB account. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. func (client PrivateLinkResourcesClient) ListByDatabaseAccount(ctx context.Context, resourceGroupName string, accountName string) (result PrivateLinkResourceListResult, err error) { if tracing.IsEnabled() { @@ -149,6 +151,8 @@ func (client PrivateLinkResourcesClient) ListByDatabaseAccount(ctx context.Conte }() } 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}, diff --git a/services/cosmos-db/mgmt/2020-03-01/documentdb/cassandraresources.go b/services/cosmos-db/mgmt/2020-03-01/documentdb/cassandraresources.go index e41b6b8b738b..de1d580750d9 100644 --- a/services/cosmos-db/mgmt/2020-03-01/documentdb/cassandraresources.go +++ b/services/cosmos-db/mgmt/2020-03-01/documentdb/cassandraresources.go @@ -32,20 +32,20 @@ type CassandraResourcesClient struct { } // NewCassandraResourcesClient creates an instance of the CassandraResourcesClient client. -func NewCassandraResourcesClient(subscriptionID string, subscriptionID1 string) CassandraResourcesClient { - return NewCassandraResourcesClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) +func NewCassandraResourcesClient(subscriptionID string) CassandraResourcesClient { + return NewCassandraResourcesClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewCassandraResourcesClientWithBaseURI creates an instance of the CassandraResourcesClient 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 NewCassandraResourcesClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) CassandraResourcesClient { - return CassandraResourcesClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} +func NewCassandraResourcesClientWithBaseURI(baseURI string, subscriptionID string) CassandraResourcesClient { + return CassandraResourcesClient{NewWithBaseURI(baseURI, subscriptionID)} } // CreateUpdateCassandraKeyspace create or update an Azure Cosmos DB Cassandra keyspace // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // keyspaceName - cosmos DB keyspace name. // createUpdateCassandraKeyspaceParameters - the parameters to provide for the current Cassandra keyspace. @@ -61,6 +61,8 @@ func (client CassandraResourcesClient) CreateUpdateCassandraKeyspace(ctx context }() } 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}, @@ -144,7 +146,7 @@ func (client CassandraResourcesClient) CreateUpdateCassandraKeyspaceResponder(re // CreateUpdateCassandraTable create or update an Azure Cosmos DB Cassandra Table // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // keyspaceName - cosmos DB keyspace name. // tableName - cosmos DB table name. @@ -161,6 +163,8 @@ func (client CassandraResourcesClient) CreateUpdateCassandraTable(ctx context.Co }() } 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}, @@ -245,7 +249,7 @@ func (client CassandraResourcesClient) CreateUpdateCassandraTableResponder(resp // DeleteCassandraKeyspace deletes an existing Azure Cosmos DB Cassandra keyspace. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // keyspaceName - cosmos DB keyspace name. func (client CassandraResourcesClient) DeleteCassandraKeyspace(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string) (result CassandraResourcesDeleteCassandraKeyspaceFuture, err error) { @@ -260,6 +264,8 @@ func (client CassandraResourcesClient) DeleteCassandraKeyspace(ctx context.Conte }() } 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}, @@ -334,7 +340,7 @@ func (client CassandraResourcesClient) DeleteCassandraKeyspaceResponder(resp *ht // DeleteCassandraTable deletes an existing Azure Cosmos DB Cassandra table. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // keyspaceName - cosmos DB keyspace name. // tableName - cosmos DB table name. @@ -350,6 +356,8 @@ func (client CassandraResourcesClient) DeleteCassandraTable(ctx context.Context, }() } 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}, @@ -426,7 +434,7 @@ func (client CassandraResourcesClient) DeleteCassandraTableResponder(resp *http. // GetCassandraKeyspace gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the // provided name. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // keyspaceName - cosmos DB keyspace name. func (client CassandraResourcesClient) GetCassandraKeyspace(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string) (result CassandraKeyspaceGetResults, err error) { @@ -441,6 +449,8 @@ func (client CassandraResourcesClient) GetCassandraKeyspace(ctx context.Context, }() } 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}, @@ -517,7 +527,7 @@ func (client CassandraResourcesClient) GetCassandraKeyspaceResponder(resp *http. // GetCassandraKeyspaceThroughput gets the RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB // database account with the provided name. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // keyspaceName - cosmos DB keyspace name. func (client CassandraResourcesClient) GetCassandraKeyspaceThroughput(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string) (result ThroughputSettingsGetResults, err error) { @@ -532,6 +542,8 @@ func (client CassandraResourcesClient) GetCassandraKeyspaceThroughput(ctx contex }() } 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}, @@ -607,7 +619,7 @@ func (client CassandraResourcesClient) GetCassandraKeyspaceThroughputResponder(r // GetCassandraTable gets the Cassandra table under an existing Azure Cosmos DB database account. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // keyspaceName - cosmos DB keyspace name. // tableName - cosmos DB table name. @@ -623,6 +635,8 @@ func (client CassandraResourcesClient) GetCassandraTable(ctx context.Context, re }() } 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}, @@ -700,7 +714,7 @@ func (client CassandraResourcesClient) GetCassandraTableResponder(resp *http.Res // GetCassandraTableThroughput gets the RUs per second of the Cassandra table under an existing Azure Cosmos DB // database account with the provided name. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // keyspaceName - cosmos DB keyspace name. // tableName - cosmos DB table name. @@ -716,6 +730,8 @@ func (client CassandraResourcesClient) GetCassandraTableThroughput(ctx context.C }() } 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}, @@ -792,7 +808,7 @@ func (client CassandraResourcesClient) GetCassandraTableThroughputResponder(resp // ListCassandraKeyspaces lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. func (client CassandraResourcesClient) ListCassandraKeyspaces(ctx context.Context, resourceGroupName string, accountName string) (result CassandraKeyspaceListResult, err error) { if tracing.IsEnabled() { @@ -806,6 +822,8 @@ func (client CassandraResourcesClient) ListCassandraKeyspaces(ctx context.Contex }() } 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}, @@ -880,7 +898,7 @@ func (client CassandraResourcesClient) ListCassandraKeyspacesResponder(resp *htt // ListCassandraTables lists the Cassandra table under an existing Azure Cosmos DB database account. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // keyspaceName - cosmos DB keyspace name. func (client CassandraResourcesClient) ListCassandraTables(ctx context.Context, resourceGroupName string, accountName string, keyspaceName string) (result CassandraTableListResult, err error) { @@ -895,6 +913,8 @@ func (client CassandraResourcesClient) ListCassandraTables(ctx context.Context, }() } 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}, @@ -970,7 +990,7 @@ func (client CassandraResourcesClient) ListCassandraTablesResponder(resp *http.R // UpdateCassandraKeyspaceThroughput update RUs per second of an Azure Cosmos DB Cassandra Keyspace // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // keyspaceName - cosmos DB keyspace name. // updateThroughputParameters - the RUs per second of the parameters to provide for the current Cassandra @@ -987,6 +1007,8 @@ func (client CassandraResourcesClient) UpdateCassandraKeyspaceThroughput(ctx con }() } 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}, @@ -1071,7 +1093,7 @@ func (client CassandraResourcesClient) UpdateCassandraKeyspaceThroughputResponde // UpdateCassandraTableThroughput update RUs per second of an Azure Cosmos DB Cassandra table // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // keyspaceName - cosmos DB keyspace name. // tableName - cosmos DB table name. @@ -1089,6 +1111,8 @@ func (client CassandraResourcesClient) UpdateCassandraTableThroughput(ctx contex }() } 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}, diff --git a/services/cosmos-db/mgmt/2020-03-01/documentdb/client.go b/services/cosmos-db/mgmt/2020-03-01/documentdb/client.go index 81a12f33ea0d..0ad2ff76e31b 100644 --- a/services/cosmos-db/mgmt/2020-03-01/documentdb/client.go +++ b/services/cosmos-db/mgmt/2020-03-01/documentdb/client.go @@ -32,23 +32,21 @@ const ( // BaseClient is the base client for Documentdb. type BaseClient struct { autorest.Client - BaseURI string - SubscriptionID string - SubscriptionID1 string + BaseURI string + SubscriptionID string } // New creates an instance of the BaseClient client. -func New(subscriptionID string, subscriptionID1 string) BaseClient { - return NewWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) +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, subscriptionID1 string) BaseClient { +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { return BaseClient{ - Client: autorest.NewClientWithUserAgent(UserAgent()), - BaseURI: baseURI, - SubscriptionID: subscriptionID, - SubscriptionID1: subscriptionID1, + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + SubscriptionID: subscriptionID, } } diff --git a/services/cosmos-db/mgmt/2020-03-01/documentdb/collection.go b/services/cosmos-db/mgmt/2020-03-01/documentdb/collection.go index bd170dde8e98..8320bc00196b 100644 --- a/services/cosmos-db/mgmt/2020-03-01/documentdb/collection.go +++ b/services/cosmos-db/mgmt/2020-03-01/documentdb/collection.go @@ -32,19 +32,19 @@ type CollectionClient struct { } // NewCollectionClient creates an instance of the CollectionClient client. -func NewCollectionClient(subscriptionID string, subscriptionID1 string) CollectionClient { - return NewCollectionClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) +func NewCollectionClient(subscriptionID string) CollectionClient { + return NewCollectionClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewCollectionClientWithBaseURI creates an instance of the CollectionClient 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 NewCollectionClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) CollectionClient { - return CollectionClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} +func NewCollectionClientWithBaseURI(baseURI string, subscriptionID string) CollectionClient { + return CollectionClient{NewWithBaseURI(baseURI, subscriptionID)} } // ListMetricDefinitions retrieves metric definitions for the given collection. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // databaseRid - cosmos DB database rid. // collectionRid - cosmos DB collection rid. @@ -60,6 +60,8 @@ func (client CollectionClient) ListMetricDefinitions(ctx context.Context, resour }() } 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}, @@ -136,7 +138,7 @@ func (client CollectionClient) ListMetricDefinitionsResponder(resp *http.Respons // ListMetrics retrieves the metrics determined by the given filter for the given database account and collection. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // databaseRid - cosmos DB database rid. // collectionRid - cosmos DB collection rid. @@ -155,6 +157,8 @@ func (client CollectionClient) ListMetrics(ctx context.Context, resourceGroupNam }() } 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}, @@ -232,7 +236,7 @@ func (client CollectionClient) ListMetricsResponder(resp *http.Response) (result // ListUsages retrieves the usages (most recent storage data) for the given collection. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // databaseRid - cosmos DB database rid. // collectionRid - cosmos DB collection rid. @@ -250,6 +254,8 @@ func (client CollectionClient) ListUsages(ctx context.Context, resourceGroupName }() } 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}, diff --git a/services/cosmos-db/mgmt/2020-03-01/documentdb/collectionpartition.go b/services/cosmos-db/mgmt/2020-03-01/documentdb/collectionpartition.go index 1f5e05d0489c..2c97d21748bb 100644 --- a/services/cosmos-db/mgmt/2020-03-01/documentdb/collectionpartition.go +++ b/services/cosmos-db/mgmt/2020-03-01/documentdb/collectionpartition.go @@ -32,20 +32,20 @@ type CollectionPartitionClient struct { } // NewCollectionPartitionClient creates an instance of the CollectionPartitionClient client. -func NewCollectionPartitionClient(subscriptionID string, subscriptionID1 string) CollectionPartitionClient { - return NewCollectionPartitionClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) +func NewCollectionPartitionClient(subscriptionID string) CollectionPartitionClient { + return NewCollectionPartitionClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewCollectionPartitionClientWithBaseURI creates an instance of the CollectionPartitionClient 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 NewCollectionPartitionClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) CollectionPartitionClient { - return CollectionPartitionClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} +func NewCollectionPartitionClientWithBaseURI(baseURI string, subscriptionID string) CollectionPartitionClient { + return CollectionPartitionClient{NewWithBaseURI(baseURI, subscriptionID)} } // ListMetrics retrieves the metrics determined by the given filter for the given collection, split by partition. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // databaseRid - cosmos DB database rid. // collectionRid - cosmos DB collection rid. @@ -64,6 +64,8 @@ func (client CollectionPartitionClient) ListMetrics(ctx context.Context, resourc }() } 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}, @@ -141,7 +143,7 @@ func (client CollectionPartitionClient) ListMetricsResponder(resp *http.Response // ListUsages retrieves the usages (most recent storage data) for the given collection, split by partition. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // databaseRid - cosmos DB database rid. // collectionRid - cosmos DB collection rid. @@ -159,6 +161,8 @@ func (client CollectionPartitionClient) ListUsages(ctx context.Context, resource }() } 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}, diff --git a/services/cosmos-db/mgmt/2020-03-01/documentdb/collectionpartitionregion.go b/services/cosmos-db/mgmt/2020-03-01/documentdb/collectionpartitionregion.go index 64f065b1887a..3df0b2f6765d 100644 --- a/services/cosmos-db/mgmt/2020-03-01/documentdb/collectionpartitionregion.go +++ b/services/cosmos-db/mgmt/2020-03-01/documentdb/collectionpartitionregion.go @@ -32,21 +32,21 @@ type CollectionPartitionRegionClient struct { } // NewCollectionPartitionRegionClient creates an instance of the CollectionPartitionRegionClient client. -func NewCollectionPartitionRegionClient(subscriptionID string, subscriptionID1 string) CollectionPartitionRegionClient { - return NewCollectionPartitionRegionClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) +func NewCollectionPartitionRegionClient(subscriptionID string) CollectionPartitionRegionClient { + return NewCollectionPartitionRegionClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewCollectionPartitionRegionClientWithBaseURI creates an instance of the CollectionPartitionRegionClient 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 NewCollectionPartitionRegionClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) CollectionPartitionRegionClient { - return CollectionPartitionRegionClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} +func NewCollectionPartitionRegionClientWithBaseURI(baseURI string, subscriptionID string) CollectionPartitionRegionClient { + return CollectionPartitionRegionClient{NewWithBaseURI(baseURI, subscriptionID)} } // ListMetrics retrieves the metrics determined by the given filter for the given collection and region, split by // partition. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // region - cosmos DB region, with spaces between words and each word capitalized. // databaseRid - cosmos DB database rid. @@ -66,6 +66,8 @@ func (client CollectionPartitionRegionClient) ListMetrics(ctx context.Context, r }() } 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}, diff --git a/services/cosmos-db/mgmt/2020-03-01/documentdb/collectionregion.go b/services/cosmos-db/mgmt/2020-03-01/documentdb/collectionregion.go index 9230730ed7b8..a2b73f368a44 100644 --- a/services/cosmos-db/mgmt/2020-03-01/documentdb/collectionregion.go +++ b/services/cosmos-db/mgmt/2020-03-01/documentdb/collectionregion.go @@ -32,21 +32,21 @@ type CollectionRegionClient struct { } // NewCollectionRegionClient creates an instance of the CollectionRegionClient client. -func NewCollectionRegionClient(subscriptionID string, subscriptionID1 string) CollectionRegionClient { - return NewCollectionRegionClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) +func NewCollectionRegionClient(subscriptionID string) CollectionRegionClient { + return NewCollectionRegionClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewCollectionRegionClientWithBaseURI creates an instance of the CollectionRegionClient 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 NewCollectionRegionClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) CollectionRegionClient { - return CollectionRegionClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} +func NewCollectionRegionClientWithBaseURI(baseURI string, subscriptionID string) CollectionRegionClient { + return CollectionRegionClient{NewWithBaseURI(baseURI, subscriptionID)} } // ListMetrics retrieves the metrics determined by the given filter for the given database account, collection and // region. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // region - cosmos DB region, with spaces between words and each word capitalized. // databaseRid - cosmos DB database rid. @@ -66,6 +66,8 @@ func (client CollectionRegionClient) ListMetrics(ctx context.Context, resourceGr }() } 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}, diff --git a/services/cosmos-db/mgmt/2020-03-01/documentdb/database.go b/services/cosmos-db/mgmt/2020-03-01/documentdb/database.go index 671ac8bd9919..41cc8df006c9 100644 --- a/services/cosmos-db/mgmt/2020-03-01/documentdb/database.go +++ b/services/cosmos-db/mgmt/2020-03-01/documentdb/database.go @@ -32,19 +32,19 @@ type DatabaseClient struct { } // NewDatabaseClient creates an instance of the DatabaseClient client. -func NewDatabaseClient(subscriptionID string, subscriptionID1 string) DatabaseClient { - return NewDatabaseClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) +func NewDatabaseClient(subscriptionID string) DatabaseClient { + return NewDatabaseClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewDatabaseClientWithBaseURI creates an instance of the DatabaseClient 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 NewDatabaseClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) DatabaseClient { - return DatabaseClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} +func NewDatabaseClientWithBaseURI(baseURI string, subscriptionID string) DatabaseClient { + return DatabaseClient{NewWithBaseURI(baseURI, subscriptionID)} } // ListMetricDefinitions retrieves metric definitions for the given database. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // databaseRid - cosmos DB database rid. func (client DatabaseClient) ListMetricDefinitions(ctx context.Context, resourceGroupName string, accountName string, databaseRid string) (result MetricDefinitionsListResult, err error) { @@ -59,6 +59,8 @@ func (client DatabaseClient) ListMetricDefinitions(ctx context.Context, resource }() } 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}, @@ -134,7 +136,7 @@ func (client DatabaseClient) ListMetricDefinitionsResponder(resp *http.Response) // ListMetrics retrieves the metrics determined by the given filter for the given database account and database. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // databaseRid - cosmos DB database rid. // filter - an OData filter expression that describes a subset of metrics to return. The parameters that can be @@ -152,6 +154,8 @@ func (client DatabaseClient) ListMetrics(ctx context.Context, resourceGroupName }() } 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}, @@ -228,7 +232,7 @@ func (client DatabaseClient) ListMetricsResponder(resp *http.Response) (result M // ListUsages retrieves the usages (most recent data) for the given database. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // databaseRid - cosmos DB database rid. // filter - an OData filter expression that describes a subset of usages to return. The supported parameter is @@ -245,6 +249,8 @@ func (client DatabaseClient) ListUsages(ctx context.Context, resourceGroupName s }() } 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}, diff --git a/services/cosmos-db/mgmt/2020-03-01/documentdb/databaseaccountregion.go b/services/cosmos-db/mgmt/2020-03-01/documentdb/databaseaccountregion.go index 937a80550a78..ae049b0415c5 100644 --- a/services/cosmos-db/mgmt/2020-03-01/documentdb/databaseaccountregion.go +++ b/services/cosmos-db/mgmt/2020-03-01/documentdb/databaseaccountregion.go @@ -32,20 +32,20 @@ type DatabaseAccountRegionClient struct { } // NewDatabaseAccountRegionClient creates an instance of the DatabaseAccountRegionClient client. -func NewDatabaseAccountRegionClient(subscriptionID string, subscriptionID1 string) DatabaseAccountRegionClient { - return NewDatabaseAccountRegionClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) +func NewDatabaseAccountRegionClient(subscriptionID string) DatabaseAccountRegionClient { + return NewDatabaseAccountRegionClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewDatabaseAccountRegionClientWithBaseURI creates an instance of the DatabaseAccountRegionClient 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 NewDatabaseAccountRegionClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) DatabaseAccountRegionClient { - return DatabaseAccountRegionClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} +func NewDatabaseAccountRegionClientWithBaseURI(baseURI string, subscriptionID string) DatabaseAccountRegionClient { + return DatabaseAccountRegionClient{NewWithBaseURI(baseURI, subscriptionID)} } // ListMetrics retrieves the metrics determined by the given filter for the given database account and region. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // region - cosmos DB region, with spaces between words and each word capitalized. // filter - an OData filter expression that describes a subset of metrics to return. The parameters that can be @@ -63,6 +63,8 @@ func (client DatabaseAccountRegionClient) ListMetrics(ctx context.Context, resou }() } 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}, diff --git a/services/cosmos-db/mgmt/2020-03-01/documentdb/databaseaccounts.go b/services/cosmos-db/mgmt/2020-03-01/documentdb/databaseaccounts.go index 6d94b29c02de..76abc75a9af9 100644 --- a/services/cosmos-db/mgmt/2020-03-01/documentdb/databaseaccounts.go +++ b/services/cosmos-db/mgmt/2020-03-01/documentdb/databaseaccounts.go @@ -32,15 +32,15 @@ type DatabaseAccountsClient struct { } // NewDatabaseAccountsClient creates an instance of the DatabaseAccountsClient client. -func NewDatabaseAccountsClient(subscriptionID string, subscriptionID1 string) DatabaseAccountsClient { - return NewDatabaseAccountsClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) +func NewDatabaseAccountsClient(subscriptionID string) DatabaseAccountsClient { + return NewDatabaseAccountsClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewDatabaseAccountsClientWithBaseURI creates an instance of the DatabaseAccountsClient 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 NewDatabaseAccountsClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) DatabaseAccountsClient { - return DatabaseAccountsClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} +func NewDatabaseAccountsClientWithBaseURI(baseURI string, subscriptionID string) DatabaseAccountsClient { + return DatabaseAccountsClient{NewWithBaseURI(baseURI, subscriptionID)} } // CheckNameExists checks that the Azure Cosmos DB account name already exists. A valid account name may contain only @@ -127,7 +127,7 @@ func (client DatabaseAccountsClient) CheckNameExistsResponder(resp *http.Respons // CreateOrUpdate creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when // performing updates on an account. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // createUpdateParameters - the parameters to provide for the current database account. func (client DatabaseAccountsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, createUpdateParameters DatabaseAccountCreateUpdateParameters) (result DatabaseAccountsCreateOrUpdateFuture, err error) { @@ -142,6 +142,8 @@ func (client DatabaseAccountsClient) CreateOrUpdate(ctx context.Context, resourc }() } 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}, @@ -233,7 +235,7 @@ func (client DatabaseAccountsClient) CreateOrUpdateResponder(resp *http.Response // Delete deletes an existing Azure Cosmos DB database account. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. func (client DatabaseAccountsClient) Delete(ctx context.Context, resourceGroupName string, accountName string) (result DatabaseAccountsDeleteFuture, err error) { if tracing.IsEnabled() { @@ -247,6 +249,8 @@ func (client DatabaseAccountsClient) Delete(ctx context.Context, resourceGroupNa }() } 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}, @@ -322,7 +326,7 @@ func (client DatabaseAccountsClient) DeleteResponder(resp *http.Response) (resul // of 0 indicates a write region. The maximum value for a failover priority = (total number of regions - 1). Failover // priority values must be unique for each of the regions in which the database account exists. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // failoverParameters - the new failover policies for the database account. func (client DatabaseAccountsClient) FailoverPriorityChange(ctx context.Context, resourceGroupName string, accountName string, failoverParameters FailoverPolicies) (result DatabaseAccountsFailoverPriorityChangeFuture, err error) { @@ -337,6 +341,8 @@ func (client DatabaseAccountsClient) FailoverPriorityChange(ctx context.Context, }() } 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}, @@ -414,7 +420,7 @@ func (client DatabaseAccountsClient) FailoverPriorityChangeResponder(resp *http. // Get retrieves the properties of an existing Azure Cosmos DB database account. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. func (client DatabaseAccountsClient) Get(ctx context.Context, resourceGroupName string, accountName string) (result DatabaseAccountGetResults, err error) { if tracing.IsEnabled() { @@ -428,6 +434,8 @@ func (client DatabaseAccountsClient) Get(ctx context.Context, resourceGroupName }() } 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}, @@ -502,7 +510,7 @@ func (client DatabaseAccountsClient) GetResponder(resp *http.Response) (result D // GetReadOnlyKeys lists the read-only access keys for the specified Azure Cosmos DB database account. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. func (client DatabaseAccountsClient) GetReadOnlyKeys(ctx context.Context, resourceGroupName string, accountName string) (result DatabaseAccountListReadOnlyKeysResult, err error) { if tracing.IsEnabled() { @@ -516,6 +524,8 @@ func (client DatabaseAccountsClient) GetReadOnlyKeys(ctx context.Context, resour }() } 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}, @@ -600,6 +610,12 @@ func (client DatabaseAccountsClient) List(ctx context.Context) (result DatabaseA 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("documentdb.DatabaseAccountsClient", "List", err.Error()) + } + req, err := client.ListPreparer(ctx) if err != nil { err = autorest.NewErrorWithError(err, "documentdb.DatabaseAccountsClient", "List", nil, "Failure preparing request") @@ -661,7 +677,7 @@ func (client DatabaseAccountsClient) ListResponder(resp *http.Response) (result // ListByResourceGroup lists all the Azure Cosmos DB database accounts available under the given resource group. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. func (client DatabaseAccountsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result DatabaseAccountsListResult, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/DatabaseAccountsClient.ListByResourceGroup") @@ -677,7 +693,9 @@ func (client DatabaseAccountsClient) ListByResourceGroup(ctx context.Context, re {TargetValue: resourceGroupName, Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { return result, validation.NewError("documentdb.DatabaseAccountsClient", "ListByResourceGroup", err.Error()) } @@ -743,7 +761,7 @@ func (client DatabaseAccountsClient) ListByResourceGroupResponder(resp *http.Res // ListConnectionStrings lists the connection strings for the specified Azure Cosmos DB database account. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. func (client DatabaseAccountsClient) ListConnectionStrings(ctx context.Context, resourceGroupName string, accountName string) (result DatabaseAccountListConnectionStringsResult, err error) { if tracing.IsEnabled() { @@ -757,6 +775,8 @@ func (client DatabaseAccountsClient) ListConnectionStrings(ctx context.Context, }() } 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}, @@ -831,7 +851,7 @@ func (client DatabaseAccountsClient) ListConnectionStringsResponder(resp *http.R // ListKeys lists the access keys for the specified Azure Cosmos DB database account. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. func (client DatabaseAccountsClient) ListKeys(ctx context.Context, resourceGroupName string, accountName string) (result DatabaseAccountListKeysResult, err error) { if tracing.IsEnabled() { @@ -845,6 +865,8 @@ func (client DatabaseAccountsClient) ListKeys(ctx context.Context, resourceGroup }() } 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}, @@ -919,7 +941,7 @@ func (client DatabaseAccountsClient) ListKeysResponder(resp *http.Response) (res // ListMetricDefinitions retrieves metric definitions for the given database account. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. func (client DatabaseAccountsClient) ListMetricDefinitions(ctx context.Context, resourceGroupName string, accountName string) (result MetricDefinitionsListResult, err error) { if tracing.IsEnabled() { @@ -933,6 +955,8 @@ func (client DatabaseAccountsClient) ListMetricDefinitions(ctx context.Context, }() } 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}, @@ -1007,7 +1031,7 @@ func (client DatabaseAccountsClient) ListMetricDefinitionsResponder(resp *http.R // ListMetrics retrieves the metrics determined by the given filter for the given database account. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // filter - an OData filter expression that describes a subset of metrics to return. The parameters that can be // filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and @@ -1024,6 +1048,8 @@ func (client DatabaseAccountsClient) ListMetrics(ctx context.Context, resourceGr }() } 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}, @@ -1099,7 +1125,7 @@ func (client DatabaseAccountsClient) ListMetricsResponder(resp *http.Response) ( // ListReadOnlyKeys lists the read-only access keys for the specified Azure Cosmos DB database account. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. func (client DatabaseAccountsClient) ListReadOnlyKeys(ctx context.Context, resourceGroupName string, accountName string) (result DatabaseAccountListReadOnlyKeysResult, err error) { if tracing.IsEnabled() { @@ -1113,6 +1139,8 @@ func (client DatabaseAccountsClient) ListReadOnlyKeys(ctx context.Context, resou }() } 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}, @@ -1187,7 +1215,7 @@ func (client DatabaseAccountsClient) ListReadOnlyKeysResponder(resp *http.Respon // ListUsages retrieves the usages (most recent data) for the given database account. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // filter - an OData filter expression that describes a subset of usages to return. The supported parameter is // name.value (name of the metric, can have an or of multiple names). @@ -1203,6 +1231,8 @@ func (client DatabaseAccountsClient) ListUsages(ctx context.Context, resourceGro }() } 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}, @@ -1280,7 +1310,7 @@ func (client DatabaseAccountsClient) ListUsagesResponder(resp *http.Response) (r // OfflineRegion offline the specified region for the specified Azure Cosmos DB database account. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // regionParameterForOffline - cosmos DB region to offline for the database account. func (client DatabaseAccountsClient) OfflineRegion(ctx context.Context, resourceGroupName string, accountName string, regionParameterForOffline RegionForOnlineOffline) (result DatabaseAccountsOfflineRegionFuture, err error) { @@ -1295,6 +1325,8 @@ func (client DatabaseAccountsClient) OfflineRegion(ctx context.Context, resource }() } 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}, @@ -1372,7 +1404,7 @@ func (client DatabaseAccountsClient) OfflineRegionResponder(resp *http.Response) // OnlineRegion online the specified region for the specified Azure Cosmos DB database account. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // regionParameterForOnline - cosmos DB region to online for the database account. func (client DatabaseAccountsClient) OnlineRegion(ctx context.Context, resourceGroupName string, accountName string, regionParameterForOnline RegionForOnlineOffline) (result DatabaseAccountsOnlineRegionFuture, err error) { @@ -1387,6 +1419,8 @@ func (client DatabaseAccountsClient) OnlineRegion(ctx context.Context, resourceG }() } 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}, @@ -1464,7 +1498,7 @@ func (client DatabaseAccountsClient) OnlineRegionResponder(resp *http.Response) // RegenerateKey regenerates an access key for the specified Azure Cosmos DB database account. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // keyToRegenerate - the name of the key to regenerate. func (client DatabaseAccountsClient) RegenerateKey(ctx context.Context, resourceGroupName string, accountName string, keyToRegenerate DatabaseAccountRegenerateKeyParameters) (result DatabaseAccountsRegenerateKeyFuture, err error) { @@ -1479,6 +1513,8 @@ func (client DatabaseAccountsClient) RegenerateKey(ctx context.Context, resource }() } 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}, @@ -1554,7 +1590,7 @@ func (client DatabaseAccountsClient) RegenerateKeyResponder(resp *http.Response) // Update updates the properties of an existing Azure Cosmos DB database account. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // updateParameters - the parameters to provide for the current database account. func (client DatabaseAccountsClient) Update(ctx context.Context, resourceGroupName string, accountName string, updateParameters DatabaseAccountUpdateParameters) (result DatabaseAccountsUpdateFuture, err error) { @@ -1569,6 +1605,8 @@ func (client DatabaseAccountsClient) Update(ctx context.Context, resourceGroupNa }() } 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}, diff --git a/services/cosmos-db/mgmt/2020-03-01/documentdb/gremlinresources.go b/services/cosmos-db/mgmt/2020-03-01/documentdb/gremlinresources.go index dd0fecef96d6..84b3a403f2c0 100644 --- a/services/cosmos-db/mgmt/2020-03-01/documentdb/gremlinresources.go +++ b/services/cosmos-db/mgmt/2020-03-01/documentdb/gremlinresources.go @@ -32,20 +32,20 @@ type GremlinResourcesClient struct { } // NewGremlinResourcesClient creates an instance of the GremlinResourcesClient client. -func NewGremlinResourcesClient(subscriptionID string, subscriptionID1 string) GremlinResourcesClient { - return NewGremlinResourcesClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) +func NewGremlinResourcesClient(subscriptionID string) GremlinResourcesClient { + return NewGremlinResourcesClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewGremlinResourcesClientWithBaseURI creates an instance of the GremlinResourcesClient 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 NewGremlinResourcesClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) GremlinResourcesClient { - return GremlinResourcesClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} +func NewGremlinResourcesClientWithBaseURI(baseURI string, subscriptionID string) GremlinResourcesClient { + return GremlinResourcesClient{NewWithBaseURI(baseURI, subscriptionID)} } // CreateUpdateGremlinDatabase create or update an Azure Cosmos DB Gremlin database // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // databaseName - cosmos DB database name. // createUpdateGremlinDatabaseParameters - the parameters to provide for the current Gremlin database. @@ -61,6 +61,8 @@ func (client GremlinResourcesClient) CreateUpdateGremlinDatabase(ctx context.Con }() } 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}, @@ -144,7 +146,7 @@ func (client GremlinResourcesClient) CreateUpdateGremlinDatabaseResponder(resp * // CreateUpdateGremlinGraph create or update an Azure Cosmos DB Gremlin graph // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // databaseName - cosmos DB database name. // graphName - cosmos DB graph name. @@ -161,6 +163,8 @@ func (client GremlinResourcesClient) CreateUpdateGremlinGraph(ctx context.Contex }() } 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}, @@ -252,7 +256,7 @@ func (client GremlinResourcesClient) CreateUpdateGremlinGraphResponder(resp *htt // DeleteGremlinDatabase deletes an existing Azure Cosmos DB Gremlin database. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // databaseName - cosmos DB database name. func (client GremlinResourcesClient) DeleteGremlinDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result GremlinResourcesDeleteGremlinDatabaseFuture, err error) { @@ -267,6 +271,8 @@ func (client GremlinResourcesClient) DeleteGremlinDatabase(ctx context.Context, }() } 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}, @@ -341,7 +347,7 @@ func (client GremlinResourcesClient) DeleteGremlinDatabaseResponder(resp *http.R // DeleteGremlinGraph deletes an existing Azure Cosmos DB Gremlin graph. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // databaseName - cosmos DB database name. // graphName - cosmos DB graph name. @@ -357,6 +363,8 @@ func (client GremlinResourcesClient) DeleteGremlinGraph(ctx context.Context, res }() } 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}, @@ -433,7 +441,7 @@ func (client GremlinResourcesClient) DeleteGremlinGraphResponder(resp *http.Resp // GetGremlinDatabase gets the Gremlin databases under an existing Azure Cosmos DB database account with the provided // name. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // databaseName - cosmos DB database name. func (client GremlinResourcesClient) GetGremlinDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result GremlinDatabaseGetResults, err error) { @@ -448,6 +456,8 @@ func (client GremlinResourcesClient) GetGremlinDatabase(ctx context.Context, res }() } 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}, @@ -524,7 +534,7 @@ func (client GremlinResourcesClient) GetGremlinDatabaseResponder(resp *http.Resp // GetGremlinDatabaseThroughput gets the RUs per second of the Gremlin database under an existing Azure Cosmos DB // database account with the provided name. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // databaseName - cosmos DB database name. func (client GremlinResourcesClient) GetGremlinDatabaseThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result ThroughputSettingsGetResults, err error) { @@ -539,6 +549,8 @@ func (client GremlinResourcesClient) GetGremlinDatabaseThroughput(ctx context.Co }() } 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}, @@ -614,7 +626,7 @@ func (client GremlinResourcesClient) GetGremlinDatabaseThroughputResponder(resp // GetGremlinGraph gets the Gremlin graph under an existing Azure Cosmos DB database account. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // databaseName - cosmos DB database name. // graphName - cosmos DB graph name. @@ -630,6 +642,8 @@ func (client GremlinResourcesClient) GetGremlinGraph(ctx context.Context, resour }() } 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}, @@ -707,7 +721,7 @@ func (client GremlinResourcesClient) GetGremlinGraphResponder(resp *http.Respons // GetGremlinGraphThroughput gets the Gremlin graph throughput under an existing Azure Cosmos DB database account with // the provided name. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // databaseName - cosmos DB database name. // graphName - cosmos DB graph name. @@ -723,6 +737,8 @@ func (client GremlinResourcesClient) GetGremlinGraphThroughput(ctx context.Conte }() } 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}, @@ -799,7 +815,7 @@ func (client GremlinResourcesClient) GetGremlinGraphThroughputResponder(resp *ht // ListGremlinDatabases lists the Gremlin databases under an existing Azure Cosmos DB database account. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. func (client GremlinResourcesClient) ListGremlinDatabases(ctx context.Context, resourceGroupName string, accountName string) (result GremlinDatabaseListResult, err error) { if tracing.IsEnabled() { @@ -813,6 +829,8 @@ func (client GremlinResourcesClient) ListGremlinDatabases(ctx context.Context, r }() } 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}, @@ -887,7 +905,7 @@ func (client GremlinResourcesClient) ListGremlinDatabasesResponder(resp *http.Re // ListGremlinGraphs lists the Gremlin graph under an existing Azure Cosmos DB database account. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // databaseName - cosmos DB database name. func (client GremlinResourcesClient) ListGremlinGraphs(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result GremlinGraphListResult, err error) { @@ -902,6 +920,8 @@ func (client GremlinResourcesClient) ListGremlinGraphs(ctx context.Context, reso }() } 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}, @@ -977,7 +997,7 @@ func (client GremlinResourcesClient) ListGremlinGraphsResponder(resp *http.Respo // UpdateGremlinDatabaseThroughput update RUs per second of an Azure Cosmos DB Gremlin database // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // databaseName - cosmos DB database name. // updateThroughputParameters - the RUs per second of the parameters to provide for the current Gremlin @@ -994,6 +1014,8 @@ func (client GremlinResourcesClient) UpdateGremlinDatabaseThroughput(ctx context }() } 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}, @@ -1078,7 +1100,7 @@ func (client GremlinResourcesClient) UpdateGremlinDatabaseThroughputResponder(re // UpdateGremlinGraphThroughput update RUs per second of an Azure Cosmos DB Gremlin graph // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // databaseName - cosmos DB database name. // graphName - cosmos DB graph name. @@ -1095,6 +1117,8 @@ func (client GremlinResourcesClient) UpdateGremlinGraphThroughput(ctx context.Co }() } 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}, diff --git a/services/cosmos-db/mgmt/2020-03-01/documentdb/mongodbresources.go b/services/cosmos-db/mgmt/2020-03-01/documentdb/mongodbresources.go index 4a96bef27fbb..db518f387bfa 100644 --- a/services/cosmos-db/mgmt/2020-03-01/documentdb/mongodbresources.go +++ b/services/cosmos-db/mgmt/2020-03-01/documentdb/mongodbresources.go @@ -32,20 +32,20 @@ type MongoDBResourcesClient struct { } // NewMongoDBResourcesClient creates an instance of the MongoDBResourcesClient client. -func NewMongoDBResourcesClient(subscriptionID string, subscriptionID1 string) MongoDBResourcesClient { - return NewMongoDBResourcesClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) +func NewMongoDBResourcesClient(subscriptionID string) MongoDBResourcesClient { + return NewMongoDBResourcesClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewMongoDBResourcesClientWithBaseURI creates an instance of the MongoDBResourcesClient 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 NewMongoDBResourcesClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) MongoDBResourcesClient { - return MongoDBResourcesClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} +func NewMongoDBResourcesClientWithBaseURI(baseURI string, subscriptionID string) MongoDBResourcesClient { + return MongoDBResourcesClient{NewWithBaseURI(baseURI, subscriptionID)} } // CreateUpdateMongoDBCollection create or update an Azure Cosmos DB MongoDB Collection // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // databaseName - cosmos DB database name. // collectionName - cosmos DB collection name. @@ -62,6 +62,8 @@ func (client MongoDBResourcesClient) CreateUpdateMongoDBCollection(ctx context.C }() } 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}, @@ -146,7 +148,7 @@ func (client MongoDBResourcesClient) CreateUpdateMongoDBCollectionResponder(resp // CreateUpdateMongoDBDatabase create or updates Azure Cosmos DB MongoDB database // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // databaseName - cosmos DB database name. // createUpdateMongoDBDatabaseParameters - the parameters to provide for the current MongoDB database. @@ -162,6 +164,8 @@ func (client MongoDBResourcesClient) CreateUpdateMongoDBDatabase(ctx context.Con }() } 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}, @@ -245,7 +249,7 @@ func (client MongoDBResourcesClient) CreateUpdateMongoDBDatabaseResponder(resp * // DeleteMongoDBCollection deletes an existing Azure Cosmos DB MongoDB Collection. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // databaseName - cosmos DB database name. // collectionName - cosmos DB collection name. @@ -261,6 +265,8 @@ func (client MongoDBResourcesClient) DeleteMongoDBCollection(ctx context.Context }() } 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}, @@ -336,7 +342,7 @@ func (client MongoDBResourcesClient) DeleteMongoDBCollectionResponder(resp *http // DeleteMongoDBDatabase deletes an existing Azure Cosmos DB MongoDB database. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // databaseName - cosmos DB database name. func (client MongoDBResourcesClient) DeleteMongoDBDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result MongoDBResourcesDeleteMongoDBDatabaseFuture, err error) { @@ -351,6 +357,8 @@ func (client MongoDBResourcesClient) DeleteMongoDBDatabase(ctx context.Context, }() } 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}, @@ -425,7 +433,7 @@ func (client MongoDBResourcesClient) DeleteMongoDBDatabaseResponder(resp *http.R // GetMongoDBCollection gets the MongoDB collection under an existing Azure Cosmos DB database account. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // databaseName - cosmos DB database name. // collectionName - cosmos DB collection name. @@ -441,6 +449,8 @@ func (client MongoDBResourcesClient) GetMongoDBCollection(ctx context.Context, r }() } 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}, @@ -518,7 +528,7 @@ func (client MongoDBResourcesClient) GetMongoDBCollectionResponder(resp *http.Re // GetMongoDBCollectionThroughput gets the RUs per second of the MongoDB collection under an existing Azure Cosmos DB // database account with the provided name. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // databaseName - cosmos DB database name. // collectionName - cosmos DB collection name. @@ -534,6 +544,8 @@ func (client MongoDBResourcesClient) GetMongoDBCollectionThroughput(ctx context. }() } 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}, @@ -611,7 +623,7 @@ func (client MongoDBResourcesClient) GetMongoDBCollectionThroughputResponder(res // GetMongoDBDatabase gets the MongoDB databases under an existing Azure Cosmos DB database account with the provided // name. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // databaseName - cosmos DB database name. func (client MongoDBResourcesClient) GetMongoDBDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result MongoDBDatabaseGetResults, err error) { @@ -626,6 +638,8 @@ func (client MongoDBResourcesClient) GetMongoDBDatabase(ctx context.Context, res }() } 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}, @@ -702,7 +716,7 @@ func (client MongoDBResourcesClient) GetMongoDBDatabaseResponder(resp *http.Resp // GetMongoDBDatabaseThroughput gets the RUs per second of the MongoDB database under an existing Azure Cosmos DB // database account with the provided name. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // databaseName - cosmos DB database name. func (client MongoDBResourcesClient) GetMongoDBDatabaseThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result ThroughputSettingsGetResults, err error) { @@ -717,6 +731,8 @@ func (client MongoDBResourcesClient) GetMongoDBDatabaseThroughput(ctx context.Co }() } 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}, @@ -792,7 +808,7 @@ func (client MongoDBResourcesClient) GetMongoDBDatabaseThroughputResponder(resp // ListMongoDBCollections lists the MongoDB collection under an existing Azure Cosmos DB database account. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // databaseName - cosmos DB database name. func (client MongoDBResourcesClient) ListMongoDBCollections(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result MongoDBCollectionListResult, err error) { @@ -807,6 +823,8 @@ func (client MongoDBResourcesClient) ListMongoDBCollections(ctx context.Context, }() } 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}, @@ -882,7 +900,7 @@ func (client MongoDBResourcesClient) ListMongoDBCollectionsResponder(resp *http. // ListMongoDBDatabases lists the MongoDB databases under an existing Azure Cosmos DB database account. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. func (client MongoDBResourcesClient) ListMongoDBDatabases(ctx context.Context, resourceGroupName string, accountName string) (result MongoDBDatabaseListResult, err error) { if tracing.IsEnabled() { @@ -896,6 +914,8 @@ func (client MongoDBResourcesClient) ListMongoDBDatabases(ctx context.Context, r }() } 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}, @@ -970,7 +990,7 @@ func (client MongoDBResourcesClient) ListMongoDBDatabasesResponder(resp *http.Re // UpdateMongoDBCollectionThroughput update the RUs per second of an Azure Cosmos DB MongoDB collection // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // databaseName - cosmos DB database name. // collectionName - cosmos DB collection name. @@ -988,6 +1008,8 @@ func (client MongoDBResourcesClient) UpdateMongoDBCollectionThroughput(ctx conte }() } 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}, @@ -1073,7 +1095,7 @@ func (client MongoDBResourcesClient) UpdateMongoDBCollectionThroughputResponder( // UpdateMongoDBDatabaseThroughput update RUs per second of the an Azure Cosmos DB MongoDB database // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // databaseName - cosmos DB database name. // updateThroughputParameters - the RUs per second of the parameters to provide for the current MongoDB @@ -1090,6 +1112,8 @@ func (client MongoDBResourcesClient) UpdateMongoDBDatabaseThroughput(ctx context }() } 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}, diff --git a/services/cosmos-db/mgmt/2020-03-01/documentdb/notebookworkspaces.go b/services/cosmos-db/mgmt/2020-03-01/documentdb/notebookworkspaces.go index b7f9cc1a3ed1..aacbf62a5c6d 100644 --- a/services/cosmos-db/mgmt/2020-03-01/documentdb/notebookworkspaces.go +++ b/services/cosmos-db/mgmt/2020-03-01/documentdb/notebookworkspaces.go @@ -32,20 +32,20 @@ type NotebookWorkspacesClient struct { } // NewNotebookWorkspacesClient creates an instance of the NotebookWorkspacesClient client. -func NewNotebookWorkspacesClient(subscriptionID string, subscriptionID1 string) NotebookWorkspacesClient { - return NewNotebookWorkspacesClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) +func NewNotebookWorkspacesClient(subscriptionID string) NotebookWorkspacesClient { + return NewNotebookWorkspacesClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewNotebookWorkspacesClientWithBaseURI creates an instance of the NotebookWorkspacesClient 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 NewNotebookWorkspacesClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) NotebookWorkspacesClient { - return NotebookWorkspacesClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} +func NewNotebookWorkspacesClientWithBaseURI(baseURI string, subscriptionID string) NotebookWorkspacesClient { + return NotebookWorkspacesClient{NewWithBaseURI(baseURI, subscriptionID)} } // CreateOrUpdate creates the notebook workspace for a Cosmos DB account. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // notebookCreateUpdateParameters - the notebook workspace to create for the current database account. func (client NotebookWorkspacesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, notebookCreateUpdateParameters NotebookWorkspaceCreateUpdateParameters) (result NotebookWorkspacesCreateOrUpdateFuture, err error) { @@ -60,6 +60,8 @@ func (client NotebookWorkspacesClient) CreateOrUpdate(ctx context.Context, resou }() } 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}, @@ -95,7 +97,7 @@ func (client NotebookWorkspacesClient) CreateOrUpdatePreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-08-01" + const APIVersion = "2020-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -137,7 +139,7 @@ func (client NotebookWorkspacesClient) CreateOrUpdateResponder(resp *http.Respon // Delete deletes the notebook workspace for a Cosmos DB account. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. func (client NotebookWorkspacesClient) Delete(ctx context.Context, resourceGroupName string, accountName string) (result NotebookWorkspacesDeleteFuture, err error) { if tracing.IsEnabled() { @@ -151,6 +153,8 @@ func (client NotebookWorkspacesClient) Delete(ctx context.Context, resourceGroup }() } 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}, @@ -186,7 +190,7 @@ func (client NotebookWorkspacesClient) DeletePreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-08-01" + const APIVersion = "2020-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -225,7 +229,7 @@ func (client NotebookWorkspacesClient) DeleteResponder(resp *http.Response) (res // Get gets the notebook workspace for a Cosmos DB account. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. func (client NotebookWorkspacesClient) Get(ctx context.Context, resourceGroupName string, accountName string) (result NotebookWorkspace, err error) { if tracing.IsEnabled() { @@ -239,6 +243,8 @@ func (client NotebookWorkspacesClient) Get(ctx context.Context, resourceGroupNam }() } 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}, @@ -280,7 +286,7 @@ func (client NotebookWorkspacesClient) GetPreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-08-01" + const APIVersion = "2020-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -314,7 +320,7 @@ func (client NotebookWorkspacesClient) GetResponder(resp *http.Response) (result // ListByDatabaseAccount gets the notebook workspace resources of an existing Cosmos DB account. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. func (client NotebookWorkspacesClient) ListByDatabaseAccount(ctx context.Context, resourceGroupName string, accountName string) (result NotebookWorkspaceListResult, err error) { if tracing.IsEnabled() { @@ -328,6 +334,8 @@ func (client NotebookWorkspacesClient) ListByDatabaseAccount(ctx context.Context }() } 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}, @@ -368,7 +376,7 @@ func (client NotebookWorkspacesClient) ListByDatabaseAccountPreparer(ctx context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-08-01" + const APIVersion = "2020-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -402,7 +410,7 @@ func (client NotebookWorkspacesClient) ListByDatabaseAccountResponder(resp *http // ListConnectionInfo retrieves the connection info for the notebook workspace // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. func (client NotebookWorkspacesClient) ListConnectionInfo(ctx context.Context, resourceGroupName string, accountName string) (result NotebookWorkspaceConnectionInfoResult, err error) { if tracing.IsEnabled() { @@ -416,6 +424,8 @@ func (client NotebookWorkspacesClient) ListConnectionInfo(ctx context.Context, r }() } 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}, @@ -457,7 +467,7 @@ func (client NotebookWorkspacesClient) ListConnectionInfoPreparer(ctx context.Co "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-08-01" + const APIVersion = "2020-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -491,7 +501,7 @@ func (client NotebookWorkspacesClient) ListConnectionInfoResponder(resp *http.Re // RegenerateAuthToken regenerates the auth token for the notebook workspace // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. func (client NotebookWorkspacesClient) RegenerateAuthToken(ctx context.Context, resourceGroupName string, accountName string) (result NotebookWorkspacesRegenerateAuthTokenFuture, err error) { if tracing.IsEnabled() { @@ -505,6 +515,8 @@ func (client NotebookWorkspacesClient) RegenerateAuthToken(ctx context.Context, }() } 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}, @@ -540,7 +552,7 @@ func (client NotebookWorkspacesClient) RegenerateAuthTokenPreparer(ctx context.C "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-08-01" + const APIVersion = "2020-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -579,7 +591,7 @@ func (client NotebookWorkspacesClient) RegenerateAuthTokenResponder(resp *http.R // Start starts the notebook workspace // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. func (client NotebookWorkspacesClient) Start(ctx context.Context, resourceGroupName string, accountName string) (result NotebookWorkspacesStartFuture, err error) { if tracing.IsEnabled() { @@ -593,6 +605,8 @@ func (client NotebookWorkspacesClient) Start(ctx context.Context, resourceGroupN }() } 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}, @@ -628,7 +642,7 @@ func (client NotebookWorkspacesClient) StartPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-08-01" + const APIVersion = "2020-03-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/cosmos-db/mgmt/2020-03-01/documentdb/operations.go b/services/cosmos-db/mgmt/2020-03-01/documentdb/operations.go index 706348652076..157ce2bc7f15 100644 --- a/services/cosmos-db/mgmt/2020-03-01/documentdb/operations.go +++ b/services/cosmos-db/mgmt/2020-03-01/documentdb/operations.go @@ -31,14 +31,14 @@ type OperationsClient struct { } // NewOperationsClient creates an instance of the OperationsClient client. -func NewOperationsClient(subscriptionID string, subscriptionID1 string) OperationsClient { - return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) +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, subscriptionID1 string) OperationsClient { - return OperationsClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} } // List lists all of the available Cosmos DB Resource Provider operations. diff --git a/services/cosmos-db/mgmt/2020-03-01/documentdb/partitionkeyrangeid.go b/services/cosmos-db/mgmt/2020-03-01/documentdb/partitionkeyrangeid.go index 29c9677f6e60..69e856b8577e 100644 --- a/services/cosmos-db/mgmt/2020-03-01/documentdb/partitionkeyrangeid.go +++ b/services/cosmos-db/mgmt/2020-03-01/documentdb/partitionkeyrangeid.go @@ -32,20 +32,20 @@ type PartitionKeyRangeIDClient struct { } // NewPartitionKeyRangeIDClient creates an instance of the PartitionKeyRangeIDClient client. -func NewPartitionKeyRangeIDClient(subscriptionID string, subscriptionID1 string) PartitionKeyRangeIDClient { - return NewPartitionKeyRangeIDClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) +func NewPartitionKeyRangeIDClient(subscriptionID string) PartitionKeyRangeIDClient { + return NewPartitionKeyRangeIDClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewPartitionKeyRangeIDClientWithBaseURI creates an instance of the PartitionKeyRangeIDClient 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 NewPartitionKeyRangeIDClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) PartitionKeyRangeIDClient { - return PartitionKeyRangeIDClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} +func NewPartitionKeyRangeIDClientWithBaseURI(baseURI string, subscriptionID string) PartitionKeyRangeIDClient { + return PartitionKeyRangeIDClient{NewWithBaseURI(baseURI, subscriptionID)} } // ListMetrics retrieves the metrics determined by the given filter for the given partition key range id. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // databaseRid - cosmos DB database rid. // collectionRid - cosmos DB collection rid. @@ -65,6 +65,8 @@ func (client PartitionKeyRangeIDClient) ListMetrics(ctx context.Context, resourc }() } 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}, diff --git a/services/cosmos-db/mgmt/2020-03-01/documentdb/partitionkeyrangeidregion.go b/services/cosmos-db/mgmt/2020-03-01/documentdb/partitionkeyrangeidregion.go index fcc328092a6f..b5333ed33867 100644 --- a/services/cosmos-db/mgmt/2020-03-01/documentdb/partitionkeyrangeidregion.go +++ b/services/cosmos-db/mgmt/2020-03-01/documentdb/partitionkeyrangeidregion.go @@ -32,20 +32,20 @@ type PartitionKeyRangeIDRegionClient struct { } // NewPartitionKeyRangeIDRegionClient creates an instance of the PartitionKeyRangeIDRegionClient client. -func NewPartitionKeyRangeIDRegionClient(subscriptionID string, subscriptionID1 string) PartitionKeyRangeIDRegionClient { - return NewPartitionKeyRangeIDRegionClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) +func NewPartitionKeyRangeIDRegionClient(subscriptionID string) PartitionKeyRangeIDRegionClient { + return NewPartitionKeyRangeIDRegionClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewPartitionKeyRangeIDRegionClientWithBaseURI creates an instance of the PartitionKeyRangeIDRegionClient 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 NewPartitionKeyRangeIDRegionClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) PartitionKeyRangeIDRegionClient { - return PartitionKeyRangeIDRegionClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} +func NewPartitionKeyRangeIDRegionClientWithBaseURI(baseURI string, subscriptionID string) PartitionKeyRangeIDRegionClient { + return PartitionKeyRangeIDRegionClient{NewWithBaseURI(baseURI, subscriptionID)} } // ListMetrics retrieves the metrics determined by the given filter for the given partition key range id and region. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // region - cosmos DB region, with spaces between words and each word capitalized. // databaseRid - cosmos DB database rid. @@ -66,6 +66,8 @@ func (client PartitionKeyRangeIDRegionClient) ListMetrics(ctx context.Context, r }() } 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}, diff --git a/services/cosmos-db/mgmt/2020-03-01/documentdb/percentile.go b/services/cosmos-db/mgmt/2020-03-01/documentdb/percentile.go index 01b5999885e0..1121e367b731 100644 --- a/services/cosmos-db/mgmt/2020-03-01/documentdb/percentile.go +++ b/services/cosmos-db/mgmt/2020-03-01/documentdb/percentile.go @@ -32,20 +32,20 @@ type PercentileClient struct { } // NewPercentileClient creates an instance of the PercentileClient client. -func NewPercentileClient(subscriptionID string, subscriptionID1 string) PercentileClient { - return NewPercentileClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) +func NewPercentileClient(subscriptionID string) PercentileClient { + return NewPercentileClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewPercentileClientWithBaseURI creates an instance of the PercentileClient 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 NewPercentileClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) PercentileClient { - return PercentileClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} +func NewPercentileClientWithBaseURI(baseURI string, subscriptionID string) PercentileClient { + return PercentileClient{NewWithBaseURI(baseURI, subscriptionID)} } // ListMetrics retrieves the metrics determined by the given filter for the given database account. This url is only // for PBS and Replication Latency data // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // filter - an OData filter expression that describes a subset of metrics to return. The parameters that can be // filtered are name.value (name of the metric, can have an or of multiple names), startTime, endTime, and @@ -62,6 +62,8 @@ func (client PercentileClient) ListMetrics(ctx context.Context, resourceGroupNam }() } 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}, diff --git a/services/cosmos-db/mgmt/2020-03-01/documentdb/percentilesourcetarget.go b/services/cosmos-db/mgmt/2020-03-01/documentdb/percentilesourcetarget.go index 0f26b2db24b6..3eefc24fefa4 100644 --- a/services/cosmos-db/mgmt/2020-03-01/documentdb/percentilesourcetarget.go +++ b/services/cosmos-db/mgmt/2020-03-01/documentdb/percentilesourcetarget.go @@ -32,21 +32,21 @@ type PercentileSourceTargetClient struct { } // NewPercentileSourceTargetClient creates an instance of the PercentileSourceTargetClient client. -func NewPercentileSourceTargetClient(subscriptionID string, subscriptionID1 string) PercentileSourceTargetClient { - return NewPercentileSourceTargetClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) +func NewPercentileSourceTargetClient(subscriptionID string) PercentileSourceTargetClient { + return NewPercentileSourceTargetClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewPercentileSourceTargetClientWithBaseURI creates an instance of the PercentileSourceTargetClient 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 NewPercentileSourceTargetClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) PercentileSourceTargetClient { - return PercentileSourceTargetClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} +func NewPercentileSourceTargetClientWithBaseURI(baseURI string, subscriptionID string) PercentileSourceTargetClient { + return PercentileSourceTargetClient{NewWithBaseURI(baseURI, subscriptionID)} } // ListMetrics retrieves the metrics determined by the given filter for the given account, source and target region. // This url is only for PBS and Replication Latency data // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // sourceRegion - source region from which data is written. Cosmos DB region, with spaces between words and // each word capitalized. @@ -67,6 +67,8 @@ func (client PercentileSourceTargetClient) ListMetrics(ctx context.Context, reso }() } 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}, diff --git a/services/cosmos-db/mgmt/2020-03-01/documentdb/percentiletarget.go b/services/cosmos-db/mgmt/2020-03-01/documentdb/percentiletarget.go index b7a00e561338..31bf8067afa4 100644 --- a/services/cosmos-db/mgmt/2020-03-01/documentdb/percentiletarget.go +++ b/services/cosmos-db/mgmt/2020-03-01/documentdb/percentiletarget.go @@ -32,21 +32,21 @@ type PercentileTargetClient struct { } // NewPercentileTargetClient creates an instance of the PercentileTargetClient client. -func NewPercentileTargetClient(subscriptionID string, subscriptionID1 string) PercentileTargetClient { - return NewPercentileTargetClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) +func NewPercentileTargetClient(subscriptionID string) PercentileTargetClient { + return NewPercentileTargetClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewPercentileTargetClientWithBaseURI creates an instance of the PercentileTargetClient 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 NewPercentileTargetClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) PercentileTargetClient { - return PercentileTargetClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} +func NewPercentileTargetClientWithBaseURI(baseURI string, subscriptionID string) PercentileTargetClient { + return PercentileTargetClient{NewWithBaseURI(baseURI, subscriptionID)} } // ListMetrics retrieves the metrics determined by the given filter for the given account target region. This url is // only for PBS and Replication Latency data // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // targetRegion - target region to which data is written. Cosmos DB region, with spaces between words and each // word capitalized. @@ -65,6 +65,8 @@ func (client PercentileTargetClient) ListMetrics(ctx context.Context, resourceGr }() } 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}, diff --git a/services/cosmos-db/mgmt/2020-03-01/documentdb/privateendpointconnections.go b/services/cosmos-db/mgmt/2020-03-01/documentdb/privateendpointconnections.go index 733ac312230f..0ecc5a78a544 100644 --- a/services/cosmos-db/mgmt/2020-03-01/documentdb/privateendpointconnections.go +++ b/services/cosmos-db/mgmt/2020-03-01/documentdb/privateendpointconnections.go @@ -32,15 +32,15 @@ type PrivateEndpointConnectionsClient struct { } // NewPrivateEndpointConnectionsClient creates an instance of the PrivateEndpointConnectionsClient client. -func NewPrivateEndpointConnectionsClient(subscriptionID string, subscriptionID1 string) PrivateEndpointConnectionsClient { - return NewPrivateEndpointConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) +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, subscriptionID1 string) PrivateEndpointConnectionsClient { - return PrivateEndpointConnectionsClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} +func NewPrivateEndpointConnectionsClientWithBaseURI(baseURI string, subscriptionID string) PrivateEndpointConnectionsClient { + return PrivateEndpointConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)} } // CreateOrUpdate approve or reject a private endpoint connection with a given name. diff --git a/services/cosmos-db/mgmt/2020-03-01/documentdb/privatelinkresources.go b/services/cosmos-db/mgmt/2020-03-01/documentdb/privatelinkresources.go index a13e3bddebd2..ae4070ccfe04 100644 --- a/services/cosmos-db/mgmt/2020-03-01/documentdb/privatelinkresources.go +++ b/services/cosmos-db/mgmt/2020-03-01/documentdb/privatelinkresources.go @@ -32,20 +32,20 @@ type PrivateLinkResourcesClient struct { } // NewPrivateLinkResourcesClient creates an instance of the PrivateLinkResourcesClient client. -func NewPrivateLinkResourcesClient(subscriptionID string, subscriptionID1 string) PrivateLinkResourcesClient { - return NewPrivateLinkResourcesClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) +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, subscriptionID1 string) PrivateLinkResourcesClient { - return PrivateLinkResourcesClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} +func NewPrivateLinkResourcesClientWithBaseURI(baseURI string, subscriptionID string) PrivateLinkResourcesClient { + return PrivateLinkResourcesClient{NewWithBaseURI(baseURI, subscriptionID)} } // Get gets the private link resources that need to be created for a Cosmos DB account. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // groupName - the name of the private link resource. func (client PrivateLinkResourcesClient) Get(ctx context.Context, resourceGroupName string, accountName string, groupName string) (result PrivateLinkResource, err error) { @@ -60,6 +60,8 @@ func (client PrivateLinkResourcesClient) Get(ctx context.Context, resourceGroupN }() } 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}, @@ -135,7 +137,7 @@ func (client PrivateLinkResourcesClient) GetResponder(resp *http.Response) (resu // ListByDatabaseAccount gets the private link resources that need to be created for a Cosmos DB account. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. func (client PrivateLinkResourcesClient) ListByDatabaseAccount(ctx context.Context, resourceGroupName string, accountName string) (result PrivateLinkResourceListResult, err error) { if tracing.IsEnabled() { @@ -149,6 +151,8 @@ func (client PrivateLinkResourcesClient) ListByDatabaseAccount(ctx context.Conte }() } 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}, diff --git a/services/cosmos-db/mgmt/2020-03-01/documentdb/sqlresources.go b/services/cosmos-db/mgmt/2020-03-01/documentdb/sqlresources.go index ea423c0d747c..7b1c8996b871 100644 --- a/services/cosmos-db/mgmt/2020-03-01/documentdb/sqlresources.go +++ b/services/cosmos-db/mgmt/2020-03-01/documentdb/sqlresources.go @@ -32,19 +32,19 @@ type SQLResourcesClient struct { } // NewSQLResourcesClient creates an instance of the SQLResourcesClient client. -func NewSQLResourcesClient(subscriptionID string, subscriptionID1 string) SQLResourcesClient { - return NewSQLResourcesClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) +func NewSQLResourcesClient(subscriptionID string) SQLResourcesClient { + return NewSQLResourcesClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewSQLResourcesClientWithBaseURI creates an instance of the SQLResourcesClient 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 NewSQLResourcesClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) SQLResourcesClient { - return SQLResourcesClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} +func NewSQLResourcesClientWithBaseURI(baseURI string, subscriptionID string) SQLResourcesClient { + return SQLResourcesClient{NewWithBaseURI(baseURI, subscriptionID)} } // CreateUpdateSQLContainer create or update an Azure Cosmos DB SQL container // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // databaseName - cosmos DB database name. // containerName - cosmos DB container name. @@ -61,6 +61,8 @@ func (client SQLResourcesClient) CreateUpdateSQLContainer(ctx context.Context, r }() } 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}, @@ -152,7 +154,7 @@ func (client SQLResourcesClient) CreateUpdateSQLContainerResponder(resp *http.Re // CreateUpdateSQLDatabase create or update an Azure Cosmos DB SQL database // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // databaseName - cosmos DB database name. // createUpdateSQLDatabaseParameters - the parameters to provide for the current SQL database. @@ -168,6 +170,8 @@ func (client SQLResourcesClient) CreateUpdateSQLDatabase(ctx context.Context, re }() } 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}, @@ -251,7 +255,7 @@ func (client SQLResourcesClient) CreateUpdateSQLDatabaseResponder(resp *http.Res // CreateUpdateSQLStoredProcedure create or update an Azure Cosmos DB SQL storedProcedure // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // databaseName - cosmos DB database name. // containerName - cosmos DB container name. @@ -269,6 +273,8 @@ func (client SQLResourcesClient) CreateUpdateSQLStoredProcedure(ctx context.Cont }() } 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}, @@ -354,7 +360,7 @@ func (client SQLResourcesClient) CreateUpdateSQLStoredProcedureResponder(resp *h // CreateUpdateSQLTrigger create or update an Azure Cosmos DB SQL trigger // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // databaseName - cosmos DB database name. // containerName - cosmos DB container name. @@ -372,6 +378,8 @@ func (client SQLResourcesClient) CreateUpdateSQLTrigger(ctx context.Context, res }() } 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}, @@ -457,7 +465,7 @@ func (client SQLResourcesClient) CreateUpdateSQLTriggerResponder(resp *http.Resp // CreateUpdateSQLUserDefinedFunction create or update an Azure Cosmos DB SQL userDefinedFunction // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // databaseName - cosmos DB database name. // containerName - cosmos DB container name. @@ -476,6 +484,8 @@ func (client SQLResourcesClient) CreateUpdateSQLUserDefinedFunction(ctx context. }() } 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}, @@ -561,7 +571,7 @@ func (client SQLResourcesClient) CreateUpdateSQLUserDefinedFunctionResponder(res // DeleteSQLContainer deletes an existing Azure Cosmos DB SQL container. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // databaseName - cosmos DB database name. // containerName - cosmos DB container name. @@ -577,6 +587,8 @@ func (client SQLResourcesClient) DeleteSQLContainer(ctx context.Context, resourc }() } 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}, @@ -652,7 +664,7 @@ func (client SQLResourcesClient) DeleteSQLContainerResponder(resp *http.Response // DeleteSQLDatabase deletes an existing Azure Cosmos DB SQL database. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // databaseName - cosmos DB database name. func (client SQLResourcesClient) DeleteSQLDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result SQLResourcesDeleteSQLDatabaseFuture, err error) { @@ -667,6 +679,8 @@ func (client SQLResourcesClient) DeleteSQLDatabase(ctx context.Context, resource }() } 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}, @@ -741,7 +755,7 @@ func (client SQLResourcesClient) DeleteSQLDatabaseResponder(resp *http.Response) // DeleteSQLStoredProcedure deletes an existing Azure Cosmos DB SQL storedProcedure. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // databaseName - cosmos DB database name. // containerName - cosmos DB container name. @@ -758,6 +772,8 @@ func (client SQLResourcesClient) DeleteSQLStoredProcedure(ctx context.Context, r }() } 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}, @@ -834,7 +850,7 @@ func (client SQLResourcesClient) DeleteSQLStoredProcedureResponder(resp *http.Re // DeleteSQLTrigger deletes an existing Azure Cosmos DB SQL trigger. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // databaseName - cosmos DB database name. // containerName - cosmos DB container name. @@ -851,6 +867,8 @@ func (client SQLResourcesClient) DeleteSQLTrigger(ctx context.Context, resourceG }() } 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}, @@ -927,7 +945,7 @@ func (client SQLResourcesClient) DeleteSQLTriggerResponder(resp *http.Response) // DeleteSQLUserDefinedFunction deletes an existing Azure Cosmos DB SQL userDefinedFunction. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // databaseName - cosmos DB database name. // containerName - cosmos DB container name. @@ -944,6 +962,8 @@ func (client SQLResourcesClient) DeleteSQLUserDefinedFunction(ctx context.Contex }() } 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}, @@ -1020,7 +1040,7 @@ func (client SQLResourcesClient) DeleteSQLUserDefinedFunctionResponder(resp *htt // GetSQLContainer gets the SQL container under an existing Azure Cosmos DB database account. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // databaseName - cosmos DB database name. // containerName - cosmos DB container name. @@ -1036,6 +1056,8 @@ func (client SQLResourcesClient) GetSQLContainer(ctx context.Context, resourceGr }() } 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}, @@ -1113,7 +1135,7 @@ func (client SQLResourcesClient) GetSQLContainerResponder(resp *http.Response) ( // GetSQLContainerThroughput gets the RUs per second of the SQL container under an existing Azure Cosmos DB database // account. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // databaseName - cosmos DB database name. // containerName - cosmos DB container name. @@ -1129,6 +1151,8 @@ func (client SQLResourcesClient) GetSQLContainerThroughput(ctx context.Context, }() } 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}, @@ -1205,7 +1229,7 @@ func (client SQLResourcesClient) GetSQLContainerThroughputResponder(resp *http.R // GetSQLDatabase gets the SQL database under an existing Azure Cosmos DB database account with the provided name. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // databaseName - cosmos DB database name. func (client SQLResourcesClient) GetSQLDatabase(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result SQLDatabaseGetResults, err error) { @@ -1220,6 +1244,8 @@ func (client SQLResourcesClient) GetSQLDatabase(ctx context.Context, resourceGro }() } 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}, @@ -1296,7 +1322,7 @@ func (client SQLResourcesClient) GetSQLDatabaseResponder(resp *http.Response) (r // GetSQLDatabaseThroughput gets the RUs per second of the SQL database under an existing Azure Cosmos DB database // account with the provided name. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // databaseName - cosmos DB database name. func (client SQLResourcesClient) GetSQLDatabaseThroughput(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result ThroughputSettingsGetResults, err error) { @@ -1311,6 +1337,8 @@ func (client SQLResourcesClient) GetSQLDatabaseThroughput(ctx context.Context, r }() } 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}, @@ -1386,7 +1414,7 @@ func (client SQLResourcesClient) GetSQLDatabaseThroughputResponder(resp *http.Re // GetSQLStoredProcedure gets the SQL storedProcedure under an existing Azure Cosmos DB database account. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // databaseName - cosmos DB database name. // containerName - cosmos DB container name. @@ -1403,6 +1431,8 @@ func (client SQLResourcesClient) GetSQLStoredProcedure(ctx context.Context, reso }() } 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}, @@ -1480,7 +1510,7 @@ func (client SQLResourcesClient) GetSQLStoredProcedureResponder(resp *http.Respo // GetSQLTrigger gets the SQL trigger under an existing Azure Cosmos DB database account. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // databaseName - cosmos DB database name. // containerName - cosmos DB container name. @@ -1497,6 +1527,8 @@ func (client SQLResourcesClient) GetSQLTrigger(ctx context.Context, resourceGrou }() } 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}, @@ -1574,7 +1606,7 @@ func (client SQLResourcesClient) GetSQLTriggerResponder(resp *http.Response) (re // GetSQLUserDefinedFunction gets the SQL userDefinedFunction under an existing Azure Cosmos DB database account. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // databaseName - cosmos DB database name. // containerName - cosmos DB container name. @@ -1591,6 +1623,8 @@ func (client SQLResourcesClient) GetSQLUserDefinedFunction(ctx context.Context, }() } 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}, @@ -1668,7 +1702,7 @@ func (client SQLResourcesClient) GetSQLUserDefinedFunctionResponder(resp *http.R // ListSQLContainers lists the SQL container under an existing Azure Cosmos DB database account. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // databaseName - cosmos DB database name. func (client SQLResourcesClient) ListSQLContainers(ctx context.Context, resourceGroupName string, accountName string, databaseName string) (result SQLContainerListResult, err error) { @@ -1683,6 +1717,8 @@ func (client SQLResourcesClient) ListSQLContainers(ctx context.Context, resource }() } 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}, @@ -1758,7 +1794,7 @@ func (client SQLResourcesClient) ListSQLContainersResponder(resp *http.Response) // ListSQLDatabases lists the SQL databases under an existing Azure Cosmos DB database account. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. func (client SQLResourcesClient) ListSQLDatabases(ctx context.Context, resourceGroupName string, accountName string) (result SQLDatabaseListResult, err error) { if tracing.IsEnabled() { @@ -1772,6 +1808,8 @@ func (client SQLResourcesClient) ListSQLDatabases(ctx context.Context, resourceG }() } 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}, @@ -1846,7 +1884,7 @@ func (client SQLResourcesClient) ListSQLDatabasesResponder(resp *http.Response) // ListSQLStoredProcedures lists the SQL storedProcedure under an existing Azure Cosmos DB database account. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // databaseName - cosmos DB database name. // containerName - cosmos DB container name. @@ -1862,6 +1900,8 @@ func (client SQLResourcesClient) ListSQLStoredProcedures(ctx context.Context, re }() } 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}, @@ -1938,7 +1978,7 @@ func (client SQLResourcesClient) ListSQLStoredProceduresResponder(resp *http.Res // ListSQLTriggers lists the SQL trigger under an existing Azure Cosmos DB database account. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // databaseName - cosmos DB database name. // containerName - cosmos DB container name. @@ -1954,6 +1994,8 @@ func (client SQLResourcesClient) ListSQLTriggers(ctx context.Context, resourceGr }() } 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}, @@ -2030,7 +2072,7 @@ func (client SQLResourcesClient) ListSQLTriggersResponder(resp *http.Response) ( // ListSQLUserDefinedFunctions lists the SQL userDefinedFunction under an existing Azure Cosmos DB database account. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // databaseName - cosmos DB database name. // containerName - cosmos DB container name. @@ -2046,6 +2088,8 @@ func (client SQLResourcesClient) ListSQLUserDefinedFunctions(ctx context.Context }() } 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}, @@ -2122,7 +2166,7 @@ func (client SQLResourcesClient) ListSQLUserDefinedFunctionsResponder(resp *http // UpdateSQLContainerThroughput update RUs per second of an Azure Cosmos DB SQL container // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // databaseName - cosmos DB database name. // containerName - cosmos DB container name. @@ -2139,6 +2183,8 @@ func (client SQLResourcesClient) UpdateSQLContainerThroughput(ctx context.Contex }() } 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}, @@ -2224,7 +2270,7 @@ func (client SQLResourcesClient) UpdateSQLContainerThroughputResponder(resp *htt // UpdateSQLDatabaseThroughput update RUs per second of an Azure Cosmos DB SQL database // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // databaseName - cosmos DB database name. // updateThroughputParameters - the parameters to provide for the RUs per second of the current SQL database. @@ -2240,6 +2286,8 @@ func (client SQLResourcesClient) UpdateSQLDatabaseThroughput(ctx context.Context }() } 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}, diff --git a/services/cosmos-db/mgmt/2020-03-01/documentdb/tableresources.go b/services/cosmos-db/mgmt/2020-03-01/documentdb/tableresources.go index 382f338a12c6..035269e59a19 100644 --- a/services/cosmos-db/mgmt/2020-03-01/documentdb/tableresources.go +++ b/services/cosmos-db/mgmt/2020-03-01/documentdb/tableresources.go @@ -32,19 +32,19 @@ type TableResourcesClient struct { } // NewTableResourcesClient creates an instance of the TableResourcesClient client. -func NewTableResourcesClient(subscriptionID string, subscriptionID1 string) TableResourcesClient { - return NewTableResourcesClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) +func NewTableResourcesClient(subscriptionID string) TableResourcesClient { + return NewTableResourcesClientWithBaseURI(DefaultBaseURI, subscriptionID) } // NewTableResourcesClientWithBaseURI creates an instance of the TableResourcesClient 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 NewTableResourcesClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) TableResourcesClient { - return TableResourcesClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} +func NewTableResourcesClientWithBaseURI(baseURI string, subscriptionID string) TableResourcesClient { + return TableResourcesClient{NewWithBaseURI(baseURI, subscriptionID)} } // CreateUpdateTable create or update an Azure Cosmos DB Table // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // tableName - cosmos DB table name. // createUpdateTableParameters - the parameters to provide for the current Table. @@ -60,6 +60,8 @@ func (client TableResourcesClient) CreateUpdateTable(ctx context.Context, resour }() } 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}, @@ -143,7 +145,7 @@ func (client TableResourcesClient) CreateUpdateTableResponder(resp *http.Respons // DeleteTable deletes an existing Azure Cosmos DB Table. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // tableName - cosmos DB table name. func (client TableResourcesClient) DeleteTable(ctx context.Context, resourceGroupName string, accountName string, tableName string) (result TableResourcesDeleteTableFuture, err error) { @@ -158,6 +160,8 @@ func (client TableResourcesClient) DeleteTable(ctx context.Context, resourceGrou }() } 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}, @@ -232,7 +236,7 @@ func (client TableResourcesClient) DeleteTableResponder(resp *http.Response) (re // GetTable gets the Tables under an existing Azure Cosmos DB database account with the provided name. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // tableName - cosmos DB table name. func (client TableResourcesClient) GetTable(ctx context.Context, resourceGroupName string, accountName string, tableName string) (result TableGetResults, err error) { @@ -247,6 +251,8 @@ func (client TableResourcesClient) GetTable(ctx context.Context, resourceGroupNa }() } 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}, @@ -323,7 +329,7 @@ func (client TableResourcesClient) GetTableResponder(resp *http.Response) (resul // GetTableThroughput gets the RUs per second of the Table under an existing Azure Cosmos DB database account with the // provided name. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // tableName - cosmos DB table name. func (client TableResourcesClient) GetTableThroughput(ctx context.Context, resourceGroupName string, accountName string, tableName string) (result ThroughputSettingsGetResults, err error) { @@ -338,6 +344,8 @@ func (client TableResourcesClient) GetTableThroughput(ctx context.Context, resou }() } 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}, @@ -413,7 +421,7 @@ func (client TableResourcesClient) GetTableThroughputResponder(resp *http.Respon // ListTables lists the Tables under an existing Azure Cosmos DB database account. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. func (client TableResourcesClient) ListTables(ctx context.Context, resourceGroupName string, accountName string) (result TableListResult, err error) { if tracing.IsEnabled() { @@ -427,6 +435,8 @@ func (client TableResourcesClient) ListTables(ctx context.Context, resourceGroup }() } 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}, @@ -501,7 +511,7 @@ func (client TableResourcesClient) ListTablesResponder(resp *http.Response) (res // UpdateTableThroughput update RUs per second of an Azure Cosmos DB Table // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // tableName - cosmos DB table name. // updateThroughputParameters - the parameters to provide for the RUs per second of the current Table. @@ -517,6 +527,8 @@ func (client TableResourcesClient) UpdateTableThroughput(ctx context.Context, re }() } 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}, diff --git a/services/datafactory/mgmt/2018-06-01/datafactory/models.go b/services/datafactory/mgmt/2018-06-01/datafactory/models.go index 6e5d6e8326a5..9ddded991030 100644 --- a/services/datafactory/mgmt/2018-06-01/datafactory/models.go +++ b/services/datafactory/mgmt/2018-06-01/datafactory/models.go @@ -1667,6 +1667,8 @@ const ( TypeDynamicsSource TypeBasicCopySource = "DynamicsSource" // TypeEloquaSource ... TypeEloquaSource TypeBasicCopySource = "EloquaSource" + // TypeExcelSource ... + TypeExcelSource TypeBasicCopySource = "ExcelSource" // TypeFileSystemSource ... TypeFileSystemSource TypeBasicCopySource = "FileSystemSource" // TypeGoogleAdWordsSource ... @@ -1789,13 +1791,15 @@ const ( TypeWebSource TypeBasicCopySource = "WebSource" // TypeXeroSource ... TypeXeroSource TypeBasicCopySource = "XeroSource" + // TypeXMLSource ... + TypeXMLSource TypeBasicCopySource = "XmlSource" // TypeZohoSource ... TypeZohoSource TypeBasicCopySource = "ZohoSource" ) // PossibleTypeBasicCopySourceValues returns an array of possible values for the TypeBasicCopySource const type. func PossibleTypeBasicCopySourceValues() []TypeBasicCopySource { - return []TypeBasicCopySource{TypeAmazonMWSSource, TypeAmazonRedshiftSource, TypeAvroSource, TypeAzureBlobFSSource, TypeAzureDataExplorerSource, TypeAzureDataLakeStoreSource, TypeAzureMariaDBSource, TypeAzureMySQLSource, TypeAzurePostgreSQLSource, TypeAzureSQLSource, TypeAzureTableSource, TypeBinarySource, TypeBlobSource, TypeCassandraSource, TypeCommonDataServiceForAppsSource, TypeConcurSource, TypeCopySource, TypeCosmosDbMongoDbAPISource, TypeCosmosDbSQLAPISource, TypeCouchbaseSource, TypeDb2Source, TypeDelimitedTextSource, TypeDocumentDbCollectionSource, TypeDrillSource, TypeDynamicsAXSource, TypeDynamicsCrmSource, TypeDynamicsSource, TypeEloquaSource, TypeFileSystemSource, TypeGoogleAdWordsSource, TypeGoogleBigQuerySource, TypeGreenplumSource, TypeHBaseSource, TypeHdfsSource, TypeHiveSource, TypeHTTPSource, TypeHubspotSource, TypeImpalaSource, TypeInformixSource, TypeJiraSource, TypeJSONSource, TypeMagentoSource, TypeMariaDBSource, TypeMarketoSource, TypeMicrosoftAccessSource, TypeMongoDbSource, TypeMongoDbV2Source, TypeMySQLSource, TypeNetezzaSource, TypeODataSource, TypeOdbcSource, TypeOffice365Source, TypeOracleServiceCloudSource, TypeOracleSource, TypeOrcSource, TypeParquetSource, TypePaypalSource, TypePhoenixSource, TypePostgreSQLSource, TypePrestoSource, TypeQuickBooksSource, TypeRelationalSource, TypeResponsysSource, TypeRestSource, TypeSalesforceMarketingCloudSource, TypeSalesforceServiceCloudSource, TypeSalesforceSource, TypeSapBwSource, TypeSapCloudForCustomerSource, TypeSapEccSource, TypeSapHanaSource, TypeSapOpenHubSource, TypeSapTableSource, TypeServiceNowSource, TypeSharePointOnlineListSource, TypeShopifySource, TypeSnowflakeSource, TypeSparkSource, TypeSQLDWSource, TypeSQLMISource, TypeSQLServerSource, TypeSQLSource, TypeSquareSource, TypeSybaseSource, TypeTabularSource, TypeTeradataSource, TypeVerticaSource, TypeWebSource, TypeXeroSource, TypeZohoSource} + return []TypeBasicCopySource{TypeAmazonMWSSource, TypeAmazonRedshiftSource, TypeAvroSource, TypeAzureBlobFSSource, TypeAzureDataExplorerSource, TypeAzureDataLakeStoreSource, TypeAzureMariaDBSource, TypeAzureMySQLSource, TypeAzurePostgreSQLSource, TypeAzureSQLSource, TypeAzureTableSource, TypeBinarySource, TypeBlobSource, TypeCassandraSource, TypeCommonDataServiceForAppsSource, TypeConcurSource, TypeCopySource, TypeCosmosDbMongoDbAPISource, TypeCosmosDbSQLAPISource, TypeCouchbaseSource, TypeDb2Source, TypeDelimitedTextSource, TypeDocumentDbCollectionSource, TypeDrillSource, TypeDynamicsAXSource, TypeDynamicsCrmSource, TypeDynamicsSource, TypeEloquaSource, TypeExcelSource, TypeFileSystemSource, TypeGoogleAdWordsSource, TypeGoogleBigQuerySource, TypeGreenplumSource, TypeHBaseSource, TypeHdfsSource, TypeHiveSource, TypeHTTPSource, TypeHubspotSource, TypeImpalaSource, TypeInformixSource, TypeJiraSource, TypeJSONSource, TypeMagentoSource, TypeMariaDBSource, TypeMarketoSource, TypeMicrosoftAccessSource, TypeMongoDbSource, TypeMongoDbV2Source, TypeMySQLSource, TypeNetezzaSource, TypeODataSource, TypeOdbcSource, TypeOffice365Source, TypeOracleServiceCloudSource, TypeOracleSource, TypeOrcSource, TypeParquetSource, TypePaypalSource, TypePhoenixSource, TypePostgreSQLSource, TypePrestoSource, TypeQuickBooksSource, TypeRelationalSource, TypeResponsysSource, TypeRestSource, TypeSalesforceMarketingCloudSource, TypeSalesforceServiceCloudSource, TypeSalesforceSource, TypeSapBwSource, TypeSapCloudForCustomerSource, TypeSapEccSource, TypeSapHanaSource, TypeSapOpenHubSource, TypeSapTableSource, TypeServiceNowSource, TypeSharePointOnlineListSource, TypeShopifySource, TypeSnowflakeSource, TypeSparkSource, TypeSQLDWSource, TypeSQLMISource, TypeSQLServerSource, TypeSQLSource, TypeSquareSource, TypeSybaseSource, TypeTabularSource, TypeTeradataSource, TypeVerticaSource, TypeWebSource, TypeXeroSource, TypeXMLSource, TypeZohoSource} } // TypeBasicCustomSetupBase enumerates the values for type basic custom setup base. @@ -1902,6 +1906,8 @@ const ( TypeDynamicsEntity TypeBasicDataset = "DynamicsEntity" // TypeEloquaObject ... TypeEloquaObject TypeBasicDataset = "EloquaObject" + // TypeExcel ... + TypeExcel TypeBasicDataset = "Excel" // TypeFileShare ... TypeFileShare TypeBasicDataset = "FileShare" // TypeGoogleAdWordsObject ... @@ -2014,13 +2020,15 @@ const ( TypeWebTable TypeBasicDataset = "WebTable" // TypeXeroObject ... TypeXeroObject TypeBasicDataset = "XeroObject" + // TypeXML ... + TypeXML TypeBasicDataset = "Xml" // TypeZohoObject ... TypeZohoObject TypeBasicDataset = "ZohoObject" ) // PossibleTypeBasicDatasetValues returns an array of possible values for the TypeBasicDataset const type. func PossibleTypeBasicDatasetValues() []TypeBasicDataset { - return []TypeBasicDataset{TypeAmazonMWSObject, TypeAmazonRedshiftTable, TypeAmazonS3Object, TypeAvro, TypeAzureBlob, TypeAzureBlobFSFile, TypeAzureDataExplorerTable, TypeAzureDataLakeStoreFile, TypeAzureMariaDBTable, TypeAzureMySQLTable, TypeAzurePostgreSQLTable, TypeAzureSearchIndex, TypeAzureSQLDWTable, TypeAzureSQLMITable, TypeAzureSQLTable, TypeAzureTable, TypeBinary, TypeCassandraTable, TypeCommonDataServiceForAppsEntity, TypeConcurObject, TypeCosmosDbMongoDbAPICollection, TypeCosmosDbSQLAPICollection, TypeCouchbaseTable, TypeCustomDataset, TypeDataset, TypeDb2Table, TypeDelimitedText, TypeDocumentDbCollection, TypeDrillTable, TypeDynamicsAXResource, TypeDynamicsCrmEntity, TypeDynamicsEntity, TypeEloquaObject, TypeFileShare, TypeGoogleAdWordsObject, TypeGoogleBigQueryObject, TypeGreenplumTable, TypeHBaseObject, TypeHiveObject, TypeHTTPFile, TypeHubspotObject, TypeImpalaObject, TypeInformixTable, TypeJiraObject, TypeJSON, TypeMagentoObject, TypeMariaDBTable, TypeMarketoObject, TypeMicrosoftAccessTable, TypeMongoDbCollection, TypeMongoDbV2Collection, TypeMySQLTable, TypeNetezzaTable, TypeODataResource, TypeOdbcTable, TypeOffice365Table, TypeOracleServiceCloudObject, TypeOracleTable, TypeOrc, TypeParquet, TypePaypalObject, TypePhoenixObject, TypePostgreSQLTable, TypePrestoObject, TypeQuickBooksObject, TypeRelationalTable, TypeResponsysObject, TypeRestResource, TypeSalesforceMarketingCloudObject, TypeSalesforceObject, TypeSalesforceServiceCloudObject, TypeSapBwCube, TypeSapCloudForCustomerResource, TypeSapEccResource, TypeSapHanaTable, TypeSapOpenHubTable, TypeSapTableResource, TypeServiceNowObject, TypeSharePointOnlineListResource, TypeShopifyObject, TypeSnowflakeTable, TypeSparkObject, TypeSQLServerTable, TypeSquareObject, TypeSybaseTable, TypeTeradataTable, TypeVerticaTable, TypeWebTable, TypeXeroObject, TypeZohoObject} + return []TypeBasicDataset{TypeAmazonMWSObject, TypeAmazonRedshiftTable, TypeAmazonS3Object, TypeAvro, TypeAzureBlob, TypeAzureBlobFSFile, TypeAzureDataExplorerTable, TypeAzureDataLakeStoreFile, TypeAzureMariaDBTable, TypeAzureMySQLTable, TypeAzurePostgreSQLTable, TypeAzureSearchIndex, TypeAzureSQLDWTable, TypeAzureSQLMITable, TypeAzureSQLTable, TypeAzureTable, TypeBinary, TypeCassandraTable, TypeCommonDataServiceForAppsEntity, TypeConcurObject, TypeCosmosDbMongoDbAPICollection, TypeCosmosDbSQLAPICollection, TypeCouchbaseTable, TypeCustomDataset, TypeDataset, TypeDb2Table, TypeDelimitedText, TypeDocumentDbCollection, TypeDrillTable, TypeDynamicsAXResource, TypeDynamicsCrmEntity, TypeDynamicsEntity, TypeEloquaObject, TypeExcel, TypeFileShare, TypeGoogleAdWordsObject, TypeGoogleBigQueryObject, TypeGreenplumTable, TypeHBaseObject, TypeHiveObject, TypeHTTPFile, TypeHubspotObject, TypeImpalaObject, TypeInformixTable, TypeJiraObject, TypeJSON, TypeMagentoObject, TypeMariaDBTable, TypeMarketoObject, TypeMicrosoftAccessTable, TypeMongoDbCollection, TypeMongoDbV2Collection, TypeMySQLTable, TypeNetezzaTable, TypeODataResource, TypeOdbcTable, TypeOffice365Table, TypeOracleServiceCloudObject, TypeOracleTable, TypeOrc, TypeParquet, TypePaypalObject, TypePhoenixObject, TypePostgreSQLTable, TypePrestoObject, TypeQuickBooksObject, TypeRelationalTable, TypeResponsysObject, TypeRestResource, TypeSalesforceMarketingCloudObject, TypeSalesforceObject, TypeSalesforceServiceCloudObject, TypeSapBwCube, TypeSapCloudForCustomerResource, TypeSapEccResource, TypeSapHanaTable, TypeSapOpenHubTable, TypeSapTableResource, TypeServiceNowObject, TypeSharePointOnlineListResource, TypeShopifyObject, TypeSnowflakeTable, TypeSparkObject, TypeSQLServerTable, TypeSquareObject, TypeSybaseTable, TypeTeradataTable, TypeVerticaTable, TypeWebTable, TypeXeroObject, TypeXML, TypeZohoObject} } // TypeBasicDatasetCompression enumerates the values for type basic dataset compression. @@ -2165,11 +2173,13 @@ const ( TypeFormatReadSettings TypeBasicFormatReadSettings = "FormatReadSettings" // TypeJSONReadSettings ... TypeJSONReadSettings TypeBasicFormatReadSettings = "JsonReadSettings" + // TypeXMLReadSettings ... + TypeXMLReadSettings TypeBasicFormatReadSettings = "XmlReadSettings" ) // PossibleTypeBasicFormatReadSettingsValues returns an array of possible values for the TypeBasicFormatReadSettings const type. func PossibleTypeBasicFormatReadSettingsValues() []TypeBasicFormatReadSettings { - return []TypeBasicFormatReadSettings{TypeBinaryReadSettings, TypeDelimitedTextReadSettings, TypeFormatReadSettings, TypeJSONReadSettings} + return []TypeBasicFormatReadSettings{TypeBinaryReadSettings, TypeDelimitedTextReadSettings, TypeFormatReadSettings, TypeJSONReadSettings, TypeXMLReadSettings} } // TypeBasicFormatWriteSettings enumerates the values for type basic format write settings. @@ -4299,7 +4309,7 @@ type AmazonMWSObjectDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -4760,6 +4770,11 @@ func (amod AmazonMWSObjectDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for AmazonMWSObjectDataset. +func (amod AmazonMWSObjectDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for AmazonMWSObjectDataset. func (amod AmazonMWSObjectDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -4775,6 +4790,11 @@ func (amod AmazonMWSObjectDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for AmazonMWSObjectDataset. +func (amod AmazonMWSObjectDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for AmazonMWSObjectDataset. func (amod AmazonMWSObjectDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -4919,7 +4939,7 @@ type AmazonMWSSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -5384,6 +5404,11 @@ func (ams AmazonMWSSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for AmazonMWSSource. func (ams AmazonMWSSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -5399,6 +5424,11 @@ func (ams AmazonMWSSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for AmazonMWSSource. +func (ams AmazonMWSSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for AmazonMWSSource. func (ams AmazonMWSSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -6223,7 +6253,7 @@ type AmazonRedshiftSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -6691,6 +6721,11 @@ func (ars AmazonRedshiftSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for AmazonRedshiftSource. func (ars AmazonRedshiftSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -6706,6 +6741,11 @@ func (ars AmazonRedshiftSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for AmazonRedshiftSource. +func (ars AmazonRedshiftSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for AmazonRedshiftSource. func (ars AmazonRedshiftSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -6840,7 +6880,7 @@ type AmazonRedshiftTableDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -7301,6 +7341,11 @@ func (artd AmazonRedshiftTableDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for AmazonRedshiftTableDataset. +func (artd AmazonRedshiftTableDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for AmazonRedshiftTableDataset. func (artd AmazonRedshiftTableDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -7316,6 +7361,11 @@ func (artd AmazonRedshiftTableDataset) AsParquetDataset() (*ParquetDataset, bool return nil, false } +// AsExcelDataset is the BasicDataset implementation for AmazonRedshiftTableDataset. +func (artd AmazonRedshiftTableDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for AmazonRedshiftTableDataset. func (artd AmazonRedshiftTableDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -7474,7 +7524,7 @@ type AmazonS3Dataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -7935,6 +7985,11 @@ func (asd AmazonS3Dataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for AmazonS3Dataset. +func (asd AmazonS3Dataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for AmazonS3Dataset. func (asd AmazonS3Dataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -7950,6 +8005,11 @@ func (asd AmazonS3Dataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for AmazonS3Dataset. +func (asd AmazonS3Dataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for AmazonS3Dataset. func (asd AmazonS3Dataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -9657,7 +9717,7 @@ type AvroDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -10118,6 +10178,11 @@ func (ad AvroDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for AvroDataset. +func (ad AvroDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for AvroDataset. func (ad AvroDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -10133,6 +10198,11 @@ func (ad AvroDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for AvroDataset. +func (ad AvroDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for AvroDataset. func (ad AvroDataset) AsAvroDataset() (*AvroDataset, bool) { return &ad, true @@ -10782,7 +10852,7 @@ type AvroSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -11242,6 +11312,11 @@ func (as AvroSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for AvroSource. +func (as AvroSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for AvroSource. func (as AvroSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -11257,6 +11332,11 @@ func (as AvroSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for AvroSource. +func (as AvroSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for AvroSource. func (as AvroSource) AsAvroSource() (*AvroSource, bool) { return &as, true @@ -12183,7 +12263,7 @@ type AzureBlobDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -12644,6 +12724,11 @@ func (abd AzureBlobDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for AzureBlobDataset. +func (abd AzureBlobDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for AzureBlobDataset. func (abd AzureBlobDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -12659,6 +12744,11 @@ func (abd AzureBlobDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for AzureBlobDataset. +func (abd AzureBlobDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for AzureBlobDataset. func (abd AzureBlobDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -12901,7 +12991,7 @@ type AzureBlobFSDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -13362,6 +13452,11 @@ func (abfd AzureBlobFSDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for AzureBlobFSDataset. +func (abfd AzureBlobFSDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for AzureBlobFSDataset. func (abfd AzureBlobFSDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -13377,6 +13472,11 @@ func (abfd AzureBlobFSDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for AzureBlobFSDataset. +func (abfd AzureBlobFSDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for AzureBlobFSDataset. func (abfd AzureBlobFSDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -15021,7 +15121,7 @@ type AzureBlobFSSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -15486,6 +15586,11 @@ func (abfs AzureBlobFSSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for AzureBlobFSSource. +func (abfs AzureBlobFSSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for AzureBlobFSSource. func (abfs AzureBlobFSSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -15501,6 +15606,11 @@ func (abfs AzureBlobFSSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for AzureBlobFSSource. +func (abfs AzureBlobFSSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for AzureBlobFSSource. func (abfs AzureBlobFSSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -19300,7 +19410,7 @@ type AzureDataExplorerSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -19768,6 +19878,11 @@ func (ades AzureDataExplorerSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for AzureDataExplorerSource. +func (ades AzureDataExplorerSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for AzureDataExplorerSource. func (ades AzureDataExplorerSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -19783,6 +19898,11 @@ func (ades AzureDataExplorerSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for AzureDataExplorerSource. +func (ades AzureDataExplorerSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for AzureDataExplorerSource. func (ades AzureDataExplorerSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -19917,7 +20037,7 @@ type AzureDataExplorerTableDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -20378,6 +20498,11 @@ func (adetd AzureDataExplorerTableDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for AzureDataExplorerTableDataset. +func (adetd AzureDataExplorerTableDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for AzureDataExplorerTableDataset. func (adetd AzureDataExplorerTableDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -20393,6 +20518,11 @@ func (adetd AzureDataExplorerTableDataset) AsParquetDataset() (*ParquetDataset, return nil, false } +// AsExcelDataset is the BasicDataset implementation for AzureDataExplorerTableDataset. +func (adetd AzureDataExplorerTableDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for AzureDataExplorerTableDataset. func (adetd AzureDataExplorerTableDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -21264,7 +21394,7 @@ type AzureDataLakeStoreDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -21725,6 +21855,11 @@ func (adlsd AzureDataLakeStoreDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for AzureDataLakeStoreDataset. +func (adlsd AzureDataLakeStoreDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for AzureDataLakeStoreDataset. func (adlsd AzureDataLakeStoreDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -21740,6 +21875,11 @@ func (adlsd AzureDataLakeStoreDataset) AsParquetDataset() (*ParquetDataset, bool return nil, false } +// AsExcelDataset is the BasicDataset implementation for AzureDataLakeStoreDataset. +func (adlsd AzureDataLakeStoreDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for AzureDataLakeStoreDataset. func (adlsd AzureDataLakeStoreDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -23402,7 +23542,7 @@ type AzureDataLakeStoreSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -23861,6 +24001,11 @@ func (adlss AzureDataLakeStoreSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for AzureDataLakeStoreSource. func (adlss AzureDataLakeStoreSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -23876,6 +24021,11 @@ func (adlss AzureDataLakeStoreSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for AzureDataLakeStoreSource. +func (adlss AzureDataLakeStoreSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for AzureDataLakeStoreSource. func (adlss AzureDataLakeStoreSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -27595,7 +27745,7 @@ type AzureMariaDBSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -28060,6 +28210,11 @@ func (amds AzureMariaDBSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for AzureMariaDBSource. +func (amds AzureMariaDBSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for AzureMariaDBSource. func (amds AzureMariaDBSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -28075,6 +28230,11 @@ func (amds AzureMariaDBSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for AzureMariaDBSource. +func (amds AzureMariaDBSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for AzureMariaDBSource. func (amds AzureMariaDBSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -28200,7 +28360,7 @@ type AzureMariaDBTableDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -28661,6 +28821,11 @@ func (amdtd AzureMariaDBTableDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for AzureMariaDBTableDataset. +func (amdtd AzureMariaDBTableDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for AzureMariaDBTableDataset. func (amdtd AzureMariaDBTableDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -28676,6 +28841,11 @@ func (amdtd AzureMariaDBTableDataset) AsParquetDataset() (*ParquetDataset, bool) return nil, false } +// AsExcelDataset is the BasicDataset implementation for AzureMariaDBTableDataset. +func (amdtd AzureMariaDBTableDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for AzureMariaDBTableDataset. func (amdtd AzureMariaDBTableDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -32318,7 +32488,7 @@ type AzureMySQLSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -32783,6 +32953,11 @@ func (amss AzureMySQLSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for AzureMySQLSource. func (amss AzureMySQLSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -32798,6 +32973,11 @@ func (amss AzureMySQLSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for AzureMySQLSource. +func (amss AzureMySQLSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for AzureMySQLSource. func (amss AzureMySQLSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -32923,7 +33103,7 @@ type AzureMySQLTableDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -33384,6 +33564,11 @@ func (amstd AzureMySQLTableDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for AzureMySQLTableDataset. +func (amstd AzureMySQLTableDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for AzureMySQLTableDataset. func (amstd AzureMySQLTableDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -33399,6 +33584,11 @@ func (amstd AzureMySQLTableDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for AzureMySQLTableDataset. +func (amstd AzureMySQLTableDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for AzureMySQLTableDataset. func (amstd AzureMySQLTableDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -34504,7 +34694,7 @@ type AzurePostgreSQLSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -34969,6 +35159,11 @@ func (apss AzurePostgreSQLSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for AzurePostgreSQLSource. func (apss AzurePostgreSQLSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -34984,6 +35179,11 @@ func (apss AzurePostgreSQLSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for AzurePostgreSQLSource. +func (apss AzurePostgreSQLSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for AzurePostgreSQLSource. func (apss AzurePostgreSQLSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -35109,7 +35309,7 @@ type AzurePostgreSQLTableDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -35570,6 +35770,11 @@ func (apstd AzurePostgreSQLTableDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. +func (apstd AzurePostgreSQLTableDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. func (apstd AzurePostgreSQLTableDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -35585,6 +35790,11 @@ func (apstd AzurePostgreSQLTableDataset) AsParquetDataset() (*ParquetDataset, bo return nil, false } +// AsExcelDataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. +func (apstd AzurePostgreSQLTableDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for AzurePostgreSQLTableDataset. func (apstd AzurePostgreSQLTableDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -36055,7 +36265,7 @@ type AzureSearchIndexDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -36516,6 +36726,11 @@ func (asid AzureSearchIndexDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for AzureSearchIndexDataset. +func (asid AzureSearchIndexDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for AzureSearchIndexDataset. func (asid AzureSearchIndexDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -36531,6 +36746,11 @@ func (asid AzureSearchIndexDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for AzureSearchIndexDataset. +func (asid AzureSearchIndexDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for AzureSearchIndexDataset. func (asid AzureSearchIndexDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -39081,7 +39301,7 @@ type AzureSQLDWTableDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -39542,6 +39762,11 @@ func (asdtd AzureSQLDWTableDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for AzureSQLDWTableDataset. +func (asdtd AzureSQLDWTableDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for AzureSQLDWTableDataset. func (asdtd AzureSQLDWTableDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -39557,6 +39782,11 @@ func (asdtd AzureSQLDWTableDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for AzureSQLDWTableDataset. +func (asdtd AzureSQLDWTableDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for AzureSQLDWTableDataset. func (asdtd AzureSQLDWTableDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -40416,7 +40646,7 @@ type AzureSQLMITableDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -40877,6 +41107,11 @@ func (asmtd AzureSQLMITableDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for AzureSQLMITableDataset. +func (asmtd AzureSQLMITableDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for AzureSQLMITableDataset. func (asmtd AzureSQLMITableDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -40892,6 +41127,11 @@ func (asmtd AzureSQLMITableDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for AzureSQLMITableDataset. +func (asmtd AzureSQLMITableDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for AzureSQLMITableDataset. func (asmtd AzureSQLMITableDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -41448,7 +41688,7 @@ type AzureSQLSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -41922,6 +42162,11 @@ func (ass AzureSQLSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for AzureSQLSource. +func (ass AzureSQLSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for AzureSQLSource. func (ass AzureSQLSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -41937,6 +42182,11 @@ func (ass AzureSQLSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for AzureSQLSource. +func (ass AzureSQLSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for AzureSQLSource. func (ass AzureSQLSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -42089,7 +42339,7 @@ type AzureSQLTableDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -42550,6 +42800,11 @@ func (astd AzureSQLTableDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for AzureSQLTableDataset. +func (astd AzureSQLTableDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for AzureSQLTableDataset. func (astd AzureSQLTableDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -42565,6 +42820,11 @@ func (astd AzureSQLTableDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for AzureSQLTableDataset. +func (astd AzureSQLTableDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for AzureSQLTableDataset. func (astd AzureSQLTableDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -43354,7 +43614,7 @@ type AzureTableDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -43815,6 +44075,11 @@ func (atd AzureTableDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for AzureTableDataset. +func (atd AzureTableDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for AzureTableDataset. func (atd AzureTableDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -43830,6 +44095,11 @@ func (atd AzureTableDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for AzureTableDataset. +func (atd AzureTableDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for AzureTableDataset. func (atd AzureTableDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -44350,7 +44620,7 @@ type AzureTableSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -44818,6 +45088,11 @@ func (ats AzureTableSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for AzureTableSource. func (ats AzureTableSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -44833,6 +45108,11 @@ func (ats AzureTableSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for AzureTableSource. +func (ats AzureTableSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for AzureTableSource. func (ats AzureTableSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -45584,7 +45864,7 @@ type BinaryDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -46045,6 +46325,11 @@ func (bd BinaryDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for BinaryDataset. +func (bd BinaryDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for BinaryDataset. func (bd BinaryDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -46060,6 +46345,11 @@ func (bd BinaryDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for BinaryDataset. +func (bd BinaryDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for BinaryDataset. func (bd BinaryDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -46233,7 +46523,7 @@ type BinaryReadSettings struct { CompressionProperties BasicCompressionReadSettings `json:"compressionProperties,omitempty"` // AdditionalProperties - Unmatched properties from the message are deserialized this collection AdditionalProperties map[string]interface{} `json:""` - // Type - Possible values include: 'TypeFormatReadSettings', 'TypeJSONReadSettings', 'TypeDelimitedTextReadSettings', 'TypeBinaryReadSettings' + // Type - Possible values include: 'TypeFormatReadSettings', 'TypeBinaryReadSettings', 'TypeXMLReadSettings', 'TypeJSONReadSettings', 'TypeDelimitedTextReadSettings' Type TypeBasicFormatReadSettings `json:"type,omitempty"` } @@ -46251,6 +46541,16 @@ func (brs BinaryReadSettings) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsBinaryReadSettings is the BasicFormatReadSettings implementation for BinaryReadSettings. +func (brs BinaryReadSettings) AsBinaryReadSettings() (*BinaryReadSettings, bool) { + return &brs, true +} + +// AsXMLReadSettings is the BasicFormatReadSettings implementation for BinaryReadSettings. +func (brs BinaryReadSettings) AsXMLReadSettings() (*XMLReadSettings, bool) { + return nil, false +} + // AsJSONReadSettings is the BasicFormatReadSettings implementation for BinaryReadSettings. func (brs BinaryReadSettings) AsJSONReadSettings() (*JSONReadSettings, bool) { return nil, false @@ -46261,11 +46561,6 @@ func (brs BinaryReadSettings) AsDelimitedTextReadSettings() (*DelimitedTextReadS return nil, false } -// AsBinaryReadSettings is the BasicFormatReadSettings implementation for BinaryReadSettings. -func (brs BinaryReadSettings) AsBinaryReadSettings() (*BinaryReadSettings, bool) { - return &brs, true -} - // AsFormatReadSettings is the BasicFormatReadSettings implementation for BinaryReadSettings. func (brs BinaryReadSettings) AsFormatReadSettings() (*FormatReadSettings, bool) { return nil, false @@ -46657,7 +46952,7 @@ type BinarySource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -47117,6 +47412,11 @@ func (bs BinarySource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for BinarySource. +func (bs BinarySource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for BinarySource. func (bs BinarySource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -47132,6 +47432,11 @@ func (bs BinarySource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for BinarySource. +func (bs BinarySource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for BinarySource. func (bs BinarySource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -47799,7 +48104,7 @@ type BlobSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -48264,6 +48569,11 @@ func (bs BlobSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for BlobSource. func (bs BlobSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -48279,6 +48589,11 @@ func (bs BlobSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for BlobSource. +func (bs BlobSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for BlobSource. func (bs BlobSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -49287,7 +49602,7 @@ type CassandraSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -49755,6 +50070,11 @@ func (cs CassandraSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for CassandraSource. func (cs CassandraSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -49770,6 +50090,11 @@ func (cs CassandraSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for CassandraSource. +func (cs CassandraSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for CassandraSource. func (cs CassandraSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -49904,7 +50229,7 @@ type CassandraTableDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -50365,6 +50690,11 @@ func (ctd CassandraTableDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for CassandraTableDataset. +func (ctd CassandraTableDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for CassandraTableDataset. func (ctd CassandraTableDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -50380,6 +50710,11 @@ func (ctd CassandraTableDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for CassandraTableDataset. +func (ctd CassandraTableDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for CassandraTableDataset. func (ctd CassandraTableDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -50902,7 +51237,7 @@ type CommonDataServiceForAppsEntityDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -51363,6 +51698,11 @@ func (cdsfaed CommonDataServiceForAppsEntityDataset) AsOrcDataset() (*OrcDataset return nil, false } +// AsXMLDataset is the BasicDataset implementation for CommonDataServiceForAppsEntityDataset. +func (cdsfaed CommonDataServiceForAppsEntityDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for CommonDataServiceForAppsEntityDataset. func (cdsfaed CommonDataServiceForAppsEntityDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -51378,6 +51718,11 @@ func (cdsfaed CommonDataServiceForAppsEntityDataset) AsParquetDataset() (*Parque return nil, false } +// AsExcelDataset is the BasicDataset implementation for CommonDataServiceForAppsEntityDataset. +func (cdsfaed CommonDataServiceForAppsEntityDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for CommonDataServiceForAppsEntityDataset. func (cdsfaed CommonDataServiceForAppsEntityDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -52648,7 +52993,7 @@ type CommonDataServiceForAppsSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -53110,6 +53455,11 @@ func (cdsfas CommonDataServiceForAppsSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for CommonDataServiceForAppsSource. +func (cdsfas CommonDataServiceForAppsSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for CommonDataServiceForAppsSource. func (cdsfas CommonDataServiceForAppsSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -53125,6 +53475,11 @@ func (cdsfas CommonDataServiceForAppsSource) AsParquetSource() (*ParquetSource, return nil, false } +// AsExcelSource is the BasicCopySource implementation for CommonDataServiceForAppsSource. +func (cdsfas CommonDataServiceForAppsSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for CommonDataServiceForAppsSource. func (cdsfas CommonDataServiceForAppsSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -54147,7 +54502,7 @@ type ConcurObjectDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -54608,6 +54963,11 @@ func (cod ConcurObjectDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for ConcurObjectDataset. +func (cod ConcurObjectDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for ConcurObjectDataset. func (cod ConcurObjectDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -54623,6 +54983,11 @@ func (cod ConcurObjectDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for ConcurObjectDataset. +func (cod ConcurObjectDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for ConcurObjectDataset. func (cod ConcurObjectDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -54767,7 +55132,7 @@ type ConcurSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -55232,6 +55597,11 @@ func (cs ConcurSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for ConcurSource. func (cs ConcurSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -55247,6 +55617,11 @@ func (cs ConcurSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for ConcurSource. +func (cs ConcurSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for ConcurSource. func (cs ConcurSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -56925,9 +57300,11 @@ type BasicCopySource interface { AsBasicTabularSource() (BasicTabularSource, bool) AsBinarySource() (*BinarySource, bool) AsOrcSource() (*OrcSource, bool) + AsXMLSource() (*XMLSource, bool) AsJSONSource() (*JSONSource, bool) AsDelimitedTextSource() (*DelimitedTextSource, bool) AsParquetSource() (*ParquetSource, bool) + AsExcelSource() (*ExcelSource, bool) AsAvroSource() (*AvroSource, bool) AsCopySource() (*CopySource, bool) } @@ -56942,7 +57319,7 @@ type CopySource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -57294,6 +57671,10 @@ func unmarshalBasicCopySource(body []byte) (BasicCopySource, error) { var osVar OrcSource err := json.Unmarshal(body, &osVar) return osVar, err + case string(TypeXMLSource): + var xs XMLSource + err := json.Unmarshal(body, &xs) + return xs, err case string(TypeJSONSource): var js JSONSource err := json.Unmarshal(body, &js) @@ -57306,6 +57687,10 @@ func unmarshalBasicCopySource(body []byte) (BasicCopySource, error) { var ps ParquetSource err := json.Unmarshal(body, &ps) return ps, err + case string(TypeExcelSource): + var es ExcelSource + err := json.Unmarshal(body, &es) + return es, err case string(TypeAvroSource): var as AvroSource err := json.Unmarshal(body, &as) @@ -57787,6 +58172,11 @@ func (cs CopySource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for CopySource. func (cs CopySource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -57802,6 +58192,11 @@ func (cs CopySource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for CopySource. +func (cs CopySource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for CopySource. func (cs CopySource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -58590,7 +58985,7 @@ type CosmosDbMongoDbAPICollectionDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -59051,6 +59446,11 @@ func (cdmdacd CosmosDbMongoDbAPICollectionDataset) AsOrcDataset() (*OrcDataset, return nil, false } +// AsXMLDataset is the BasicDataset implementation for CosmosDbMongoDbAPICollectionDataset. +func (cdmdacd CosmosDbMongoDbAPICollectionDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for CosmosDbMongoDbAPICollectionDataset. func (cdmdacd CosmosDbMongoDbAPICollectionDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -59066,6 +59466,11 @@ func (cdmdacd CosmosDbMongoDbAPICollectionDataset) AsParquetDataset() (*ParquetD return nil, false } +// AsExcelDataset is the BasicDataset implementation for CosmosDbMongoDbAPICollectionDataset. +func (cdmdacd CosmosDbMongoDbAPICollectionDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for CosmosDbMongoDbAPICollectionDataset. func (cdmdacd CosmosDbMongoDbAPICollectionDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -60171,7 +60576,7 @@ type CosmosDbMongoDbAPISource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -60642,6 +61047,11 @@ func (cdmdas CosmosDbMongoDbAPISource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for CosmosDbMongoDbAPISource. +func (cdmdas CosmosDbMongoDbAPISource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for CosmosDbMongoDbAPISource. func (cdmdas CosmosDbMongoDbAPISource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -60657,6 +61067,11 @@ func (cdmdas CosmosDbMongoDbAPISource) AsParquetSource() (*ParquetSource, bool) return nil, false } +// AsExcelSource is the BasicCopySource implementation for CosmosDbMongoDbAPISource. +func (cdmdas CosmosDbMongoDbAPISource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for CosmosDbMongoDbAPISource. func (cdmdas CosmosDbMongoDbAPISource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -60800,7 +61215,7 @@ type CosmosDbSQLAPICollectionDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -61261,6 +61676,11 @@ func (cdsacd CosmosDbSQLAPICollectionDataset) AsOrcDataset() (*OrcDataset, bool) return nil, false } +// AsXMLDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. func (cdsacd CosmosDbSQLAPICollectionDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -61276,6 +61696,11 @@ func (cdsacd CosmosDbSQLAPICollectionDataset) AsParquetDataset() (*ParquetDatase return nil, false } +// AsExcelDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. +func (cdsacd CosmosDbSQLAPICollectionDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for CosmosDbSQLAPICollectionDataset. func (cdsacd CosmosDbSQLAPICollectionDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -61754,7 +62179,7 @@ type CosmosDbSQLAPISource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -62222,6 +62647,11 @@ func (cdsas CosmosDbSQLAPISource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for CosmosDbSQLAPISource. func (cdsas CosmosDbSQLAPISource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -62237,6 +62667,11 @@ func (cdsas CosmosDbSQLAPISource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for CosmosDbSQLAPISource. +func (cdsas CosmosDbSQLAPISource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for CosmosDbSQLAPISource. func (cdsas CosmosDbSQLAPISource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -62994,7 +63429,7 @@ type CouchbaseSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -63459,6 +63894,11 @@ func (cs CouchbaseSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for CouchbaseSource. func (cs CouchbaseSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -63474,6 +63914,11 @@ func (cs CouchbaseSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for CouchbaseSource. +func (cs CouchbaseSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for CouchbaseSource. func (cs CouchbaseSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -63599,7 +64044,7 @@ type CouchbaseTableDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -64060,6 +64505,11 @@ func (ctd CouchbaseTableDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for CouchbaseTableDataset. +func (ctd CouchbaseTableDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for CouchbaseTableDataset. func (ctd CouchbaseTableDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -64075,6 +64525,11 @@ func (ctd CouchbaseTableDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for CouchbaseTableDataset. +func (ctd CouchbaseTableDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for CouchbaseTableDataset. func (ctd CouchbaseTableDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -64666,7 +65121,7 @@ type CustomDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -65127,6 +65582,11 @@ func (cd CustomDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for CustomDataset. +func (cd CustomDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for CustomDataset. func (cd CustomDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -65142,6 +65602,11 @@ func (cd CustomDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for CustomDataset. +func (cd CustomDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for CustomDataset. func (cd CustomDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -67870,6 +68335,10 @@ func (dfr *DataFlowResource) UnmarshalJSON(body []byte) error { type DataFlowSink struct { // Dataset - Dataset reference. Dataset *DatasetReference `json:"dataset,omitempty"` + // LinkedService - Linked service reference. + LinkedService *LinkedServiceReference `json:"linkedService,omitempty"` + // SchemaLinkedService - Schema linked service reference. + SchemaLinkedService *LinkedServiceReference `json:"schemaLinkedService,omitempty"` // Name - Transformation name. Name *string `json:"name,omitempty"` // Description - Transformation description. @@ -67880,6 +68349,10 @@ type DataFlowSink struct { type DataFlowSource struct { // Dataset - Dataset reference. Dataset *DatasetReference `json:"dataset,omitempty"` + // LinkedService - Linked service reference. + LinkedService *LinkedServiceReference `json:"linkedService,omitempty"` + // SchemaLinkedService - Schema linked service reference. + SchemaLinkedService *LinkedServiceReference `json:"schemaLinkedService,omitempty"` // Name - Transformation name. Name *string `json:"name,omitempty"` // Description - Transformation description. @@ -68451,9 +68924,11 @@ type BasicDataset interface { AsAzureBlobDataset() (*AzureBlobDataset, bool) AsBinaryDataset() (*BinaryDataset, bool) AsOrcDataset() (*OrcDataset, bool) + AsXMLDataset() (*XMLDataset, bool) AsJSONDataset() (*JSONDataset, bool) AsDelimitedTextDataset() (*DelimitedTextDataset, bool) AsParquetDataset() (*ParquetDataset, bool) + AsExcelDataset() (*ExcelDataset, bool) AsAvroDataset() (*AvroDataset, bool) AsAmazonS3Dataset() (*AmazonS3Dataset, bool) AsDataset() (*Dataset, bool) @@ -68478,7 +68953,7 @@ type Dataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -68826,6 +69301,10 @@ func unmarshalBasicDataset(body []byte) (BasicDataset, error) { var od OrcDataset err := json.Unmarshal(body, &od) return od, err + case string(TypeXML): + var xd XMLDataset + err := json.Unmarshal(body, &xd) + return xd, err case string(TypeJSON): var jd JSONDataset err := json.Unmarshal(body, &jd) @@ -68838,6 +69317,10 @@ func unmarshalBasicDataset(body []byte) (BasicDataset, error) { var pd ParquetDataset err := json.Unmarshal(body, &pd) return pd, err + case string(TypeExcel): + var ed ExcelDataset + err := json.Unmarshal(body, &ed) + return ed, err case string(TypeAvro): var ad AvroDataset err := json.Unmarshal(body, &ad) @@ -69325,6 +69808,11 @@ func (d Dataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for Dataset. +func (d Dataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for Dataset. func (d Dataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -69340,6 +69828,11 @@ func (d Dataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for Dataset. +func (d Dataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for Dataset. func (d Dataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -71462,7 +71955,7 @@ type Db2Source struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -71927,6 +72420,11 @@ func (d2s Db2Source) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for Db2Source. +func (d2s Db2Source) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for Db2Source. func (d2s Db2Source) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -71942,6 +72440,11 @@ func (d2s Db2Source) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for Db2Source. +func (d2s Db2Source) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for Db2Source. func (d2s Db2Source) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -72067,7 +72570,7 @@ type Db2TableDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -72528,6 +73031,11 @@ func (d2td Db2TableDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for Db2TableDataset. +func (d2td Db2TableDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for Db2TableDataset. func (d2td Db2TableDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -72543,6 +73051,11 @@ func (d2td Db2TableDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for Db2TableDataset. +func (d2td Db2TableDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for Db2TableDataset. func (d2td Db2TableDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -73048,6 +73561,76 @@ type DeleteActivityTypeProperties struct { LogStorageSettings *LogStorageSettings `json:"logStorageSettings,omitempty"` // Dataset - Delete activity dataset reference. Dataset *DatasetReference `json:"dataset,omitempty"` + // StoreSettings - Delete activity store settings. + StoreSettings BasicStoreReadSettings `json:"storeSettings,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for DeleteActivityTypeProperties struct. +func (datp *DeleteActivityTypeProperties) 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 "recursive": + if v != nil { + var recursive interface{} + err = json.Unmarshal(*v, &recursive) + if err != nil { + return err + } + datp.Recursive = recursive + } + case "maxConcurrentConnections": + if v != nil { + var maxConcurrentConnections int32 + err = json.Unmarshal(*v, &maxConcurrentConnections) + if err != nil { + return err + } + datp.MaxConcurrentConnections = &maxConcurrentConnections + } + case "enableLogging": + if v != nil { + var enableLogging interface{} + err = json.Unmarshal(*v, &enableLogging) + if err != nil { + return err + } + datp.EnableLogging = enableLogging + } + case "logStorageSettings": + if v != nil { + var logStorageSettings LogStorageSettings + err = json.Unmarshal(*v, &logStorageSettings) + if err != nil { + return err + } + datp.LogStorageSettings = &logStorageSettings + } + case "dataset": + if v != nil { + var dataset DatasetReference + err = json.Unmarshal(*v, &dataset) + if err != nil { + return err + } + datp.Dataset = &dataset + } + case "storeSettings": + if v != nil { + storeSettings, err := unmarshalBasicStoreReadSettings(*v) + if err != nil { + return err + } + datp.StoreSettings = storeSettings + } + } + } + + return nil } // DeleteDataFlowDebugSessionRequest request body structure for deleting data flow debug session. @@ -73076,7 +73659,7 @@ type DelimitedTextDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -73537,6 +74120,11 @@ func (dtd DelimitedTextDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for DelimitedTextDataset. +func (dtd DelimitedTextDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for DelimitedTextDataset. func (dtd DelimitedTextDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -73552,6 +74140,11 @@ func (dtd DelimitedTextDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for DelimitedTextDataset. +func (dtd DelimitedTextDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for DelimitedTextDataset. func (dtd DelimitedTextDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -73815,7 +74408,7 @@ type DelimitedTextReadSettings struct { CompressionProperties BasicCompressionReadSettings `json:"compressionProperties,omitempty"` // AdditionalProperties - Unmatched properties from the message are deserialized this collection AdditionalProperties map[string]interface{} `json:""` - // Type - Possible values include: 'TypeFormatReadSettings', 'TypeJSONReadSettings', 'TypeDelimitedTextReadSettings', 'TypeBinaryReadSettings' + // Type - Possible values include: 'TypeFormatReadSettings', 'TypeBinaryReadSettings', 'TypeXMLReadSettings', 'TypeJSONReadSettings', 'TypeDelimitedTextReadSettings' Type TypeBasicFormatReadSettings `json:"type,omitempty"` } @@ -73836,6 +74429,16 @@ func (dtrs DelimitedTextReadSettings) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsBinaryReadSettings is the BasicFormatReadSettings implementation for DelimitedTextReadSettings. +func (dtrs DelimitedTextReadSettings) AsBinaryReadSettings() (*BinaryReadSettings, bool) { + return nil, false +} + +// AsXMLReadSettings is the BasicFormatReadSettings implementation for DelimitedTextReadSettings. +func (dtrs DelimitedTextReadSettings) AsXMLReadSettings() (*XMLReadSettings, bool) { + return nil, false +} + // AsJSONReadSettings is the BasicFormatReadSettings implementation for DelimitedTextReadSettings. func (dtrs DelimitedTextReadSettings) AsJSONReadSettings() (*JSONReadSettings, bool) { return nil, false @@ -73846,11 +74449,6 @@ func (dtrs DelimitedTextReadSettings) AsDelimitedTextReadSettings() (*DelimitedT return &dtrs, true } -// AsBinaryReadSettings is the BasicFormatReadSettings implementation for DelimitedTextReadSettings. -func (dtrs DelimitedTextReadSettings) AsBinaryReadSettings() (*BinaryReadSettings, bool) { - return nil, false -} - // AsFormatReadSettings is the BasicFormatReadSettings implementation for DelimitedTextReadSettings. func (dtrs DelimitedTextReadSettings) AsFormatReadSettings() (*FormatReadSettings, bool) { return nil, false @@ -74267,7 +74865,7 @@ type DelimitedTextSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -74730,6 +75328,11 @@ func (dts DelimitedTextSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for DelimitedTextSource. +func (dts DelimitedTextSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for DelimitedTextSource. func (dts DelimitedTextSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -74745,6 +75348,11 @@ func (dts DelimitedTextSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for DelimitedTextSource. +func (dts DelimitedTextSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for DelimitedTextSource. func (dts DelimitedTextSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -75089,7 +75697,7 @@ type DocumentDbCollectionDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -75550,6 +76158,11 @@ func (ddcd DocumentDbCollectionDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for DocumentDbCollectionDataset. +func (ddcd DocumentDbCollectionDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for DocumentDbCollectionDataset. func (ddcd DocumentDbCollectionDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -75565,6 +76178,11 @@ func (ddcd DocumentDbCollectionDataset) AsParquetDataset() (*ParquetDataset, boo return nil, false } +// AsExcelDataset is the BasicDataset implementation for DocumentDbCollectionDataset. +func (ddcd DocumentDbCollectionDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for DocumentDbCollectionDataset. func (ddcd DocumentDbCollectionDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -76057,7 +76675,7 @@ type DocumentDbCollectionSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -76525,6 +77143,11 @@ func (ddcs DocumentDbCollectionSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for DocumentDbCollectionSource. func (ddcs DocumentDbCollectionSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -76540,6 +77163,11 @@ func (ddcs DocumentDbCollectionSource) AsParquetSource() (*ParquetSource, bool) return nil, false } +// AsExcelSource is the BasicCopySource implementation for DocumentDbCollectionSource. +func (ddcs DocumentDbCollectionSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for DocumentDbCollectionSource. func (ddcs DocumentDbCollectionSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -77307,7 +77935,7 @@ type DrillSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -77772,6 +78400,11 @@ func (ds DrillSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for DrillSource. func (ds DrillSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -77787,6 +78420,11 @@ func (ds DrillSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for DrillSource. +func (ds DrillSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for DrillSource. func (ds DrillSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -77912,7 +78550,7 @@ type DrillTableDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -78373,6 +79011,11 @@ func (dtd DrillTableDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for DrillTableDataset. +func (dtd DrillTableDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for DrillTableDataset. func (dtd DrillTableDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -78388,6 +79031,11 @@ func (dtd DrillTableDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for DrillTableDataset. +func (dtd DrillTableDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for DrillTableDataset. func (dtd DrillTableDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -79265,7 +79913,7 @@ type DynamicsAXResourceDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -79726,6 +80374,11 @@ func (dard DynamicsAXResourceDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for DynamicsAXResourceDataset. +func (dard DynamicsAXResourceDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for DynamicsAXResourceDataset. func (dard DynamicsAXResourceDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -79741,6 +80394,11 @@ func (dard DynamicsAXResourceDataset) AsParquetDataset() (*ParquetDataset, bool) return nil, false } +// AsExcelDataset is the BasicDataset implementation for DynamicsAXResourceDataset. +func (dard DynamicsAXResourceDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for DynamicsAXResourceDataset. func (dard DynamicsAXResourceDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -79893,7 +80551,7 @@ type DynamicsAXSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -80361,6 +81019,11 @@ func (das DynamicsAXSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for DynamicsAXSource. +func (das DynamicsAXSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for DynamicsAXSource. func (das DynamicsAXSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -80376,6 +81039,11 @@ func (das DynamicsAXSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for DynamicsAXSource. +func (das DynamicsAXSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for DynamicsAXSource. func (das DynamicsAXSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -80510,7 +81178,7 @@ type DynamicsCrmEntityDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -80971,6 +81639,11 @@ func (dced DynamicsCrmEntityDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for DynamicsCrmEntityDataset. +func (dced DynamicsCrmEntityDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for DynamicsCrmEntityDataset. func (dced DynamicsCrmEntityDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -80986,6 +81659,11 @@ func (dced DynamicsCrmEntityDataset) AsParquetDataset() (*ParquetDataset, bool) return nil, false } +// AsExcelDataset is the BasicDataset implementation for DynamicsCrmEntityDataset. +func (dced DynamicsCrmEntityDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for DynamicsCrmEntityDataset. func (dced DynamicsCrmEntityDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -82254,7 +82932,7 @@ type DynamicsCrmSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -82716,6 +83394,11 @@ func (dcs DynamicsCrmSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for DynamicsCrmSource. +func (dcs DynamicsCrmSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for DynamicsCrmSource. func (dcs DynamicsCrmSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -82731,6 +83414,11 @@ func (dcs DynamicsCrmSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for DynamicsCrmSource. +func (dcs DynamicsCrmSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for DynamicsCrmSource. func (dcs DynamicsCrmSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -82847,7 +83535,7 @@ type DynamicsEntityDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -83308,6 +83996,11 @@ func (ded DynamicsEntityDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for DynamicsEntityDataset. +func (ded DynamicsEntityDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for DynamicsEntityDataset. func (ded DynamicsEntityDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -83323,6 +84016,11 @@ func (ded DynamicsEntityDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for DynamicsEntityDataset. +func (ded DynamicsEntityDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for DynamicsEntityDataset. func (ded DynamicsEntityDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -84591,7 +85289,7 @@ type DynamicsSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -85053,6 +85751,11 @@ func (ds DynamicsSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for DynamicsSource. func (ds DynamicsSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -85068,6 +85771,11 @@ func (ds DynamicsSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for DynamicsSource. +func (ds DynamicsSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for DynamicsSource. func (ds DynamicsSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -85896,7 +86604,7 @@ type EloquaObjectDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -86357,6 +87065,11 @@ func (eod EloquaObjectDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for EloquaObjectDataset. +func (eod EloquaObjectDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for EloquaObjectDataset. func (eod EloquaObjectDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -86372,6 +87085,11 @@ func (eod EloquaObjectDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for EloquaObjectDataset. +func (eod EloquaObjectDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for EloquaObjectDataset. func (eod EloquaObjectDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -86516,7 +87234,7 @@ type EloquaSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -86981,6 +87699,11 @@ func (es EloquaSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for EloquaSource. func (es EloquaSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -86996,6 +87719,11 @@ func (es EloquaSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for EloquaSource. +func (es EloquaSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for EloquaSource. func (es EloquaSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -87196,6 +87924,1317 @@ type EnvironmentVariableSetupTypeProperties struct { VariableValue *string `json:"variableValue,omitempty"` } +// ExcelDataset excel dataset. +type ExcelDataset struct { + // ExcelDatasetTypeProperties - Excel dataset properties. + *ExcelDatasetTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Dataset description. + Description *string `json:"description,omitempty"` + // Structure - Columns that define the structure of the dataset. Type: array (or Expression with resultType array), itemType: DatasetDataElement. + Structure interface{} `json:"structure,omitempty"` + // Schema - Columns that define the physical type schema of the dataset. Type: array (or Expression with resultType array), itemType: DatasetSchemaDataElement. + Schema interface{} `json:"schema,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Parameters - Parameters for dataset. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. + Folder *DatasetFolder `json:"folder,omitempty"` + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' + Type TypeBasicDataset `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExcelDataset. +func (ed ExcelDataset) MarshalJSON() ([]byte, error) { + ed.Type = TypeExcel + objectMap := make(map[string]interface{}) + if ed.ExcelDatasetTypeProperties != nil { + objectMap["typeProperties"] = ed.ExcelDatasetTypeProperties + } + if ed.Description != nil { + objectMap["description"] = ed.Description + } + if ed.Structure != nil { + objectMap["structure"] = ed.Structure + } + if ed.Schema != nil { + objectMap["schema"] = ed.Schema + } + if ed.LinkedServiceName != nil { + objectMap["linkedServiceName"] = ed.LinkedServiceName + } + if ed.Parameters != nil { + objectMap["parameters"] = ed.Parameters + } + if ed.Annotations != nil { + objectMap["annotations"] = ed.Annotations + } + if ed.Folder != nil { + objectMap["folder"] = ed.Folder + } + if ed.Type != "" { + objectMap["type"] = ed.Type + } + for k, v := range ed.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsSharePointOnlineListResourceDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsSharePointOnlineListResourceDataset() (*SharePointOnlineListResourceDataset, bool) { + return nil, false +} + +// AsSnowflakeDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsSnowflakeDataset() (*SnowflakeDataset, bool) { + return nil, false +} + +// AsGoogleAdWordsObjectDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsGoogleAdWordsObjectDataset() (*GoogleAdWordsObjectDataset, bool) { + return nil, false +} + +// AsAzureDataExplorerTableDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsAzureDataExplorerTableDataset() (*AzureDataExplorerTableDataset, bool) { + return nil, false +} + +// AsOracleServiceCloudObjectDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsOracleServiceCloudObjectDataset() (*OracleServiceCloudObjectDataset, bool) { + return nil, false +} + +// AsDynamicsAXResourceDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsDynamicsAXResourceDataset() (*DynamicsAXResourceDataset, bool) { + return nil, false +} + +// AsResponsysObjectDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsResponsysObjectDataset() (*ResponsysObjectDataset, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudObjectDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsSalesforceMarketingCloudObjectDataset() (*SalesforceMarketingCloudObjectDataset, bool) { + return nil, false +} + +// AsVerticaTableDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsVerticaTableDataset() (*VerticaTableDataset, bool) { + return nil, false +} + +// AsNetezzaTableDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsNetezzaTableDataset() (*NetezzaTableDataset, bool) { + return nil, false +} + +// AsZohoObjectDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsZohoObjectDataset() (*ZohoObjectDataset, bool) { + return nil, false +} + +// AsXeroObjectDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsXeroObjectDataset() (*XeroObjectDataset, bool) { + return nil, false +} + +// AsSquareObjectDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsSquareObjectDataset() (*SquareObjectDataset, bool) { + return nil, false +} + +// AsSparkObjectDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsSparkObjectDataset() (*SparkObjectDataset, bool) { + return nil, false +} + +// AsShopifyObjectDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsShopifyObjectDataset() (*ShopifyObjectDataset, bool) { + return nil, false +} + +// AsServiceNowObjectDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsServiceNowObjectDataset() (*ServiceNowObjectDataset, bool) { + return nil, false +} + +// AsQuickBooksObjectDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsQuickBooksObjectDataset() (*QuickBooksObjectDataset, bool) { + return nil, false +} + +// AsPrestoObjectDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsPrestoObjectDataset() (*PrestoObjectDataset, bool) { + return nil, false +} + +// AsPhoenixObjectDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsPhoenixObjectDataset() (*PhoenixObjectDataset, bool) { + return nil, false +} + +// AsPaypalObjectDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsPaypalObjectDataset() (*PaypalObjectDataset, bool) { + return nil, false +} + +// AsMarketoObjectDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsMarketoObjectDataset() (*MarketoObjectDataset, bool) { + return nil, false +} + +// AsAzureMariaDBTableDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsAzureMariaDBTableDataset() (*AzureMariaDBTableDataset, bool) { + return nil, false +} + +// AsMariaDBTableDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsMariaDBTableDataset() (*MariaDBTableDataset, bool) { + return nil, false +} + +// AsMagentoObjectDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsMagentoObjectDataset() (*MagentoObjectDataset, bool) { + return nil, false +} + +// AsJiraObjectDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsJiraObjectDataset() (*JiraObjectDataset, bool) { + return nil, false +} + +// AsImpalaObjectDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsImpalaObjectDataset() (*ImpalaObjectDataset, bool) { + return nil, false +} + +// AsHubspotObjectDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsHubspotObjectDataset() (*HubspotObjectDataset, bool) { + return nil, false +} + +// AsHiveObjectDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsHiveObjectDataset() (*HiveObjectDataset, bool) { + return nil, false +} + +// AsHBaseObjectDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsHBaseObjectDataset() (*HBaseObjectDataset, bool) { + return nil, false +} + +// AsGreenplumTableDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsGreenplumTableDataset() (*GreenplumTableDataset, bool) { + return nil, false +} + +// AsGoogleBigQueryObjectDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsGoogleBigQueryObjectDataset() (*GoogleBigQueryObjectDataset, bool) { + return nil, false +} + +// AsEloquaObjectDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsEloquaObjectDataset() (*EloquaObjectDataset, bool) { + return nil, false +} + +// AsDrillTableDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsDrillTableDataset() (*DrillTableDataset, bool) { + return nil, false +} + +// AsCouchbaseTableDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsCouchbaseTableDataset() (*CouchbaseTableDataset, bool) { + return nil, false +} + +// AsConcurObjectDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsConcurObjectDataset() (*ConcurObjectDataset, bool) { + return nil, false +} + +// AsAzurePostgreSQLTableDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsAzurePostgreSQLTableDataset() (*AzurePostgreSQLTableDataset, bool) { + return nil, false +} + +// AsAmazonMWSObjectDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsAmazonMWSObjectDataset() (*AmazonMWSObjectDataset, bool) { + return nil, false +} + +// AsHTTPDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsHTTPDataset() (*HTTPDataset, bool) { + return nil, false +} + +// AsAzureSearchIndexDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsAzureSearchIndexDataset() (*AzureSearchIndexDataset, bool) { + return nil, false +} + +// AsWebTableDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsWebTableDataset() (*WebTableDataset, bool) { + return nil, false +} + +// AsSapTableResourceDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsSapTableResourceDataset() (*SapTableResourceDataset, bool) { + return nil, false +} + +// AsRestResourceDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsRestResourceDataset() (*RestResourceDataset, bool) { + return nil, false +} + +// AsSQLServerTableDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsSQLServerTableDataset() (*SQLServerTableDataset, bool) { + return nil, false +} + +// AsSapOpenHubTableDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsSapOpenHubTableDataset() (*SapOpenHubTableDataset, bool) { + return nil, false +} + +// AsSapHanaTableDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsSapHanaTableDataset() (*SapHanaTableDataset, bool) { + return nil, false +} + +// AsSapEccResourceDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsSapEccResourceDataset() (*SapEccResourceDataset, bool) { + return nil, false +} + +// AsSapCloudForCustomerResourceDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsSapCloudForCustomerResourceDataset() (*SapCloudForCustomerResourceDataset, bool) { + return nil, false +} + +// AsSapBwCubeDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsSapBwCubeDataset() (*SapBwCubeDataset, bool) { + return nil, false +} + +// AsSybaseTableDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsSybaseTableDataset() (*SybaseTableDataset, bool) { + return nil, false +} + +// AsSalesforceServiceCloudObjectDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsSalesforceServiceCloudObjectDataset() (*SalesforceServiceCloudObjectDataset, bool) { + return nil, false +} + +// AsSalesforceObjectDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsSalesforceObjectDataset() (*SalesforceObjectDataset, bool) { + return nil, false +} + +// AsMicrosoftAccessTableDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsMicrosoftAccessTableDataset() (*MicrosoftAccessTableDataset, bool) { + return nil, false +} + +// AsPostgreSQLTableDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsPostgreSQLTableDataset() (*PostgreSQLTableDataset, bool) { + return nil, false +} + +// AsMySQLTableDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsMySQLTableDataset() (*MySQLTableDataset, bool) { + return nil, false +} + +// AsOdbcTableDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsOdbcTableDataset() (*OdbcTableDataset, bool) { + return nil, false +} + +// AsInformixTableDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsInformixTableDataset() (*InformixTableDataset, bool) { + return nil, false +} + +// AsRelationalTableDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsRelationalTableDataset() (*RelationalTableDataset, bool) { + return nil, false +} + +// AsDb2TableDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsDb2TableDataset() (*Db2TableDataset, bool) { + return nil, false +} + +// AsAmazonRedshiftTableDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsAmazonRedshiftTableDataset() (*AmazonRedshiftTableDataset, bool) { + return nil, false +} + +// AsAzureMySQLTableDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsAzureMySQLTableDataset() (*AzureMySQLTableDataset, bool) { + return nil, false +} + +// AsTeradataTableDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsTeradataTableDataset() (*TeradataTableDataset, bool) { + return nil, false +} + +// AsOracleTableDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsOracleTableDataset() (*OracleTableDataset, bool) { + return nil, false +} + +// AsODataResourceDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsODataResourceDataset() (*ODataResourceDataset, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPICollectionDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsCosmosDbMongoDbAPICollectionDataset() (*CosmosDbMongoDbAPICollectionDataset, bool) { + return nil, false +} + +// AsMongoDbV2CollectionDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsMongoDbV2CollectionDataset() (*MongoDbV2CollectionDataset, bool) { + return nil, false +} + +// AsMongoDbCollectionDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsMongoDbCollectionDataset() (*MongoDbCollectionDataset, bool) { + return nil, false +} + +// AsFileShareDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsFileShareDataset() (*FileShareDataset, bool) { + return nil, false +} + +// AsOffice365Dataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsOffice365Dataset() (*Office365Dataset, bool) { + return nil, false +} + +// AsAzureBlobFSDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsAzureBlobFSDataset() (*AzureBlobFSDataset, bool) { + return nil, false +} + +// AsAzureDataLakeStoreDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsAzureDataLakeStoreDataset() (*AzureDataLakeStoreDataset, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsEntityDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsCommonDataServiceForAppsEntityDataset() (*CommonDataServiceForAppsEntityDataset, bool) { + return nil, false +} + +// AsDynamicsCrmEntityDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsDynamicsCrmEntityDataset() (*DynamicsCrmEntityDataset, bool) { + return nil, false +} + +// AsDynamicsEntityDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsDynamicsEntityDataset() (*DynamicsEntityDataset, bool) { + return nil, false +} + +// AsDocumentDbCollectionDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionDataset, bool) { + return nil, false +} + +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + +// AsCustomDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsCustomDataset() (*CustomDataset, bool) { + return nil, false +} + +// AsCassandraTableDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsCassandraTableDataset() (*CassandraTableDataset, bool) { + return nil, false +} + +// AsAzureSQLDWTableDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsAzureSQLDWTableDataset() (*AzureSQLDWTableDataset, bool) { + return nil, false +} + +// AsAzureSQLMITableDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsAzureSQLMITableDataset() (*AzureSQLMITableDataset, bool) { + return nil, false +} + +// AsAzureSQLTableDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsAzureSQLTableDataset() (*AzureSQLTableDataset, bool) { + return nil, false +} + +// AsAzureTableDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsAzureTableDataset() (*AzureTableDataset, bool) { + return nil, false +} + +// AsAzureBlobDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsAzureBlobDataset() (*AzureBlobDataset, bool) { + return nil, false +} + +// AsBinaryDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsBinaryDataset() (*BinaryDataset, bool) { + return nil, false +} + +// AsOrcDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + +// AsXMLDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + +// AsJSONDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsJSONDataset() (*JSONDataset, bool) { + return nil, false +} + +// AsDelimitedTextDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsDelimitedTextDataset() (*DelimitedTextDataset, bool) { + return nil, false +} + +// AsParquetDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsParquetDataset() (*ParquetDataset, bool) { + return nil, false +} + +// AsExcelDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsExcelDataset() (*ExcelDataset, bool) { + return &ed, true +} + +// AsAvroDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsAvroDataset() (*AvroDataset, bool) { + return nil, false +} + +// AsAmazonS3Dataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsAmazonS3Dataset() (*AmazonS3Dataset, bool) { + return nil, false +} + +// AsDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsDataset() (*Dataset, bool) { + return nil, false +} + +// AsBasicDataset is the BasicDataset implementation for ExcelDataset. +func (ed ExcelDataset) AsBasicDataset() (BasicDataset, bool) { + return &ed, true +} + +// UnmarshalJSON is the custom unmarshaler for ExcelDataset struct. +func (ed *ExcelDataset) 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 excelDatasetTypeProperties ExcelDatasetTypeProperties + err = json.Unmarshal(*v, &excelDatasetTypeProperties) + if err != nil { + return err + } + ed.ExcelDatasetTypeProperties = &excelDatasetTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if ed.AdditionalProperties == nil { + ed.AdditionalProperties = make(map[string]interface{}) + } + ed.AdditionalProperties[k] = additionalProperties + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + ed.Description = &description + } + case "structure": + if v != nil { + var structure interface{} + err = json.Unmarshal(*v, &structure) + if err != nil { + return err + } + ed.Structure = structure + } + case "schema": + if v != nil { + var schema interface{} + err = json.Unmarshal(*v, &schema) + if err != nil { + return err + } + ed.Schema = schema + } + case "linkedServiceName": + if v != nil { + var linkedServiceName LinkedServiceReference + err = json.Unmarshal(*v, &linkedServiceName) + if err != nil { + return err + } + ed.LinkedServiceName = &linkedServiceName + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + ed.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + ed.Annotations = &annotations + } + case "folder": + if v != nil { + var folder DatasetFolder + err = json.Unmarshal(*v, &folder) + if err != nil { + return err + } + ed.Folder = &folder + } + case "type": + if v != nil { + var typeVar TypeBasicDataset + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ed.Type = typeVar + } + } + } + + return nil +} + +// ExcelDatasetTypeProperties excel dataset properties. +type ExcelDatasetTypeProperties struct { + // Location - The location of the excel storage. + Location BasicDatasetLocation `json:"location,omitempty"` + // SheetName - The sheet of excel file. Type: string (or Expression with resultType string). + SheetName interface{} `json:"sheetName,omitempty"` + // Range - The partial data of one sheet. Type: string (or Expression with resultType string). + Range interface{} `json:"range,omitempty"` + // FirstRowAsHeader - When used as input, treat the first row of data as headers. When used as output,write the headers into the output as the first row of data. The default value is false. Type: boolean (or Expression with resultType boolean). + FirstRowAsHeader interface{} `json:"firstRowAsHeader,omitempty"` + // Compression - The data compression method used for the json dataset. + Compression BasicDatasetCompression `json:"compression,omitempty"` + // NullValue - The null value string. Type: string (or Expression with resultType string). + NullValue interface{} `json:"nullValue,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ExcelDatasetTypeProperties struct. +func (edtp *ExcelDatasetTypeProperties) 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 { + location, err := unmarshalBasicDatasetLocation(*v) + if err != nil { + return err + } + edtp.Location = location + } + case "sheetName": + if v != nil { + var sheetName interface{} + err = json.Unmarshal(*v, &sheetName) + if err != nil { + return err + } + edtp.SheetName = sheetName + } + case "range": + if v != nil { + var rangeVar interface{} + err = json.Unmarshal(*v, &rangeVar) + if err != nil { + return err + } + edtp.Range = rangeVar + } + case "firstRowAsHeader": + if v != nil { + var firstRowAsHeader interface{} + err = json.Unmarshal(*v, &firstRowAsHeader) + if err != nil { + return err + } + edtp.FirstRowAsHeader = firstRowAsHeader + } + case "compression": + if v != nil { + compression, err := unmarshalBasicDatasetCompression(*v) + if err != nil { + return err + } + edtp.Compression = compression + } + case "nullValue": + if v != nil { + var nullValue interface{} + err = json.Unmarshal(*v, &nullValue) + if err != nil { + return err + } + edtp.NullValue = nullValue + } + } + } + + return nil +} + +// ExcelSource a copy activity excel source. +type ExcelSource struct { + // StoreSettings - Excel store settings. + StoreSettings BasicStoreReadSettings `json:"storeSettings,omitempty"` + // AdditionalColumns - Specifies the additional columns to be added to source data. Type: array of objects (or Expression with resultType array of objects). + AdditionalColumns *[]AdditionalColumns `json:"additionalColumns,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // SourceRetryCount - Source retry count. Type: integer (or Expression with resultType integer). + SourceRetryCount interface{} `json:"sourceRetryCount,omitempty"` + // SourceRetryWait - Source retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` + // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). + MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' + Type TypeBasicCopySource `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExcelSource. +func (es ExcelSource) MarshalJSON() ([]byte, error) { + es.Type = TypeExcelSource + objectMap := make(map[string]interface{}) + objectMap["storeSettings"] = es.StoreSettings + if es.AdditionalColumns != nil { + objectMap["additionalColumns"] = es.AdditionalColumns + } + if es.SourceRetryCount != nil { + objectMap["sourceRetryCount"] = es.SourceRetryCount + } + if es.SourceRetryWait != nil { + objectMap["sourceRetryWait"] = es.SourceRetryWait + } + if es.MaxConcurrentConnections != nil { + objectMap["maxConcurrentConnections"] = es.MaxConcurrentConnections + } + if es.Type != "" { + objectMap["type"] = es.Type + } + for k, v := range es.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsSharePointOnlineListSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsSharePointOnlineListSource() (*SharePointOnlineListSource, bool) { + return nil, false +} + +// AsSnowflakeSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsSnowflakeSource() (*SnowflakeSource, bool) { + return nil, false +} + +// AsHTTPSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + +// AsAmazonRedshiftSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { + return nil, false +} + +// AsGoogleAdWordsSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsGoogleAdWordsSource() (*GoogleAdWordsSource, bool) { + return nil, false +} + +// AsOracleServiceCloudSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsOracleServiceCloudSource() (*OracleServiceCloudSource, bool) { + return nil, false +} + +// AsDynamicsAXSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsDynamicsAXSource() (*DynamicsAXSource, bool) { + return nil, false +} + +// AsResponsysSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsResponsysSource() (*ResponsysSource, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsSalesforceMarketingCloudSource() (*SalesforceMarketingCloudSource, bool) { + return nil, false +} + +// AsVerticaSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsVerticaSource() (*VerticaSource, bool) { + return nil, false +} + +// AsNetezzaSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsNetezzaSource() (*NetezzaSource, bool) { + return nil, false +} + +// AsZohoSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsZohoSource() (*ZohoSource, bool) { + return nil, false +} + +// AsXeroSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsXeroSource() (*XeroSource, bool) { + return nil, false +} + +// AsSquareSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsSquareSource() (*SquareSource, bool) { + return nil, false +} + +// AsSparkSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsSparkSource() (*SparkSource, bool) { + return nil, false +} + +// AsShopifySource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsShopifySource() (*ShopifySource, bool) { + return nil, false +} + +// AsServiceNowSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsServiceNowSource() (*ServiceNowSource, bool) { + return nil, false +} + +// AsQuickBooksSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsQuickBooksSource() (*QuickBooksSource, bool) { + return nil, false +} + +// AsPrestoSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsPrestoSource() (*PrestoSource, bool) { + return nil, false +} + +// AsPhoenixSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsPhoenixSource() (*PhoenixSource, bool) { + return nil, false +} + +// AsPaypalSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsPaypalSource() (*PaypalSource, bool) { + return nil, false +} + +// AsMarketoSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsMarketoSource() (*MarketoSource, bool) { + return nil, false +} + +// AsAzureMariaDBSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsAzureMariaDBSource() (*AzureMariaDBSource, bool) { + return nil, false +} + +// AsMariaDBSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsMariaDBSource() (*MariaDBSource, bool) { + return nil, false +} + +// AsMagentoSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsMagentoSource() (*MagentoSource, bool) { + return nil, false +} + +// AsJiraSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsJiraSource() (*JiraSource, bool) { + return nil, false +} + +// AsImpalaSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsImpalaSource() (*ImpalaSource, bool) { + return nil, false +} + +// AsHubspotSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsHubspotSource() (*HubspotSource, bool) { + return nil, false +} + +// AsHiveSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsHiveSource() (*HiveSource, bool) { + return nil, false +} + +// AsHBaseSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsHBaseSource() (*HBaseSource, bool) { + return nil, false +} + +// AsGreenplumSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsGreenplumSource() (*GreenplumSource, bool) { + return nil, false +} + +// AsGoogleBigQuerySource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsGoogleBigQuerySource() (*GoogleBigQuerySource, bool) { + return nil, false +} + +// AsEloquaSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsEloquaSource() (*EloquaSource, bool) { + return nil, false +} + +// AsDrillSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsDrillSource() (*DrillSource, bool) { + return nil, false +} + +// AsCouchbaseSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsCouchbaseSource() (*CouchbaseSource, bool) { + return nil, false +} + +// AsConcurSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsConcurSource() (*ConcurSource, bool) { + return nil, false +} + +// AsAzurePostgreSQLSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsAzurePostgreSQLSource() (*AzurePostgreSQLSource, bool) { + return nil, false +} + +// AsAmazonMWSSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { + return nil, false +} + +// AsCassandraSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsCassandraSource() (*CassandraSource, bool) { + return nil, false +} + +// AsTeradataSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsTeradataSource() (*TeradataSource, bool) { + return nil, false +} + +// AsAzureMySQLSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { + return nil, false +} + +// AsSQLDWSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsSQLDWSource() (*SQLDWSource, bool) { + return nil, false +} + +// AsSQLMISource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsSQLMISource() (*SQLMISource, bool) { + return nil, false +} + +// AsAzureSQLSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsAzureSQLSource() (*AzureSQLSource, bool) { + return nil, false +} + +// AsSQLServerSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsSQLServerSource() (*SQLServerSource, bool) { + return nil, false +} + +// AsSQLSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsSQLSource() (*SQLSource, bool) { + return nil, false +} + +// AsSapTableSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsSapTableSource() (*SapTableSource, bool) { + return nil, false +} + +// AsSapOpenHubSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsSapOpenHubSource() (*SapOpenHubSource, bool) { + return nil, false +} + +// AsSapHanaSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsSapHanaSource() (*SapHanaSource, bool) { + return nil, false +} + +// AsSapEccSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsSapEccSource() (*SapEccSource, bool) { + return nil, false +} + +// AsSapCloudForCustomerSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, bool) { + return nil, false +} + +// AsSalesforceSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsSalesforceSource() (*SalesforceSource, bool) { + return nil, false +} + +// AsSapBwSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsSapBwSource() (*SapBwSource, bool) { + return nil, false +} + +// AsSybaseSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsSybaseSource() (*SybaseSource, bool) { + return nil, false +} + +// AsPostgreSQLSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsPostgreSQLSource() (*PostgreSQLSource, bool) { + return nil, false +} + +// AsMySQLSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsMySQLSource() (*MySQLSource, bool) { + return nil, false +} + +// AsOdbcSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsOdbcSource() (*OdbcSource, bool) { + return nil, false +} + +// AsDb2Source is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsDb2Source() (*Db2Source, bool) { + return nil, false +} + +// AsInformixSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsInformixSource() (*InformixSource, bool) { + return nil, false +} + +// AsAzureTableSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsAzureTableSource() (*AzureTableSource, bool) { + return nil, false +} + +// AsTabularSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsTabularSource() (*TabularSource, bool) { + return nil, false +} + +// AsBasicTabularSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsBasicTabularSource() (BasicTabularSource, bool) { + return nil, false +} + +// AsBinarySource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsBinarySource() (*BinarySource, bool) { + return nil, false +} + +// AsOrcSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsOrcSource() (*OrcSource, bool) { + return nil, false +} + +// AsXMLSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + +// AsJSONSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsJSONSource() (*JSONSource, bool) { + return nil, false +} + +// AsDelimitedTextSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsDelimitedTextSource() (*DelimitedTextSource, bool) { + return nil, false +} + +// AsParquetSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsParquetSource() (*ParquetSource, bool) { + return nil, false +} + +// AsExcelSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsExcelSource() (*ExcelSource, bool) { + return &es, true +} + +// AsAvroSource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsAvroSource() (*AvroSource, bool) { + return nil, false +} + +// AsCopySource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsCopySource() (*CopySource, bool) { + return nil, false +} + +// AsBasicCopySource is the BasicCopySource implementation for ExcelSource. +func (es ExcelSource) AsBasicCopySource() (BasicCopySource, bool) { + return &es, true +} + +// UnmarshalJSON is the custom unmarshaler for ExcelSource struct. +func (es *ExcelSource) 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 "storeSettings": + if v != nil { + storeSettings, err := unmarshalBasicStoreReadSettings(*v) + if err != nil { + return err + } + es.StoreSettings = storeSettings + } + case "additionalColumns": + if v != nil { + var additionalColumns []AdditionalColumns + err = json.Unmarshal(*v, &additionalColumns) + if err != nil { + return err + } + es.AdditionalColumns = &additionalColumns + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if es.AdditionalProperties == nil { + es.AdditionalProperties = make(map[string]interface{}) + } + es.AdditionalProperties[k] = additionalProperties + } + case "sourceRetryCount": + if v != nil { + var sourceRetryCount interface{} + err = json.Unmarshal(*v, &sourceRetryCount) + if err != nil { + return err + } + es.SourceRetryCount = sourceRetryCount + } + case "sourceRetryWait": + if v != nil { + var sourceRetryWait interface{} + err = json.Unmarshal(*v, &sourceRetryWait) + if err != nil { + return err + } + es.SourceRetryWait = sourceRetryWait + } + case "maxConcurrentConnections": + if v != nil { + var maxConcurrentConnections interface{} + err = json.Unmarshal(*v, &maxConcurrentConnections) + if err != nil { + return err + } + es.MaxConcurrentConnections = maxConcurrentConnections + } + case "type": + if v != nil { + var typeVar TypeBasicCopySource + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + es.Type = typeVar + } + } + } + + return nil +} + // ExecuteDataFlowActivity execute data flow activity. type ExecuteDataFlowActivity struct { // ExecuteDataFlowActivityTypeProperties - Execute data flow activity properties. @@ -90880,7 +92919,7 @@ type FileShareDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -91341,6 +93380,11 @@ func (fsd FileShareDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for FileShareDataset. +func (fsd FileShareDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for FileShareDataset. func (fsd FileShareDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -91356,6 +93400,11 @@ func (fsd FileShareDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for FileShareDataset. +func (fsd FileShareDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for FileShareDataset. func (fsd FileShareDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -91918,7 +93967,7 @@ type FileSystemSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -92380,6 +94429,11 @@ func (fss FileSystemSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for FileSystemSource. func (fss FileSystemSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -92395,6 +94449,11 @@ func (fss FileSystemSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for FileSystemSource. +func (fss FileSystemSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for FileSystemSource. func (fss FileSystemSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -93217,9 +95276,10 @@ func (featp *ForEachActivityTypeProperties) UnmarshalJSON(body []byte) error { // BasicFormatReadSettings format read settings. type BasicFormatReadSettings interface { + AsBinaryReadSettings() (*BinaryReadSettings, bool) + AsXMLReadSettings() (*XMLReadSettings, bool) AsJSONReadSettings() (*JSONReadSettings, bool) AsDelimitedTextReadSettings() (*DelimitedTextReadSettings, bool) - AsBinaryReadSettings() (*BinaryReadSettings, bool) AsFormatReadSettings() (*FormatReadSettings, bool) } @@ -93227,7 +95287,7 @@ type BasicFormatReadSettings interface { type FormatReadSettings struct { // AdditionalProperties - Unmatched properties from the message are deserialized this collection AdditionalProperties map[string]interface{} `json:""` - // Type - Possible values include: 'TypeFormatReadSettings', 'TypeJSONReadSettings', 'TypeDelimitedTextReadSettings', 'TypeBinaryReadSettings' + // Type - Possible values include: 'TypeFormatReadSettings', 'TypeBinaryReadSettings', 'TypeXMLReadSettings', 'TypeJSONReadSettings', 'TypeDelimitedTextReadSettings' Type TypeBasicFormatReadSettings `json:"type,omitempty"` } @@ -93239,6 +95299,14 @@ func unmarshalBasicFormatReadSettings(body []byte) (BasicFormatReadSettings, err } switch m["type"] { + case string(TypeBinaryReadSettings): + var brs BinaryReadSettings + err := json.Unmarshal(body, &brs) + return brs, err + case string(TypeXMLReadSettings): + var xrs XMLReadSettings + err := json.Unmarshal(body, &xrs) + return xrs, err case string(TypeJSONReadSettings): var jrs JSONReadSettings err := json.Unmarshal(body, &jrs) @@ -93247,10 +95315,6 @@ func unmarshalBasicFormatReadSettings(body []byte) (BasicFormatReadSettings, err var dtrs DelimitedTextReadSettings err := json.Unmarshal(body, &dtrs) return dtrs, err - case string(TypeBinaryReadSettings): - var brs BinaryReadSettings - err := json.Unmarshal(body, &brs) - return brs, err default: var frs FormatReadSettings err := json.Unmarshal(body, &frs) @@ -93289,6 +95353,16 @@ func (frs FormatReadSettings) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsBinaryReadSettings is the BasicFormatReadSettings implementation for FormatReadSettings. +func (frs FormatReadSettings) AsBinaryReadSettings() (*BinaryReadSettings, bool) { + return nil, false +} + +// AsXMLReadSettings is the BasicFormatReadSettings implementation for FormatReadSettings. +func (frs FormatReadSettings) AsXMLReadSettings() (*XMLReadSettings, bool) { + return nil, false +} + // AsJSONReadSettings is the BasicFormatReadSettings implementation for FormatReadSettings. func (frs FormatReadSettings) AsJSONReadSettings() (*JSONReadSettings, bool) { return nil, false @@ -93299,11 +95373,6 @@ func (frs FormatReadSettings) AsDelimitedTextReadSettings() (*DelimitedTextReadS return nil, false } -// AsBinaryReadSettings is the BasicFormatReadSettings implementation for FormatReadSettings. -func (frs FormatReadSettings) AsBinaryReadSettings() (*BinaryReadSettings, bool) { - return nil, false -} - // AsFormatReadSettings is the BasicFormatReadSettings implementation for FormatReadSettings. func (frs FormatReadSettings) AsFormatReadSettings() (*FormatReadSettings, bool) { return &frs, true @@ -95015,6 +97084,59 @@ type GetMetadataActivityTypeProperties struct { Dataset *DatasetReference `json:"dataset,omitempty"` // FieldList - Fields of metadata to get from dataset. FieldList *[]interface{} `json:"fieldList,omitempty"` + // StoreSettings - GetMetadata activity store settings. + StoreSettings BasicStoreReadSettings `json:"storeSettings,omitempty"` + // FormatSettings - GetMetadata activity format settings. + FormatSettings BasicFormatReadSettings `json:"formatSettings,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for GetMetadataActivityTypeProperties struct. +func (gmatp *GetMetadataActivityTypeProperties) 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 "dataset": + if v != nil { + var dataset DatasetReference + err = json.Unmarshal(*v, &dataset) + if err != nil { + return err + } + gmatp.Dataset = &dataset + } + case "fieldList": + if v != nil { + var fieldList []interface{} + err = json.Unmarshal(*v, &fieldList) + if err != nil { + return err + } + gmatp.FieldList = &fieldList + } + case "storeSettings": + if v != nil { + storeSettings, err := unmarshalBasicStoreReadSettings(*v) + if err != nil { + return err + } + gmatp.StoreSettings = storeSettings + } + case "formatSettings": + if v != nil { + formatSettings, err := unmarshalBasicFormatReadSettings(*v) + if err != nil { + return err + } + gmatp.FormatSettings = formatSettings + } + } + } + + return nil } // GetSsisObjectMetadataRequest the request payload of get SSIS object metadata. @@ -95814,7 +97936,7 @@ type GoogleAdWordsObjectDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -96275,6 +98397,11 @@ func (gawod GoogleAdWordsObjectDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for GoogleAdWordsObjectDataset. +func (gawod GoogleAdWordsObjectDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for GoogleAdWordsObjectDataset. func (gawod GoogleAdWordsObjectDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -96290,6 +98417,11 @@ func (gawod GoogleAdWordsObjectDataset) AsParquetDataset() (*ParquetDataset, boo return nil, false } +// AsExcelDataset is the BasicDataset implementation for GoogleAdWordsObjectDataset. +func (gawod GoogleAdWordsObjectDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for GoogleAdWordsObjectDataset. func (gawod GoogleAdWordsObjectDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -96434,7 +98566,7 @@ type GoogleAdWordsSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -96899,6 +99031,11 @@ func (gaws GoogleAdWordsSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for GoogleAdWordsSource. +func (gaws GoogleAdWordsSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for GoogleAdWordsSource. func (gaws GoogleAdWordsSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -96914,6 +99051,11 @@ func (gaws GoogleAdWordsSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for GoogleAdWordsSource. +func (gaws GoogleAdWordsSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for GoogleAdWordsSource. func (gaws GoogleAdWordsSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -97815,7 +99957,7 @@ type GoogleBigQueryObjectDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -98276,6 +100418,11 @@ func (gbqod GoogleBigQueryObjectDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. +func (gbqod GoogleBigQueryObjectDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. func (gbqod GoogleBigQueryObjectDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -98291,6 +100438,11 @@ func (gbqod GoogleBigQueryObjectDataset) AsParquetDataset() (*ParquetDataset, bo return nil, false } +// AsExcelDataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. +func (gbqod GoogleBigQueryObjectDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for GoogleBigQueryObjectDataset. func (gbqod GoogleBigQueryObjectDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -98435,7 +100587,7 @@ type GoogleBigQuerySource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -98900,6 +101052,11 @@ func (gbqs GoogleBigQuerySource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for GoogleBigQuerySource. func (gbqs GoogleBigQuerySource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -98915,6 +101072,11 @@ func (gbqs GoogleBigQuerySource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for GoogleBigQuerySource. +func (gbqs GoogleBigQuerySource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for GoogleBigQuerySource. func (gbqs GoogleBigQuerySource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -100792,7 +102954,7 @@ type GreenplumSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -101257,6 +103419,11 @@ func (gs GreenplumSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for GreenplumSource. func (gs GreenplumSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -101272,6 +103439,11 @@ func (gs GreenplumSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for GreenplumSource. +func (gs GreenplumSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for GreenplumSource. func (gs GreenplumSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -101397,7 +103569,7 @@ type GreenplumTableDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -101858,6 +104030,11 @@ func (gtd GreenplumTableDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for GreenplumTableDataset. +func (gtd GreenplumTableDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for GreenplumTableDataset. func (gtd GreenplumTableDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -101873,6 +104050,11 @@ func (gtd GreenplumTableDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for GreenplumTableDataset. +func (gtd GreenplumTableDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for GreenplumTableDataset. func (gtd GreenplumTableDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -102777,7 +104959,7 @@ type HBaseObjectDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -103238,6 +105420,11 @@ func (hbod HBaseObjectDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for HBaseObjectDataset. +func (hbod HBaseObjectDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for HBaseObjectDataset. func (hbod HBaseObjectDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -103253,6 +105440,11 @@ func (hbod HBaseObjectDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for HBaseObjectDataset. +func (hbod HBaseObjectDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for HBaseObjectDataset. func (hbod HBaseObjectDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -103397,7 +105589,7 @@ type HBaseSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -103862,6 +106054,11 @@ func (hbs HBaseSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for HBaseSource. func (hbs HBaseSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -103877,6 +106074,11 @@ func (hbs HBaseSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for HBaseSource. +func (hbs HBaseSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for HBaseSource. func (hbs HBaseSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -105098,7 +107300,7 @@ type HdfsSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -105560,6 +107762,11 @@ func (hs HdfsSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for HdfsSource. func (hs HdfsSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -105575,6 +107782,11 @@ func (hs HdfsSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for HdfsSource. +func (hs HdfsSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for HdfsSource. func (hs HdfsSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -110277,7 +112489,7 @@ type HiveObjectDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -110738,6 +112950,11 @@ func (hod HiveObjectDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for HiveObjectDataset. +func (hod HiveObjectDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for HiveObjectDataset. func (hod HiveObjectDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -110753,6 +112970,11 @@ func (hod HiveObjectDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for HiveObjectDataset. +func (hod HiveObjectDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for HiveObjectDataset. func (hod HiveObjectDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -110897,7 +113119,7 @@ type HiveSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -111362,6 +113584,11 @@ func (hs HiveSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for HiveSource. func (hs HiveSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -111377,6 +113604,11 @@ func (hs HiveSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for HiveSource. +func (hs HiveSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for HiveSource. func (hs HiveSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -111502,7 +113734,7 @@ type HTTPDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -111963,6 +114195,11 @@ func (hd HTTPDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for HTTPDataset. +func (hd HTTPDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for HTTPDataset. func (hd HTTPDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -111978,6 +114215,11 @@ func (hd HTTPDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for HTTPDataset. +func (hd HTTPDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for HTTPDataset. func (hd HTTPDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -113310,7 +115552,7 @@ type HTTPSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -113769,6 +116011,11 @@ func (hs HTTPSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for HTTPSource. func (hs HTTPSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -113784,6 +116031,11 @@ func (hs HTTPSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for HTTPSource. +func (hs HTTPSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for HTTPSource. func (hs HTTPSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -114612,7 +116864,7 @@ type HubspotObjectDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -115073,6 +117325,11 @@ func (hod HubspotObjectDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for HubspotObjectDataset. +func (hod HubspotObjectDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for HubspotObjectDataset. func (hod HubspotObjectDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -115088,6 +117345,11 @@ func (hod HubspotObjectDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for HubspotObjectDataset. +func (hod HubspotObjectDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for HubspotObjectDataset. func (hod HubspotObjectDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -115232,7 +117494,7 @@ type HubspotSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -115697,6 +117959,11 @@ func (hs HubspotSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for HubspotSource. func (hs HubspotSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -115712,6 +117979,11 @@ func (hs HubspotSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for HubspotSource. +func (hs HubspotSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for HubspotSource. func (hs HubspotSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -116982,7 +119254,7 @@ type ImpalaObjectDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -117443,6 +119715,11 @@ func (iod ImpalaObjectDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for ImpalaObjectDataset. +func (iod ImpalaObjectDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for ImpalaObjectDataset. func (iod ImpalaObjectDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -117458,6 +119735,11 @@ func (iod ImpalaObjectDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for ImpalaObjectDataset. +func (iod ImpalaObjectDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for ImpalaObjectDataset. func (iod ImpalaObjectDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -117602,7 +119884,7 @@ type ImpalaSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -118067,6 +120349,11 @@ func (is ImpalaSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for ImpalaSource. func (is ImpalaSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -118082,6 +120369,11 @@ func (is ImpalaSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for ImpalaSource. +func (is ImpalaSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for ImpalaSource. func (is ImpalaSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -119344,7 +121636,7 @@ type InformixSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -119809,6 +122101,11 @@ func (is InformixSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for InformixSource. +func (is InformixSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for InformixSource. func (is InformixSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -119824,6 +122121,11 @@ func (is InformixSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for InformixSource. +func (is InformixSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for InformixSource. func (is InformixSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -119949,7 +122251,7 @@ type InformixTableDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -120410,6 +122712,11 @@ func (itd InformixTableDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for InformixTableDataset. +func (itd InformixTableDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for InformixTableDataset. func (itd InformixTableDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -120425,6 +122732,11 @@ func (itd InformixTableDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for InformixTableDataset. +func (itd InformixTableDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for InformixTableDataset. func (itd InformixTableDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -122825,7 +125137,7 @@ type JiraObjectDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -123286,6 +125598,11 @@ func (jod JiraObjectDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for JiraObjectDataset. +func (jod JiraObjectDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for JiraObjectDataset. func (jod JiraObjectDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -123301,6 +125618,11 @@ func (jod JiraObjectDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for JiraObjectDataset. +func (jod JiraObjectDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for JiraObjectDataset. func (jod JiraObjectDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -123445,7 +125767,7 @@ type JiraSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -123910,6 +126232,11 @@ func (js JiraSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for JiraSource. func (js JiraSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -123925,6 +126252,11 @@ func (js JiraSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for JiraSource. +func (js JiraSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for JiraSource. func (js JiraSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -124050,7 +126382,7 @@ type JSONDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -124511,6 +126843,11 @@ func (jd JSONDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for JSONDataset. +func (jd JSONDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for JSONDataset. func (jd JSONDataset) AsJSONDataset() (*JSONDataset, bool) { return &jd, true @@ -124526,6 +126863,11 @@ func (jd JSONDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for JSONDataset. +func (jd JSONDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for JSONDataset. func (jd JSONDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -124900,7 +127242,7 @@ type JSONReadSettings struct { CompressionProperties BasicCompressionReadSettings `json:"compressionProperties,omitempty"` // AdditionalProperties - Unmatched properties from the message are deserialized this collection AdditionalProperties map[string]interface{} `json:""` - // Type - Possible values include: 'TypeFormatReadSettings', 'TypeJSONReadSettings', 'TypeDelimitedTextReadSettings', 'TypeBinaryReadSettings' + // Type - Possible values include: 'TypeFormatReadSettings', 'TypeBinaryReadSettings', 'TypeXMLReadSettings', 'TypeJSONReadSettings', 'TypeDelimitedTextReadSettings' Type TypeBasicFormatReadSettings `json:"type,omitempty"` } @@ -124918,6 +127260,16 @@ func (jrs JSONReadSettings) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AsBinaryReadSettings is the BasicFormatReadSettings implementation for JSONReadSettings. +func (jrs JSONReadSettings) AsBinaryReadSettings() (*BinaryReadSettings, bool) { + return nil, false +} + +// AsXMLReadSettings is the BasicFormatReadSettings implementation for JSONReadSettings. +func (jrs JSONReadSettings) AsXMLReadSettings() (*XMLReadSettings, bool) { + return nil, false +} + // AsJSONReadSettings is the BasicFormatReadSettings implementation for JSONReadSettings. func (jrs JSONReadSettings) AsJSONReadSettings() (*JSONReadSettings, bool) { return &jrs, true @@ -124928,11 +127280,6 @@ func (jrs JSONReadSettings) AsDelimitedTextReadSettings() (*DelimitedTextReadSet return nil, false } -// AsBinaryReadSettings is the BasicFormatReadSettings implementation for JSONReadSettings. -func (jrs JSONReadSettings) AsBinaryReadSettings() (*BinaryReadSettings, bool) { - return nil, false -} - // AsFormatReadSettings is the BasicFormatReadSettings implementation for JSONReadSettings. func (jrs JSONReadSettings) AsFormatReadSettings() (*FormatReadSettings, bool) { return nil, false @@ -125340,7 +127687,7 @@ type JSONSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -125803,6 +128150,11 @@ func (js JSONSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for JSONSource. +func (js JSONSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for JSONSource. func (js JSONSource) AsJSONSource() (*JSONSource, bool) { return &js, true @@ -125818,6 +128170,11 @@ func (js JSONSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for JSONSource. +func (js JSONSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for JSONSource. func (js JSONSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -128850,7 +131207,7 @@ type MagentoObjectDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -129311,6 +131668,11 @@ func (mod MagentoObjectDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for MagentoObjectDataset. +func (mod MagentoObjectDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for MagentoObjectDataset. func (mod MagentoObjectDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -129326,6 +131688,11 @@ func (mod MagentoObjectDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for MagentoObjectDataset. +func (mod MagentoObjectDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for MagentoObjectDataset. func (mod MagentoObjectDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -129470,7 +131837,7 @@ type MagentoSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -129935,6 +132302,11 @@ func (ms MagentoSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for MagentoSource. func (ms MagentoSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -129950,6 +132322,11 @@ func (ms MagentoSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for MagentoSource. +func (ms MagentoSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for MagentoSource. func (ms MagentoSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -131109,7 +133486,7 @@ type MariaDBSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -131574,6 +133951,11 @@ func (mds MariaDBSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for MariaDBSource. func (mds MariaDBSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -131589,6 +133971,11 @@ func (mds MariaDBSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for MariaDBSource. +func (mds MariaDBSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for MariaDBSource. func (mds MariaDBSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -131714,7 +134101,7 @@ type MariaDBTableDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -132175,6 +134562,11 @@ func (mdtd MariaDBTableDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for MariaDBTableDataset. +func (mdtd MariaDBTableDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for MariaDBTableDataset. func (mdtd MariaDBTableDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -132190,6 +134582,11 @@ func (mdtd MariaDBTableDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for MariaDBTableDataset. +func (mdtd MariaDBTableDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for MariaDBTableDataset. func (mdtd MariaDBTableDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -133050,7 +135447,7 @@ type MarketoObjectDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -133511,6 +135908,11 @@ func (mod MarketoObjectDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for MarketoObjectDataset. +func (mod MarketoObjectDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for MarketoObjectDataset. func (mod MarketoObjectDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -133526,6 +135928,11 @@ func (mod MarketoObjectDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for MarketoObjectDataset. +func (mod MarketoObjectDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for MarketoObjectDataset. func (mod MarketoObjectDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -133670,7 +136077,7 @@ type MarketoSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -134135,6 +136542,11 @@ func (ms MarketoSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for MarketoSource. func (ms MarketoSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -134150,6 +136562,11 @@ func (ms MarketoSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for MarketoSource. +func (ms MarketoSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for MarketoSource. func (ms MarketoSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -135295,7 +137712,7 @@ type MicrosoftAccessSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -135757,6 +138174,11 @@ func (mas MicrosoftAccessSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for MicrosoftAccessSource. +func (mas MicrosoftAccessSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for MicrosoftAccessSource. func (mas MicrosoftAccessSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -135772,6 +138194,11 @@ func (mas MicrosoftAccessSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for MicrosoftAccessSource. +func (mas MicrosoftAccessSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for MicrosoftAccessSource. func (mas MicrosoftAccessSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -135888,7 +138315,7 @@ type MicrosoftAccessTableDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -136349,6 +138776,11 @@ func (matd MicrosoftAccessTableDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for MicrosoftAccessTableDataset. +func (matd MicrosoftAccessTableDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for MicrosoftAccessTableDataset. func (matd MicrosoftAccessTableDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -136364,6 +138796,11 @@ func (matd MicrosoftAccessTableDataset) AsParquetDataset() (*ParquetDataset, boo return nil, false } +// AsExcelDataset is the BasicDataset implementation for MicrosoftAccessTableDataset. +func (matd MicrosoftAccessTableDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for MicrosoftAccessTableDataset. func (matd MicrosoftAccessTableDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -136518,7 +138955,7 @@ type MongoDbCollectionDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -136979,6 +139416,11 @@ func (mdcd MongoDbCollectionDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for MongoDbCollectionDataset. +func (mdcd MongoDbCollectionDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for MongoDbCollectionDataset. func (mdcd MongoDbCollectionDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -136994,6 +139436,11 @@ func (mdcd MongoDbCollectionDataset) AsParquetDataset() (*ParquetDataset, bool) return nil, false } +// AsExcelDataset is the BasicDataset implementation for MongoDbCollectionDataset. +func (mdcd MongoDbCollectionDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for MongoDbCollectionDataset. func (mdcd MongoDbCollectionDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -137985,7 +140432,7 @@ type MongoDbSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -138447,6 +140894,11 @@ func (mds MongoDbSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for MongoDbSource. func (mds MongoDbSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -138462,6 +140914,11 @@ func (mds MongoDbSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for MongoDbSource. +func (mds MongoDbSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for MongoDbSource. func (mds MongoDbSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -138578,7 +141035,7 @@ type MongoDbV2CollectionDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -139039,6 +141496,11 @@ func (mdvcd MongoDbV2CollectionDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for MongoDbV2CollectionDataset. +func (mdvcd MongoDbV2CollectionDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for MongoDbV2CollectionDataset. func (mdvcd MongoDbV2CollectionDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -139054,6 +141516,11 @@ func (mdvcd MongoDbV2CollectionDataset) AsParquetDataset() (*ParquetDataset, boo return nil, false } +// AsExcelDataset is the BasicDataset implementation for MongoDbV2CollectionDataset. +func (mdvcd MongoDbV2CollectionDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for MongoDbV2CollectionDataset. func (mdvcd MongoDbV2CollectionDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -139833,7 +142300,7 @@ type MongoDbV2Source struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -140304,6 +142771,11 @@ func (mdvs MongoDbV2Source) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for MongoDbV2Source. +func (mdvs MongoDbV2Source) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for MongoDbV2Source. func (mdvs MongoDbV2Source) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -140319,6 +142791,11 @@ func (mdvs MongoDbV2Source) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for MongoDbV2Source. +func (mdvs MongoDbV2Source) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for MongoDbV2Source. func (mdvs MongoDbV2Source) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -141298,7 +143775,7 @@ type MySQLSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -141763,6 +144240,11 @@ func (mss MySQLSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for MySQLSource. +func (mss MySQLSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for MySQLSource. func (mss MySQLSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -141778,6 +144260,11 @@ func (mss MySQLSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for MySQLSource. +func (mss MySQLSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for MySQLSource. func (mss MySQLSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -141903,7 +144390,7 @@ type MySQLTableDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -142364,6 +144851,11 @@ func (mstd MySQLTableDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for MySQLTableDataset. +func (mstd MySQLTableDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for MySQLTableDataset. func (mstd MySQLTableDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -142379,6 +144871,11 @@ func (mstd MySQLTableDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for MySQLTableDataset. +func (mstd MySQLTableDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for MySQLTableDataset. func (mstd MySQLTableDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -143170,7 +145667,7 @@ type NetezzaSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -143641,6 +146138,11 @@ func (ns NetezzaSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for NetezzaSource. func (ns NetezzaSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -143656,6 +146158,11 @@ func (ns NetezzaSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for NetezzaSource. +func (ns NetezzaSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for NetezzaSource. func (ns NetezzaSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -143799,7 +146306,7 @@ type NetezzaTableDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -144260,6 +146767,11 @@ func (ntd NetezzaTableDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for NetezzaTableDataset. +func (ntd NetezzaTableDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for NetezzaTableDataset. func (ntd NetezzaTableDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -144275,6 +146787,11 @@ func (ntd NetezzaTableDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for NetezzaTableDataset. +func (ntd NetezzaTableDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for NetezzaTableDataset. func (ntd NetezzaTableDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -145197,7 +147714,7 @@ type ODataResourceDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -145658,6 +148175,11 @@ func (odrd ODataResourceDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for ODataResourceDataset. +func (odrd ODataResourceDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for ODataResourceDataset. func (odrd ODataResourceDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -145673,6 +148195,11 @@ func (odrd ODataResourceDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for ODataResourceDataset. +func (odrd ODataResourceDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for ODataResourceDataset. func (odrd ODataResourceDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -145823,7 +148350,7 @@ type ODataSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -146288,6 +148815,11 @@ func (ods ODataSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for ODataSource. +func (ods ODataSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for ODataSource. func (ods ODataSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -146303,6 +148835,11 @@ func (ods ODataSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for ODataSource. +func (ods ODataSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for ODataSource. func (ods ODataSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -147450,7 +149987,7 @@ type OdbcSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -147915,6 +150452,11 @@ func (osVar OdbcSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for OdbcSource. +func (osVar OdbcSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for OdbcSource. func (osVar OdbcSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -147930,6 +150472,11 @@ func (osVar OdbcSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for OdbcSource. +func (osVar OdbcSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for OdbcSource. func (osVar OdbcSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -148055,7 +150602,7 @@ type OdbcTableDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -148516,6 +151063,11 @@ func (otd OdbcTableDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for OdbcTableDataset. +func (otd OdbcTableDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for OdbcTableDataset. func (otd OdbcTableDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -148531,6 +151083,11 @@ func (otd OdbcTableDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for OdbcTableDataset. +func (otd OdbcTableDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for OdbcTableDataset. func (otd OdbcTableDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -148685,7 +151242,7 @@ type Office365Dataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -149146,6 +151703,11 @@ func (o3d Office365Dataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for Office365Dataset. +func (o3d Office365Dataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for Office365Dataset. func (o3d Office365Dataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -149161,6 +151723,11 @@ func (o3d Office365Dataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for Office365Dataset. +func (o3d Office365Dataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for Office365Dataset. func (o3d Office365Dataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -150009,7 +152576,7 @@ type Office365Source struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -150483,6 +153050,11 @@ func (o3s Office365Source) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for Office365Source. +func (o3s Office365Source) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for Office365Source. func (o3s Office365Source) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -150498,6 +153070,11 @@ func (o3s Office365Source) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for Office365Source. +func (o3s Office365Source) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for Office365Source. func (o3s Office365Source) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -152306,7 +154883,7 @@ type OracleServiceCloudObjectDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -152767,6 +155344,11 @@ func (oscod OracleServiceCloudObjectDataset) AsOrcDataset() (*OrcDataset, bool) return nil, false } +// AsXMLDataset is the BasicDataset implementation for OracleServiceCloudObjectDataset. +func (oscod OracleServiceCloudObjectDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for OracleServiceCloudObjectDataset. func (oscod OracleServiceCloudObjectDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -152782,6 +155364,11 @@ func (oscod OracleServiceCloudObjectDataset) AsParquetDataset() (*ParquetDataset return nil, false } +// AsExcelDataset is the BasicDataset implementation for OracleServiceCloudObjectDataset. +func (oscod OracleServiceCloudObjectDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for OracleServiceCloudObjectDataset. func (oscod OracleServiceCloudObjectDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -152926,7 +155513,7 @@ type OracleServiceCloudSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -153391,6 +155978,11 @@ func (oscs OracleServiceCloudSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for OracleServiceCloudSource. +func (oscs OracleServiceCloudSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for OracleServiceCloudSource. func (oscs OracleServiceCloudSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -153406,6 +155998,11 @@ func (oscs OracleServiceCloudSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for OracleServiceCloudSource. +func (oscs OracleServiceCloudSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for OracleServiceCloudSource. func (oscs OracleServiceCloudSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -153857,7 +156454,7 @@ type OracleSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -154328,6 +156925,11 @@ func (osVar OracleSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for OracleSource. func (osVar OracleSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -154343,6 +156945,11 @@ func (osVar OracleSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for OracleSource. +func (osVar OracleSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for OracleSource. func (osVar OracleSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -154486,7 +157093,7 @@ type OracleTableDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -154947,6 +157554,11 @@ func (otd OracleTableDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for OracleTableDataset. +func (otd OracleTableDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for OracleTableDataset. func (otd OracleTableDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -154962,6 +157574,11 @@ func (otd OracleTableDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for OracleTableDataset. +func (otd OracleTableDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for OracleTableDataset. func (otd OracleTableDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -155120,7 +157737,7 @@ type OrcDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -155581,6 +158198,11 @@ func (od OrcDataset) AsOrcDataset() (*OrcDataset, bool) { return &od, true } +// AsXMLDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for OrcDataset. func (od OrcDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -155596,6 +158218,11 @@ func (od OrcDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for OrcDataset. +func (od OrcDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for OrcDataset. func (od OrcDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -156221,7 +158848,7 @@ type OrcSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -156681,6 +159308,11 @@ func (osVar OrcSource) AsOrcSource() (*OrcSource, bool) { return &osVar, true } +// AsXMLSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for OrcSource. func (osVar OrcSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -156696,6 +159328,11 @@ func (osVar OrcSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for OrcSource. +func (osVar OrcSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for OrcSource. func (osVar OrcSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -156827,7 +159464,7 @@ type ParquetDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -157288,6 +159925,11 @@ func (pd ParquetDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for ParquetDataset. +func (pd ParquetDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for ParquetDataset. func (pd ParquetDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -157303,6 +159945,11 @@ func (pd ParquetDataset) AsParquetDataset() (*ParquetDataset, bool) { return &pd, true } +// AsExcelDataset is the BasicDataset implementation for ParquetDataset. +func (pd ParquetDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for ParquetDataset. func (pd ParquetDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -157927,7 +160574,7 @@ type ParquetSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -158387,6 +161034,11 @@ func (ps ParquetSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for ParquetSource. +func (ps ParquetSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for ParquetSource. func (ps ParquetSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -158402,6 +161054,11 @@ func (ps ParquetSource) AsParquetSource() (*ParquetSource, bool) { return &ps, true } +// AsExcelSource is the BasicCopySource implementation for ParquetSource. +func (ps ParquetSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for ParquetSource. func (ps ParquetSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -159229,7 +161886,7 @@ type PaypalObjectDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -159690,6 +162347,11 @@ func (pod PaypalObjectDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for PaypalObjectDataset. +func (pod PaypalObjectDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for PaypalObjectDataset. func (pod PaypalObjectDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -159705,6 +162367,11 @@ func (pod PaypalObjectDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for PaypalObjectDataset. +func (pod PaypalObjectDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for PaypalObjectDataset. func (pod PaypalObjectDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -159849,7 +162516,7 @@ type PaypalSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -160314,6 +162981,11 @@ func (ps PaypalSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for PaypalSource. func (ps PaypalSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -160329,6 +163001,11 @@ func (ps PaypalSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for PaypalSource. +func (ps PaypalSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for PaypalSource. func (ps PaypalSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -161231,7 +163908,7 @@ type PhoenixObjectDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -161692,6 +164369,11 @@ func (pod PhoenixObjectDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for PhoenixObjectDataset. +func (pod PhoenixObjectDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for PhoenixObjectDataset. func (pod PhoenixObjectDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -161707,6 +164389,11 @@ func (pod PhoenixObjectDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for PhoenixObjectDataset. +func (pod PhoenixObjectDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for PhoenixObjectDataset. func (pod PhoenixObjectDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -161851,7 +164538,7 @@ type PhoenixSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -162316,6 +165003,11 @@ func (ps PhoenixSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for PhoenixSource. func (ps PhoenixSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -162331,6 +165023,11 @@ func (ps PhoenixSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for PhoenixSource. +func (ps PhoenixSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for PhoenixSource. func (ps PhoenixSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -163782,7 +166479,7 @@ type PostgreSQLSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -164247,6 +166944,11 @@ func (pss PostgreSQLSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for PostgreSQLSource. +func (pss PostgreSQLSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for PostgreSQLSource. func (pss PostgreSQLSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -164262,6 +166964,11 @@ func (pss PostgreSQLSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for PostgreSQLSource. +func (pss PostgreSQLSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for PostgreSQLSource. func (pss PostgreSQLSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -164387,7 +167094,7 @@ type PostgreSQLTableDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -164848,6 +167555,11 @@ func (pstd PostgreSQLTableDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for PostgreSQLTableDataset. +func (pstd PostgreSQLTableDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for PostgreSQLTableDataset. func (pstd PostgreSQLTableDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -164863,6 +167575,11 @@ func (pstd PostgreSQLTableDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for PostgreSQLTableDataset. +func (pstd PostgreSQLTableDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for PostgreSQLTableDataset. func (pstd PostgreSQLTableDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -165820,7 +168537,7 @@ type PrestoObjectDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -166281,6 +168998,11 @@ func (pod PrestoObjectDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for PrestoObjectDataset. +func (pod PrestoObjectDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for PrestoObjectDataset. func (pod PrestoObjectDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -166296,6 +169018,11 @@ func (pod PrestoObjectDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for PrestoObjectDataset. +func (pod PrestoObjectDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for PrestoObjectDataset. func (pod PrestoObjectDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -166440,7 +169167,7 @@ type PrestoSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -166905,6 +169632,11 @@ func (ps PrestoSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for PrestoSource. func (ps PrestoSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -166920,6 +169652,11 @@ func (ps PrestoSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for PrestoSource. +func (ps PrestoSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for PrestoSource. func (ps PrestoSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -167913,7 +170650,7 @@ type QuickBooksObjectDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -168374,6 +171111,11 @@ func (qbod QuickBooksObjectDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for QuickBooksObjectDataset. +func (qbod QuickBooksObjectDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for QuickBooksObjectDataset. func (qbod QuickBooksObjectDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -168389,6 +171131,11 @@ func (qbod QuickBooksObjectDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for QuickBooksObjectDataset. +func (qbod QuickBooksObjectDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for QuickBooksObjectDataset. func (qbod QuickBooksObjectDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -168533,7 +171280,7 @@ type QuickBooksSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -168998,6 +171745,11 @@ func (qbs QuickBooksSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for QuickBooksSource. func (qbs QuickBooksSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -169013,6 +171765,11 @@ func (qbs QuickBooksSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for QuickBooksSource. +func (qbs QuickBooksSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for QuickBooksSource. func (qbs QuickBooksSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -169394,7 +172151,7 @@ type RelationalSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -169856,6 +172613,11 @@ func (rs RelationalSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for RelationalSource. func (rs RelationalSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -169871,6 +172633,11 @@ func (rs RelationalSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for RelationalSource. +func (rs RelationalSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for RelationalSource. func (rs RelationalSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -169987,7 +172754,7 @@ type RelationalTableDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -170448,6 +173215,11 @@ func (rtd RelationalTableDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for RelationalTableDataset. +func (rtd RelationalTableDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for RelationalTableDataset. func (rtd RelationalTableDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -170463,6 +173235,11 @@ func (rtd RelationalTableDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for RelationalTableDataset. +func (rtd RelationalTableDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for RelationalTableDataset. func (rtd RelationalTableDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -171530,7 +174307,7 @@ type ResponsysObjectDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -171991,6 +174768,11 @@ func (rod ResponsysObjectDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for ResponsysObjectDataset. +func (rod ResponsysObjectDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for ResponsysObjectDataset. func (rod ResponsysObjectDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -172006,6 +174788,11 @@ func (rod ResponsysObjectDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for ResponsysObjectDataset. +func (rod ResponsysObjectDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for ResponsysObjectDataset. func (rod ResponsysObjectDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -172150,7 +174937,7 @@ type ResponsysSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -172615,6 +175402,11 @@ func (rs ResponsysSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for ResponsysSource. func (rs ResponsysSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -172630,6 +175422,11 @@ func (rs ResponsysSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for ResponsysSource. +func (rs ResponsysSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for ResponsysSource. func (rs ResponsysSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -172755,7 +175552,7 @@ type RestResourceDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -173216,6 +176013,11 @@ func (rrd RestResourceDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for RestResourceDataset. +func (rrd RestResourceDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for RestResourceDataset. func (rrd RestResourceDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -173231,6 +176033,11 @@ func (rrd RestResourceDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for RestResourceDataset. +func (rrd RestResourceDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for RestResourceDataset. func (rrd RestResourceDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -174141,7 +176948,7 @@ type RestSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -174618,6 +177425,11 @@ func (rs RestSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for RestSource. +func (rs RestSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for RestSource. func (rs RestSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -174633,6 +177445,11 @@ func (rs RestSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for RestSource. +func (rs RestSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for RestSource. func (rs RestSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -176236,7 +179053,7 @@ type SalesforceMarketingCloudObjectDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -176697,6 +179514,11 @@ func (smcod SalesforceMarketingCloudObjectDataset) AsOrcDataset() (*OrcDataset, return nil, false } +// AsXMLDataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. +func (smcod SalesforceMarketingCloudObjectDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. func (smcod SalesforceMarketingCloudObjectDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -176712,6 +179534,11 @@ func (smcod SalesforceMarketingCloudObjectDataset) AsParquetDataset() (*ParquetD return nil, false } +// AsExcelDataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. +func (smcod SalesforceMarketingCloudObjectDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for SalesforceMarketingCloudObjectDataset. func (smcod SalesforceMarketingCloudObjectDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -176856,7 +179683,7 @@ type SalesforceMarketingCloudSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -177321,6 +180148,11 @@ func (smcs SalesforceMarketingCloudSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. func (smcs SalesforceMarketingCloudSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -177336,6 +180168,11 @@ func (smcs SalesforceMarketingCloudSource) AsParquetSource() (*ParquetSource, bo return nil, false } +// AsExcelSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. +func (smcs SalesforceMarketingCloudSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for SalesforceMarketingCloudSource. func (smcs SalesforceMarketingCloudSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -177461,7 +180298,7 @@ type SalesforceObjectDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -177922,6 +180759,11 @@ func (sod SalesforceObjectDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for SalesforceObjectDataset. +func (sod SalesforceObjectDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for SalesforceObjectDataset. func (sod SalesforceObjectDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -177937,6 +180779,11 @@ func (sod SalesforceObjectDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for SalesforceObjectDataset. +func (sod SalesforceObjectDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for SalesforceObjectDataset. func (sod SalesforceObjectDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -178802,7 +181649,7 @@ type SalesforceServiceCloudObjectDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -179263,6 +182110,11 @@ func (sscod SalesforceServiceCloudObjectDataset) AsOrcDataset() (*OrcDataset, bo return nil, false } +// AsXMLDataset is the BasicDataset implementation for SalesforceServiceCloudObjectDataset. +func (sscod SalesforceServiceCloudObjectDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for SalesforceServiceCloudObjectDataset. func (sscod SalesforceServiceCloudObjectDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -179278,6 +182130,11 @@ func (sscod SalesforceServiceCloudObjectDataset) AsParquetDataset() (*ParquetDat return nil, false } +// AsExcelDataset is the BasicDataset implementation for SalesforceServiceCloudObjectDataset. +func (sscod SalesforceServiceCloudObjectDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for SalesforceServiceCloudObjectDataset. func (sscod SalesforceServiceCloudObjectDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -179782,7 +182639,7 @@ type SalesforceServiceCloudSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -180247,6 +183104,11 @@ func (sscs SalesforceServiceCloudSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for SalesforceServiceCloudSource. +func (sscs SalesforceServiceCloudSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for SalesforceServiceCloudSource. func (sscs SalesforceServiceCloudSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -180262,6 +183124,11 @@ func (sscs SalesforceServiceCloudSource) AsParquetSource() (*ParquetSource, bool return nil, false } +// AsExcelSource is the BasicCopySource implementation for SalesforceServiceCloudSource. +func (sscs SalesforceServiceCloudSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for SalesforceServiceCloudSource. func (sscs SalesforceServiceCloudSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -180739,7 +183606,7 @@ type SalesforceSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -181207,6 +184074,11 @@ func (ss SalesforceSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for SalesforceSource. func (ss SalesforceSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -181222,6 +184094,11 @@ func (ss SalesforceSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for SalesforceSource. +func (ss SalesforceSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for SalesforceSource. func (ss SalesforceSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -181354,7 +184231,7 @@ type SapBwCubeDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -181812,6 +184689,11 @@ func (sbcd SapBwCubeDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for SapBwCubeDataset. +func (sbcd SapBwCubeDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for SapBwCubeDataset. func (sbcd SapBwCubeDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -181827,6 +184709,11 @@ func (sbcd SapBwCubeDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for SapBwCubeDataset. +func (sbcd SapBwCubeDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for SapBwCubeDataset. func (sbcd SapBwCubeDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -182663,7 +185550,7 @@ type SapBwSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -183128,6 +186015,11 @@ func (sbs SapBwSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for SapBwSource. +func (sbs SapBwSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for SapBwSource. func (sbs SapBwSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -183143,6 +186035,11 @@ func (sbs SapBwSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for SapBwSource. +func (sbs SapBwSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for SapBwSource. func (sbs SapBwSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -183947,7 +186844,7 @@ type SapCloudForCustomerResourceDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -184408,6 +187305,11 @@ func (scfcrd SapCloudForCustomerResourceDataset) AsOrcDataset() (*OrcDataset, bo return nil, false } +// AsXMLDataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. +func (scfcrd SapCloudForCustomerResourceDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. func (scfcrd SapCloudForCustomerResourceDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -184423,6 +187325,11 @@ func (scfcrd SapCloudForCustomerResourceDataset) AsParquetDataset() (*ParquetDat return nil, false } +// AsExcelDataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. +func (scfcrd SapCloudForCustomerResourceDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for SapCloudForCustomerResourceDataset. func (scfcrd SapCloudForCustomerResourceDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -184916,7 +187823,7 @@ type SapCloudForCustomerSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -185384,6 +188291,11 @@ func (scfcs SapCloudForCustomerSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for SapCloudForCustomerSource. func (scfcs SapCloudForCustomerSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -185399,6 +188311,11 @@ func (scfcs SapCloudForCustomerSource) AsParquetSource() (*ParquetSource, bool) return nil, false } +// AsExcelSource is the BasicCopySource implementation for SapCloudForCustomerSource. +func (scfcs SapCloudForCustomerSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for SapCloudForCustomerSource. func (scfcs SapCloudForCustomerSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -186212,7 +189129,7 @@ type SapEccResourceDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -186673,6 +189590,11 @@ func (serd SapEccResourceDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for SapEccResourceDataset. +func (serd SapEccResourceDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for SapEccResourceDataset. func (serd SapEccResourceDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -186688,6 +189610,11 @@ func (serd SapEccResourceDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for SapEccResourceDataset. +func (serd SapEccResourceDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for SapEccResourceDataset. func (serd SapEccResourceDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -186840,7 +189767,7 @@ type SapEccSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -187308,6 +190235,11 @@ func (ses SapEccSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for SapEccSource. func (ses SapEccSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -187323,6 +190255,11 @@ func (ses SapEccSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for SapEccSource. +func (ses SapEccSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for SapEccSource. func (ses SapEccSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -188166,7 +191103,7 @@ type SapHanaSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -188640,6 +191577,11 @@ func (shs SapHanaSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for SapHanaSource. +func (shs SapHanaSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for SapHanaSource. func (shs SapHanaSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -188655,6 +191597,11 @@ func (shs SapHanaSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for SapHanaSource. +func (shs SapHanaSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for SapHanaSource. func (shs SapHanaSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -188807,7 +191754,7 @@ type SapHanaTableDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -189268,6 +192215,11 @@ func (shtd SapHanaTableDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for SapHanaTableDataset. +func (shtd SapHanaTableDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for SapHanaTableDataset. func (shtd SapHanaTableDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -189283,6 +192235,11 @@ func (shtd SapHanaTableDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for SapHanaTableDataset. +func (shtd SapHanaTableDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for SapHanaTableDataset. func (shtd SapHanaTableDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -190150,7 +193107,7 @@ type SapOpenHubSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -190618,6 +193575,11 @@ func (sohs SapOpenHubSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for SapOpenHubSource. +func (sohs SapOpenHubSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for SapOpenHubSource. func (sohs SapOpenHubSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -190633,6 +193595,11 @@ func (sohs SapOpenHubSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for SapOpenHubSource. +func (sohs SapOpenHubSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for SapOpenHubSource. func (sohs SapOpenHubSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -190767,7 +193734,7 @@ type SapOpenHubTableDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -191228,6 +194195,11 @@ func (sohtd SapOpenHubTableDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for SapOpenHubTableDataset. +func (sohtd SapOpenHubTableDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for SapOpenHubTableDataset. func (sohtd SapOpenHubTableDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -191243,6 +194215,11 @@ func (sohtd SapOpenHubTableDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for SapOpenHubTableDataset. +func (sohtd SapOpenHubTableDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for SapOpenHubTableDataset. func (sohtd SapOpenHubTableDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -192224,7 +195201,7 @@ type SapTableResourceDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -192685,6 +195662,11 @@ func (strd SapTableResourceDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for SapTableResourceDataset. +func (strd SapTableResourceDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for SapTableResourceDataset. func (strd SapTableResourceDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -192700,6 +195682,11 @@ func (strd SapTableResourceDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for SapTableResourceDataset. +func (strd SapTableResourceDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for SapTableResourceDataset. func (strd SapTableResourceDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -192864,7 +195851,7 @@ type SapTableSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -193350,6 +196337,11 @@ func (sts SapTableSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for SapTableSource. +func (sts SapTableSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for SapTableSource. func (sts SapTableSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -193365,6 +196357,11 @@ func (sts SapTableSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for SapTableSource. +func (sts SapTableSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for SapTableSource. func (sts SapTableSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -195138,7 +198135,7 @@ type ServiceNowObjectDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -195599,6 +198596,11 @@ func (snod ServiceNowObjectDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for ServiceNowObjectDataset. +func (snod ServiceNowObjectDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for ServiceNowObjectDataset. func (snod ServiceNowObjectDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -195614,6 +198616,11 @@ func (snod ServiceNowObjectDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for ServiceNowObjectDataset. +func (snod ServiceNowObjectDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for ServiceNowObjectDataset. func (snod ServiceNowObjectDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -195758,7 +198765,7 @@ type ServiceNowSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -196223,6 +199230,11 @@ func (sns ServiceNowSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for ServiceNowSource. func (sns ServiceNowSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -196238,6 +199250,11 @@ func (sns ServiceNowSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for ServiceNowSource. +func (sns ServiceNowSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for ServiceNowSource. func (sns ServiceNowSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -198694,7 +201711,7 @@ type SharePointOnlineListResourceDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -199155,6 +202172,11 @@ func (spolrd SharePointOnlineListResourceDataset) AsOrcDataset() (*OrcDataset, b return nil, false } +// AsXMLDataset is the BasicDataset implementation for SharePointOnlineListResourceDataset. +func (spolrd SharePointOnlineListResourceDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for SharePointOnlineListResourceDataset. func (spolrd SharePointOnlineListResourceDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -199170,6 +202192,11 @@ func (spolrd SharePointOnlineListResourceDataset) AsParquetDataset() (*ParquetDa return nil, false } +// AsExcelDataset is the BasicDataset implementation for SharePointOnlineListResourceDataset. +func (spolrd SharePointOnlineListResourceDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for SharePointOnlineListResourceDataset. func (spolrd SharePointOnlineListResourceDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -199312,7 +202339,7 @@ type SharePointOnlineListSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -199774,6 +202801,11 @@ func (spols SharePointOnlineListSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for SharePointOnlineListSource. +func (spols SharePointOnlineListSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for SharePointOnlineListSource. func (spols SharePointOnlineListSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -199789,6 +202821,11 @@ func (spols SharePointOnlineListSource) AsParquetSource() (*ParquetSource, bool) return nil, false } +// AsExcelSource is the BasicCopySource implementation for SharePointOnlineListSource. +func (spols SharePointOnlineListSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for SharePointOnlineListSource. func (spols SharePointOnlineListSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -200606,7 +203643,7 @@ type ShopifyObjectDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -201067,6 +204104,11 @@ func (sod ShopifyObjectDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for ShopifyObjectDataset. +func (sod ShopifyObjectDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for ShopifyObjectDataset. func (sod ShopifyObjectDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -201082,6 +204124,11 @@ func (sod ShopifyObjectDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for ShopifyObjectDataset. +func (sod ShopifyObjectDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for ShopifyObjectDataset. func (sod ShopifyObjectDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -201226,7 +204273,7 @@ type ShopifySource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -201691,6 +204738,11 @@ func (ss ShopifySource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for ShopifySource. func (ss ShopifySource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -201706,6 +204758,11 @@ func (ss ShopifySource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for ShopifySource. +func (ss ShopifySource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for ShopifySource. func (ss ShopifySource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -201839,7 +204896,7 @@ type SnowflakeDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -202300,6 +205357,11 @@ func (sd SnowflakeDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for SnowflakeDataset. +func (sd SnowflakeDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for SnowflakeDataset. func (sd SnowflakeDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -202315,6 +205377,11 @@ func (sd SnowflakeDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for SnowflakeDataset. +func (sd SnowflakeDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for SnowflakeDataset. func (sd SnowflakeDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -203632,7 +206699,7 @@ type SnowflakeSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -204094,6 +207161,11 @@ func (ss SnowflakeSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for SnowflakeSource. +func (ss SnowflakeSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for SnowflakeSource. func (ss SnowflakeSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -204109,6 +207181,11 @@ func (ss SnowflakeSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for SnowflakeSource. +func (ss SnowflakeSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for SnowflakeSource. func (ss SnowflakeSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -205024,7 +208101,7 @@ type SparkObjectDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -205485,6 +208562,11 @@ func (sod SparkObjectDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for SparkObjectDataset. +func (sod SparkObjectDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for SparkObjectDataset. func (sod SparkObjectDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -205500,6 +208582,11 @@ func (sod SparkObjectDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for SparkObjectDataset. +func (sod SparkObjectDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for SparkObjectDataset. func (sod SparkObjectDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -205644,7 +208731,7 @@ type SparkSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -206109,6 +209196,11 @@ func (ss SparkSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for SparkSource. func (ss SparkSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -206124,6 +209216,11 @@ func (ss SparkSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for SparkSource. +func (ss SparkSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for SparkSource. func (ss SparkSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -206645,7 +209742,7 @@ type SQLDWSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -207116,6 +210213,11 @@ func (sds SQLDWSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for SQLDWSource. func (sds SQLDWSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -207131,6 +210233,11 @@ func (sds SQLDWSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for SQLDWSource. +func (sds SQLDWSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for SQLDWSource. func (sds SQLDWSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -207672,7 +210779,7 @@ type SQLMISource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -208146,6 +211253,11 @@ func (sms SQLMISource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for SQLMISource. +func (sms SQLMISource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for SQLMISource. func (sms SQLMISource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -208161,6 +211273,11 @@ func (sms SQLMISource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for SQLMISource. +func (sms SQLMISource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for SQLMISource. func (sms SQLMISource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -209390,7 +212507,7 @@ type SQLServerSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -209864,6 +212981,11 @@ func (sss SQLServerSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for SQLServerSource. +func (sss SQLServerSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for SQLServerSource. func (sss SQLServerSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -209879,6 +213001,11 @@ func (sss SQLServerSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for SQLServerSource. +func (sss SQLServerSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for SQLServerSource. func (sss SQLServerSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -210406,7 +213533,7 @@ type SQLServerTableDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -210867,6 +213994,11 @@ func (sstd SQLServerTableDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for SQLServerTableDataset. +func (sstd SQLServerTableDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for SQLServerTableDataset. func (sstd SQLServerTableDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -210882,6 +214014,11 @@ func (sstd SQLServerTableDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for SQLServerTableDataset. +func (sstd SQLServerTableDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for SQLServerTableDataset. func (sstd SQLServerTableDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -211438,7 +214575,7 @@ type SQLSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -211912,6 +215049,11 @@ func (ss SQLSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for SQLSource. func (ss SQLSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -211927,6 +215069,11 @@ func (ss SQLSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for SQLSource. +func (ss SQLSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for SQLSource. func (ss SQLSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -212802,7 +215949,7 @@ type SquareObjectDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -213263,6 +216410,11 @@ func (sod SquareObjectDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for SquareObjectDataset. +func (sod SquareObjectDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for SquareObjectDataset. func (sod SquareObjectDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -213278,6 +216430,11 @@ func (sod SquareObjectDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for SquareObjectDataset. +func (sod SquareObjectDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for SquareObjectDataset. func (sod SquareObjectDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -213422,7 +216579,7 @@ type SquareSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -213887,6 +217044,11 @@ func (ss SquareSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for SquareSource. func (ss SquareSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -213902,6 +217064,11 @@ func (ss SquareSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for SquareSource. +func (ss SquareSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for SquareSource. func (ss SquareSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -216536,7 +219703,7 @@ type SybaseSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -217001,6 +220168,11 @@ func (ss SybaseSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for SybaseSource. +func (ss SybaseSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for SybaseSource. func (ss SybaseSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -217016,6 +220188,11 @@ func (ss SybaseSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for SybaseSource. +func (ss SybaseSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for SybaseSource. func (ss SybaseSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -217141,7 +220318,7 @@ type SybaseTableDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -217602,6 +220779,11 @@ func (std SybaseTableDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for SybaseTableDataset. +func (std SybaseTableDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for SybaseTableDataset. func (std SybaseTableDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -217617,6 +220799,11 @@ func (std SybaseTableDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for SybaseTableDataset. +func (std SybaseTableDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for SybaseTableDataset. func (std SybaseTableDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -217827,7 +221014,7 @@ type TabularSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -218550,6 +221737,11 @@ func (ts TabularSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for TabularSource. func (ts TabularSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -218565,6 +221757,11 @@ func (ts TabularSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for TabularSource. +func (ts TabularSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for TabularSource. func (ts TabularSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -219392,7 +222589,7 @@ type TeradataSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -219863,6 +223060,11 @@ func (ts TeradataSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for TeradataSource. +func (ts TeradataSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for TeradataSource. func (ts TeradataSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -219878,6 +223080,11 @@ func (ts TeradataSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for TeradataSource. +func (ts TeradataSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for TeradataSource. func (ts TeradataSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -220021,7 +223228,7 @@ type TeradataTableDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -220482,6 +223689,11 @@ func (ttd TeradataTableDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for TeradataTableDataset. +func (ttd TeradataTableDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for TeradataTableDataset. func (ttd TeradataTableDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -220497,6 +223709,11 @@ func (ttd TeradataTableDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for TeradataTableDataset. +func (ttd TeradataTableDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for TeradataTableDataset. func (ttd TeradataTableDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -223498,7 +226715,7 @@ type VerticaSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -223963,6 +227180,11 @@ func (vs VerticaSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for VerticaSource. func (vs VerticaSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -223978,6 +227200,11 @@ func (vs VerticaSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for VerticaSource. +func (vs VerticaSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for VerticaSource. func (vs VerticaSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -224103,7 +227330,7 @@ type VerticaTableDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -224564,6 +227791,11 @@ func (vtd VerticaTableDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for VerticaTableDataset. +func (vtd VerticaTableDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for VerticaTableDataset. func (vtd VerticaTableDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -224579,6 +227811,11 @@ func (vtd VerticaTableDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for VerticaTableDataset. +func (vtd VerticaTableDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for VerticaTableDataset. func (vtd VerticaTableDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -226814,7 +230051,7 @@ type WebSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -227273,6 +230510,11 @@ func (ws WebSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for WebSource. func (ws WebSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -227288,6 +230530,11 @@ func (ws WebSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for WebSource. +func (ws WebSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for WebSource. func (ws WebSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -227395,7 +230642,7 @@ type WebTableDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -227856,6 +231103,11 @@ func (wtd WebTableDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for WebTableDataset. +func (wtd WebTableDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for WebTableDataset. func (wtd WebTableDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -227871,6 +231123,11 @@ func (wtd WebTableDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for WebTableDataset. +func (wtd WebTableDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for WebTableDataset. func (wtd WebTableDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -228739,7 +231996,7 @@ type XeroObjectDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -229200,6 +232457,11 @@ func (xod XeroObjectDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for XeroObjectDataset. +func (xod XeroObjectDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for XeroObjectDataset. func (xod XeroObjectDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -229215,6 +232477,11 @@ func (xod XeroObjectDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for XeroObjectDataset. +func (xod XeroObjectDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for XeroObjectDataset. func (xod XeroObjectDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -229359,7 +232626,7 @@ type XeroSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -229824,6 +233091,11 @@ func (xs XeroSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for XeroSource. func (xs XeroSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -229839,6 +233111,11 @@ func (xs XeroSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for XeroSource. +func (xs XeroSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for XeroSource. func (xs XeroSource) AsAvroSource() (*AvroSource, bool) { return nil, false @@ -229944,6 +233221,1435 @@ func (xs *XeroSource) UnmarshalJSON(body []byte) error { return nil } +// XMLDataset xml dataset. +type XMLDataset struct { + // XMLDatasetTypeProperties - Xml dataset properties. + *XMLDatasetTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Description - Dataset description. + Description *string `json:"description,omitempty"` + // Structure - Columns that define the structure of the dataset. Type: array (or Expression with resultType array), itemType: DatasetDataElement. + Structure interface{} `json:"structure,omitempty"` + // Schema - Columns that define the physical type schema of the dataset. Type: array (or Expression with resultType array), itemType: DatasetSchemaDataElement. + Schema interface{} `json:"schema,omitempty"` + // LinkedServiceName - Linked service reference. + LinkedServiceName *LinkedServiceReference `json:"linkedServiceName,omitempty"` + // Parameters - Parameters for dataset. + Parameters map[string]*ParameterSpecification `json:"parameters"` + // Annotations - List of tags that can be used for describing the Dataset. + Annotations *[]interface{} `json:"annotations,omitempty"` + // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. + Folder *DatasetFolder `json:"folder,omitempty"` + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' + Type TypeBasicDataset `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for XMLDataset. +func (xd XMLDataset) MarshalJSON() ([]byte, error) { + xd.Type = TypeXML + objectMap := make(map[string]interface{}) + if xd.XMLDatasetTypeProperties != nil { + objectMap["typeProperties"] = xd.XMLDatasetTypeProperties + } + if xd.Description != nil { + objectMap["description"] = xd.Description + } + if xd.Structure != nil { + objectMap["structure"] = xd.Structure + } + if xd.Schema != nil { + objectMap["schema"] = xd.Schema + } + if xd.LinkedServiceName != nil { + objectMap["linkedServiceName"] = xd.LinkedServiceName + } + if xd.Parameters != nil { + objectMap["parameters"] = xd.Parameters + } + if xd.Annotations != nil { + objectMap["annotations"] = xd.Annotations + } + if xd.Folder != nil { + objectMap["folder"] = xd.Folder + } + if xd.Type != "" { + objectMap["type"] = xd.Type + } + for k, v := range xd.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsSharePointOnlineListResourceDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsSharePointOnlineListResourceDataset() (*SharePointOnlineListResourceDataset, bool) { + return nil, false +} + +// AsSnowflakeDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsSnowflakeDataset() (*SnowflakeDataset, bool) { + return nil, false +} + +// AsGoogleAdWordsObjectDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsGoogleAdWordsObjectDataset() (*GoogleAdWordsObjectDataset, bool) { + return nil, false +} + +// AsAzureDataExplorerTableDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsAzureDataExplorerTableDataset() (*AzureDataExplorerTableDataset, bool) { + return nil, false +} + +// AsOracleServiceCloudObjectDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsOracleServiceCloudObjectDataset() (*OracleServiceCloudObjectDataset, bool) { + return nil, false +} + +// AsDynamicsAXResourceDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsDynamicsAXResourceDataset() (*DynamicsAXResourceDataset, bool) { + return nil, false +} + +// AsResponsysObjectDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsResponsysObjectDataset() (*ResponsysObjectDataset, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudObjectDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsSalesforceMarketingCloudObjectDataset() (*SalesforceMarketingCloudObjectDataset, bool) { + return nil, false +} + +// AsVerticaTableDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsVerticaTableDataset() (*VerticaTableDataset, bool) { + return nil, false +} + +// AsNetezzaTableDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsNetezzaTableDataset() (*NetezzaTableDataset, bool) { + return nil, false +} + +// AsZohoObjectDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsZohoObjectDataset() (*ZohoObjectDataset, bool) { + return nil, false +} + +// AsXeroObjectDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsXeroObjectDataset() (*XeroObjectDataset, bool) { + return nil, false +} + +// AsSquareObjectDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsSquareObjectDataset() (*SquareObjectDataset, bool) { + return nil, false +} + +// AsSparkObjectDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsSparkObjectDataset() (*SparkObjectDataset, bool) { + return nil, false +} + +// AsShopifyObjectDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsShopifyObjectDataset() (*ShopifyObjectDataset, bool) { + return nil, false +} + +// AsServiceNowObjectDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsServiceNowObjectDataset() (*ServiceNowObjectDataset, bool) { + return nil, false +} + +// AsQuickBooksObjectDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsQuickBooksObjectDataset() (*QuickBooksObjectDataset, bool) { + return nil, false +} + +// AsPrestoObjectDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsPrestoObjectDataset() (*PrestoObjectDataset, bool) { + return nil, false +} + +// AsPhoenixObjectDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsPhoenixObjectDataset() (*PhoenixObjectDataset, bool) { + return nil, false +} + +// AsPaypalObjectDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsPaypalObjectDataset() (*PaypalObjectDataset, bool) { + return nil, false +} + +// AsMarketoObjectDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsMarketoObjectDataset() (*MarketoObjectDataset, bool) { + return nil, false +} + +// AsAzureMariaDBTableDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsAzureMariaDBTableDataset() (*AzureMariaDBTableDataset, bool) { + return nil, false +} + +// AsMariaDBTableDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsMariaDBTableDataset() (*MariaDBTableDataset, bool) { + return nil, false +} + +// AsMagentoObjectDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsMagentoObjectDataset() (*MagentoObjectDataset, bool) { + return nil, false +} + +// AsJiraObjectDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsJiraObjectDataset() (*JiraObjectDataset, bool) { + return nil, false +} + +// AsImpalaObjectDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsImpalaObjectDataset() (*ImpalaObjectDataset, bool) { + return nil, false +} + +// AsHubspotObjectDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsHubspotObjectDataset() (*HubspotObjectDataset, bool) { + return nil, false +} + +// AsHiveObjectDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsHiveObjectDataset() (*HiveObjectDataset, bool) { + return nil, false +} + +// AsHBaseObjectDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsHBaseObjectDataset() (*HBaseObjectDataset, bool) { + return nil, false +} + +// AsGreenplumTableDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsGreenplumTableDataset() (*GreenplumTableDataset, bool) { + return nil, false +} + +// AsGoogleBigQueryObjectDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsGoogleBigQueryObjectDataset() (*GoogleBigQueryObjectDataset, bool) { + return nil, false +} + +// AsEloquaObjectDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsEloquaObjectDataset() (*EloquaObjectDataset, bool) { + return nil, false +} + +// AsDrillTableDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsDrillTableDataset() (*DrillTableDataset, bool) { + return nil, false +} + +// AsCouchbaseTableDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsCouchbaseTableDataset() (*CouchbaseTableDataset, bool) { + return nil, false +} + +// AsConcurObjectDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsConcurObjectDataset() (*ConcurObjectDataset, bool) { + return nil, false +} + +// AsAzurePostgreSQLTableDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsAzurePostgreSQLTableDataset() (*AzurePostgreSQLTableDataset, bool) { + return nil, false +} + +// AsAmazonMWSObjectDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsAmazonMWSObjectDataset() (*AmazonMWSObjectDataset, bool) { + return nil, false +} + +// AsHTTPDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsHTTPDataset() (*HTTPDataset, bool) { + return nil, false +} + +// AsAzureSearchIndexDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsAzureSearchIndexDataset() (*AzureSearchIndexDataset, bool) { + return nil, false +} + +// AsWebTableDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsWebTableDataset() (*WebTableDataset, bool) { + return nil, false +} + +// AsSapTableResourceDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsSapTableResourceDataset() (*SapTableResourceDataset, bool) { + return nil, false +} + +// AsRestResourceDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsRestResourceDataset() (*RestResourceDataset, bool) { + return nil, false +} + +// AsSQLServerTableDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsSQLServerTableDataset() (*SQLServerTableDataset, bool) { + return nil, false +} + +// AsSapOpenHubTableDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsSapOpenHubTableDataset() (*SapOpenHubTableDataset, bool) { + return nil, false +} + +// AsSapHanaTableDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsSapHanaTableDataset() (*SapHanaTableDataset, bool) { + return nil, false +} + +// AsSapEccResourceDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsSapEccResourceDataset() (*SapEccResourceDataset, bool) { + return nil, false +} + +// AsSapCloudForCustomerResourceDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsSapCloudForCustomerResourceDataset() (*SapCloudForCustomerResourceDataset, bool) { + return nil, false +} + +// AsSapBwCubeDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsSapBwCubeDataset() (*SapBwCubeDataset, bool) { + return nil, false +} + +// AsSybaseTableDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsSybaseTableDataset() (*SybaseTableDataset, bool) { + return nil, false +} + +// AsSalesforceServiceCloudObjectDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsSalesforceServiceCloudObjectDataset() (*SalesforceServiceCloudObjectDataset, bool) { + return nil, false +} + +// AsSalesforceObjectDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsSalesforceObjectDataset() (*SalesforceObjectDataset, bool) { + return nil, false +} + +// AsMicrosoftAccessTableDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsMicrosoftAccessTableDataset() (*MicrosoftAccessTableDataset, bool) { + return nil, false +} + +// AsPostgreSQLTableDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsPostgreSQLTableDataset() (*PostgreSQLTableDataset, bool) { + return nil, false +} + +// AsMySQLTableDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsMySQLTableDataset() (*MySQLTableDataset, bool) { + return nil, false +} + +// AsOdbcTableDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsOdbcTableDataset() (*OdbcTableDataset, bool) { + return nil, false +} + +// AsInformixTableDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsInformixTableDataset() (*InformixTableDataset, bool) { + return nil, false +} + +// AsRelationalTableDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsRelationalTableDataset() (*RelationalTableDataset, bool) { + return nil, false +} + +// AsDb2TableDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsDb2TableDataset() (*Db2TableDataset, bool) { + return nil, false +} + +// AsAmazonRedshiftTableDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsAmazonRedshiftTableDataset() (*AmazonRedshiftTableDataset, bool) { + return nil, false +} + +// AsAzureMySQLTableDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsAzureMySQLTableDataset() (*AzureMySQLTableDataset, bool) { + return nil, false +} + +// AsTeradataTableDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsTeradataTableDataset() (*TeradataTableDataset, bool) { + return nil, false +} + +// AsOracleTableDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsOracleTableDataset() (*OracleTableDataset, bool) { + return nil, false +} + +// AsODataResourceDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsODataResourceDataset() (*ODataResourceDataset, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPICollectionDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsCosmosDbMongoDbAPICollectionDataset() (*CosmosDbMongoDbAPICollectionDataset, bool) { + return nil, false +} + +// AsMongoDbV2CollectionDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsMongoDbV2CollectionDataset() (*MongoDbV2CollectionDataset, bool) { + return nil, false +} + +// AsMongoDbCollectionDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsMongoDbCollectionDataset() (*MongoDbCollectionDataset, bool) { + return nil, false +} + +// AsFileShareDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsFileShareDataset() (*FileShareDataset, bool) { + return nil, false +} + +// AsOffice365Dataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsOffice365Dataset() (*Office365Dataset, bool) { + return nil, false +} + +// AsAzureBlobFSDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsAzureBlobFSDataset() (*AzureBlobFSDataset, bool) { + return nil, false +} + +// AsAzureDataLakeStoreDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsAzureDataLakeStoreDataset() (*AzureDataLakeStoreDataset, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsEntityDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsCommonDataServiceForAppsEntityDataset() (*CommonDataServiceForAppsEntityDataset, bool) { + return nil, false +} + +// AsDynamicsCrmEntityDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsDynamicsCrmEntityDataset() (*DynamicsCrmEntityDataset, bool) { + return nil, false +} + +// AsDynamicsEntityDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsDynamicsEntityDataset() (*DynamicsEntityDataset, bool) { + return nil, false +} + +// AsDocumentDbCollectionDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsDocumentDbCollectionDataset() (*DocumentDbCollectionDataset, bool) { + return nil, false +} + +// AsCosmosDbSQLAPICollectionDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsCosmosDbSQLAPICollectionDataset() (*CosmosDbSQLAPICollectionDataset, bool) { + return nil, false +} + +// AsCustomDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsCustomDataset() (*CustomDataset, bool) { + return nil, false +} + +// AsCassandraTableDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsCassandraTableDataset() (*CassandraTableDataset, bool) { + return nil, false +} + +// AsAzureSQLDWTableDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsAzureSQLDWTableDataset() (*AzureSQLDWTableDataset, bool) { + return nil, false +} + +// AsAzureSQLMITableDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsAzureSQLMITableDataset() (*AzureSQLMITableDataset, bool) { + return nil, false +} + +// AsAzureSQLTableDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsAzureSQLTableDataset() (*AzureSQLTableDataset, bool) { + return nil, false +} + +// AsAzureTableDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsAzureTableDataset() (*AzureTableDataset, bool) { + return nil, false +} + +// AsAzureBlobDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsAzureBlobDataset() (*AzureBlobDataset, bool) { + return nil, false +} + +// AsBinaryDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsBinaryDataset() (*BinaryDataset, bool) { + return nil, false +} + +// AsOrcDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsOrcDataset() (*OrcDataset, bool) { + return nil, false +} + +// AsXMLDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsXMLDataset() (*XMLDataset, bool) { + return &xd, true +} + +// AsJSONDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsJSONDataset() (*JSONDataset, bool) { + return nil, false +} + +// AsDelimitedTextDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsDelimitedTextDataset() (*DelimitedTextDataset, bool) { + return nil, false +} + +// AsParquetDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsParquetDataset() (*ParquetDataset, bool) { + return nil, false +} + +// AsExcelDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + +// AsAvroDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsAvroDataset() (*AvroDataset, bool) { + return nil, false +} + +// AsAmazonS3Dataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsAmazonS3Dataset() (*AmazonS3Dataset, bool) { + return nil, false +} + +// AsDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsDataset() (*Dataset, bool) { + return nil, false +} + +// AsBasicDataset is the BasicDataset implementation for XMLDataset. +func (xd XMLDataset) AsBasicDataset() (BasicDataset, bool) { + return &xd, true +} + +// UnmarshalJSON is the custom unmarshaler for XMLDataset struct. +func (xd *XMLDataset) 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 XMLDatasetTypeProperties XMLDatasetTypeProperties + err = json.Unmarshal(*v, &XMLDatasetTypeProperties) + if err != nil { + return err + } + xd.XMLDatasetTypeProperties = &XMLDatasetTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if xd.AdditionalProperties == nil { + xd.AdditionalProperties = make(map[string]interface{}) + } + xd.AdditionalProperties[k] = additionalProperties + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + xd.Description = &description + } + case "structure": + if v != nil { + var structure interface{} + err = json.Unmarshal(*v, &structure) + if err != nil { + return err + } + xd.Structure = structure + } + case "schema": + if v != nil { + var schema interface{} + err = json.Unmarshal(*v, &schema) + if err != nil { + return err + } + xd.Schema = schema + } + case "linkedServiceName": + if v != nil { + var linkedServiceName LinkedServiceReference + err = json.Unmarshal(*v, &linkedServiceName) + if err != nil { + return err + } + xd.LinkedServiceName = &linkedServiceName + } + case "parameters": + if v != nil { + var parameters map[string]*ParameterSpecification + err = json.Unmarshal(*v, ¶meters) + if err != nil { + return err + } + xd.Parameters = parameters + } + case "annotations": + if v != nil { + var annotations []interface{} + err = json.Unmarshal(*v, &annotations) + if err != nil { + return err + } + xd.Annotations = &annotations + } + case "folder": + if v != nil { + var folder DatasetFolder + err = json.Unmarshal(*v, &folder) + if err != nil { + return err + } + xd.Folder = &folder + } + case "type": + if v != nil { + var typeVar TypeBasicDataset + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + xd.Type = typeVar + } + } + } + + return nil +} + +// XMLDatasetTypeProperties xml dataset properties. +type XMLDatasetTypeProperties struct { + // Location - The location of the json data storage. + Location BasicDatasetLocation `json:"location,omitempty"` + // EncodingName - The code page name of the preferred encoding. If not specified, the default value is UTF-8, unless BOM denotes another Unicode encoding. Refer to the name column of the table in the following link to set supported values: https://msdn.microsoft.com/library/system.text.encoding.aspx. Type: string (or Expression with resultType string). + EncodingName interface{} `json:"encodingName,omitempty"` + // NullValue - The null value string. Type: string (or Expression with resultType string). + NullValue interface{} `json:"nullValue,omitempty"` + // Compression - The data compression method used for the json dataset. + Compression BasicDatasetCompression `json:"compression,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for XMLDatasetTypeProperties struct. +func (xdtp *XMLDatasetTypeProperties) 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 { + location, err := unmarshalBasicDatasetLocation(*v) + if err != nil { + return err + } + xdtp.Location = location + } + case "encodingName": + if v != nil { + var encodingName interface{} + err = json.Unmarshal(*v, &encodingName) + if err != nil { + return err + } + xdtp.EncodingName = encodingName + } + case "nullValue": + if v != nil { + var nullValue interface{} + err = json.Unmarshal(*v, &nullValue) + if err != nil { + return err + } + xdtp.NullValue = nullValue + } + case "compression": + if v != nil { + compression, err := unmarshalBasicDatasetCompression(*v) + if err != nil { + return err + } + xdtp.Compression = compression + } + } + } + + return nil +} + +// XMLReadSettings xml read settings. +type XMLReadSettings struct { + // CompressionProperties - Compression settings. + CompressionProperties BasicCompressionReadSettings `json:"compressionProperties,omitempty"` + // ValidationMode - Indicates what validation method is used when reading the xml files. Allowed values: 'none', 'xsd', or 'dtd'. Type: string (or Expression with resultType string). + ValidationMode interface{} `json:"validationMode,omitempty"` + // NamespacePrefixes - Namespace uri to prefix mappings to override the prefixes in column names when namespace is enabled, if no prefix is defined for a namespace uri, the prefix of xml element/attribute name in the xml data file will be used. Example: "{"http://www.example.com/xml":"prefix"}" Type: object (or Expression with resultType object). + NamespacePrefixes interface{} `json:"namespacePrefixes,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Type - Possible values include: 'TypeFormatReadSettings', 'TypeBinaryReadSettings', 'TypeXMLReadSettings', 'TypeJSONReadSettings', 'TypeDelimitedTextReadSettings' + Type TypeBasicFormatReadSettings `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for XMLReadSettings. +func (xrs XMLReadSettings) MarshalJSON() ([]byte, error) { + xrs.Type = TypeXMLReadSettings + objectMap := make(map[string]interface{}) + objectMap["compressionProperties"] = xrs.CompressionProperties + if xrs.ValidationMode != nil { + objectMap["validationMode"] = xrs.ValidationMode + } + if xrs.NamespacePrefixes != nil { + objectMap["namespacePrefixes"] = xrs.NamespacePrefixes + } + if xrs.Type != "" { + objectMap["type"] = xrs.Type + } + for k, v := range xrs.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsBinaryReadSettings is the BasicFormatReadSettings implementation for XMLReadSettings. +func (xrs XMLReadSettings) AsBinaryReadSettings() (*BinaryReadSettings, bool) { + return nil, false +} + +// AsXMLReadSettings is the BasicFormatReadSettings implementation for XMLReadSettings. +func (xrs XMLReadSettings) AsXMLReadSettings() (*XMLReadSettings, bool) { + return &xrs, true +} + +// AsJSONReadSettings is the BasicFormatReadSettings implementation for XMLReadSettings. +func (xrs XMLReadSettings) AsJSONReadSettings() (*JSONReadSettings, bool) { + return nil, false +} + +// AsDelimitedTextReadSettings is the BasicFormatReadSettings implementation for XMLReadSettings. +func (xrs XMLReadSettings) AsDelimitedTextReadSettings() (*DelimitedTextReadSettings, bool) { + return nil, false +} + +// AsFormatReadSettings is the BasicFormatReadSettings implementation for XMLReadSettings. +func (xrs XMLReadSettings) AsFormatReadSettings() (*FormatReadSettings, bool) { + return nil, false +} + +// AsBasicFormatReadSettings is the BasicFormatReadSettings implementation for XMLReadSettings. +func (xrs XMLReadSettings) AsBasicFormatReadSettings() (BasicFormatReadSettings, bool) { + return &xrs, true +} + +// UnmarshalJSON is the custom unmarshaler for XMLReadSettings struct. +func (xrs *XMLReadSettings) 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 "compressionProperties": + if v != nil { + compressionProperties, err := unmarshalBasicCompressionReadSettings(*v) + if err != nil { + return err + } + xrs.CompressionProperties = compressionProperties + } + case "validationMode": + if v != nil { + var validationMode interface{} + err = json.Unmarshal(*v, &validationMode) + if err != nil { + return err + } + xrs.ValidationMode = validationMode + } + case "namespacePrefixes": + if v != nil { + var namespacePrefixes interface{} + err = json.Unmarshal(*v, &namespacePrefixes) + if err != nil { + return err + } + xrs.NamespacePrefixes = namespacePrefixes + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if xrs.AdditionalProperties == nil { + xrs.AdditionalProperties = make(map[string]interface{}) + } + xrs.AdditionalProperties[k] = additionalProperties + } + case "type": + if v != nil { + var typeVar TypeBasicFormatReadSettings + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + xrs.Type = typeVar + } + } + } + + return nil +} + +// XMLSource a copy activity Xml source. +type XMLSource struct { + // StoreSettings - Xml store settings. + StoreSettings BasicStoreReadSettings `json:"storeSettings,omitempty"` + // FormatSettings - Xml format settings. + FormatSettings *XMLReadSettings `json:"formatSettings,omitempty"` + // AdditionalColumns - Specifies the additional columns to be added to source data. Type: array of objects (or Expression with resultType array of objects). + AdditionalColumns *[]AdditionalColumns `json:"additionalColumns,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // SourceRetryCount - Source retry count. Type: integer (or Expression with resultType integer). + SourceRetryCount interface{} `json:"sourceRetryCount,omitempty"` + // SourceRetryWait - Source retry wait. Type: string (or Expression with resultType string), pattern: ((\d+)\.)?(\d\d):(60|([0-5][0-9])):(60|([0-5][0-9])). + SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` + // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). + MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' + Type TypeBasicCopySource `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for XMLSource. +func (xs XMLSource) MarshalJSON() ([]byte, error) { + xs.Type = TypeXMLSource + objectMap := make(map[string]interface{}) + objectMap["storeSettings"] = xs.StoreSettings + if xs.FormatSettings != nil { + objectMap["formatSettings"] = xs.FormatSettings + } + if xs.AdditionalColumns != nil { + objectMap["additionalColumns"] = xs.AdditionalColumns + } + if xs.SourceRetryCount != nil { + objectMap["sourceRetryCount"] = xs.SourceRetryCount + } + if xs.SourceRetryWait != nil { + objectMap["sourceRetryWait"] = xs.SourceRetryWait + } + if xs.MaxConcurrentConnections != nil { + objectMap["maxConcurrentConnections"] = xs.MaxConcurrentConnections + } + if xs.Type != "" { + objectMap["type"] = xs.Type + } + for k, v := range xs.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsSharePointOnlineListSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsSharePointOnlineListSource() (*SharePointOnlineListSource, bool) { + return nil, false +} + +// AsSnowflakeSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsSnowflakeSource() (*SnowflakeSource, bool) { + return nil, false +} + +// AsHTTPSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsHTTPSource() (*HTTPSource, bool) { + return nil, false +} + +// AsAzureBlobFSSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsAzureBlobFSSource() (*AzureBlobFSSource, bool) { + return nil, false +} + +// AsAzureDataLakeStoreSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsAzureDataLakeStoreSource() (*AzureDataLakeStoreSource, bool) { + return nil, false +} + +// AsOffice365Source is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsOffice365Source() (*Office365Source, bool) { + return nil, false +} + +// AsCosmosDbMongoDbAPISource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsCosmosDbMongoDbAPISource() (*CosmosDbMongoDbAPISource, bool) { + return nil, false +} + +// AsMongoDbV2Source is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsMongoDbV2Source() (*MongoDbV2Source, bool) { + return nil, false +} + +// AsMongoDbSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsMongoDbSource() (*MongoDbSource, bool) { + return nil, false +} + +// AsWebSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsWebSource() (*WebSource, bool) { + return nil, false +} + +// AsOracleSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsOracleSource() (*OracleSource, bool) { + return nil, false +} + +// AsAzureDataExplorerSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsAzureDataExplorerSource() (*AzureDataExplorerSource, bool) { + return nil, false +} + +// AsHdfsSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsHdfsSource() (*HdfsSource, bool) { + return nil, false +} + +// AsFileSystemSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsFileSystemSource() (*FileSystemSource, bool) { + return nil, false +} + +// AsRestSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsRestSource() (*RestSource, bool) { + return nil, false +} + +// AsSalesforceServiceCloudSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsSalesforceServiceCloudSource() (*SalesforceServiceCloudSource, bool) { + return nil, false +} + +// AsODataSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsODataSource() (*ODataSource, bool) { + return nil, false +} + +// AsMicrosoftAccessSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsMicrosoftAccessSource() (*MicrosoftAccessSource, bool) { + return nil, false +} + +// AsRelationalSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsRelationalSource() (*RelationalSource, bool) { + return nil, false +} + +// AsCommonDataServiceForAppsSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsCommonDataServiceForAppsSource() (*CommonDataServiceForAppsSource, bool) { + return nil, false +} + +// AsDynamicsCrmSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsDynamicsCrmSource() (*DynamicsCrmSource, bool) { + return nil, false +} + +// AsDynamicsSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsDynamicsSource() (*DynamicsSource, bool) { + return nil, false +} + +// AsCosmosDbSQLAPISource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsCosmosDbSQLAPISource() (*CosmosDbSQLAPISource, bool) { + return nil, false +} + +// AsDocumentDbCollectionSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsDocumentDbCollectionSource() (*DocumentDbCollectionSource, bool) { + return nil, false +} + +// AsBlobSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsBlobSource() (*BlobSource, bool) { + return nil, false +} + +// AsAmazonRedshiftSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsAmazonRedshiftSource() (*AmazonRedshiftSource, bool) { + return nil, false +} + +// AsGoogleAdWordsSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsGoogleAdWordsSource() (*GoogleAdWordsSource, bool) { + return nil, false +} + +// AsOracleServiceCloudSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsOracleServiceCloudSource() (*OracleServiceCloudSource, bool) { + return nil, false +} + +// AsDynamicsAXSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsDynamicsAXSource() (*DynamicsAXSource, bool) { + return nil, false +} + +// AsResponsysSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsResponsysSource() (*ResponsysSource, bool) { + return nil, false +} + +// AsSalesforceMarketingCloudSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsSalesforceMarketingCloudSource() (*SalesforceMarketingCloudSource, bool) { + return nil, false +} + +// AsVerticaSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsVerticaSource() (*VerticaSource, bool) { + return nil, false +} + +// AsNetezzaSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsNetezzaSource() (*NetezzaSource, bool) { + return nil, false +} + +// AsZohoSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsZohoSource() (*ZohoSource, bool) { + return nil, false +} + +// AsXeroSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsXeroSource() (*XeroSource, bool) { + return nil, false +} + +// AsSquareSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsSquareSource() (*SquareSource, bool) { + return nil, false +} + +// AsSparkSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsSparkSource() (*SparkSource, bool) { + return nil, false +} + +// AsShopifySource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsShopifySource() (*ShopifySource, bool) { + return nil, false +} + +// AsServiceNowSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsServiceNowSource() (*ServiceNowSource, bool) { + return nil, false +} + +// AsQuickBooksSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsQuickBooksSource() (*QuickBooksSource, bool) { + return nil, false +} + +// AsPrestoSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsPrestoSource() (*PrestoSource, bool) { + return nil, false +} + +// AsPhoenixSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsPhoenixSource() (*PhoenixSource, bool) { + return nil, false +} + +// AsPaypalSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsPaypalSource() (*PaypalSource, bool) { + return nil, false +} + +// AsMarketoSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsMarketoSource() (*MarketoSource, bool) { + return nil, false +} + +// AsAzureMariaDBSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsAzureMariaDBSource() (*AzureMariaDBSource, bool) { + return nil, false +} + +// AsMariaDBSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsMariaDBSource() (*MariaDBSource, bool) { + return nil, false +} + +// AsMagentoSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsMagentoSource() (*MagentoSource, bool) { + return nil, false +} + +// AsJiraSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsJiraSource() (*JiraSource, bool) { + return nil, false +} + +// AsImpalaSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsImpalaSource() (*ImpalaSource, bool) { + return nil, false +} + +// AsHubspotSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsHubspotSource() (*HubspotSource, bool) { + return nil, false +} + +// AsHiveSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsHiveSource() (*HiveSource, bool) { + return nil, false +} + +// AsHBaseSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsHBaseSource() (*HBaseSource, bool) { + return nil, false +} + +// AsGreenplumSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsGreenplumSource() (*GreenplumSource, bool) { + return nil, false +} + +// AsGoogleBigQuerySource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsGoogleBigQuerySource() (*GoogleBigQuerySource, bool) { + return nil, false +} + +// AsEloquaSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsEloquaSource() (*EloquaSource, bool) { + return nil, false +} + +// AsDrillSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsDrillSource() (*DrillSource, bool) { + return nil, false +} + +// AsCouchbaseSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsCouchbaseSource() (*CouchbaseSource, bool) { + return nil, false +} + +// AsConcurSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsConcurSource() (*ConcurSource, bool) { + return nil, false +} + +// AsAzurePostgreSQLSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsAzurePostgreSQLSource() (*AzurePostgreSQLSource, bool) { + return nil, false +} + +// AsAmazonMWSSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsAmazonMWSSource() (*AmazonMWSSource, bool) { + return nil, false +} + +// AsCassandraSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsCassandraSource() (*CassandraSource, bool) { + return nil, false +} + +// AsTeradataSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsTeradataSource() (*TeradataSource, bool) { + return nil, false +} + +// AsAzureMySQLSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsAzureMySQLSource() (*AzureMySQLSource, bool) { + return nil, false +} + +// AsSQLDWSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsSQLDWSource() (*SQLDWSource, bool) { + return nil, false +} + +// AsSQLMISource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsSQLMISource() (*SQLMISource, bool) { + return nil, false +} + +// AsAzureSQLSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsAzureSQLSource() (*AzureSQLSource, bool) { + return nil, false +} + +// AsSQLServerSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsSQLServerSource() (*SQLServerSource, bool) { + return nil, false +} + +// AsSQLSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsSQLSource() (*SQLSource, bool) { + return nil, false +} + +// AsSapTableSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsSapTableSource() (*SapTableSource, bool) { + return nil, false +} + +// AsSapOpenHubSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsSapOpenHubSource() (*SapOpenHubSource, bool) { + return nil, false +} + +// AsSapHanaSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsSapHanaSource() (*SapHanaSource, bool) { + return nil, false +} + +// AsSapEccSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsSapEccSource() (*SapEccSource, bool) { + return nil, false +} + +// AsSapCloudForCustomerSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsSapCloudForCustomerSource() (*SapCloudForCustomerSource, bool) { + return nil, false +} + +// AsSalesforceSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsSalesforceSource() (*SalesforceSource, bool) { + return nil, false +} + +// AsSapBwSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsSapBwSource() (*SapBwSource, bool) { + return nil, false +} + +// AsSybaseSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsSybaseSource() (*SybaseSource, bool) { + return nil, false +} + +// AsPostgreSQLSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsPostgreSQLSource() (*PostgreSQLSource, bool) { + return nil, false +} + +// AsMySQLSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsMySQLSource() (*MySQLSource, bool) { + return nil, false +} + +// AsOdbcSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsOdbcSource() (*OdbcSource, bool) { + return nil, false +} + +// AsDb2Source is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsDb2Source() (*Db2Source, bool) { + return nil, false +} + +// AsInformixSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsInformixSource() (*InformixSource, bool) { + return nil, false +} + +// AsAzureTableSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsAzureTableSource() (*AzureTableSource, bool) { + return nil, false +} + +// AsTabularSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsTabularSource() (*TabularSource, bool) { + return nil, false +} + +// AsBasicTabularSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsBasicTabularSource() (BasicTabularSource, bool) { + return nil, false +} + +// AsBinarySource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsBinarySource() (*BinarySource, bool) { + return nil, false +} + +// AsOrcSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsOrcSource() (*OrcSource, bool) { + return nil, false +} + +// AsXMLSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsXMLSource() (*XMLSource, bool) { + return &xs, true +} + +// AsJSONSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsJSONSource() (*JSONSource, bool) { + return nil, false +} + +// AsDelimitedTextSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsDelimitedTextSource() (*DelimitedTextSource, bool) { + return nil, false +} + +// AsParquetSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsParquetSource() (*ParquetSource, bool) { + return nil, false +} + +// AsExcelSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + +// AsAvroSource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsAvroSource() (*AvroSource, bool) { + return nil, false +} + +// AsCopySource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsCopySource() (*CopySource, bool) { + return nil, false +} + +// AsBasicCopySource is the BasicCopySource implementation for XMLSource. +func (xs XMLSource) AsBasicCopySource() (BasicCopySource, bool) { + return &xs, true +} + +// UnmarshalJSON is the custom unmarshaler for XMLSource struct. +func (xs *XMLSource) 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 "storeSettings": + if v != nil { + storeSettings, err := unmarshalBasicStoreReadSettings(*v) + if err != nil { + return err + } + xs.StoreSettings = storeSettings + } + case "formatSettings": + if v != nil { + var formatSettings XMLReadSettings + err = json.Unmarshal(*v, &formatSettings) + if err != nil { + return err + } + xs.FormatSettings = &formatSettings + } + case "additionalColumns": + if v != nil { + var additionalColumns []AdditionalColumns + err = json.Unmarshal(*v, &additionalColumns) + if err != nil { + return err + } + xs.AdditionalColumns = &additionalColumns + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if xs.AdditionalProperties == nil { + xs.AdditionalProperties = make(map[string]interface{}) + } + xs.AdditionalProperties[k] = additionalProperties + } + case "sourceRetryCount": + if v != nil { + var sourceRetryCount interface{} + err = json.Unmarshal(*v, &sourceRetryCount) + if err != nil { + return err + } + xs.SourceRetryCount = sourceRetryCount + } + case "sourceRetryWait": + if v != nil { + var sourceRetryWait interface{} + err = json.Unmarshal(*v, &sourceRetryWait) + if err != nil { + return err + } + xs.SourceRetryWait = sourceRetryWait + } + case "maxConcurrentConnections": + if v != nil { + var maxConcurrentConnections interface{} + err = json.Unmarshal(*v, &maxConcurrentConnections) + if err != nil { + return err + } + xs.MaxConcurrentConnections = maxConcurrentConnections + } + case "type": + if v != nil { + var typeVar TypeBasicCopySource + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + xs.Type = typeVar + } + } + } + + return nil +} + // ZipDeflateReadSettings the ZipDeflate compression read settings. type ZipDeflateReadSettings struct { // PreserveZipFileNameAsFolder - Preserve the zip file name as folder path. Type: boolean (or Expression with resultType boolean). @@ -230751,7 +235457,7 @@ type ZohoObjectDataset struct { Annotations *[]interface{} `json:"annotations,omitempty"` // Folder - The folder that this Dataset is in. If not specified, Dataset will appear at the root level. Folder *DatasetFolder `json:"folder,omitempty"` - // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeAvro', 'TypeAmazonS3Object' + // Type - Possible values include: 'TypeDataset', 'TypeSharePointOnlineListResource', 'TypeSnowflakeTable', 'TypeGoogleAdWordsObject', 'TypeAzureDataExplorerTable', 'TypeOracleServiceCloudObject', 'TypeDynamicsAXResource', 'TypeResponsysObject', 'TypeSalesforceMarketingCloudObject', 'TypeVerticaTable', 'TypeNetezzaTable', 'TypeZohoObject', 'TypeXeroObject', 'TypeSquareObject', 'TypeSparkObject', 'TypeShopifyObject', 'TypeServiceNowObject', 'TypeQuickBooksObject', 'TypePrestoObject', 'TypePhoenixObject', 'TypePaypalObject', 'TypeMarketoObject', 'TypeAzureMariaDBTable', 'TypeMariaDBTable', 'TypeMagentoObject', 'TypeJiraObject', 'TypeImpalaObject', 'TypeHubspotObject', 'TypeHiveObject', 'TypeHBaseObject', 'TypeGreenplumTable', 'TypeGoogleBigQueryObject', 'TypeEloquaObject', 'TypeDrillTable', 'TypeCouchbaseTable', 'TypeConcurObject', 'TypeAzurePostgreSQLTable', 'TypeAmazonMWSObject', 'TypeHTTPFile', 'TypeAzureSearchIndex', 'TypeWebTable', 'TypeSapTableResource', 'TypeRestResource', 'TypeSQLServerTable', 'TypeSapOpenHubTable', 'TypeSapHanaTable', 'TypeSapEccResource', 'TypeSapCloudForCustomerResource', 'TypeSapBwCube', 'TypeSybaseTable', 'TypeSalesforceServiceCloudObject', 'TypeSalesforceObject', 'TypeMicrosoftAccessTable', 'TypePostgreSQLTable', 'TypeMySQLTable', 'TypeOdbcTable', 'TypeInformixTable', 'TypeRelationalTable', 'TypeDb2Table', 'TypeAmazonRedshiftTable', 'TypeAzureMySQLTable', 'TypeTeradataTable', 'TypeOracleTable', 'TypeODataResource', 'TypeCosmosDbMongoDbAPICollection', 'TypeMongoDbV2Collection', 'TypeMongoDbCollection', 'TypeFileShare', 'TypeOffice365Table', 'TypeAzureBlobFSFile', 'TypeAzureDataLakeStoreFile', 'TypeCommonDataServiceForAppsEntity', 'TypeDynamicsCrmEntity', 'TypeDynamicsEntity', 'TypeDocumentDbCollection', 'TypeCosmosDbSQLAPICollection', 'TypeCustomDataset', 'TypeCassandraTable', 'TypeAzureSQLDWTable', 'TypeAzureSQLMITable', 'TypeAzureSQLTable', 'TypeAzureTable', 'TypeAzureBlob', 'TypeBinary', 'TypeOrc', 'TypeXML', 'TypeJSON', 'TypeDelimitedText', 'TypeParquet', 'TypeExcel', 'TypeAvro', 'TypeAmazonS3Object' Type TypeBasicDataset `json:"type,omitempty"` } @@ -231212,6 +235918,11 @@ func (zod ZohoObjectDataset) AsOrcDataset() (*OrcDataset, bool) { return nil, false } +// AsXMLDataset is the BasicDataset implementation for ZohoObjectDataset. +func (zod ZohoObjectDataset) AsXMLDataset() (*XMLDataset, bool) { + return nil, false +} + // AsJSONDataset is the BasicDataset implementation for ZohoObjectDataset. func (zod ZohoObjectDataset) AsJSONDataset() (*JSONDataset, bool) { return nil, false @@ -231227,6 +235938,11 @@ func (zod ZohoObjectDataset) AsParquetDataset() (*ParquetDataset, bool) { return nil, false } +// AsExcelDataset is the BasicDataset implementation for ZohoObjectDataset. +func (zod ZohoObjectDataset) AsExcelDataset() (*ExcelDataset, bool) { + return nil, false +} + // AsAvroDataset is the BasicDataset implementation for ZohoObjectDataset. func (zod ZohoObjectDataset) AsAvroDataset() (*AvroDataset, bool) { return nil, false @@ -231371,7 +236087,7 @@ type ZohoSource struct { SourceRetryWait interface{} `json:"sourceRetryWait,omitempty"` // MaxConcurrentConnections - The maximum concurrent connection count for the source data store. Type: integer (or Expression with resultType integer). MaxConcurrentConnections interface{} `json:"maxConcurrentConnections,omitempty"` - // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeAvroSource' + // Type - Possible values include: 'TypeCopySource', 'TypeSharePointOnlineListSource', 'TypeSnowflakeSource', 'TypeHTTPSource', 'TypeAzureBlobFSSource', 'TypeAzureDataLakeStoreSource', 'TypeOffice365Source', 'TypeCosmosDbMongoDbAPISource', 'TypeMongoDbV2Source', 'TypeMongoDbSource', 'TypeWebSource', 'TypeOracleSource', 'TypeAzureDataExplorerSource', 'TypeHdfsSource', 'TypeFileSystemSource', 'TypeRestSource', 'TypeSalesforceServiceCloudSource', 'TypeODataSource', 'TypeMicrosoftAccessSource', 'TypeRelationalSource', 'TypeCommonDataServiceForAppsSource', 'TypeDynamicsCrmSource', 'TypeDynamicsSource', 'TypeCosmosDbSQLAPISource', 'TypeDocumentDbCollectionSource', 'TypeBlobSource', 'TypeAmazonRedshiftSource', 'TypeGoogleAdWordsSource', 'TypeOracleServiceCloudSource', 'TypeDynamicsAXSource', 'TypeResponsysSource', 'TypeSalesforceMarketingCloudSource', 'TypeVerticaSource', 'TypeNetezzaSource', 'TypeZohoSource', 'TypeXeroSource', 'TypeSquareSource', 'TypeSparkSource', 'TypeShopifySource', 'TypeServiceNowSource', 'TypeQuickBooksSource', 'TypePrestoSource', 'TypePhoenixSource', 'TypePaypalSource', 'TypeMarketoSource', 'TypeAzureMariaDBSource', 'TypeMariaDBSource', 'TypeMagentoSource', 'TypeJiraSource', 'TypeImpalaSource', 'TypeHubspotSource', 'TypeHiveSource', 'TypeHBaseSource', 'TypeGreenplumSource', 'TypeGoogleBigQuerySource', 'TypeEloquaSource', 'TypeDrillSource', 'TypeCouchbaseSource', 'TypeConcurSource', 'TypeAzurePostgreSQLSource', 'TypeAmazonMWSSource', 'TypeCassandraSource', 'TypeTeradataSource', 'TypeAzureMySQLSource', 'TypeSQLDWSource', 'TypeSQLMISource', 'TypeAzureSQLSource', 'TypeSQLServerSource', 'TypeSQLSource', 'TypeSapTableSource', 'TypeSapOpenHubSource', 'TypeSapHanaSource', 'TypeSapEccSource', 'TypeSapCloudForCustomerSource', 'TypeSalesforceSource', 'TypeSapBwSource', 'TypeSybaseSource', 'TypePostgreSQLSource', 'TypeMySQLSource', 'TypeOdbcSource', 'TypeDb2Source', 'TypeInformixSource', 'TypeAzureTableSource', 'TypeTabularSource', 'TypeBinarySource', 'TypeOrcSource', 'TypeXMLSource', 'TypeJSONSource', 'TypeDelimitedTextSource', 'TypeParquetSource', 'TypeExcelSource', 'TypeAvroSource' Type TypeBasicCopySource `json:"type,omitempty"` } @@ -231836,6 +236552,11 @@ func (zs ZohoSource) AsOrcSource() (*OrcSource, bool) { return nil, false } +// AsXMLSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsXMLSource() (*XMLSource, bool) { + return nil, false +} + // AsJSONSource is the BasicCopySource implementation for ZohoSource. func (zs ZohoSource) AsJSONSource() (*JSONSource, bool) { return nil, false @@ -231851,6 +236572,11 @@ func (zs ZohoSource) AsParquetSource() (*ParquetSource, bool) { return nil, false } +// AsExcelSource is the BasicCopySource implementation for ZohoSource. +func (zs ZohoSource) AsExcelSource() (*ExcelSource, bool) { + return nil, false +} + // AsAvroSource is the BasicCopySource implementation for ZohoSource. func (zs ZohoSource) AsAvroSource() (*AvroSource, bool) { return nil, false diff --git a/services/eventgrid/2018-01-01/eventgrid/models.go b/services/eventgrid/2018-01-01/eventgrid/models.go index 90a2011d7716..d8a8f3858979 100644 --- a/services/eventgrid/2018-01-01/eventgrid/models.go +++ b/services/eventgrid/2018-01-01/eventgrid/models.go @@ -25,6 +25,59 @@ import ( // The package's fully qualified name. const fqdn = "github.com/Azure/azure-sdk-for-go/services/eventgrid/2018-01-01/eventgrid" +// AppAction enumerates the values for app action. +type AppAction string + +const ( + // ChangedAppSettings There was an operation to change app setting on the web app. + ChangedAppSettings AppAction = "ChangedAppSettings" + // Completed The job has completed. + Completed AppAction = "Completed" + // Failed The job has failed to complete. + Failed AppAction = "Failed" + // Restarted Web app was restarted. + Restarted AppAction = "Restarted" + // Started The job has started. + Started AppAction = "Started" + // Stopped Web app was stopped. + Stopped AppAction = "Stopped" +) + +// PossibleAppActionValues returns an array of possible values for the AppAction const type. +func PossibleAppActionValues() []AppAction { + return []AppAction{ChangedAppSettings, Completed, Failed, Restarted, Started, Stopped} +} + +// AppServicePlanAction enumerates the values for app service plan action. +type AppServicePlanAction string + +const ( + // Updated App Service plan is being updated. + Updated AppServicePlanAction = "Updated" +) + +// PossibleAppServicePlanActionValues returns an array of possible values for the AppServicePlanAction const type. +func PossibleAppServicePlanActionValues() []AppServicePlanAction { + return []AppServicePlanAction{Updated} +} + +// AsyncStatus enumerates the values for async status. +type AsyncStatus string + +const ( + // AsyncStatusCompleted Async operation has completed. + AsyncStatusCompleted AsyncStatus = "Completed" + // AsyncStatusFailed Async operation failed to complete. + AsyncStatusFailed AsyncStatus = "Failed" + // AsyncStatusStarted Async operation has started. + AsyncStatusStarted AsyncStatus = "Started" +) + +// PossibleAsyncStatusValues returns an array of possible values for the AsyncStatus const type. +func PossibleAsyncStatusValues() []AsyncStatus { + return []AsyncStatus{AsyncStatusCompleted, AsyncStatusFailed, AsyncStatusStarted} +} + // MediaJobErrorCategory enumerates the values for media job error category. type MediaJobErrorCategory string @@ -141,6 +194,23 @@ func PossibleOdataTypeValues() []OdataType { return []OdataType{OdataTypeMediaJobOutput, OdataTypeMicrosoftMediaJobOutputAsset} } +// StampKind enumerates the values for stamp kind. +type StampKind string + +const ( + // AseV1 App Service Plan is running on an App Service Environment V1. + AseV1 StampKind = "AseV1" + // AseV2 App Service Plan is running on an App Service Environment V2. + AseV2 StampKind = "AseV2" + // Public App Service Plan is running on a public stamp. + Public StampKind = "Public" +) + +// PossibleStampKindValues returns an array of possible values for the StampKind const type. +func PossibleStampKindValues() []StampKind { + return []StampKind{AseV1, AseV2, Public} +} + // AppConfigurationKeyValueDeletedEventData schema of the Data property of an EventGridEvent for an // Microsoft.AppConfiguration.KeyValueDeleted event. type AppConfigurationKeyValueDeletedEventData struct { @@ -163,6 +233,22 @@ type AppConfigurationKeyValueModifiedEventData struct { Etag *string `json:"etag,omitempty"` } +// AppEventTypeDetail detail of action on the app. +type AppEventTypeDetail struct { + // Action - Type of action of the operation. Possible values include: 'Restarted', 'Stopped', 'ChangedAppSettings', 'Started', 'Completed', 'Failed' + Action AppAction `json:"action,omitempty"` +} + +// AppServicePlanEventTypeDetail detail of action on the app service plan. +type AppServicePlanEventTypeDetail struct { + // StampKind - Kind of environment where app service plan is. Possible values include: 'Public', 'AseV1', 'AseV2' + StampKind StampKind `json:"stampKind,omitempty"` + // Action - Type of action on the app service plan. Possible values include: 'Updated' + Action AppServicePlanAction `json:"action,omitempty"` + // Status - Possible values include: 'AsyncStatusStarted', 'AsyncStatusCompleted', 'AsyncStatusFailed' + Status AsyncStatus `json:"status,omitempty"` +} + // ContainerRegistryArtifactEventData the content of the event request message. type ContainerRegistryArtifactEventData struct { // ID - The event ID. @@ -2467,3 +2553,253 @@ type SubscriptionValidationResponse struct { // ValidationResponse - The validation response sent by the subscriber to Azure Event Grid to complete the validation of an event subscription. ValidationResponse *string `json:"validationResponse,omitempty"` } + +// WebAppServicePlanUpdatedEventData schema of the Data property of an EventGridEvent for an +// Microsoft.Web.AppServicePlanUpdated event. +type WebAppServicePlanUpdatedEventData struct { + AppServicePlanEventTypeDetail *AppServicePlanEventTypeDetail `json:"appServicePlanEventTypeDetail,omitempty"` + // Sku - sku of app service plan. + Sku *WebAppServicePlanUpdatedEventDataSku `json:"sku,omitempty"` + // Name - name of the app service plan that had this event. + Name *string `json:"name,omitempty"` + // ClientRequestID - The client request id generated by the app service for the app service plan API operation that triggered this event. + ClientRequestID *string `json:"clientRequestId,omitempty"` + // CorrelationRequestID - The correlation request id generated by the app service for the app service plan API operation that triggered this event. + CorrelationRequestID *string `json:"correlationRequestId,omitempty"` + // RequestID - The request id generated by the app service for the app service plan API operation that triggered this event. + RequestID *string `json:"requestId,omitempty"` + // Address - HTTP request URL of this operation. + Address *string `json:"address,omitempty"` + // Verb - HTTP verb of this operation. + Verb *string `json:"verb,omitempty"` +} + +// WebAppServicePlanUpdatedEventDataSku sku of app service plan. +type WebAppServicePlanUpdatedEventDataSku struct { + // Name - name of app service plan sku. + Name *string `json:"name,omitempty"` + // Tier - tier of app service plan sku. + Tier *string `json:"Tier,omitempty"` + // Size - size of app service plan sku. + Size *string `json:"Size,omitempty"` + // Family - family of app service plan sku. + Family *string `json:"Family,omitempty"` + // Capacity - capacity of app service plan sku. + Capacity *string `json:"Capacity,omitempty"` +} + +// WebAppUpdatedEventData schema of the Data property of an EventGridEvent for an Microsoft.Web.AppUpdated +// event. +type WebAppUpdatedEventData struct { + AppEventTypeDetail *AppEventTypeDetail `json:"appEventTypeDetail,omitempty"` + // Name - name of the web site that had this event. + Name *string `json:"name,omitempty"` + // ClientRequestID - The client request id generated by the app service for the site API operation that triggered this event. + ClientRequestID *string `json:"clientRequestId,omitempty"` + // CorrelationRequestID - The correlation request id generated by the app service for the site API operation that triggered this event. + CorrelationRequestID *string `json:"correlationRequestId,omitempty"` + // RequestID - The request id generated by the app service for the site API operation that triggered this event. + RequestID *string `json:"requestId,omitempty"` + // Address - HTTP request URL of this operation. + Address *string `json:"address,omitempty"` + // Verb - HTTP verb of this operation. + Verb *string `json:"verb,omitempty"` +} + +// WebBackupOperationCompletedEventData schema of the Data property of an EventGridEvent for an +// Microsoft.Web.BackupOperationCompleted event. +type WebBackupOperationCompletedEventData struct { + AppEventTypeDetail *AppEventTypeDetail `json:"appEventTypeDetail,omitempty"` + // Name - name of the web site that had this event. + Name *string `json:"name,omitempty"` + // ClientRequestID - The client request id generated by the app service for the site API operation that triggered this event. + ClientRequestID *string `json:"clientRequestId,omitempty"` + // CorrelationRequestID - The correlation request id generated by the app service for the site API operation that triggered this event. + CorrelationRequestID *string `json:"correlationRequestId,omitempty"` + // RequestID - The request id generated by the app service for the site API operation that triggered this event. + RequestID *string `json:"requestId,omitempty"` + // Address - HTTP request URL of this operation. + Address *string `json:"address,omitempty"` + // Verb - HTTP verb of this operation. + Verb *string `json:"verb,omitempty"` +} + +// WebBackupOperationFailedEventData schema of the Data property of an EventGridEvent for an +// Microsoft.Web.BackupOperationFailed event. +type WebBackupOperationFailedEventData struct { + AppEventTypeDetail *AppEventTypeDetail `json:"appEventTypeDetail,omitempty"` + // Name - name of the web site that had this event. + Name *string `json:"name,omitempty"` + // ClientRequestID - The client request id generated by the app service for the site API operation that triggered this event. + ClientRequestID *string `json:"clientRequestId,omitempty"` + // CorrelationRequestID - The correlation request id generated by the app service for the site API operation that triggered this event. + CorrelationRequestID *string `json:"correlationRequestId,omitempty"` + // RequestID - The request id generated by the app service for the site API operation that triggered this event. + RequestID *string `json:"requestId,omitempty"` + // Address - HTTP request URL of this operation. + Address *string `json:"address,omitempty"` + // Verb - HTTP verb of this operation. + Verb *string `json:"verb,omitempty"` +} + +// WebBackupOperationStartedEventData schema of the Data property of an EventGridEvent for an +// Microsoft.Web.BackupOperationStarted event. +type WebBackupOperationStartedEventData struct { + AppEventTypeDetail *AppEventTypeDetail `json:"appEventTypeDetail,omitempty"` + // Name - name of the web site that had this event. + Name *string `json:"name,omitempty"` + // ClientRequestID - The client request id generated by the app service for the site API operation that triggered this event. + ClientRequestID *string `json:"clientRequestId,omitempty"` + // CorrelationRequestID - The correlation request id generated by the app service for the site API operation that triggered this event. + CorrelationRequestID *string `json:"correlationRequestId,omitempty"` + // RequestID - The request id generated by the app service for the site API operation that triggered this event. + RequestID *string `json:"requestId,omitempty"` + // Address - HTTP request URL of this operation. + Address *string `json:"address,omitempty"` + // Verb - HTTP verb of this operation. + Verb *string `json:"verb,omitempty"` +} + +// WebRestoreOperationCompletedEventData schema of the Data property of an EventGridEvent for an +// Microsoft.Web.RestoreOperationCompleted event. +type WebRestoreOperationCompletedEventData struct { + AppEventTypeDetail *AppEventTypeDetail `json:"appEventTypeDetail,omitempty"` + // Name - name of the web site that had this event. + Name *string `json:"name,omitempty"` + // ClientRequestID - The client request id generated by the app service for the site API operation that triggered this event. + ClientRequestID *string `json:"clientRequestId,omitempty"` + // CorrelationRequestID - The correlation request id generated by the app service for the site API operation that triggered this event. + CorrelationRequestID *string `json:"correlationRequestId,omitempty"` + // RequestID - The request id generated by the app service for the site API operation that triggered this event. + RequestID *string `json:"requestId,omitempty"` + // Address - HTTP request URL of this operation. + Address *string `json:"address,omitempty"` + // Verb - HTTP verb of this operation. + Verb *string `json:"verb,omitempty"` +} + +// WebRestoreOperationFailedEventData schema of the Data property of an EventGridEvent for an +// Microsoft.Web.RestoreOperationFailed event. +type WebRestoreOperationFailedEventData struct { + AppEventTypeDetail *AppEventTypeDetail `json:"appEventTypeDetail,omitempty"` + // Name - name of the web site that had this event. + Name *string `json:"name,omitempty"` + // ClientRequestID - The client request id generated by the app service for the site API operation that triggered this event. + ClientRequestID *string `json:"clientRequestId,omitempty"` + // CorrelationRequestID - The correlation request id generated by the app service for the site API operation that triggered this event. + CorrelationRequestID *string `json:"correlationRequestId,omitempty"` + // RequestID - The request id generated by the app service for the site API operation that triggered this event. + RequestID *string `json:"requestId,omitempty"` + // Address - HTTP request URL of this operation. + Address *string `json:"address,omitempty"` + // Verb - HTTP verb of this operation. + Verb *string `json:"verb,omitempty"` +} + +// WebRestoreOperationStartedEventData schema of the Data property of an EventGridEvent for an +// Microsoft.Web.RestoreOperationStarted event. +type WebRestoreOperationStartedEventData struct { + AppEventTypeDetail *AppEventTypeDetail `json:"appEventTypeDetail,omitempty"` + // Name - name of the web site that had this event. + Name *string `json:"name,omitempty"` + // ClientRequestID - The client request id generated by the app service for the site API operation that triggered this event. + ClientRequestID *string `json:"clientRequestId,omitempty"` + // CorrelationRequestID - The correlation request id generated by the app service for the site API operation that triggered this event. + CorrelationRequestID *string `json:"correlationRequestId,omitempty"` + // RequestID - The request id generated by the app service for the site API operation that triggered this event. + RequestID *string `json:"requestId,omitempty"` + // Address - HTTP request URL of this operation. + Address *string `json:"address,omitempty"` + // Verb - HTTP verb of this operation. + Verb *string `json:"verb,omitempty"` +} + +// WebSlotSwapCompletedEventData schema of the Data property of an EventGridEvent for an +// Microsoft.Web.SlotSwapCompleted event. +type WebSlotSwapCompletedEventData struct { + AppEventTypeDetail *AppEventTypeDetail `json:"appEventTypeDetail,omitempty"` + // Name - name of the web site that had this event. + Name *string `json:"name,omitempty"` + // ClientRequestID - The client request id generated by the app service for the site API operation that triggered this event. + ClientRequestID *string `json:"clientRequestId,omitempty"` + // CorrelationRequestID - The correlation request id generated by the app service for the site API operation that triggered this event. + CorrelationRequestID *string `json:"correlationRequestId,omitempty"` + // RequestID - The request id generated by the app service for the site API operation that triggered this event. + RequestID *string `json:"requestId,omitempty"` + // Address - HTTP request URL of this operation. + Address *string `json:"address,omitempty"` + // Verb - HTTP verb of this operation. + Verb *string `json:"verb,omitempty"` +} + +// WebSlotSwapFailedEventData schema of the Data property of an EventGridEvent for an +// Microsoft.Web.SlotSwapFailed event. +type WebSlotSwapFailedEventData struct { + AppEventTypeDetail *AppEventTypeDetail `json:"appEventTypeDetail,omitempty"` + // Name - name of the web site that had this event. + Name *string `json:"name,omitempty"` + // ClientRequestID - The client request id generated by the app service for the site API operation that triggered this event. + ClientRequestID *string `json:"clientRequestId,omitempty"` + // CorrelationRequestID - The correlation request id generated by the app service for the site API operation that triggered this event. + CorrelationRequestID *string `json:"correlationRequestId,omitempty"` + // RequestID - The request id generated by the app service for the site API operation that triggered this event. + RequestID *string `json:"requestId,omitempty"` + // Address - HTTP request URL of this operation. + Address *string `json:"address,omitempty"` + // Verb - HTTP verb of this operation. + Verb *string `json:"verb,omitempty"` +} + +// WebSlotSwapStartedEventData schema of the Data property of an EventGridEvent for an +// Microsoft.Web.SlotSwapStarted event. +type WebSlotSwapStartedEventData struct { + AppEventTypeDetail *AppEventTypeDetail `json:"appEventTypeDetail,omitempty"` + // Name - name of the web site that had this event. + Name *string `json:"name,omitempty"` + // ClientRequestID - The client request id generated by the app service for the site API operation that triggered this event. + ClientRequestID *string `json:"clientRequestId,omitempty"` + // CorrelationRequestID - The correlation request id generated by the app service for the site API operation that triggered this event. + CorrelationRequestID *string `json:"correlationRequestId,omitempty"` + // RequestID - The request id generated by the app service for the site API operation that triggered this event. + RequestID *string `json:"requestId,omitempty"` + // Address - HTTP request URL of this operation. + Address *string `json:"address,omitempty"` + // Verb - HTTP verb of this operation. + Verb *string `json:"verb,omitempty"` +} + +// WebSlotSwapWithPreviewCancelledEventData schema of the Data property of an EventGridEvent for an +// Microsoft.Web.SlotSwapWithPreviewCancelled event. +type WebSlotSwapWithPreviewCancelledEventData struct { + AppEventTypeDetail *AppEventTypeDetail `json:"appEventTypeDetail,omitempty"` + // Name - name of the web site that had this event. + Name *string `json:"name,omitempty"` + // ClientRequestID - The client request id generated by the app service for the site API operation that triggered this event. + ClientRequestID *string `json:"clientRequestId,omitempty"` + // CorrelationRequestID - The correlation request id generated by the app service for the site API operation that triggered this event. + CorrelationRequestID *string `json:"correlationRequestId,omitempty"` + // RequestID - The request id generated by the app service for the site API operation that triggered this event. + RequestID *string `json:"requestId,omitempty"` + // Address - HTTP request URL of this operation. + Address *string `json:"address,omitempty"` + // Verb - HTTP verb of this operation. + Verb *string `json:"verb,omitempty"` +} + +// WebSlotSwapWithPreviewStartedEventData schema of the Data property of an EventGridEvent for an +// Microsoft.Web.SlotSwapWithPreviewStarted event. +type WebSlotSwapWithPreviewStartedEventData struct { + AppEventTypeDetail *AppEventTypeDetail `json:"appEventTypeDetail,omitempty"` + // Name - name of the web site that had this event. + Name *string `json:"name,omitempty"` + // ClientRequestID - The client request id generated by the app service for the site API operation that triggered this event. + ClientRequestID *string `json:"clientRequestId,omitempty"` + // CorrelationRequestID - The correlation request id generated by the app service for the site API operation that triggered this event. + CorrelationRequestID *string `json:"correlationRequestId,omitempty"` + // RequestID - The request id generated by the app service for the site API operation that triggered this event. + RequestID *string `json:"requestId,omitempty"` + // Address - HTTP request URL of this operation. + Address *string `json:"address,omitempty"` + // Verb - HTTP verb of this operation. + Verb *string `json:"verb,omitempty"` +} diff --git a/services/frontdoor/mgmt/2020-04-01/frontdoor/client.go b/services/frontdoor/mgmt/2020-04-01/frontdoor/client.go new file mode 100644 index 000000000000..7d58c9a4115e --- /dev/null +++ b/services/frontdoor/mgmt/2020-04-01/frontdoor/client.go @@ -0,0 +1,215 @@ +// Package frontdoor implements the Azure ARM Frontdoor service API version . +// +// FrontDoor Client +package frontdoor + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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 Frontdoor + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Frontdoor. +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, + } +} + +// CheckFrontDoorNameAvailability check the availability of a Front Door resource name. +// Parameters: +// checkFrontDoorNameAvailabilityInput - input to check. +func (client BaseClient) CheckFrontDoorNameAvailability(ctx context.Context, checkFrontDoorNameAvailabilityInput CheckNameAvailabilityInput) (result CheckNameAvailabilityOutput, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CheckFrontDoorNameAvailability") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: checkFrontDoorNameAvailabilityInput, + Constraints: []validation.Constraint{{Target: "checkFrontDoorNameAvailabilityInput.Name", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.BaseClient", "CheckFrontDoorNameAvailability", err.Error()) + } + + req, err := client.CheckFrontDoorNameAvailabilityPreparer(ctx, checkFrontDoorNameAvailabilityInput) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.BaseClient", "CheckFrontDoorNameAvailability", nil, "Failure preparing request") + return + } + + resp, err := client.CheckFrontDoorNameAvailabilitySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "frontdoor.BaseClient", "CheckFrontDoorNameAvailability", resp, "Failure sending request") + return + } + + result, err = client.CheckFrontDoorNameAvailabilityResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.BaseClient", "CheckFrontDoorNameAvailability", resp, "Failure responding to request") + } + + return +} + +// CheckFrontDoorNameAvailabilityPreparer prepares the CheckFrontDoorNameAvailability request. +func (client BaseClient) CheckFrontDoorNameAvailabilityPreparer(ctx context.Context, checkFrontDoorNameAvailabilityInput CheckNameAvailabilityInput) (*http.Request, error) { + const APIVersion = "2020-04-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.WithPath("/providers/Microsoft.Network/checkFrontDoorNameAvailability"), + autorest.WithJSON(checkFrontDoorNameAvailabilityInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CheckFrontDoorNameAvailabilitySender sends the CheckFrontDoorNameAvailability request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) CheckFrontDoorNameAvailabilitySender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// CheckFrontDoorNameAvailabilityResponder handles the response to the CheckFrontDoorNameAvailability request. The method always +// closes the http.Response Body. +func (client BaseClient) CheckFrontDoorNameAvailabilityResponder(resp *http.Response) (result CheckNameAvailabilityOutput, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CheckFrontDoorNameAvailabilityWithSubscription check the availability of a Front Door subdomain. +// Parameters: +// checkFrontDoorNameAvailabilityInput - input to check. +func (client BaseClient) CheckFrontDoorNameAvailabilityWithSubscription(ctx context.Context, checkFrontDoorNameAvailabilityInput CheckNameAvailabilityInput) (result CheckNameAvailabilityOutput, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CheckFrontDoorNameAvailabilityWithSubscription") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: checkFrontDoorNameAvailabilityInput, + Constraints: []validation.Constraint{{Target: "checkFrontDoorNameAvailabilityInput.Name", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.BaseClient", "CheckFrontDoorNameAvailabilityWithSubscription", err.Error()) + } + + req, err := client.CheckFrontDoorNameAvailabilityWithSubscriptionPreparer(ctx, checkFrontDoorNameAvailabilityInput) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.BaseClient", "CheckFrontDoorNameAvailabilityWithSubscription", nil, "Failure preparing request") + return + } + + resp, err := client.CheckFrontDoorNameAvailabilityWithSubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "frontdoor.BaseClient", "CheckFrontDoorNameAvailabilityWithSubscription", resp, "Failure sending request") + return + } + + result, err = client.CheckFrontDoorNameAvailabilityWithSubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.BaseClient", "CheckFrontDoorNameAvailabilityWithSubscription", resp, "Failure responding to request") + } + + return +} + +// CheckFrontDoorNameAvailabilityWithSubscriptionPreparer prepares the CheckFrontDoorNameAvailabilityWithSubscription request. +func (client BaseClient) CheckFrontDoorNameAvailabilityWithSubscriptionPreparer(ctx context.Context, checkFrontDoorNameAvailabilityInput CheckNameAvailabilityInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-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.Network/checkFrontDoorNameAvailability", pathParameters), + autorest.WithJSON(checkFrontDoorNameAvailabilityInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CheckFrontDoorNameAvailabilityWithSubscriptionSender sends the CheckFrontDoorNameAvailabilityWithSubscription request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) CheckFrontDoorNameAvailabilityWithSubscriptionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CheckFrontDoorNameAvailabilityWithSubscriptionResponder handles the response to the CheckFrontDoorNameAvailabilityWithSubscription request. The method always +// closes the http.Response Body. +func (client BaseClient) CheckFrontDoorNameAvailabilityWithSubscriptionResponder(resp *http.Response) (result CheckNameAvailabilityOutput, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/frontdoor/mgmt/2020-04-01/frontdoor/endpoints.go b/services/frontdoor/mgmt/2020-04-01/frontdoor/endpoints.go new file mode 100644 index 000000000000..33f39b957108 --- /dev/null +++ b/services/frontdoor/mgmt/2020-04-01/frontdoor/endpoints.go @@ -0,0 +1,137 @@ +package frontdoor + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// EndpointsClient is the frontDoor Client +type EndpointsClient struct { + BaseClient +} + +// NewEndpointsClient creates an instance of the EndpointsClient client. +func NewEndpointsClient(subscriptionID string) EndpointsClient { + return NewEndpointsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewEndpointsClientWithBaseURI creates an instance of the EndpointsClient 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 NewEndpointsClientWithBaseURI(baseURI string, subscriptionID string) EndpointsClient { + return EndpointsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// PurgeContent removes a content from Front Door. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// frontDoorName - name of the Front Door which is globally unique. +// contentFilePaths - the path to the content to be purged. Path can be a full URL, e.g. '/pictures/city.png' +// which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' which removes all folders +// and files in the directory. +func (client EndpointsClient) PurgeContent(ctx context.Context, resourceGroupName string, frontDoorName string, contentFilePaths PurgeParameters) (result EndpointsPurgeContentFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EndpointsClient.PurgeContent") + 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: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: frontDoorName, + Constraints: []validation.Constraint{{Target: "frontDoorName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "frontDoorName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "frontDoorName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$`, Chain: nil}}}, + {TargetValue: contentFilePaths, + Constraints: []validation.Constraint{{Target: "contentFilePaths.ContentPaths", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.EndpointsClient", "PurgeContent", err.Error()) + } + + req, err := client.PurgeContentPreparer(ctx, resourceGroupName, frontDoorName, contentFilePaths) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.EndpointsClient", "PurgeContent", nil, "Failure preparing request") + return + } + + result, err = client.PurgeContentSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.EndpointsClient", "PurgeContent", result.Response(), "Failure sending request") + return + } + + return +} + +// PurgeContentPreparer prepares the PurgeContent request. +func (client EndpointsClient) PurgeContentPreparer(ctx context.Context, resourceGroupName string, frontDoorName string, contentFilePaths PurgeParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "frontDoorName": autorest.Encode("path", frontDoorName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-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.Network/frontDoors/{frontDoorName}/purge", pathParameters), + autorest.WithJSON(contentFilePaths), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PurgeContentSender sends the PurgeContent request. The method will close the +// http.Response Body if it receives an error. +func (client EndpointsClient) PurgeContentSender(req *http.Request) (future EndpointsPurgeContentFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// PurgeContentResponder handles the response to the PurgeContent request. The method always +// closes the http.Response Body. +func (client EndpointsClient) PurgeContentResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/services/frontdoor/mgmt/2020-04-01/frontdoor/experiments.go b/services/frontdoor/mgmt/2020-04-01/frontdoor/experiments.go new file mode 100644 index 000000000000..b90056bcd2b1 --- /dev/null +++ b/services/frontdoor/mgmt/2020-04-01/frontdoor/experiments.go @@ -0,0 +1,532 @@ +package frontdoor + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// ExperimentsClient is the frontDoor Client +type ExperimentsClient struct { + BaseClient +} + +// NewExperimentsClient creates an instance of the ExperimentsClient client. +func NewExperimentsClient(subscriptionID string) ExperimentsClient { + return NewExperimentsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewExperimentsClientWithBaseURI creates an instance of the ExperimentsClient 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 NewExperimentsClientWithBaseURI(baseURI string, subscriptionID string) ExperimentsClient { + return ExperimentsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate sends the create or update request. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - the Profile identifier associated with the Tenant and Partner +// experimentName - the Experiment identifier associated with the Experiment +// parameters - the Experiment resource +func (client ExperimentsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, profileName string, experimentName string, parameters Experiment) (result ExperimentsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExperimentsClient.CreateOrUpdate") + 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: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: profileName, + Constraints: []validation.Constraint{{Target: "profileName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: experimentName, + Constraints: []validation.Constraint{{Target: "experimentName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.ExperimentsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, profileName, experimentName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ExperimentsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, profileName string, experimentName string, parameters Experiment) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "experimentName": autorest.Encode("path", experimentName), + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-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.Network/NetworkExperimentProfiles/{profileName}/Experiments/{experimentName}", pathParameters), + autorest.WithJSON(parameters), + 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 ExperimentsClient) CreateOrUpdateSender(req *http.Request) (future ExperimentsCreateOrUpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client ExperimentsClient) CreateOrUpdateResponder(resp *http.Response) (result Experiment, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete sends the delete request. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - the Profile identifier associated with the Tenant and Partner +// experimentName - the Experiment identifier associated with the Experiment +func (client ExperimentsClient) Delete(ctx context.Context, resourceGroupName string, profileName string, experimentName string) (result ExperimentsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExperimentsClient.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: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: profileName, + Constraints: []validation.Constraint{{Target: "profileName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: experimentName, + Constraints: []validation.Constraint{{Target: "experimentName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.ExperimentsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, profileName, experimentName) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ExperimentsClient) DeletePreparer(ctx context.Context, resourceGroupName string, profileName string, experimentName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "experimentName": autorest.Encode("path", experimentName), + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-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.Network/NetworkExperimentProfiles/{profileName}/Experiments/{experimentName}", 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 ExperimentsClient) DeleteSender(req *http.Request) (future ExperimentsDeleteFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ExperimentsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 within the Azure subscription. +// profileName - the Profile identifier associated with the Tenant and Partner +// experimentName - the Experiment identifier associated with the Experiment +func (client ExperimentsClient) Get(ctx context.Context, resourceGroupName string, profileName string, experimentName string) (result Experiment, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExperimentsClient.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: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: profileName, + Constraints: []validation.Constraint{{Target: "profileName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: experimentName, + Constraints: []validation.Constraint{{Target: "experimentName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.ExperimentsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, profileName, experimentName) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ExperimentsClient) GetPreparer(ctx context.Context, resourceGroupName string, profileName string, experimentName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "experimentName": autorest.Encode("path", experimentName), + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/NetworkExperimentProfiles/{profileName}/Experiments/{experimentName}", 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 ExperimentsClient) 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 ExperimentsClient) GetResponder(resp *http.Response) (result Experiment, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByProfile sends the list by profile request. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - the Profile identifier associated with the Tenant and Partner +func (client ExperimentsClient) ListByProfile(ctx context.Context, resourceGroupName string, profileName string) (result ExperimentListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExperimentsClient.ListByProfile") + defer func() { + sc := -1 + if result.el.Response.Response != nil { + sc = result.el.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: profileName, + Constraints: []validation.Constraint{{Target: "profileName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.ExperimentsClient", "ListByProfile", err.Error()) + } + + result.fn = client.listByProfileNextResults + req, err := client.ListByProfilePreparer(ctx, resourceGroupName, profileName) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsClient", "ListByProfile", nil, "Failure preparing request") + return + } + + resp, err := client.ListByProfileSender(req) + if err != nil { + result.el.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsClient", "ListByProfile", resp, "Failure sending request") + return + } + + result.el, err = client.ListByProfileResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsClient", "ListByProfile", resp, "Failure responding to request") + } + + return +} + +// ListByProfilePreparer prepares the ListByProfile request. +func (client ExperimentsClient) ListByProfilePreparer(ctx context.Context, resourceGroupName string, profileName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/NetworkExperimentProfiles/{profileName}/Experiments", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByProfileSender sends the ListByProfile request. The method will close the +// http.Response Body if it receives an error. +func (client ExperimentsClient) ListByProfileSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByProfileResponder handles the response to the ListByProfile request. The method always +// closes the http.Response Body. +func (client ExperimentsClient) ListByProfileResponder(resp *http.Response) (result ExperimentList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByProfileNextResults retrieves the next set of results, if any. +func (client ExperimentsClient) listByProfileNextResults(ctx context.Context, lastResults ExperimentList) (result ExperimentList, err error) { + req, err := lastResults.experimentListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "frontdoor.ExperimentsClient", "listByProfileNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByProfileSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "frontdoor.ExperimentsClient", "listByProfileNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByProfileResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsClient", "listByProfileNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByProfileComplete enumerates all values, automatically crossing page boundaries as required. +func (client ExperimentsClient) ListByProfileComplete(ctx context.Context, resourceGroupName string, profileName string) (result ExperimentListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExperimentsClient.ListByProfile") + 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.ListByProfile(ctx, resourceGroupName, profileName) + return +} + +// Update updates an Experiment +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - the Profile identifier associated with the Tenant and Partner +// experimentName - the Experiment identifier associated with the Experiment +// parameters - the Experiment Update Model +func (client ExperimentsClient) Update(ctx context.Context, resourceGroupName string, profileName string, experimentName string, parameters ExperimentUpdateModel) (result ExperimentsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExperimentsClient.Update") + 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: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: profileName, + Constraints: []validation.Constraint{{Target: "profileName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: experimentName, + Constraints: []validation.Constraint{{Target: "experimentName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.ExperimentsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, profileName, experimentName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ExperimentsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, profileName string, experimentName string, parameters ExperimentUpdateModel) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "experimentName": autorest.Encode("path", experimentName), + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-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.Network/NetworkExperimentProfiles/{profileName}/Experiments/{experimentName}", pathParameters), + autorest.WithJSON(parameters), + 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 ExperimentsClient) UpdateSender(req *http.Request) (future ExperimentsUpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ExperimentsClient) UpdateResponder(resp *http.Response) (result Experiment, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/frontdoor/mgmt/2020-04-01/frontdoor/frontdoorapi/interfaces.go b/services/frontdoor/mgmt/2020-04-01/frontdoor/frontdoorapi/interfaces.go new file mode 100644 index 000000000000..ef9b18e32c71 --- /dev/null +++ b/services/frontdoor/mgmt/2020-04-01/frontdoor/frontdoorapi/interfaces.go @@ -0,0 +1,136 @@ +package frontdoorapi + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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/frontdoor/mgmt/2020-04-01/frontdoor" + "github.com/Azure/go-autorest/autorest/date" +) + +// BaseClientAPI contains the set of methods on the BaseClient type. +type BaseClientAPI interface { + CheckFrontDoorNameAvailability(ctx context.Context, checkFrontDoorNameAvailabilityInput frontdoor.CheckNameAvailabilityInput) (result frontdoor.CheckNameAvailabilityOutput, err error) + CheckFrontDoorNameAvailabilityWithSubscription(ctx context.Context, checkFrontDoorNameAvailabilityInput frontdoor.CheckNameAvailabilityInput) (result frontdoor.CheckNameAvailabilityOutput, err error) +} + +var _ BaseClientAPI = (*frontdoor.BaseClient)(nil) + +// NetworkExperimentProfilesClientAPI contains the set of methods on the NetworkExperimentProfilesClient type. +type NetworkExperimentProfilesClientAPI interface { + CreateOrUpdate(ctx context.Context, profileName string, resourceGroupName string, parameters frontdoor.Profile) (result frontdoor.NetworkExperimentProfilesCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, profileName string) (result frontdoor.NetworkExperimentProfilesDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, profileName string) (result frontdoor.Profile, err error) + List(ctx context.Context) (result frontdoor.ProfileListPage, err error) + ListComplete(ctx context.Context) (result frontdoor.ProfileListIterator, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result frontdoor.ProfileListPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result frontdoor.ProfileListIterator, err error) + Update(ctx context.Context, resourceGroupName string, profileName string, parameters frontdoor.ProfileUpdateModel) (result frontdoor.NetworkExperimentProfilesUpdateFuture, err error) +} + +var _ NetworkExperimentProfilesClientAPI = (*frontdoor.NetworkExperimentProfilesClient)(nil) + +// PreconfiguredEndpointsClientAPI contains the set of methods on the PreconfiguredEndpointsClient type. +type PreconfiguredEndpointsClientAPI interface { + List(ctx context.Context, resourceGroupName string, profileName string) (result frontdoor.PreconfiguredEndpointListPage, err error) + ListComplete(ctx context.Context, resourceGroupName string, profileName string) (result frontdoor.PreconfiguredEndpointListIterator, err error) +} + +var _ PreconfiguredEndpointsClientAPI = (*frontdoor.PreconfiguredEndpointsClient)(nil) + +// ExperimentsClientAPI contains the set of methods on the ExperimentsClient type. +type ExperimentsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, profileName string, experimentName string, parameters frontdoor.Experiment) (result frontdoor.ExperimentsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, profileName string, experimentName string) (result frontdoor.ExperimentsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, profileName string, experimentName string) (result frontdoor.Experiment, err error) + ListByProfile(ctx context.Context, resourceGroupName string, profileName string) (result frontdoor.ExperimentListPage, err error) + ListByProfileComplete(ctx context.Context, resourceGroupName string, profileName string) (result frontdoor.ExperimentListIterator, err error) + Update(ctx context.Context, resourceGroupName string, profileName string, experimentName string, parameters frontdoor.ExperimentUpdateModel) (result frontdoor.ExperimentsUpdateFuture, err error) +} + +var _ ExperimentsClientAPI = (*frontdoor.ExperimentsClient)(nil) + +// ReportsClientAPI contains the set of methods on the ReportsClient type. +type ReportsClientAPI interface { + GetLatencyScorecards(ctx context.Context, resourceGroupName string, profileName string, experimentName string, aggregationInterval frontdoor.LatencyScorecardAggregationInterval, endDateTimeUTC string, country string) (result frontdoor.LatencyScorecard, err error) + GetTimeseries(ctx context.Context, resourceGroupName string, profileName string, experimentName string, startDateTimeUTC date.Time, endDateTimeUTC date.Time, aggregationInterval frontdoor.TimeseriesAggregationInterval, timeseriesType frontdoor.TimeseriesType, endpoint string, country string) (result frontdoor.Timeseries, err error) +} + +var _ ReportsClientAPI = (*frontdoor.ReportsClient)(nil) + +// FrontDoorsClientAPI contains the set of methods on the FrontDoorsClient type. +type FrontDoorsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, frontDoorName string, frontDoorParameters frontdoor.FrontDoor) (result frontdoor.FrontDoorsCreateOrUpdateFutureType, err error) + Delete(ctx context.Context, resourceGroupName string, frontDoorName string) (result frontdoor.FrontDoorsDeleteFutureType, err error) + Get(ctx context.Context, resourceGroupName string, frontDoorName string) (result frontdoor.FrontDoor, err error) + List(ctx context.Context) (result frontdoor.ListResultPage, err error) + ListComplete(ctx context.Context) (result frontdoor.ListResultIterator, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result frontdoor.ListResultPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result frontdoor.ListResultIterator, err error) + ValidateCustomDomain(ctx context.Context, resourceGroupName string, frontDoorName string, customDomainProperties frontdoor.ValidateCustomDomainInput) (result frontdoor.ValidateCustomDomainOutput, err error) +} + +var _ FrontDoorsClientAPI = (*frontdoor.FrontDoorsClient)(nil) + +// FrontendEndpointsClientAPI contains the set of methods on the FrontendEndpointsClient type. +type FrontendEndpointsClientAPI interface { + DisableHTTPS(ctx context.Context, resourceGroupName string, frontDoorName string, frontendEndpointName string) (result frontdoor.FrontendEndpointsDisableHTTPSFuture, err error) + EnableHTTPS(ctx context.Context, resourceGroupName string, frontDoorName string, frontendEndpointName string, customHTTPSConfiguration frontdoor.CustomHTTPSConfiguration) (result frontdoor.FrontendEndpointsEnableHTTPSFuture, err error) + Get(ctx context.Context, resourceGroupName string, frontDoorName string, frontendEndpointName string) (result frontdoor.FrontendEndpoint, err error) + ListByFrontDoor(ctx context.Context, resourceGroupName string, frontDoorName string) (result frontdoor.FrontendEndpointsListResultPage, err error) + ListByFrontDoorComplete(ctx context.Context, resourceGroupName string, frontDoorName string) (result frontdoor.FrontendEndpointsListResultIterator, err error) +} + +var _ FrontendEndpointsClientAPI = (*frontdoor.FrontendEndpointsClient)(nil) + +// EndpointsClientAPI contains the set of methods on the EndpointsClient type. +type EndpointsClientAPI interface { + PurgeContent(ctx context.Context, resourceGroupName string, frontDoorName string, contentFilePaths frontdoor.PurgeParameters) (result frontdoor.EndpointsPurgeContentFuture, err error) +} + +var _ EndpointsClientAPI = (*frontdoor.EndpointsClient)(nil) + +// RulesEnginesClientAPI contains the set of methods on the RulesEnginesClient type. +type RulesEnginesClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, frontDoorName string, rulesEngineName string, rulesEngineParameters frontdoor.RulesEngine) (result frontdoor.RulesEnginesCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, frontDoorName string, rulesEngineName string) (result frontdoor.RulesEnginesDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, frontDoorName string, rulesEngineName string) (result frontdoor.RulesEngine, err error) + ListByFrontDoor(ctx context.Context, resourceGroupName string, frontDoorName string) (result frontdoor.RulesEngineListResultPage, err error) + ListByFrontDoorComplete(ctx context.Context, resourceGroupName string, frontDoorName string) (result frontdoor.RulesEngineListResultIterator, err error) +} + +var _ RulesEnginesClientAPI = (*frontdoor.RulesEnginesClient)(nil) + +// PoliciesClientAPI contains the set of methods on the PoliciesClient type. +type PoliciesClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, policyName string, parameters frontdoor.WebApplicationFirewallPolicy) (result frontdoor.PoliciesCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, policyName string) (result frontdoor.PoliciesDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, policyName string) (result frontdoor.WebApplicationFirewallPolicy, err error) + List(ctx context.Context, resourceGroupName string) (result frontdoor.WebApplicationFirewallPolicyListPage, err error) + ListComplete(ctx context.Context, resourceGroupName string) (result frontdoor.WebApplicationFirewallPolicyListIterator, err error) +} + +var _ PoliciesClientAPI = (*frontdoor.PoliciesClient)(nil) + +// ManagedRuleSetsClientAPI contains the set of methods on the ManagedRuleSetsClient type. +type ManagedRuleSetsClientAPI interface { + List(ctx context.Context) (result frontdoor.ManagedRuleSetDefinitionListPage, err error) + ListComplete(ctx context.Context) (result frontdoor.ManagedRuleSetDefinitionListIterator, err error) +} + +var _ ManagedRuleSetsClientAPI = (*frontdoor.ManagedRuleSetsClient)(nil) diff --git a/services/frontdoor/mgmt/2020-04-01/frontdoor/frontdoors.go b/services/frontdoor/mgmt/2020-04-01/frontdoor/frontdoors.go new file mode 100644 index 000000000000..55babe21fbbe --- /dev/null +++ b/services/frontdoor/mgmt/2020-04-01/frontdoor/frontdoors.go @@ -0,0 +1,632 @@ +package frontdoor + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// FrontDoorsClient is the frontDoor Client +type FrontDoorsClient struct { + BaseClient +} + +// NewFrontDoorsClient creates an instance of the FrontDoorsClient client. +func NewFrontDoorsClient(subscriptionID string) FrontDoorsClient { + return NewFrontDoorsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewFrontDoorsClientWithBaseURI creates an instance of the FrontDoorsClient 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 NewFrontDoorsClientWithBaseURI(baseURI string, subscriptionID string) FrontDoorsClient { + return FrontDoorsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates a new Front Door with a Front Door name under the specified subscription and resource group. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// frontDoorName - name of the Front Door which is globally unique. +// frontDoorParameters - front Door properties needed to create a new Front Door. +func (client FrontDoorsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, frontDoorName string, frontDoorParameters FrontDoor) (result FrontDoorsCreateOrUpdateFutureType, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FrontDoorsClient.CreateOrUpdate") + 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: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: frontDoorName, + Constraints: []validation.Constraint{{Target: "frontDoorName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "frontDoorName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "frontDoorName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.FrontDoorsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, frontDoorName, frontDoorParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.FrontDoorsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.FrontDoorsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client FrontDoorsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, frontDoorName string, frontDoorParameters FrontDoor) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "frontDoorName": autorest.Encode("path", frontDoorName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-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.Network/frontDoors/{frontDoorName}", pathParameters), + autorest.WithJSON(frontDoorParameters), + 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 FrontDoorsClient) CreateOrUpdateSender(req *http.Request) (future FrontDoorsCreateOrUpdateFutureType, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client FrontDoorsClient) CreateOrUpdateResponder(resp *http.Response) (result FrontDoor, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes an existing Front Door with the specified parameters. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// frontDoorName - name of the Front Door which is globally unique. +func (client FrontDoorsClient) Delete(ctx context.Context, resourceGroupName string, frontDoorName string) (result FrontDoorsDeleteFutureType, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FrontDoorsClient.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: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: frontDoorName, + Constraints: []validation.Constraint{{Target: "frontDoorName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "frontDoorName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "frontDoorName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.FrontDoorsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, frontDoorName) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.FrontDoorsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.FrontDoorsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client FrontDoorsClient) DeletePreparer(ctx context.Context, resourceGroupName string, frontDoorName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "frontDoorName": autorest.Encode("path", frontDoorName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-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.Network/frontDoors/{frontDoorName}", 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 FrontDoorsClient) DeleteSender(req *http.Request) (future FrontDoorsDeleteFutureType, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client FrontDoorsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets a Front Door with the specified Front Door name under the specified subscription and resource group. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// frontDoorName - name of the Front Door which is globally unique. +func (client FrontDoorsClient) Get(ctx context.Context, resourceGroupName string, frontDoorName string) (result FrontDoor, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FrontDoorsClient.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: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: frontDoorName, + Constraints: []validation.Constraint{{Target: "frontDoorName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "frontDoorName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "frontDoorName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.FrontDoorsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, frontDoorName) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.FrontDoorsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "frontdoor.FrontDoorsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.FrontDoorsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client FrontDoorsClient) GetPreparer(ctx context.Context, resourceGroupName string, frontDoorName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "frontDoorName": autorest.Encode("path", frontDoorName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}", 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 FrontDoorsClient) 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 FrontDoorsClient) GetResponder(resp *http.Response) (result FrontDoor, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists all of the Front Doors within an Azure subscription. +func (client FrontDoorsClient) List(ctx context.Context) (result ListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FrontDoorsClient.List") + defer func() { + sc := -1 + if result.lr.Response.Response != nil { + sc = result.lr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.FrontDoorsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.lr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "frontdoor.FrontDoorsClient", "List", resp, "Failure sending request") + return + } + + result.lr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.FrontDoorsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client FrontDoorsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/frontDoors", 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 FrontDoorsClient) 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 FrontDoorsClient) ListResponder(resp *http.Response) (result ListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 FrontDoorsClient) listNextResults(ctx context.Context, lastResults ListResult) (result ListResult, err error) { + req, err := lastResults.listResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "frontdoor.FrontDoorsClient", "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, "frontdoor.FrontDoorsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.FrontDoorsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client FrontDoorsClient) ListComplete(ctx context.Context) (result ListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FrontDoorsClient.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 of the Front Doors within a resource group under a subscription. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +func (client FrontDoorsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FrontDoorsClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.lr.Response.Response != nil { + sc = result.lr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.FrontDoorsClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.FrontDoorsClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.lr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "frontdoor.FrontDoorsClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.lr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.FrontDoorsClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client FrontDoorsClient) 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 = "2020-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors", 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 FrontDoorsClient) 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 FrontDoorsClient) ListByResourceGroupResponder(resp *http.Response) (result ListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 FrontDoorsClient) listByResourceGroupNextResults(ctx context.Context, lastResults ListResult) (result ListResult, err error) { + req, err := lastResults.listResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "frontdoor.FrontDoorsClient", "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, "frontdoor.FrontDoorsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.FrontDoorsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client FrontDoorsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FrontDoorsClient.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 +} + +// ValidateCustomDomain validates the custom domain mapping to ensure it maps to the correct Front Door endpoint in +// DNS. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// frontDoorName - name of the Front Door which is globally unique. +// customDomainProperties - custom domain to be validated. +func (client FrontDoorsClient) ValidateCustomDomain(ctx context.Context, resourceGroupName string, frontDoorName string, customDomainProperties ValidateCustomDomainInput) (result ValidateCustomDomainOutput, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FrontDoorsClient.ValidateCustomDomain") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: frontDoorName, + Constraints: []validation.Constraint{{Target: "frontDoorName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "frontDoorName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "frontDoorName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$`, Chain: nil}}}, + {TargetValue: customDomainProperties, + Constraints: []validation.Constraint{{Target: "customDomainProperties.HostName", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.FrontDoorsClient", "ValidateCustomDomain", err.Error()) + } + + req, err := client.ValidateCustomDomainPreparer(ctx, resourceGroupName, frontDoorName, customDomainProperties) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.FrontDoorsClient", "ValidateCustomDomain", nil, "Failure preparing request") + return + } + + resp, err := client.ValidateCustomDomainSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "frontdoor.FrontDoorsClient", "ValidateCustomDomain", resp, "Failure sending request") + return + } + + result, err = client.ValidateCustomDomainResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.FrontDoorsClient", "ValidateCustomDomain", resp, "Failure responding to request") + } + + return +} + +// ValidateCustomDomainPreparer prepares the ValidateCustomDomain request. +func (client FrontDoorsClient) ValidateCustomDomainPreparer(ctx context.Context, resourceGroupName string, frontDoorName string, customDomainProperties ValidateCustomDomainInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "frontDoorName": autorest.Encode("path", frontDoorName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-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.Network/frontDoors/{frontDoorName}/validateCustomDomain", pathParameters), + autorest.WithJSON(customDomainProperties), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ValidateCustomDomainSender sends the ValidateCustomDomain request. The method will close the +// http.Response Body if it receives an error. +func (client FrontDoorsClient) ValidateCustomDomainSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ValidateCustomDomainResponder handles the response to the ValidateCustomDomain request. The method always +// closes the http.Response Body. +func (client FrontDoorsClient) ValidateCustomDomainResponder(resp *http.Response) (result ValidateCustomDomainOutput, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/frontdoor/mgmt/2020-04-01/frontdoor/frontendendpoints.go b/services/frontdoor/mgmt/2020-04-01/frontdoor/frontendendpoints.go new file mode 100644 index 000000000000..76ccaaeb9fb9 --- /dev/null +++ b/services/frontdoor/mgmt/2020-04-01/frontdoor/frontendendpoints.go @@ -0,0 +1,455 @@ +package frontdoor + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// FrontendEndpointsClient is the frontDoor Client +type FrontendEndpointsClient struct { + BaseClient +} + +// NewFrontendEndpointsClient creates an instance of the FrontendEndpointsClient client. +func NewFrontendEndpointsClient(subscriptionID string) FrontendEndpointsClient { + return NewFrontendEndpointsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewFrontendEndpointsClientWithBaseURI creates an instance of the FrontendEndpointsClient 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 NewFrontendEndpointsClientWithBaseURI(baseURI string, subscriptionID string) FrontendEndpointsClient { + return FrontendEndpointsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// DisableHTTPS disables a frontendEndpoint for HTTPS traffic +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// frontDoorName - name of the Front Door which is globally unique. +// frontendEndpointName - name of the Frontend endpoint which is unique within the Front Door. +func (client FrontendEndpointsClient) DisableHTTPS(ctx context.Context, resourceGroupName string, frontDoorName string, frontendEndpointName string) (result FrontendEndpointsDisableHTTPSFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FrontendEndpointsClient.DisableHTTPS") + 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: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: frontDoorName, + Constraints: []validation.Constraint{{Target: "frontDoorName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "frontDoorName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "frontDoorName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$`, Chain: nil}}}, + {TargetValue: frontendEndpointName, + Constraints: []validation.Constraint{{Target: "frontendEndpointName", Name: validation.MaxLength, Rule: 255, Chain: nil}, + {Target: "frontendEndpointName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "frontendEndpointName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.FrontendEndpointsClient", "DisableHTTPS", err.Error()) + } + + req, err := client.DisableHTTPSPreparer(ctx, resourceGroupName, frontDoorName, frontendEndpointName) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.FrontendEndpointsClient", "DisableHTTPS", nil, "Failure preparing request") + return + } + + result, err = client.DisableHTTPSSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.FrontendEndpointsClient", "DisableHTTPS", result.Response(), "Failure sending request") + return + } + + return +} + +// DisableHTTPSPreparer prepares the DisableHTTPS request. +func (client FrontendEndpointsClient) DisableHTTPSPreparer(ctx context.Context, resourceGroupName string, frontDoorName string, frontendEndpointName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "frontDoorName": autorest.Encode("path", frontDoorName), + "frontendEndpointName": autorest.Encode("path", frontendEndpointName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-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.Network/frontDoors/{frontDoorName}/frontendEndpoints/{frontendEndpointName}/disableHttps", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DisableHTTPSSender sends the DisableHTTPS request. The method will close the +// http.Response Body if it receives an error. +func (client FrontendEndpointsClient) DisableHTTPSSender(req *http.Request) (future FrontendEndpointsDisableHTTPSFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DisableHTTPSResponder handles the response to the DisableHTTPS request. The method always +// closes the http.Response Body. +func (client FrontendEndpointsClient) DisableHTTPSResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// EnableHTTPS enables a frontendEndpoint for HTTPS traffic +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// frontDoorName - name of the Front Door which is globally unique. +// frontendEndpointName - name of the Frontend endpoint which is unique within the Front Door. +// customHTTPSConfiguration - the configuration specifying how to enable HTTPS +func (client FrontendEndpointsClient) EnableHTTPS(ctx context.Context, resourceGroupName string, frontDoorName string, frontendEndpointName string, customHTTPSConfiguration CustomHTTPSConfiguration) (result FrontendEndpointsEnableHTTPSFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FrontendEndpointsClient.EnableHTTPS") + 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: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: frontDoorName, + Constraints: []validation.Constraint{{Target: "frontDoorName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "frontDoorName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "frontDoorName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$`, Chain: nil}}}, + {TargetValue: frontendEndpointName, + Constraints: []validation.Constraint{{Target: "frontendEndpointName", Name: validation.MaxLength, Rule: 255, Chain: nil}, + {Target: "frontendEndpointName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "frontendEndpointName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}, + {TargetValue: customHTTPSConfiguration, + Constraints: []validation.Constraint{{Target: "customHTTPSConfiguration.ProtocolType", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.FrontendEndpointsClient", "EnableHTTPS", err.Error()) + } + + req, err := client.EnableHTTPSPreparer(ctx, resourceGroupName, frontDoorName, frontendEndpointName, customHTTPSConfiguration) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.FrontendEndpointsClient", "EnableHTTPS", nil, "Failure preparing request") + return + } + + result, err = client.EnableHTTPSSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.FrontendEndpointsClient", "EnableHTTPS", result.Response(), "Failure sending request") + return + } + + return +} + +// EnableHTTPSPreparer prepares the EnableHTTPS request. +func (client FrontendEndpointsClient) EnableHTTPSPreparer(ctx context.Context, resourceGroupName string, frontDoorName string, frontendEndpointName string, customHTTPSConfiguration CustomHTTPSConfiguration) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "frontDoorName": autorest.Encode("path", frontDoorName), + "frontendEndpointName": autorest.Encode("path", frontendEndpointName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-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.Network/frontDoors/{frontDoorName}/frontendEndpoints/{frontendEndpointName}/enableHttps", pathParameters), + autorest.WithJSON(customHTTPSConfiguration), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// EnableHTTPSSender sends the EnableHTTPS request. The method will close the +// http.Response Body if it receives an error. +func (client FrontendEndpointsClient) EnableHTTPSSender(req *http.Request) (future FrontendEndpointsEnableHTTPSFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// EnableHTTPSResponder handles the response to the EnableHTTPS request. The method always +// closes the http.Response Body. +func (client FrontendEndpointsClient) EnableHTTPSResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets a Frontend endpoint with the specified name within the specified Front Door. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// frontDoorName - name of the Front Door which is globally unique. +// frontendEndpointName - name of the Frontend endpoint which is unique within the Front Door. +func (client FrontendEndpointsClient) Get(ctx context.Context, resourceGroupName string, frontDoorName string, frontendEndpointName string) (result FrontendEndpoint, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FrontendEndpointsClient.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: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: frontDoorName, + Constraints: []validation.Constraint{{Target: "frontDoorName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "frontDoorName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "frontDoorName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$`, Chain: nil}}}, + {TargetValue: frontendEndpointName, + Constraints: []validation.Constraint{{Target: "frontendEndpointName", Name: validation.MaxLength, Rule: 255, Chain: nil}, + {Target: "frontendEndpointName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "frontendEndpointName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.FrontendEndpointsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, frontDoorName, frontendEndpointName) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.FrontendEndpointsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "frontdoor.FrontendEndpointsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.FrontendEndpointsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client FrontendEndpointsClient) GetPreparer(ctx context.Context, resourceGroupName string, frontDoorName string, frontendEndpointName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "frontDoorName": autorest.Encode("path", frontDoorName), + "frontendEndpointName": autorest.Encode("path", frontendEndpointName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/frontendEndpoints/{frontendEndpointName}", 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 FrontendEndpointsClient) 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 FrontendEndpointsClient) GetResponder(resp *http.Response) (result FrontendEndpoint, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByFrontDoor lists all of the frontend endpoints within a Front Door. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// frontDoorName - name of the Front Door which is globally unique. +func (client FrontendEndpointsClient) ListByFrontDoor(ctx context.Context, resourceGroupName string, frontDoorName string) (result FrontendEndpointsListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FrontendEndpointsClient.ListByFrontDoor") + defer func() { + sc := -1 + if result.felr.Response.Response != nil { + sc = result.felr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: frontDoorName, + Constraints: []validation.Constraint{{Target: "frontDoorName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "frontDoorName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "frontDoorName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.FrontendEndpointsClient", "ListByFrontDoor", err.Error()) + } + + result.fn = client.listByFrontDoorNextResults + req, err := client.ListByFrontDoorPreparer(ctx, resourceGroupName, frontDoorName) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.FrontendEndpointsClient", "ListByFrontDoor", nil, "Failure preparing request") + return + } + + resp, err := client.ListByFrontDoorSender(req) + if err != nil { + result.felr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "frontdoor.FrontendEndpointsClient", "ListByFrontDoor", resp, "Failure sending request") + return + } + + result.felr, err = client.ListByFrontDoorResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.FrontendEndpointsClient", "ListByFrontDoor", resp, "Failure responding to request") + } + + return +} + +// ListByFrontDoorPreparer prepares the ListByFrontDoor request. +func (client FrontendEndpointsClient) ListByFrontDoorPreparer(ctx context.Context, resourceGroupName string, frontDoorName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "frontDoorName": autorest.Encode("path", frontDoorName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/frontendEndpoints", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByFrontDoorSender sends the ListByFrontDoor request. The method will close the +// http.Response Body if it receives an error. +func (client FrontendEndpointsClient) ListByFrontDoorSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByFrontDoorResponder handles the response to the ListByFrontDoor request. The method always +// closes the http.Response Body. +func (client FrontendEndpointsClient) ListByFrontDoorResponder(resp *http.Response) (result FrontendEndpointsListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByFrontDoorNextResults retrieves the next set of results, if any. +func (client FrontendEndpointsClient) listByFrontDoorNextResults(ctx context.Context, lastResults FrontendEndpointsListResult) (result FrontendEndpointsListResult, err error) { + req, err := lastResults.frontendEndpointsListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "frontdoor.FrontendEndpointsClient", "listByFrontDoorNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByFrontDoorSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "frontdoor.FrontendEndpointsClient", "listByFrontDoorNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByFrontDoorResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.FrontendEndpointsClient", "listByFrontDoorNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByFrontDoorComplete enumerates all values, automatically crossing page boundaries as required. +func (client FrontendEndpointsClient) ListByFrontDoorComplete(ctx context.Context, resourceGroupName string, frontDoorName string) (result FrontendEndpointsListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FrontendEndpointsClient.ListByFrontDoor") + 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.ListByFrontDoor(ctx, resourceGroupName, frontDoorName) + return +} diff --git a/services/frontdoor/mgmt/2020-04-01/frontdoor/managedrulesets.go b/services/frontdoor/mgmt/2020-04-01/frontdoor/managedrulesets.go new file mode 100644 index 000000000000..a834ab7616fb --- /dev/null +++ b/services/frontdoor/mgmt/2020-04-01/frontdoor/managedrulesets.go @@ -0,0 +1,151 @@ +package frontdoor + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// ManagedRuleSetsClient is the frontDoor Client +type ManagedRuleSetsClient struct { + BaseClient +} + +// NewManagedRuleSetsClient creates an instance of the ManagedRuleSetsClient client. +func NewManagedRuleSetsClient(subscriptionID string) ManagedRuleSetsClient { + return NewManagedRuleSetsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewManagedRuleSetsClientWithBaseURI creates an instance of the ManagedRuleSetsClient 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 NewManagedRuleSetsClientWithBaseURI(baseURI string, subscriptionID string) ManagedRuleSetsClient { + return ManagedRuleSetsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List lists all available managed rule sets. +func (client ManagedRuleSetsClient) List(ctx context.Context) (result ManagedRuleSetDefinitionListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedRuleSetsClient.List") + defer func() { + sc := -1 + if result.mrsdl.Response.Response != nil { + sc = result.mrsdl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ManagedRuleSetsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.mrsdl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "frontdoor.ManagedRuleSetsClient", "List", resp, "Failure sending request") + return + } + + result.mrsdl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ManagedRuleSetsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client ManagedRuleSetsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/FrontDoorWebApplicationFirewallManagedRuleSets", 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 ManagedRuleSetsClient) 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 ManagedRuleSetsClient) ListResponder(resp *http.Response) (result ManagedRuleSetDefinitionList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 ManagedRuleSetsClient) listNextResults(ctx context.Context, lastResults ManagedRuleSetDefinitionList) (result ManagedRuleSetDefinitionList, err error) { + req, err := lastResults.managedRuleSetDefinitionListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "frontdoor.ManagedRuleSetsClient", "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, "frontdoor.ManagedRuleSetsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ManagedRuleSetsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ManagedRuleSetsClient) ListComplete(ctx context.Context) (result ManagedRuleSetDefinitionListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedRuleSetsClient.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/frontdoor/mgmt/2020-04-01/frontdoor/models.go b/services/frontdoor/mgmt/2020-04-01/frontdoor/models.go new file mode 100644 index 000000000000..1ff850208700 --- /dev/null +++ b/services/frontdoor/mgmt/2020-04-01/frontdoor/models.go @@ -0,0 +1,5220 @@ +package frontdoor + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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/frontdoor/mgmt/2020-04-01/frontdoor" + +// ActionType enumerates the values for action type. +type ActionType string + +const ( + // Allow ... + Allow ActionType = "Allow" + // Block ... + Block ActionType = "Block" + // Log ... + Log ActionType = "Log" + // Redirect ... + Redirect ActionType = "Redirect" +) + +// PossibleActionTypeValues returns an array of possible values for the ActionType const type. +func PossibleActionTypeValues() []ActionType { + return []ActionType{Allow, Block, Log, Redirect} +} + +// AggregationInterval enumerates the values for aggregation interval. +type AggregationInterval string + +const ( + // Daily ... + Daily AggregationInterval = "Daily" + // Hourly ... + Hourly AggregationInterval = "Hourly" +) + +// PossibleAggregationIntervalValues returns an array of possible values for the AggregationInterval const type. +func PossibleAggregationIntervalValues() []AggregationInterval { + return []AggregationInterval{Daily, Hourly} +} + +// Availability enumerates the values for availability. +type Availability string + +const ( + // Available ... + Available Availability = "Available" + // Unavailable ... + Unavailable Availability = "Unavailable" +) + +// PossibleAvailabilityValues returns an array of possible values for the Availability const type. +func PossibleAvailabilityValues() []Availability { + return []Availability{Available, Unavailable} +} + +// BackendEnabledState enumerates the values for backend enabled state. +type BackendEnabledState string + +const ( + // Disabled ... + Disabled BackendEnabledState = "Disabled" + // Enabled ... + Enabled BackendEnabledState = "Enabled" +) + +// PossibleBackendEnabledStateValues returns an array of possible values for the BackendEnabledState const type. +func PossibleBackendEnabledStateValues() []BackendEnabledState { + return []BackendEnabledState{Disabled, Enabled} +} + +// CertificateSource enumerates the values for certificate source. +type CertificateSource string + +const ( + // CertificateSourceAzureKeyVault ... + CertificateSourceAzureKeyVault CertificateSource = "AzureKeyVault" + // CertificateSourceFrontDoor ... + CertificateSourceFrontDoor CertificateSource = "FrontDoor" +) + +// PossibleCertificateSourceValues returns an array of possible values for the CertificateSource const type. +func PossibleCertificateSourceValues() []CertificateSource { + return []CertificateSource{CertificateSourceAzureKeyVault, CertificateSourceFrontDoor} +} + +// CertificateType enumerates the values for certificate type. +type CertificateType string + +const ( + // Dedicated ... + Dedicated CertificateType = "Dedicated" +) + +// PossibleCertificateTypeValues returns an array of possible values for the CertificateType const type. +func PossibleCertificateTypeValues() []CertificateType { + return []CertificateType{Dedicated} +} + +// CustomHTTPSProvisioningState enumerates the values for custom https provisioning state. +type CustomHTTPSProvisioningState string + +const ( + // CustomHTTPSProvisioningStateDisabled ... + CustomHTTPSProvisioningStateDisabled CustomHTTPSProvisioningState = "Disabled" + // CustomHTTPSProvisioningStateDisabling ... + CustomHTTPSProvisioningStateDisabling CustomHTTPSProvisioningState = "Disabling" + // CustomHTTPSProvisioningStateEnabled ... + CustomHTTPSProvisioningStateEnabled CustomHTTPSProvisioningState = "Enabled" + // CustomHTTPSProvisioningStateEnabling ... + CustomHTTPSProvisioningStateEnabling CustomHTTPSProvisioningState = "Enabling" + // CustomHTTPSProvisioningStateFailed ... + CustomHTTPSProvisioningStateFailed CustomHTTPSProvisioningState = "Failed" +) + +// PossibleCustomHTTPSProvisioningStateValues returns an array of possible values for the CustomHTTPSProvisioningState const type. +func PossibleCustomHTTPSProvisioningStateValues() []CustomHTTPSProvisioningState { + return []CustomHTTPSProvisioningState{CustomHTTPSProvisioningStateDisabled, CustomHTTPSProvisioningStateDisabling, CustomHTTPSProvisioningStateEnabled, CustomHTTPSProvisioningStateEnabling, CustomHTTPSProvisioningStateFailed} +} + +// CustomHTTPSProvisioningSubstate enumerates the values for custom https provisioning substate. +type CustomHTTPSProvisioningSubstate string + +const ( + // CertificateDeleted ... + CertificateDeleted CustomHTTPSProvisioningSubstate = "CertificateDeleted" + // CertificateDeployed ... + CertificateDeployed CustomHTTPSProvisioningSubstate = "CertificateDeployed" + // DeletingCertificate ... + DeletingCertificate CustomHTTPSProvisioningSubstate = "DeletingCertificate" + // DeployingCertificate ... + DeployingCertificate CustomHTTPSProvisioningSubstate = "DeployingCertificate" + // DomainControlValidationRequestApproved ... + DomainControlValidationRequestApproved CustomHTTPSProvisioningSubstate = "DomainControlValidationRequestApproved" + // DomainControlValidationRequestRejected ... + DomainControlValidationRequestRejected CustomHTTPSProvisioningSubstate = "DomainControlValidationRequestRejected" + // DomainControlValidationRequestTimedOut ... + DomainControlValidationRequestTimedOut CustomHTTPSProvisioningSubstate = "DomainControlValidationRequestTimedOut" + // IssuingCertificate ... + IssuingCertificate CustomHTTPSProvisioningSubstate = "IssuingCertificate" + // PendingDomainControlValidationREquestApproval ... + PendingDomainControlValidationREquestApproval CustomHTTPSProvisioningSubstate = "PendingDomainControlValidationREquestApproval" + // SubmittingDomainControlValidationRequest ... + SubmittingDomainControlValidationRequest CustomHTTPSProvisioningSubstate = "SubmittingDomainControlValidationRequest" +) + +// PossibleCustomHTTPSProvisioningSubstateValues returns an array of possible values for the CustomHTTPSProvisioningSubstate const type. +func PossibleCustomHTTPSProvisioningSubstateValues() []CustomHTTPSProvisioningSubstate { + return []CustomHTTPSProvisioningSubstate{CertificateDeleted, CertificateDeployed, DeletingCertificate, DeployingCertificate, DomainControlValidationRequestApproved, DomainControlValidationRequestRejected, DomainControlValidationRequestTimedOut, IssuingCertificate, PendingDomainControlValidationREquestApproval, SubmittingDomainControlValidationRequest} +} + +// CustomRuleEnabledState enumerates the values for custom rule enabled state. +type CustomRuleEnabledState string + +const ( + // CustomRuleEnabledStateDisabled ... + CustomRuleEnabledStateDisabled CustomRuleEnabledState = "Disabled" + // CustomRuleEnabledStateEnabled ... + CustomRuleEnabledStateEnabled CustomRuleEnabledState = "Enabled" +) + +// PossibleCustomRuleEnabledStateValues returns an array of possible values for the CustomRuleEnabledState const type. +func PossibleCustomRuleEnabledStateValues() []CustomRuleEnabledState { + return []CustomRuleEnabledState{CustomRuleEnabledStateDisabled, CustomRuleEnabledStateEnabled} +} + +// DynamicCompressionEnabled enumerates the values for dynamic compression enabled. +type DynamicCompressionEnabled string + +const ( + // DynamicCompressionEnabledDisabled ... + DynamicCompressionEnabledDisabled DynamicCompressionEnabled = "Disabled" + // DynamicCompressionEnabledEnabled ... + DynamicCompressionEnabledEnabled DynamicCompressionEnabled = "Enabled" +) + +// PossibleDynamicCompressionEnabledValues returns an array of possible values for the DynamicCompressionEnabled const type. +func PossibleDynamicCompressionEnabledValues() []DynamicCompressionEnabled { + return []DynamicCompressionEnabled{DynamicCompressionEnabledDisabled, DynamicCompressionEnabledEnabled} +} + +// EnabledState enumerates the values for enabled state. +type EnabledState string + +const ( + // EnabledStateDisabled ... + EnabledStateDisabled EnabledState = "Disabled" + // EnabledStateEnabled ... + EnabledStateEnabled EnabledState = "Enabled" +) + +// PossibleEnabledStateValues returns an array of possible values for the EnabledState const type. +func PossibleEnabledStateValues() []EnabledState { + return []EnabledState{EnabledStateDisabled, EnabledStateEnabled} +} + +// EndpointType enumerates the values for endpoint type. +type EndpointType string + +const ( + // AFD ... + AFD EndpointType = "AFD" + // ATM ... + ATM EndpointType = "ATM" + // AzureRegion ... + AzureRegion EndpointType = "AzureRegion" + // CDN ... + CDN EndpointType = "CDN" +) + +// PossibleEndpointTypeValues returns an array of possible values for the EndpointType const type. +func PossibleEndpointTypeValues() []EndpointType { + return []EndpointType{AFD, ATM, AzureRegion, CDN} +} + +// EnforceCertificateNameCheckEnabledState enumerates the values for enforce certificate name check enabled +// state. +type EnforceCertificateNameCheckEnabledState string + +const ( + // EnforceCertificateNameCheckEnabledStateDisabled ... + EnforceCertificateNameCheckEnabledStateDisabled EnforceCertificateNameCheckEnabledState = "Disabled" + // EnforceCertificateNameCheckEnabledStateEnabled ... + EnforceCertificateNameCheckEnabledStateEnabled EnforceCertificateNameCheckEnabledState = "Enabled" +) + +// PossibleEnforceCertificateNameCheckEnabledStateValues returns an array of possible values for the EnforceCertificateNameCheckEnabledState const type. +func PossibleEnforceCertificateNameCheckEnabledStateValues() []EnforceCertificateNameCheckEnabledState { + return []EnforceCertificateNameCheckEnabledState{EnforceCertificateNameCheckEnabledStateDisabled, EnforceCertificateNameCheckEnabledStateEnabled} +} + +// ForwardingProtocol enumerates the values for forwarding protocol. +type ForwardingProtocol string + +const ( + // HTTPOnly ... + HTTPOnly ForwardingProtocol = "HttpOnly" + // HTTPSOnly ... + HTTPSOnly ForwardingProtocol = "HttpsOnly" + // MatchRequest ... + MatchRequest ForwardingProtocol = "MatchRequest" +) + +// PossibleForwardingProtocolValues returns an array of possible values for the ForwardingProtocol const type. +func PossibleForwardingProtocolValues() []ForwardingProtocol { + return []ForwardingProtocol{HTTPOnly, HTTPSOnly, MatchRequest} +} + +// HeaderActionType enumerates the values for header action type. +type HeaderActionType string + +const ( + // Append ... + Append HeaderActionType = "Append" + // Delete ... + Delete HeaderActionType = "Delete" + // Overwrite ... + Overwrite HeaderActionType = "Overwrite" +) + +// PossibleHeaderActionTypeValues returns an array of possible values for the HeaderActionType const type. +func PossibleHeaderActionTypeValues() []HeaderActionType { + return []HeaderActionType{Append, Delete, Overwrite} +} + +// HealthProbeEnabled enumerates the values for health probe enabled. +type HealthProbeEnabled string + +const ( + // HealthProbeEnabledDisabled ... + HealthProbeEnabledDisabled HealthProbeEnabled = "Disabled" + // HealthProbeEnabledEnabled ... + HealthProbeEnabledEnabled HealthProbeEnabled = "Enabled" +) + +// PossibleHealthProbeEnabledValues returns an array of possible values for the HealthProbeEnabled const type. +func PossibleHealthProbeEnabledValues() []HealthProbeEnabled { + return []HealthProbeEnabled{HealthProbeEnabledDisabled, HealthProbeEnabledEnabled} +} + +// HealthProbeMethod enumerates the values for health probe method. +type HealthProbeMethod string + +const ( + // GET ... + GET HealthProbeMethod = "GET" + // HEAD ... + HEAD HealthProbeMethod = "HEAD" +) + +// PossibleHealthProbeMethodValues returns an array of possible values for the HealthProbeMethod const type. +func PossibleHealthProbeMethodValues() []HealthProbeMethod { + return []HealthProbeMethod{GET, HEAD} +} + +// LatencyScorecardAggregationInterval enumerates the values for latency scorecard aggregation interval. +type LatencyScorecardAggregationInterval string + +const ( + // LatencyScorecardAggregationIntervalDaily ... + LatencyScorecardAggregationIntervalDaily LatencyScorecardAggregationInterval = "Daily" + // LatencyScorecardAggregationIntervalMonthly ... + LatencyScorecardAggregationIntervalMonthly LatencyScorecardAggregationInterval = "Monthly" + // LatencyScorecardAggregationIntervalWeekly ... + LatencyScorecardAggregationIntervalWeekly LatencyScorecardAggregationInterval = "Weekly" +) + +// PossibleLatencyScorecardAggregationIntervalValues returns an array of possible values for the LatencyScorecardAggregationInterval const type. +func PossibleLatencyScorecardAggregationIntervalValues() []LatencyScorecardAggregationInterval { + return []LatencyScorecardAggregationInterval{LatencyScorecardAggregationIntervalDaily, LatencyScorecardAggregationIntervalMonthly, LatencyScorecardAggregationIntervalWeekly} +} + +// ManagedRuleEnabledState enumerates the values for managed rule enabled state. +type ManagedRuleEnabledState string + +const ( + // ManagedRuleEnabledStateDisabled ... + ManagedRuleEnabledStateDisabled ManagedRuleEnabledState = "Disabled" + // ManagedRuleEnabledStateEnabled ... + ManagedRuleEnabledStateEnabled ManagedRuleEnabledState = "Enabled" +) + +// PossibleManagedRuleEnabledStateValues returns an array of possible values for the ManagedRuleEnabledState const type. +func PossibleManagedRuleEnabledStateValues() []ManagedRuleEnabledState { + return []ManagedRuleEnabledState{ManagedRuleEnabledStateDisabled, ManagedRuleEnabledStateEnabled} +} + +// ManagedRuleExclusionMatchVariable enumerates the values for managed rule exclusion match variable. +type ManagedRuleExclusionMatchVariable string + +const ( + // QueryStringArgNames ... + QueryStringArgNames ManagedRuleExclusionMatchVariable = "QueryStringArgNames" + // RequestBodyPostArgNames ... + RequestBodyPostArgNames ManagedRuleExclusionMatchVariable = "RequestBodyPostArgNames" + // RequestCookieNames ... + RequestCookieNames ManagedRuleExclusionMatchVariable = "RequestCookieNames" + // RequestHeaderNames ... + RequestHeaderNames ManagedRuleExclusionMatchVariable = "RequestHeaderNames" +) + +// PossibleManagedRuleExclusionMatchVariableValues returns an array of possible values for the ManagedRuleExclusionMatchVariable const type. +func PossibleManagedRuleExclusionMatchVariableValues() []ManagedRuleExclusionMatchVariable { + return []ManagedRuleExclusionMatchVariable{QueryStringArgNames, RequestBodyPostArgNames, RequestCookieNames, RequestHeaderNames} +} + +// ManagedRuleExclusionSelectorMatchOperator enumerates the values for managed rule exclusion selector match +// operator. +type ManagedRuleExclusionSelectorMatchOperator string + +const ( + // Contains ... + Contains ManagedRuleExclusionSelectorMatchOperator = "Contains" + // EndsWith ... + EndsWith ManagedRuleExclusionSelectorMatchOperator = "EndsWith" + // Equals ... + Equals ManagedRuleExclusionSelectorMatchOperator = "Equals" + // EqualsAny ... + EqualsAny ManagedRuleExclusionSelectorMatchOperator = "EqualsAny" + // StartsWith ... + StartsWith ManagedRuleExclusionSelectorMatchOperator = "StartsWith" +) + +// PossibleManagedRuleExclusionSelectorMatchOperatorValues returns an array of possible values for the ManagedRuleExclusionSelectorMatchOperator const type. +func PossibleManagedRuleExclusionSelectorMatchOperatorValues() []ManagedRuleExclusionSelectorMatchOperator { + return []ManagedRuleExclusionSelectorMatchOperator{Contains, EndsWith, Equals, EqualsAny, StartsWith} +} + +// MatchProcessingBehavior enumerates the values for match processing behavior. +type MatchProcessingBehavior string + +const ( + // Continue ... + Continue MatchProcessingBehavior = "Continue" + // Stop ... + Stop MatchProcessingBehavior = "Stop" +) + +// PossibleMatchProcessingBehaviorValues returns an array of possible values for the MatchProcessingBehavior const type. +func PossibleMatchProcessingBehaviorValues() []MatchProcessingBehavior { + return []MatchProcessingBehavior{Continue, Stop} +} + +// MatchVariable enumerates the values for match variable. +type MatchVariable string + +const ( + // Cookies ... + Cookies MatchVariable = "Cookies" + // PostArgs ... + PostArgs MatchVariable = "PostArgs" + // QueryString ... + QueryString MatchVariable = "QueryString" + // RemoteAddr ... + RemoteAddr MatchVariable = "RemoteAddr" + // RequestBody ... + RequestBody MatchVariable = "RequestBody" + // RequestHeader ... + RequestHeader MatchVariable = "RequestHeader" + // RequestMethod ... + RequestMethod MatchVariable = "RequestMethod" + // RequestURI ... + RequestURI MatchVariable = "RequestUri" + // SocketAddr ... + SocketAddr MatchVariable = "SocketAddr" +) + +// PossibleMatchVariableValues returns an array of possible values for the MatchVariable const type. +func PossibleMatchVariableValues() []MatchVariable { + return []MatchVariable{Cookies, PostArgs, QueryString, RemoteAddr, RequestBody, RequestHeader, RequestMethod, RequestURI, SocketAddr} +} + +// MinimumTLSVersion enumerates the values for minimum tls version. +type MinimumTLSVersion string + +const ( + // OneFullStopTwo ... + OneFullStopTwo MinimumTLSVersion = "1.2" + // OneFullStopZero ... + OneFullStopZero MinimumTLSVersion = "1.0" +) + +// PossibleMinimumTLSVersionValues returns an array of possible values for the MinimumTLSVersion const type. +func PossibleMinimumTLSVersionValues() []MinimumTLSVersion { + return []MinimumTLSVersion{OneFullStopTwo, OneFullStopZero} +} + +// NetworkExperimentResourceState enumerates the values for network experiment resource state. +type NetworkExperimentResourceState string + +const ( + // NetworkExperimentResourceStateCreating ... + NetworkExperimentResourceStateCreating NetworkExperimentResourceState = "Creating" + // NetworkExperimentResourceStateDeleting ... + NetworkExperimentResourceStateDeleting NetworkExperimentResourceState = "Deleting" + // NetworkExperimentResourceStateDisabled ... + NetworkExperimentResourceStateDisabled NetworkExperimentResourceState = "Disabled" + // NetworkExperimentResourceStateDisabling ... + NetworkExperimentResourceStateDisabling NetworkExperimentResourceState = "Disabling" + // NetworkExperimentResourceStateEnabled ... + NetworkExperimentResourceStateEnabled NetworkExperimentResourceState = "Enabled" + // NetworkExperimentResourceStateEnabling ... + NetworkExperimentResourceStateEnabling NetworkExperimentResourceState = "Enabling" +) + +// PossibleNetworkExperimentResourceStateValues returns an array of possible values for the NetworkExperimentResourceState const type. +func PossibleNetworkExperimentResourceStateValues() []NetworkExperimentResourceState { + return []NetworkExperimentResourceState{NetworkExperimentResourceStateCreating, NetworkExperimentResourceStateDeleting, NetworkExperimentResourceStateDisabled, NetworkExperimentResourceStateDisabling, NetworkExperimentResourceStateEnabled, NetworkExperimentResourceStateEnabling} +} + +// NetworkOperationStatus enumerates the values for network operation status. +type NetworkOperationStatus string + +const ( + // Failed ... + Failed NetworkOperationStatus = "Failed" + // InProgress ... + InProgress NetworkOperationStatus = "InProgress" + // Succeeded ... + Succeeded NetworkOperationStatus = "Succeeded" +) + +// PossibleNetworkOperationStatusValues returns an array of possible values for the NetworkOperationStatus const type. +func PossibleNetworkOperationStatusValues() []NetworkOperationStatus { + return []NetworkOperationStatus{Failed, InProgress, Succeeded} +} + +// OdataType enumerates the values for odata type. +type OdataType string + +const ( + // OdataTypeMicrosoftAzureFrontDoorModelsFrontdoorForwardingConfiguration ... + OdataTypeMicrosoftAzureFrontDoorModelsFrontdoorForwardingConfiguration OdataType = "#Microsoft.Azure.FrontDoor.Models.FrontdoorForwardingConfiguration" + // OdataTypeMicrosoftAzureFrontDoorModelsFrontdoorRedirectConfiguration ... + OdataTypeMicrosoftAzureFrontDoorModelsFrontdoorRedirectConfiguration OdataType = "#Microsoft.Azure.FrontDoor.Models.FrontdoorRedirectConfiguration" + // OdataTypeRouteConfiguration ... + OdataTypeRouteConfiguration OdataType = "RouteConfiguration" +) + +// PossibleOdataTypeValues returns an array of possible values for the OdataType const type. +func PossibleOdataTypeValues() []OdataType { + return []OdataType{OdataTypeMicrosoftAzureFrontDoorModelsFrontdoorForwardingConfiguration, OdataTypeMicrosoftAzureFrontDoorModelsFrontdoorRedirectConfiguration, OdataTypeRouteConfiguration} +} + +// Operator enumerates the values for operator. +type Operator string + +const ( + // OperatorAny ... + OperatorAny Operator = "Any" + // OperatorBeginsWith ... + OperatorBeginsWith Operator = "BeginsWith" + // OperatorContains ... + OperatorContains Operator = "Contains" + // OperatorEndsWith ... + OperatorEndsWith Operator = "EndsWith" + // OperatorEqual ... + OperatorEqual Operator = "Equal" + // OperatorGeoMatch ... + OperatorGeoMatch Operator = "GeoMatch" + // OperatorGreaterThan ... + OperatorGreaterThan Operator = "GreaterThan" + // OperatorGreaterThanOrEqual ... + OperatorGreaterThanOrEqual Operator = "GreaterThanOrEqual" + // OperatorIPMatch ... + OperatorIPMatch Operator = "IPMatch" + // OperatorLessThan ... + OperatorLessThan Operator = "LessThan" + // OperatorLessThanOrEqual ... + OperatorLessThanOrEqual Operator = "LessThanOrEqual" + // OperatorRegEx ... + OperatorRegEx Operator = "RegEx" +) + +// PossibleOperatorValues returns an array of possible values for the Operator const type. +func PossibleOperatorValues() []Operator { + return []Operator{OperatorAny, OperatorBeginsWith, OperatorContains, OperatorEndsWith, OperatorEqual, OperatorGeoMatch, OperatorGreaterThan, OperatorGreaterThanOrEqual, OperatorIPMatch, OperatorLessThan, OperatorLessThanOrEqual, OperatorRegEx} +} + +// PolicyEnabledState enumerates the values for policy enabled state. +type PolicyEnabledState string + +const ( + // PolicyEnabledStateDisabled ... + PolicyEnabledStateDisabled PolicyEnabledState = "Disabled" + // PolicyEnabledStateEnabled ... + PolicyEnabledStateEnabled PolicyEnabledState = "Enabled" +) + +// PossiblePolicyEnabledStateValues returns an array of possible values for the PolicyEnabledState const type. +func PossiblePolicyEnabledStateValues() []PolicyEnabledState { + return []PolicyEnabledState{PolicyEnabledStateDisabled, PolicyEnabledStateEnabled} +} + +// PolicyMode enumerates the values for policy mode. +type PolicyMode string + +const ( + // Detection ... + Detection PolicyMode = "Detection" + // Prevention ... + Prevention PolicyMode = "Prevention" +) + +// PossiblePolicyModeValues returns an array of possible values for the PolicyMode const type. +func PossiblePolicyModeValues() []PolicyMode { + return []PolicyMode{Detection, Prevention} +} + +// PolicyResourceState enumerates the values for policy resource state. +type PolicyResourceState string + +const ( + // PolicyResourceStateCreating ... + PolicyResourceStateCreating PolicyResourceState = "Creating" + // PolicyResourceStateDeleting ... + PolicyResourceStateDeleting PolicyResourceState = "Deleting" + // PolicyResourceStateDisabled ... + PolicyResourceStateDisabled PolicyResourceState = "Disabled" + // PolicyResourceStateDisabling ... + PolicyResourceStateDisabling PolicyResourceState = "Disabling" + // PolicyResourceStateEnabled ... + PolicyResourceStateEnabled PolicyResourceState = "Enabled" + // PolicyResourceStateEnabling ... + PolicyResourceStateEnabling PolicyResourceState = "Enabling" +) + +// PossiblePolicyResourceStateValues returns an array of possible values for the PolicyResourceState const type. +func PossiblePolicyResourceStateValues() []PolicyResourceState { + return []PolicyResourceState{PolicyResourceStateCreating, PolicyResourceStateDeleting, PolicyResourceStateDisabled, PolicyResourceStateDisabling, PolicyResourceStateEnabled, PolicyResourceStateEnabling} +} + +// PrivateEndpointStatus enumerates the values for private endpoint status. +type PrivateEndpointStatus string + +const ( + // Approved ... + Approved PrivateEndpointStatus = "Approved" + // Disconnected ... + Disconnected PrivateEndpointStatus = "Disconnected" + // Pending ... + Pending PrivateEndpointStatus = "Pending" + // Rejected ... + Rejected PrivateEndpointStatus = "Rejected" + // Timeout ... + Timeout PrivateEndpointStatus = "Timeout" +) + +// PossiblePrivateEndpointStatusValues returns an array of possible values for the PrivateEndpointStatus const type. +func PossiblePrivateEndpointStatusValues() []PrivateEndpointStatus { + return []PrivateEndpointStatus{Approved, Disconnected, Pending, Rejected, Timeout} +} + +// Protocol enumerates the values for protocol. +type Protocol string + +const ( + // HTTP ... + HTTP Protocol = "Http" + // HTTPS ... + HTTPS Protocol = "Https" +) + +// PossibleProtocolValues returns an array of possible values for the Protocol const type. +func PossibleProtocolValues() []Protocol { + return []Protocol{HTTP, HTTPS} +} + +// Query enumerates the values for query. +type Query string + +const ( + // StripAll ... + StripAll Query = "StripAll" + // StripAllExcept ... + StripAllExcept Query = "StripAllExcept" + // StripNone ... + StripNone Query = "StripNone" + // StripOnly ... + StripOnly Query = "StripOnly" +) + +// PossibleQueryValues returns an array of possible values for the Query const type. +func PossibleQueryValues() []Query { + return []Query{StripAll, StripAllExcept, StripNone, StripOnly} +} + +// RedirectProtocol enumerates the values for redirect protocol. +type RedirectProtocol string + +const ( + // RedirectProtocolHTTPOnly ... + RedirectProtocolHTTPOnly RedirectProtocol = "HttpOnly" + // RedirectProtocolHTTPSOnly ... + RedirectProtocolHTTPSOnly RedirectProtocol = "HttpsOnly" + // RedirectProtocolMatchRequest ... + RedirectProtocolMatchRequest RedirectProtocol = "MatchRequest" +) + +// PossibleRedirectProtocolValues returns an array of possible values for the RedirectProtocol const type. +func PossibleRedirectProtocolValues() []RedirectProtocol { + return []RedirectProtocol{RedirectProtocolHTTPOnly, RedirectProtocolHTTPSOnly, RedirectProtocolMatchRequest} +} + +// RedirectType enumerates the values for redirect type. +type RedirectType string + +const ( + // Found ... + Found RedirectType = "Found" + // Moved ... + Moved RedirectType = "Moved" + // PermanentRedirect ... + PermanentRedirect RedirectType = "PermanentRedirect" + // TemporaryRedirect ... + TemporaryRedirect RedirectType = "TemporaryRedirect" +) + +// PossibleRedirectTypeValues returns an array of possible values for the RedirectType const type. +func PossibleRedirectTypeValues() []RedirectType { + return []RedirectType{Found, Moved, PermanentRedirect, TemporaryRedirect} +} + +// ResourceState enumerates the values for resource state. +type ResourceState string + +const ( + // ResourceStateCreating ... + ResourceStateCreating ResourceState = "Creating" + // ResourceStateDeleting ... + ResourceStateDeleting ResourceState = "Deleting" + // ResourceStateDisabled ... + ResourceStateDisabled ResourceState = "Disabled" + // ResourceStateDisabling ... + ResourceStateDisabling ResourceState = "Disabling" + // ResourceStateEnabled ... + ResourceStateEnabled ResourceState = "Enabled" + // ResourceStateEnabling ... + ResourceStateEnabling ResourceState = "Enabling" +) + +// PossibleResourceStateValues returns an array of possible values for the ResourceState const type. +func PossibleResourceStateValues() []ResourceState { + return []ResourceState{ResourceStateCreating, ResourceStateDeleting, ResourceStateDisabled, ResourceStateDisabling, ResourceStateEnabled, ResourceStateEnabling} +} + +// ResourceType enumerates the values for resource type. +type ResourceType string + +const ( + // MicrosoftNetworkfrontDoors ... + MicrosoftNetworkfrontDoors ResourceType = "Microsoft.Network/frontDoors" + // MicrosoftNetworkfrontDoorsfrontendEndpoints ... + MicrosoftNetworkfrontDoorsfrontendEndpoints ResourceType = "Microsoft.Network/frontDoors/frontendEndpoints" +) + +// PossibleResourceTypeValues returns an array of possible values for the ResourceType const type. +func PossibleResourceTypeValues() []ResourceType { + return []ResourceType{MicrosoftNetworkfrontDoors, MicrosoftNetworkfrontDoorsfrontendEndpoints} +} + +// RoutingRuleEnabledState enumerates the values for routing rule enabled state. +type RoutingRuleEnabledState string + +const ( + // RoutingRuleEnabledStateDisabled ... + RoutingRuleEnabledStateDisabled RoutingRuleEnabledState = "Disabled" + // RoutingRuleEnabledStateEnabled ... + RoutingRuleEnabledStateEnabled RoutingRuleEnabledState = "Enabled" +) + +// PossibleRoutingRuleEnabledStateValues returns an array of possible values for the RoutingRuleEnabledState const type. +func PossibleRoutingRuleEnabledStateValues() []RoutingRuleEnabledState { + return []RoutingRuleEnabledState{RoutingRuleEnabledStateDisabled, RoutingRuleEnabledStateEnabled} +} + +// RulesEngineMatchVariable enumerates the values for rules engine match variable. +type RulesEngineMatchVariable string + +const ( + // RulesEngineMatchVariableIsMobile ... + RulesEngineMatchVariableIsMobile RulesEngineMatchVariable = "IsMobile" + // RulesEngineMatchVariablePostArgs ... + RulesEngineMatchVariablePostArgs RulesEngineMatchVariable = "PostArgs" + // RulesEngineMatchVariableQueryString ... + RulesEngineMatchVariableQueryString RulesEngineMatchVariable = "QueryString" + // RulesEngineMatchVariableRemoteAddr ... + RulesEngineMatchVariableRemoteAddr RulesEngineMatchVariable = "RemoteAddr" + // RulesEngineMatchVariableRequestBody ... + RulesEngineMatchVariableRequestBody RulesEngineMatchVariable = "RequestBody" + // RulesEngineMatchVariableRequestFilename ... + RulesEngineMatchVariableRequestFilename RulesEngineMatchVariable = "RequestFilename" + // RulesEngineMatchVariableRequestFilenameExtension ... + RulesEngineMatchVariableRequestFilenameExtension RulesEngineMatchVariable = "RequestFilenameExtension" + // RulesEngineMatchVariableRequestHeader ... + RulesEngineMatchVariableRequestHeader RulesEngineMatchVariable = "RequestHeader" + // RulesEngineMatchVariableRequestMethod ... + RulesEngineMatchVariableRequestMethod RulesEngineMatchVariable = "RequestMethod" + // RulesEngineMatchVariableRequestPath ... + RulesEngineMatchVariableRequestPath RulesEngineMatchVariable = "RequestPath" + // RulesEngineMatchVariableRequestScheme ... + RulesEngineMatchVariableRequestScheme RulesEngineMatchVariable = "RequestScheme" + // RulesEngineMatchVariableRequestURI ... + RulesEngineMatchVariableRequestURI RulesEngineMatchVariable = "RequestUri" +) + +// PossibleRulesEngineMatchVariableValues returns an array of possible values for the RulesEngineMatchVariable const type. +func PossibleRulesEngineMatchVariableValues() []RulesEngineMatchVariable { + return []RulesEngineMatchVariable{RulesEngineMatchVariableIsMobile, RulesEngineMatchVariablePostArgs, RulesEngineMatchVariableQueryString, RulesEngineMatchVariableRemoteAddr, RulesEngineMatchVariableRequestBody, RulesEngineMatchVariableRequestFilename, RulesEngineMatchVariableRequestFilenameExtension, RulesEngineMatchVariableRequestHeader, RulesEngineMatchVariableRequestMethod, RulesEngineMatchVariableRequestPath, RulesEngineMatchVariableRequestScheme, RulesEngineMatchVariableRequestURI} +} + +// RulesEngineOperator enumerates the values for rules engine operator. +type RulesEngineOperator string + +const ( + // RulesEngineOperatorAny ... + RulesEngineOperatorAny RulesEngineOperator = "Any" + // RulesEngineOperatorBeginsWith ... + RulesEngineOperatorBeginsWith RulesEngineOperator = "BeginsWith" + // RulesEngineOperatorContains ... + RulesEngineOperatorContains RulesEngineOperator = "Contains" + // RulesEngineOperatorEndsWith ... + RulesEngineOperatorEndsWith RulesEngineOperator = "EndsWith" + // RulesEngineOperatorEqual ... + RulesEngineOperatorEqual RulesEngineOperator = "Equal" + // RulesEngineOperatorGeoMatch ... + RulesEngineOperatorGeoMatch RulesEngineOperator = "GeoMatch" + // RulesEngineOperatorGreaterThan ... + RulesEngineOperatorGreaterThan RulesEngineOperator = "GreaterThan" + // RulesEngineOperatorGreaterThanOrEqual ... + RulesEngineOperatorGreaterThanOrEqual RulesEngineOperator = "GreaterThanOrEqual" + // RulesEngineOperatorIPMatch ... + RulesEngineOperatorIPMatch RulesEngineOperator = "IPMatch" + // RulesEngineOperatorLessThan ... + RulesEngineOperatorLessThan RulesEngineOperator = "LessThan" + // RulesEngineOperatorLessThanOrEqual ... + RulesEngineOperatorLessThanOrEqual RulesEngineOperator = "LessThanOrEqual" +) + +// PossibleRulesEngineOperatorValues returns an array of possible values for the RulesEngineOperator const type. +func PossibleRulesEngineOperatorValues() []RulesEngineOperator { + return []RulesEngineOperator{RulesEngineOperatorAny, RulesEngineOperatorBeginsWith, RulesEngineOperatorContains, RulesEngineOperatorEndsWith, RulesEngineOperatorEqual, RulesEngineOperatorGeoMatch, RulesEngineOperatorGreaterThan, RulesEngineOperatorGreaterThanOrEqual, RulesEngineOperatorIPMatch, RulesEngineOperatorLessThan, RulesEngineOperatorLessThanOrEqual} +} + +// RuleType enumerates the values for rule type. +type RuleType string + +const ( + // MatchRule ... + MatchRule RuleType = "MatchRule" + // RateLimitRule ... + RateLimitRule RuleType = "RateLimitRule" +) + +// PossibleRuleTypeValues returns an array of possible values for the RuleType const type. +func PossibleRuleTypeValues() []RuleType { + return []RuleType{MatchRule, RateLimitRule} +} + +// SessionAffinityEnabledState enumerates the values for session affinity enabled state. +type SessionAffinityEnabledState string + +const ( + // SessionAffinityEnabledStateDisabled ... + SessionAffinityEnabledStateDisabled SessionAffinityEnabledState = "Disabled" + // SessionAffinityEnabledStateEnabled ... + SessionAffinityEnabledStateEnabled SessionAffinityEnabledState = "Enabled" +) + +// PossibleSessionAffinityEnabledStateValues returns an array of possible values for the SessionAffinityEnabledState const type. +func PossibleSessionAffinityEnabledStateValues() []SessionAffinityEnabledState { + return []SessionAffinityEnabledState{SessionAffinityEnabledStateDisabled, SessionAffinityEnabledStateEnabled} +} + +// State enumerates the values for state. +type State string + +const ( + // StateDisabled ... + StateDisabled State = "Disabled" + // StateEnabled ... + StateEnabled State = "Enabled" +) + +// PossibleStateValues returns an array of possible values for the State const type. +func PossibleStateValues() []State { + return []State{StateDisabled, StateEnabled} +} + +// TimeseriesAggregationInterval enumerates the values for timeseries aggregation interval. +type TimeseriesAggregationInterval string + +const ( + // TimeseriesAggregationIntervalDaily ... + TimeseriesAggregationIntervalDaily TimeseriesAggregationInterval = "Daily" + // TimeseriesAggregationIntervalHourly ... + TimeseriesAggregationIntervalHourly TimeseriesAggregationInterval = "Hourly" +) + +// PossibleTimeseriesAggregationIntervalValues returns an array of possible values for the TimeseriesAggregationInterval const type. +func PossibleTimeseriesAggregationIntervalValues() []TimeseriesAggregationInterval { + return []TimeseriesAggregationInterval{TimeseriesAggregationIntervalDaily, TimeseriesAggregationIntervalHourly} +} + +// TimeseriesType enumerates the values for timeseries type. +type TimeseriesType string + +const ( + // LatencyP50 ... + LatencyP50 TimeseriesType = "LatencyP50" + // LatencyP75 ... + LatencyP75 TimeseriesType = "LatencyP75" + // LatencyP95 ... + LatencyP95 TimeseriesType = "LatencyP95" + // MeasurementCounts ... + MeasurementCounts TimeseriesType = "MeasurementCounts" +) + +// PossibleTimeseriesTypeValues returns an array of possible values for the TimeseriesType const type. +func PossibleTimeseriesTypeValues() []TimeseriesType { + return []TimeseriesType{LatencyP50, LatencyP75, LatencyP95, MeasurementCounts} +} + +// Transform enumerates the values for transform. +type Transform string + +const ( + // Lowercase ... + Lowercase Transform = "Lowercase" + // RemoveNulls ... + RemoveNulls Transform = "RemoveNulls" + // Trim ... + Trim Transform = "Trim" + // Uppercase ... + Uppercase Transform = "Uppercase" + // URLDecode ... + URLDecode Transform = "UrlDecode" + // URLEncode ... + URLEncode Transform = "UrlEncode" +) + +// PossibleTransformValues returns an array of possible values for the Transform const type. +func PossibleTransformValues() []Transform { + return []Transform{Lowercase, RemoveNulls, Trim, Uppercase, URLDecode, URLEncode} +} + +// TransformType enumerates the values for transform type. +type TransformType string + +const ( + // TransformTypeLowercase ... + TransformTypeLowercase TransformType = "Lowercase" + // TransformTypeRemoveNulls ... + TransformTypeRemoveNulls TransformType = "RemoveNulls" + // TransformTypeTrim ... + TransformTypeTrim TransformType = "Trim" + // TransformTypeUppercase ... + TransformTypeUppercase TransformType = "Uppercase" + // TransformTypeURLDecode ... + TransformTypeURLDecode TransformType = "UrlDecode" + // TransformTypeURLEncode ... + TransformTypeURLEncode TransformType = "UrlEncode" +) + +// PossibleTransformTypeValues returns an array of possible values for the TransformType const type. +func PossibleTransformTypeValues() []TransformType { + return []TransformType{TransformTypeLowercase, TransformTypeRemoveNulls, TransformTypeTrim, TransformTypeUppercase, TransformTypeURLDecode, TransformTypeURLEncode} +} + +// AzureAsyncOperationResult the response body contains the status of the specified asynchronous operation, +// indicating whether it has succeeded, is in progress, or has failed. Note that this status is distinct +// from the HTTP status code returned for the Get Operation Status operation itself. If the asynchronous +// operation succeeded, the response body includes the HTTP status code for the successful request. If the +// asynchronous operation failed, the response body includes the HTTP status code for the failed request +// and error information regarding the failure. +type AzureAsyncOperationResult struct { + // Status - Status of the Azure async operation. Possible values are: 'InProgress', 'Succeeded', and 'Failed'. Possible values include: 'InProgress', 'Succeeded', 'Failed' + Status NetworkOperationStatus `json:"status,omitempty"` + Error *Error `json:"error,omitempty"` +} + +// Backend backend address of a frontDoor load balancer. +type Backend struct { + // Address - Location of the backend (IP address or FQDN) + Address *string `json:"address,omitempty"` + // PrivateLinkAlias - The Alias of the Private Link resource. Populating this optional field indicates that this backend is 'Private' + PrivateLinkAlias *string `json:"privateLinkAlias,omitempty"` + // PrivateEndpointStatus - READ-ONLY; The Approval status for the connection to the Private Link. Possible values include: 'Pending', 'Approved', 'Rejected', 'Disconnected', 'Timeout' + PrivateEndpointStatus PrivateEndpointStatus `json:"privateEndpointStatus,omitempty"` + // PrivateLinkApprovalMessage - A custom message to be included in the approval request to connect to the Private Link + PrivateLinkApprovalMessage *string `json:"privateLinkApprovalMessage,omitempty"` + // HTTPPort - The HTTP TCP port number. Must be between 1 and 65535. + HTTPPort *int32 `json:"httpPort,omitempty"` + // HTTPSPort - The HTTPS TCP port number. Must be between 1 and 65535. + HTTPSPort *int32 `json:"httpsPort,omitempty"` + // EnabledState - Whether to enable use of this backend. Permitted values are 'Enabled' or 'Disabled'. Possible values include: 'Enabled', 'Disabled' + EnabledState BackendEnabledState `json:"enabledState,omitempty"` + // Priority - Priority to use for load balancing. Higher priorities will not be used for load balancing if any lower priority backend is healthy. + Priority *int32 `json:"priority,omitempty"` + // Weight - Weight of this endpoint for load balancing purposes. + Weight *int32 `json:"weight,omitempty"` + // BackendHostHeader - The value to use as the host header sent to the backend. If blank or unspecified, this defaults to the incoming host. + BackendHostHeader *string `json:"backendHostHeader,omitempty"` +} + +// BackendPool a backend pool is a collection of backends that can be routed to. +type BackendPool struct { + // BackendPoolProperties - Properties of the Front Door Backend Pool + *BackendPoolProperties `json:"properties,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for BackendPool. +func (bp BackendPool) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if bp.BackendPoolProperties != nil { + objectMap["properties"] = bp.BackendPoolProperties + } + if bp.Name != nil { + objectMap["name"] = bp.Name + } + if bp.ID != nil { + objectMap["id"] = bp.ID + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for BackendPool struct. +func (bp *BackendPool) 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 backendPoolProperties BackendPoolProperties + err = json.Unmarshal(*v, &backendPoolProperties) + if err != nil { + return err + } + bp.BackendPoolProperties = &backendPoolProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + bp.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + bp.Type = &typeVar + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + bp.ID = &ID + } + } + } + + return nil +} + +// BackendPoolListResult result of the request to list Backend Pools. It contains a list of Backend Pools +// objects and a URL link to get the next set of results. +type BackendPoolListResult struct { + // Value - READ-ONLY; List of Backend Pools within a Front Door. + Value *[]BackendPool `json:"value,omitempty"` + // NextLink - URL to get the next set of BackendPool objects if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// BackendPoolProperties the JSON object that contains the properties required to create a Backend Pool. +type BackendPoolProperties struct { + // ResourceState - Resource status. Possible values include: 'ResourceStateCreating', 'ResourceStateEnabling', 'ResourceStateEnabled', 'ResourceStateDisabling', 'ResourceStateDisabled', 'ResourceStateDeleting' + ResourceState ResourceState `json:"resourceState,omitempty"` + // Backends - The set of backends for this pool + Backends *[]Backend `json:"backends,omitempty"` + // LoadBalancingSettings - Load balancing settings for a backend pool + LoadBalancingSettings *SubResource `json:"loadBalancingSettings,omitempty"` + // HealthProbeSettings - L7 health probe settings for a backend pool + HealthProbeSettings *SubResource `json:"healthProbeSettings,omitempty"` +} + +// BackendPoolsSettings settings that apply to all backend pools. +type BackendPoolsSettings struct { + // EnforceCertificateNameCheck - Whether to enforce certificate name check on HTTPS requests to all backend pools. No effect on non-HTTPS requests. Possible values include: 'EnforceCertificateNameCheckEnabledStateEnabled', 'EnforceCertificateNameCheckEnabledStateDisabled' + EnforceCertificateNameCheck EnforceCertificateNameCheckEnabledState `json:"enforceCertificateNameCheck,omitempty"` + // SendRecvTimeoutSeconds - Send and receive timeout on forwarding request to the backend. When timeout is reached, the request fails and returns. + SendRecvTimeoutSeconds *int32 `json:"sendRecvTimeoutSeconds,omitempty"` +} + +// BackendPoolUpdateParameters a collection of backends that can be routed to. +type BackendPoolUpdateParameters struct { + // Backends - The set of backends for this pool + Backends *[]Backend `json:"backends,omitempty"` + // LoadBalancingSettings - Load balancing settings for a backend pool + LoadBalancingSettings *SubResource `json:"loadBalancingSettings,omitempty"` + // HealthProbeSettings - L7 health probe settings for a backend pool + HealthProbeSettings *SubResource `json:"healthProbeSettings,omitempty"` +} + +// CacheConfiguration caching settings for a caching-type route. To disable caching, do not provide a +// cacheConfiguration object. +type CacheConfiguration struct { + // QueryParameterStripDirective - Treatment of URL query terms when forming the cache key. Possible values include: 'StripNone', 'StripAll', 'StripOnly', 'StripAllExcept' + QueryParameterStripDirective Query `json:"queryParameterStripDirective,omitempty"` + // QueryParameters - query parameters to include or exclude (comma separated). + QueryParameters *string `json:"queryParameters,omitempty"` + // DynamicCompression - Whether to use dynamic compression for cached content. Possible values include: 'DynamicCompressionEnabledEnabled', 'DynamicCompressionEnabledDisabled' + DynamicCompression DynamicCompressionEnabled `json:"dynamicCompression,omitempty"` + // CacheDuration - The duration for which the content needs to be cached. Allowed format is in ISO 8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations). HTTP requires the value to be no more than a year + CacheDuration *string `json:"cacheDuration,omitempty"` +} + +// CertificateSourceParameters parameters required for enabling SSL with Front Door-managed certificates +type CertificateSourceParameters struct { + // CertificateType - Defines the type of the certificate used for secure connections to a frontendEndpoint. Possible values include: 'Dedicated' + CertificateType CertificateType `json:"certificateType,omitempty"` +} + +// CheckNameAvailabilityInput input of CheckNameAvailability API. +type CheckNameAvailabilityInput struct { + // Name - The resource name to validate. + Name *string `json:"name,omitempty"` + // Type - The type of the resource whose name is to be validated. Possible values include: 'MicrosoftNetworkfrontDoors', 'MicrosoftNetworkfrontDoorsfrontendEndpoints' + Type ResourceType `json:"type,omitempty"` +} + +// CheckNameAvailabilityOutput output of check name availability API. +type CheckNameAvailabilityOutput struct { + autorest.Response `json:"-"` + // NameAvailability - READ-ONLY; Indicates whether the name is available. Possible values include: 'Available', 'Unavailable' + NameAvailability Availability `json:"nameAvailability,omitempty"` + // Reason - READ-ONLY; The reason why the name is not available. + Reason *string `json:"reason,omitempty"` + // Message - READ-ONLY; The detailed error message describing why the name is not available. + Message *string `json:"message,omitempty"` +} + +// CustomHTTPSConfiguration https settings for a domain +type CustomHTTPSConfiguration struct { + // CertificateSource - Defines the source of the SSL certificate. Possible values include: 'CertificateSourceAzureKeyVault', 'CertificateSourceFrontDoor' + CertificateSource CertificateSource `json:"certificateSource,omitempty"` + // ProtocolType - Defines the TLS extension protocol that is used for secure delivery + ProtocolType *string `json:"protocolType,omitempty"` + // MinimumTLSVersion - The minimum TLS version required from the clients to establish an SSL handshake with Front Door. Possible values include: 'OneFullStopZero', 'OneFullStopTwo' + MinimumTLSVersion MinimumTLSVersion `json:"minimumTlsVersion,omitempty"` + // KeyVaultCertificateSourceParameters - KeyVault certificate source parameters (if certificateSource=AzureKeyVault) + *KeyVaultCertificateSourceParameters `json:"keyVaultCertificateSourceParameters,omitempty"` + // CertificateSourceParameters - Parameters required for enabling SSL with Front Door-managed certificates (if certificateSource=FrontDoor) + *CertificateSourceParameters `json:"frontDoorCertificateSourceParameters,omitempty"` +} + +// MarshalJSON is the custom marshaler for CustomHTTPSConfiguration. +func (chc CustomHTTPSConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if chc.CertificateSource != "" { + objectMap["certificateSource"] = chc.CertificateSource + } + if chc.ProtocolType != nil { + objectMap["protocolType"] = chc.ProtocolType + } + if chc.MinimumTLSVersion != "" { + objectMap["minimumTlsVersion"] = chc.MinimumTLSVersion + } + if chc.KeyVaultCertificateSourceParameters != nil { + objectMap["keyVaultCertificateSourceParameters"] = chc.KeyVaultCertificateSourceParameters + } + if chc.CertificateSourceParameters != nil { + objectMap["frontDoorCertificateSourceParameters"] = chc.CertificateSourceParameters + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CustomHTTPSConfiguration struct. +func (chc *CustomHTTPSConfiguration) 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 "certificateSource": + if v != nil { + var certificateSource CertificateSource + err = json.Unmarshal(*v, &certificateSource) + if err != nil { + return err + } + chc.CertificateSource = certificateSource + } + case "protocolType": + if v != nil { + var protocolType string + err = json.Unmarshal(*v, &protocolType) + if err != nil { + return err + } + chc.ProtocolType = &protocolType + } + case "minimumTlsVersion": + if v != nil { + var minimumTLSVersion MinimumTLSVersion + err = json.Unmarshal(*v, &minimumTLSVersion) + if err != nil { + return err + } + chc.MinimumTLSVersion = minimumTLSVersion + } + case "keyVaultCertificateSourceParameters": + if v != nil { + var keyVaultCertificateSourceParameters KeyVaultCertificateSourceParameters + err = json.Unmarshal(*v, &keyVaultCertificateSourceParameters) + if err != nil { + return err + } + chc.KeyVaultCertificateSourceParameters = &keyVaultCertificateSourceParameters + } + case "frontDoorCertificateSourceParameters": + if v != nil { + var certificateSourceParameters CertificateSourceParameters + err = json.Unmarshal(*v, &certificateSourceParameters) + if err != nil { + return err + } + chc.CertificateSourceParameters = &certificateSourceParameters + } + } + } + + return nil +} + +// CustomRule defines contents of a web application rule +type CustomRule struct { + // Name - Describes the name of the rule. + Name *string `json:"name,omitempty"` + // Priority - Describes priority of the rule. Rules with a lower value will be evaluated before rules with a higher value. + Priority *int32 `json:"priority,omitempty"` + // EnabledState - Describes if the custom rule is in enabled or disabled state. Defaults to Enabled if not specified. Possible values include: 'CustomRuleEnabledStateDisabled', 'CustomRuleEnabledStateEnabled' + EnabledState CustomRuleEnabledState `json:"enabledState,omitempty"` + // RuleType - Describes type of rule. Possible values include: 'MatchRule', 'RateLimitRule' + RuleType RuleType `json:"ruleType,omitempty"` + // RateLimitDurationInMinutes - Time window for resetting the rate limit count. Default is 1 minute. + RateLimitDurationInMinutes *int32 `json:"rateLimitDurationInMinutes,omitempty"` + // RateLimitThreshold - Number of allowed requests per client within the time window. + RateLimitThreshold *int32 `json:"rateLimitThreshold,omitempty"` + // MatchConditions - List of match conditions. + MatchConditions *[]MatchCondition `json:"matchConditions,omitempty"` + // Action - Describes what action to be applied when rule matches. Possible values include: 'Allow', 'Block', 'Log', 'Redirect' + Action ActionType `json:"action,omitempty"` +} + +// CustomRuleList defines contents of custom rules +type CustomRuleList struct { + // Rules - List of rules + Rules *[]CustomRule `json:"rules,omitempty"` +} + +// Endpoint defines the endpoint properties +type Endpoint struct { + // Name - The name of the endpoint + Name *string `json:"name,omitempty"` + // Endpoint - The endpoint URL + Endpoint *string `json:"endpoint,omitempty"` +} + +// EndpointsPurgeContentFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type EndpointsPurgeContentFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *EndpointsPurgeContentFuture) Result(client EndpointsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.EndpointsPurgeContentFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("frontdoor.EndpointsPurgeContentFuture") + return + } + ar.Response = future.Response() + return +} + +// Error ... +type Error struct { + Code *string `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Target *string `json:"target,omitempty"` + Details *[]ErrorDetails `json:"details,omitempty"` + InnerError *string `json:"innerError,omitempty"` +} + +// ErrorDetails ... +type ErrorDetails struct { + Code *string `json:"code,omitempty"` + Target *string `json:"target,omitempty"` + Message *string `json:"message,omitempty"` +} + +// ErrorResponse error response indicates Front Door service is not able to process the incoming request. +// The reason is provided in the error message. +type ErrorResponse struct { + // Code - READ-ONLY; Error code. + Code *string `json:"code,omitempty"` + // Message - READ-ONLY; Error message indicating why the operation failed. + Message *string `json:"message,omitempty"` +} + +// Experiment defines the properties of an Experiment +type Experiment struct { + autorest.Response `json:"-"` + // ExperimentProperties - The properties of an Experiment + *ExperimentProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Experiment. +func (e Experiment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if e.ExperimentProperties != nil { + objectMap["properties"] = e.ExperimentProperties + } + if e.Location != nil { + objectMap["location"] = e.Location + } + if e.Tags != nil { + objectMap["tags"] = e.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Experiment struct. +func (e *Experiment) 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 experimentProperties ExperimentProperties + err = json.Unmarshal(*v, &experimentProperties) + if err != nil { + return err + } + e.ExperimentProperties = &experimentProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + e.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + e.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + e.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + e.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + e.Tags = tags + } + } + } + + return nil +} + +// ExperimentList defines a list of Experiments. It contains a list of Experiment objects and a URL link to +// get the next set of results. +type ExperimentList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of Experiments within a resource group. + Value *[]Experiment `json:"value,omitempty"` + // NextLink - URL to get the next set of Experiment objects if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// ExperimentListIterator provides access to a complete listing of Experiment values. +type ExperimentListIterator struct { + i int + page ExperimentListPage +} + +// 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 *ExperimentListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExperimentListIterator.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 *ExperimentListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ExperimentListIterator) 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 ExperimentListIterator) Response() ExperimentList { + 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 ExperimentListIterator) Value() Experiment { + if !iter.page.NotDone() { + return Experiment{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ExperimentListIterator type. +func NewExperimentListIterator(page ExperimentListPage) ExperimentListIterator { + return ExperimentListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (el ExperimentList) IsEmpty() bool { + return el.Value == nil || len(*el.Value) == 0 +} + +// experimentListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (el ExperimentList) experimentListPreparer(ctx context.Context) (*http.Request, error) { + if el.NextLink == nil || len(to.String(el.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(el.NextLink))) +} + +// ExperimentListPage contains a page of Experiment values. +type ExperimentListPage struct { + fn func(context.Context, ExperimentList) (ExperimentList, error) + el ExperimentList +} + +// 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 *ExperimentListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExperimentListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.el) + if err != nil { + return err + } + page.el = next + 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 *ExperimentListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ExperimentListPage) NotDone() bool { + return !page.el.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ExperimentListPage) Response() ExperimentList { + return page.el +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ExperimentListPage) Values() []Experiment { + if page.el.IsEmpty() { + return nil + } + return *page.el.Value +} + +// Creates a new instance of the ExperimentListPage type. +func NewExperimentListPage(getNextPage func(context.Context, ExperimentList) (ExperimentList, error)) ExperimentListPage { + return ExperimentListPage{fn: getNextPage} +} + +// ExperimentProperties defines the properties of an experiment +type ExperimentProperties struct { + // Description - The description of the details or intents of the Experiment + Description *string `json:"description,omitempty"` + // EndpointA - The endpoint A of an experiment + EndpointA *Endpoint `json:"endpointA,omitempty"` + // EndpointB - The endpoint B of an experiment + EndpointB *Endpoint `json:"endpointB,omitempty"` + // EnabledState - The state of the Experiment. Possible values include: 'StateEnabled', 'StateDisabled' + EnabledState State `json:"enabledState,omitempty"` + // ResourceState - Resource status. Possible values include: 'NetworkExperimentResourceStateCreating', 'NetworkExperimentResourceStateEnabling', 'NetworkExperimentResourceStateEnabled', 'NetworkExperimentResourceStateDisabling', 'NetworkExperimentResourceStateDisabled', 'NetworkExperimentResourceStateDeleting' + ResourceState NetworkExperimentResourceState `json:"resourceState,omitempty"` + // Status - READ-ONLY; The description of Experiment status from the server side + Status *string `json:"status,omitempty"` + // ScriptFileURI - READ-ONLY; The uri to the Script used in the Experiment + ScriptFileURI *string `json:"scriptFileUri,omitempty"` +} + +// ExperimentsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ExperimentsCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ExperimentsCreateOrUpdateFuture) Result(client ExperimentsClient) (e Experiment, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("frontdoor.ExperimentsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if e.Response.Response, err = future.GetResult(sender); err == nil && e.Response.Response.StatusCode != http.StatusNoContent { + e, err = client.CreateOrUpdateResponder(e.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsCreateOrUpdateFuture", "Result", e.Response.Response, "Failure responding to request") + } + } + return +} + +// ExperimentsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ExperimentsDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ExperimentsDeleteFuture) Result(client ExperimentsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("frontdoor.ExperimentsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ExperimentsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ExperimentsUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ExperimentsUpdateFuture) Result(client ExperimentsClient) (e Experiment, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("frontdoor.ExperimentsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if e.Response.Response, err = future.GetResult(sender); err == nil && e.Response.Response.StatusCode != http.StatusNoContent { + e, err = client.UpdateResponder(e.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsUpdateFuture", "Result", e.Response.Response, "Failure responding to request") + } + } + return +} + +// ExperimentUpdateModel defines modifiable attributes of an Experiment +type ExperimentUpdateModel struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ExperimentUpdateProperties - The properties of a Profile + *ExperimentUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExperimentUpdateModel. +func (eum ExperimentUpdateModel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if eum.Tags != nil { + objectMap["tags"] = eum.Tags + } + if eum.ExperimentUpdateProperties != nil { + objectMap["properties"] = eum.ExperimentUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ExperimentUpdateModel struct. +func (eum *ExperimentUpdateModel) 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 + } + eum.Tags = tags + } + case "properties": + if v != nil { + var experimentUpdateProperties ExperimentUpdateProperties + err = json.Unmarshal(*v, &experimentUpdateProperties) + if err != nil { + return err + } + eum.ExperimentUpdateProperties = &experimentUpdateProperties + } + } + } + + return nil +} + +// ExperimentUpdateProperties defines the properties of an experiment +type ExperimentUpdateProperties struct { + // Description - The description of the intent or details of the Experiment + Description *string `json:"description,omitempty"` + // EnabledState - The state of the Experiment. Possible values include: 'StateEnabled', 'StateDisabled' + EnabledState State `json:"enabledState,omitempty"` +} + +// ForwardingConfiguration describes Forwarding Route. +type ForwardingConfiguration struct { + // CustomForwardingPath - A custom path used to rewrite resource paths matched by this rule. Leave empty to use incoming path. + CustomForwardingPath *string `json:"customForwardingPath,omitempty"` + // ForwardingProtocol - Protocol this rule will use when forwarding traffic to backends. Possible values include: 'HTTPOnly', 'HTTPSOnly', 'MatchRequest' + ForwardingProtocol ForwardingProtocol `json:"forwardingProtocol,omitempty"` + // CacheConfiguration - The caching configuration associated with this rule. + CacheConfiguration *CacheConfiguration `json:"cacheConfiguration,omitempty"` + // BackendPool - A reference to the BackendPool which this rule routes to. + BackendPool *SubResource `json:"backendPool,omitempty"` + // OdataType - Possible values include: 'OdataTypeRouteConfiguration', 'OdataTypeMicrosoftAzureFrontDoorModelsFrontdoorForwardingConfiguration', 'OdataTypeMicrosoftAzureFrontDoorModelsFrontdoorRedirectConfiguration' + OdataType OdataType `json:"@odata.type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ForwardingConfiguration. +func (fc ForwardingConfiguration) MarshalJSON() ([]byte, error) { + fc.OdataType = OdataTypeMicrosoftAzureFrontDoorModelsFrontdoorForwardingConfiguration + objectMap := make(map[string]interface{}) + if fc.CustomForwardingPath != nil { + objectMap["customForwardingPath"] = fc.CustomForwardingPath + } + if fc.ForwardingProtocol != "" { + objectMap["forwardingProtocol"] = fc.ForwardingProtocol + } + if fc.CacheConfiguration != nil { + objectMap["cacheConfiguration"] = fc.CacheConfiguration + } + if fc.BackendPool != nil { + objectMap["backendPool"] = fc.BackendPool + } + if fc.OdataType != "" { + objectMap["@odata.type"] = fc.OdataType + } + return json.Marshal(objectMap) +} + +// AsForwardingConfiguration is the BasicRouteConfiguration implementation for ForwardingConfiguration. +func (fc ForwardingConfiguration) AsForwardingConfiguration() (*ForwardingConfiguration, bool) { + return &fc, true +} + +// AsRedirectConfiguration is the BasicRouteConfiguration implementation for ForwardingConfiguration. +func (fc ForwardingConfiguration) AsRedirectConfiguration() (*RedirectConfiguration, bool) { + return nil, false +} + +// AsRouteConfiguration is the BasicRouteConfiguration implementation for ForwardingConfiguration. +func (fc ForwardingConfiguration) AsRouteConfiguration() (*RouteConfiguration, bool) { + return nil, false +} + +// AsBasicRouteConfiguration is the BasicRouteConfiguration implementation for ForwardingConfiguration. +func (fc ForwardingConfiguration) AsBasicRouteConfiguration() (BasicRouteConfiguration, bool) { + return &fc, true +} + +// FrontDoor front Door represents a collection of backend endpoints to route traffic to along with rules +// that specify how traffic is sent there. +type FrontDoor struct { + autorest.Response `json:"-"` + // Properties - Properties of the Front Door Load Balancer + *Properties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for FrontDoor. +func (fd FrontDoor) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if fd.Properties != nil { + objectMap["properties"] = fd.Properties + } + if fd.Location != nil { + objectMap["location"] = fd.Location + } + if fd.Tags != nil { + objectMap["tags"] = fd.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for FrontDoor struct. +func (fd *FrontDoor) 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 properties Properties + err = json.Unmarshal(*v, &properties) + if err != nil { + return err + } + fd.Properties = &properties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + fd.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + fd.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + fd.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + fd.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + fd.Tags = tags + } + } + } + + return nil +} + +// FrontDoorsCreateOrUpdateFutureType an abstraction for monitoring and retrieving the results of a +// long-running operation. +type FrontDoorsCreateOrUpdateFutureType struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *FrontDoorsCreateOrUpdateFutureType) Result(client FrontDoorsClient) (fd FrontDoor, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.FrontDoorsCreateOrUpdateFutureType", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("frontdoor.FrontDoorsCreateOrUpdateFutureType") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if fd.Response.Response, err = future.GetResult(sender); err == nil && fd.Response.Response.StatusCode != http.StatusNoContent { + fd, err = client.CreateOrUpdateResponder(fd.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.FrontDoorsCreateOrUpdateFutureType", "Result", fd.Response.Response, "Failure responding to request") + } + } + return +} + +// FrontDoorsDeleteFutureType an abstraction for monitoring and retrieving the results of a long-running +// operation. +type FrontDoorsDeleteFutureType struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *FrontDoorsDeleteFutureType) Result(client FrontDoorsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.FrontDoorsDeleteFutureType", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("frontdoor.FrontDoorsDeleteFutureType") + return + } + ar.Response = future.Response() + return +} + +// FrontendEndpoint a frontend endpoint used for routing. +type FrontendEndpoint struct { + autorest.Response `json:"-"` + // FrontendEndpointProperties - Properties of the Frontend endpoint + *FrontendEndpointProperties `json:"properties,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for FrontendEndpoint. +func (fe FrontendEndpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if fe.FrontendEndpointProperties != nil { + objectMap["properties"] = fe.FrontendEndpointProperties + } + if fe.Name != nil { + objectMap["name"] = fe.Name + } + if fe.ID != nil { + objectMap["id"] = fe.ID + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for FrontendEndpoint struct. +func (fe *FrontendEndpoint) 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 frontendEndpointProperties FrontendEndpointProperties + err = json.Unmarshal(*v, &frontendEndpointProperties) + if err != nil { + return err + } + fe.FrontendEndpointProperties = &frontendEndpointProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + fe.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + fe.Type = &typeVar + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + fe.ID = &ID + } + } + } + + return nil +} + +// FrontendEndpointLink defines the Resource ID for a Frontend Endpoint. +type FrontendEndpointLink struct { + // ID - Resource ID. + ID *string `json:"id,omitempty"` +} + +// FrontendEndpointProperties the JSON object that contains the properties required to create a frontend +// endpoint. +type FrontendEndpointProperties struct { + // ResourceState - Resource status. Possible values include: 'ResourceStateCreating', 'ResourceStateEnabling', 'ResourceStateEnabled', 'ResourceStateDisabling', 'ResourceStateDisabled', 'ResourceStateDeleting' + ResourceState ResourceState `json:"resourceState,omitempty"` + // CustomHTTPSProvisioningState - READ-ONLY; Provisioning status of Custom Https of the frontendEndpoint. Possible values include: 'CustomHTTPSProvisioningStateEnabling', 'CustomHTTPSProvisioningStateEnabled', 'CustomHTTPSProvisioningStateDisabling', 'CustomHTTPSProvisioningStateDisabled', 'CustomHTTPSProvisioningStateFailed' + CustomHTTPSProvisioningState CustomHTTPSProvisioningState `json:"customHttpsProvisioningState,omitempty"` + // CustomHTTPSProvisioningSubstate - READ-ONLY; Provisioning substate shows the progress of custom HTTPS enabling/disabling process step by step. Possible values include: 'SubmittingDomainControlValidationRequest', 'PendingDomainControlValidationREquestApproval', 'DomainControlValidationRequestApproved', 'DomainControlValidationRequestRejected', 'DomainControlValidationRequestTimedOut', 'IssuingCertificate', 'DeployingCertificate', 'CertificateDeployed', 'DeletingCertificate', 'CertificateDeleted' + CustomHTTPSProvisioningSubstate CustomHTTPSProvisioningSubstate `json:"customHttpsProvisioningSubstate,omitempty"` + // CustomHTTPSConfiguration - READ-ONLY; The configuration specifying how to enable HTTPS + CustomHTTPSConfiguration *CustomHTTPSConfiguration `json:"customHttpsConfiguration,omitempty"` + // HostName - The host name of the frontendEndpoint. Must be a domain name. + HostName *string `json:"hostName,omitempty"` + // SessionAffinityEnabledState - Whether to allow session affinity on this host. Valid options are 'Enabled' or 'Disabled'. Possible values include: 'SessionAffinityEnabledStateEnabled', 'SessionAffinityEnabledStateDisabled' + SessionAffinityEnabledState SessionAffinityEnabledState `json:"sessionAffinityEnabledState,omitempty"` + // SessionAffinityTTLSeconds - UNUSED. This field will be ignored. The TTL to use in seconds for session affinity, if applicable. + SessionAffinityTTLSeconds *int32 `json:"sessionAffinityTtlSeconds,omitempty"` + // WebApplicationFirewallPolicyLink - Defines the Web Application Firewall policy for each host (if applicable) + WebApplicationFirewallPolicyLink *FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink `json:"webApplicationFirewallPolicyLink,omitempty"` +} + +// FrontendEndpointsDisableHTTPSFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type FrontendEndpointsDisableHTTPSFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *FrontendEndpointsDisableHTTPSFuture) Result(client FrontendEndpointsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.FrontendEndpointsDisableHTTPSFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("frontdoor.FrontendEndpointsDisableHTTPSFuture") + return + } + ar.Response = future.Response() + return +} + +// FrontendEndpointsEnableHTTPSFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type FrontendEndpointsEnableHTTPSFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *FrontendEndpointsEnableHTTPSFuture) Result(client FrontendEndpointsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.FrontendEndpointsEnableHTTPSFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("frontdoor.FrontendEndpointsEnableHTTPSFuture") + return + } + ar.Response = future.Response() + return +} + +// FrontendEndpointsListResult result of the request to list frontend endpoints. It contains a list of +// Frontend endpoint objects and a URL link to get the next set of results. +type FrontendEndpointsListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of Frontend endpoints within a Front Door. + Value *[]FrontendEndpoint `json:"value,omitempty"` + // NextLink - URL to get the next set of frontend endpoints if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// FrontendEndpointsListResultIterator provides access to a complete listing of FrontendEndpoint values. +type FrontendEndpointsListResultIterator struct { + i int + page FrontendEndpointsListResultPage +} + +// 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 *FrontendEndpointsListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FrontendEndpointsListResultIterator.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 *FrontendEndpointsListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter FrontendEndpointsListResultIterator) 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 FrontendEndpointsListResultIterator) Response() FrontendEndpointsListResult { + 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 FrontendEndpointsListResultIterator) Value() FrontendEndpoint { + if !iter.page.NotDone() { + return FrontendEndpoint{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the FrontendEndpointsListResultIterator type. +func NewFrontendEndpointsListResultIterator(page FrontendEndpointsListResultPage) FrontendEndpointsListResultIterator { + return FrontendEndpointsListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (felr FrontendEndpointsListResult) IsEmpty() bool { + return felr.Value == nil || len(*felr.Value) == 0 +} + +// frontendEndpointsListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (felr FrontendEndpointsListResult) frontendEndpointsListResultPreparer(ctx context.Context) (*http.Request, error) { + if felr.NextLink == nil || len(to.String(felr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(felr.NextLink))) +} + +// FrontendEndpointsListResultPage contains a page of FrontendEndpoint values. +type FrontendEndpointsListResultPage struct { + fn func(context.Context, FrontendEndpointsListResult) (FrontendEndpointsListResult, error) + felr FrontendEndpointsListResult +} + +// 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 *FrontendEndpointsListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FrontendEndpointsListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.felr) + if err != nil { + return err + } + page.felr = next + 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 *FrontendEndpointsListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page FrontendEndpointsListResultPage) NotDone() bool { + return !page.felr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page FrontendEndpointsListResultPage) Response() FrontendEndpointsListResult { + return page.felr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page FrontendEndpointsListResultPage) Values() []FrontendEndpoint { + if page.felr.IsEmpty() { + return nil + } + return *page.felr.Value +} + +// Creates a new instance of the FrontendEndpointsListResultPage type. +func NewFrontendEndpointsListResultPage(getNextPage func(context.Context, FrontendEndpointsListResult) (FrontendEndpointsListResult, error)) FrontendEndpointsListResultPage { + return FrontendEndpointsListResultPage{fn: getNextPage} +} + +// FrontendEndpointUpdateParameters frontend endpoint used in routing rule +type FrontendEndpointUpdateParameters struct { + // HostName - The host name of the frontendEndpoint. Must be a domain name. + HostName *string `json:"hostName,omitempty"` + // SessionAffinityEnabledState - Whether to allow session affinity on this host. Valid options are 'Enabled' or 'Disabled'. Possible values include: 'SessionAffinityEnabledStateEnabled', 'SessionAffinityEnabledStateDisabled' + SessionAffinityEnabledState SessionAffinityEnabledState `json:"sessionAffinityEnabledState,omitempty"` + // SessionAffinityTTLSeconds - UNUSED. This field will be ignored. The TTL to use in seconds for session affinity, if applicable. + SessionAffinityTTLSeconds *int32 `json:"sessionAffinityTtlSeconds,omitempty"` + // WebApplicationFirewallPolicyLink - Defines the Web Application Firewall policy for each host (if applicable) + WebApplicationFirewallPolicyLink *FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink `json:"webApplicationFirewallPolicyLink,omitempty"` +} + +// FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink defines the Web Application Firewall +// policy for each host (if applicable) +type FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink struct { + // ID - Resource ID. + ID *string `json:"id,omitempty"` +} + +// HeaderAction an action that can manipulate an http header. +type HeaderAction struct { + // HeaderActionType - Which type of manipulation to apply to the header. Possible values include: 'Append', 'Delete', 'Overwrite' + HeaderActionType HeaderActionType `json:"headerActionType,omitempty"` + // HeaderName - The name of the header this action will apply to. + HeaderName *string `json:"headerName,omitempty"` + // Value - The value to update the given header name with. This value is not used if the actionType is Delete. + Value *string `json:"value,omitempty"` +} + +// HealthProbeSettingsListResult result of the request to list HealthProbeSettings. It contains a list of +// HealthProbeSettings objects and a URL link to get the next set of results. +type HealthProbeSettingsListResult struct { + // Value - READ-ONLY; List of HealthProbeSettings within a Front Door. + Value *[]HealthProbeSettingsModel `json:"value,omitempty"` + // NextLink - URL to get the next set of HealthProbeSettings objects if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// HealthProbeSettingsModel load balancing settings for a backend pool +type HealthProbeSettingsModel struct { + // HealthProbeSettingsProperties - Properties of the health probe settings + *HealthProbeSettingsProperties `json:"properties,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for HealthProbeSettingsModel. +func (hpsm HealthProbeSettingsModel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if hpsm.HealthProbeSettingsProperties != nil { + objectMap["properties"] = hpsm.HealthProbeSettingsProperties + } + if hpsm.Name != nil { + objectMap["name"] = hpsm.Name + } + if hpsm.ID != nil { + objectMap["id"] = hpsm.ID + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for HealthProbeSettingsModel struct. +func (hpsm *HealthProbeSettingsModel) 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 healthProbeSettingsProperties HealthProbeSettingsProperties + err = json.Unmarshal(*v, &healthProbeSettingsProperties) + if err != nil { + return err + } + hpsm.HealthProbeSettingsProperties = &healthProbeSettingsProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + hpsm.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + hpsm.Type = &typeVar + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + hpsm.ID = &ID + } + } + } + + return nil +} + +// HealthProbeSettingsProperties the JSON object that contains the properties required to create a health +// probe settings. +type HealthProbeSettingsProperties struct { + // ResourceState - Resource status. Possible values include: 'ResourceStateCreating', 'ResourceStateEnabling', 'ResourceStateEnabled', 'ResourceStateDisabling', 'ResourceStateDisabled', 'ResourceStateDeleting' + ResourceState ResourceState `json:"resourceState,omitempty"` + // Path - The path to use for the health probe. Default is / + Path *string `json:"path,omitempty"` + // Protocol - Protocol scheme to use for this probe. Possible values include: 'HTTP', 'HTTPS' + Protocol Protocol `json:"protocol,omitempty"` + // IntervalInSeconds - The number of seconds between health probes. + IntervalInSeconds *int32 `json:"intervalInSeconds,omitempty"` + // HealthProbeMethod - Configures which HTTP method to use to probe the backends defined under backendPools. Possible values include: 'GET', 'HEAD' + HealthProbeMethod HealthProbeMethod `json:"healthProbeMethod,omitempty"` + // EnabledState - Whether to enable health probes to be made against backends defined under backendPools. Health probes can only be disabled if there is a single enabled backend in single enabled backend pool. Possible values include: 'HealthProbeEnabledEnabled', 'HealthProbeEnabledDisabled' + EnabledState HealthProbeEnabled `json:"enabledState,omitempty"` +} + +// HealthProbeSettingsUpdateParameters l7 health probe settings for a backend pool +type HealthProbeSettingsUpdateParameters struct { + // Path - The path to use for the health probe. Default is / + Path *string `json:"path,omitempty"` + // Protocol - Protocol scheme to use for this probe. Possible values include: 'HTTP', 'HTTPS' + Protocol Protocol `json:"protocol,omitempty"` + // IntervalInSeconds - The number of seconds between health probes. + IntervalInSeconds *int32 `json:"intervalInSeconds,omitempty"` + // HealthProbeMethod - Configures which HTTP method to use to probe the backends defined under backendPools. Possible values include: 'GET', 'HEAD' + HealthProbeMethod HealthProbeMethod `json:"healthProbeMethod,omitempty"` + // EnabledState - Whether to enable health probes to be made against backends defined under backendPools. Health probes can only be disabled if there is a single enabled backend in single enabled backend pool. Possible values include: 'HealthProbeEnabledEnabled', 'HealthProbeEnabledDisabled' + EnabledState HealthProbeEnabled `json:"enabledState,omitempty"` +} + +// KeyVaultCertificateSourceParameters parameters required for bring-your-own-certification via Key Vault +type KeyVaultCertificateSourceParameters struct { + // Vault - The Key Vault containing the SSL certificate + Vault *KeyVaultCertificateSourceParametersVault `json:"vault,omitempty"` + // SecretName - The name of the Key Vault secret representing the full certificate PFX + SecretName *string `json:"secretName,omitempty"` + // SecretVersion - The version of the Key Vault secret representing the full certificate PFX + SecretVersion *string `json:"secretVersion,omitempty"` +} + +// KeyVaultCertificateSourceParametersVault the Key Vault containing the SSL certificate +type KeyVaultCertificateSourceParametersVault struct { + // ID - Resource ID. + ID *string `json:"id,omitempty"` +} + +// LatencyMetric defines the properties of a latency metric used in the latency scorecard +type LatencyMetric struct { + // Name - READ-ONLY; The name of the Latency Metric + Name *string `json:"name,omitempty"` + // EndDateTimeUTC - READ-ONLY; The end time of the Latency Scorecard in UTC + EndDateTimeUTC *string `json:"endDateTimeUTC,omitempty"` + // AValue - READ-ONLY; The metric value of the A endpoint + AValue *float64 `json:"aValue,omitempty"` + // BValue - READ-ONLY; The metric value of the B endpoint + BValue *float64 `json:"bValue,omitempty"` + // Delta - READ-ONLY; The difference in value between endpoint A and B + Delta *float64 `json:"delta,omitempty"` + // DeltaPercent - READ-ONLY; The percent difference between endpoint A and B + DeltaPercent *float64 `json:"deltaPercent,omitempty"` + // ACLower95CI - READ-ONLY; The lower end of the 95% confidence interval for endpoint A + ACLower95CI *float64 `json:"aCLower95CI,omitempty"` + // AHUpper95CI - READ-ONLY; The upper end of the 95% confidence interval for endpoint A + AHUpper95CI *float64 `json:"aHUpper95CI,omitempty"` + // BCLower95CI - READ-ONLY; The lower end of the 95% confidence interval for endpoint B + BCLower95CI *float64 `json:"bCLower95CI,omitempty"` + // BUpper95CI - READ-ONLY; The upper end of the 95% confidence interval for endpoint B + BUpper95CI *float64 `json:"bUpper95CI,omitempty"` +} + +// LatencyScorecard defines the LatencyScorecard +type LatencyScorecard struct { + autorest.Response `json:"-"` + // LatencyScorecardProperties - The properties of a latency scorecard + *LatencyScorecardProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for LatencyScorecard. +func (ls LatencyScorecard) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ls.LatencyScorecardProperties != nil { + objectMap["properties"] = ls.LatencyScorecardProperties + } + if ls.Location != nil { + objectMap["location"] = ls.Location + } + if ls.Tags != nil { + objectMap["tags"] = ls.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for LatencyScorecard struct. +func (ls *LatencyScorecard) 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 latencyScorecardProperties LatencyScorecardProperties + err = json.Unmarshal(*v, &latencyScorecardProperties) + if err != nil { + return err + } + ls.LatencyScorecardProperties = &latencyScorecardProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ls.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ls.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ls.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + ls.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + ls.Tags = tags + } + } + } + + return nil +} + +// LatencyScorecardProperties defines a the properties of a Latency Scorecard +type LatencyScorecardProperties struct { + // ID - READ-ONLY; The unique identifier of the Latency Scorecard + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the Latency Scorecard + Name *string `json:"name,omitempty"` + // Description - READ-ONLY; The description of the Latency Scorecard + Description *string `json:"description,omitempty"` + // EndpointA - READ-ONLY; The A endpoint in the scorecard + EndpointA *string `json:"endpointA,omitempty"` + // EndpointB - READ-ONLY; The B endpoint in the scorecard + EndpointB *string `json:"endpointB,omitempty"` + // StartDateTimeUTC - READ-ONLY; The start time of the Latency Scorecard in UTC + StartDateTimeUTC *date.Time `json:"startDateTimeUTC,omitempty"` + // EndDateTimeUTC - READ-ONLY; The end time of the Latency Scorecard in UTC + EndDateTimeUTC *date.Time `json:"endDateTimeUTC,omitempty"` + // Country - READ-ONLY; The country associated with the Latency Scorecard. Values are country ISO codes as specified here- https://www.iso.org/iso-3166-country-codes.html + Country *string `json:"country,omitempty"` + // LatencyMetrics - The latency metrics of the Latency Scorecard + LatencyMetrics *[]LatencyMetric `json:"latencyMetrics,omitempty"` +} + +// ListResult result of the request to list Front Doors. It contains a list of Front Door objects and a URL +// link to get the next set of results. +type ListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of Front Doors within a resource group. + Value *[]FrontDoor `json:"value,omitempty"` + // NextLink - URL to get the next set of Front Door objects if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// ListResultIterator provides access to a complete listing of FrontDoor values. +type ListResultIterator struct { + i int + page ListResultPage +} + +// 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 *ListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ListResultIterator.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 *ListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ListResultIterator) 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 ListResultIterator) Response() ListResult { + 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 ListResultIterator) Value() FrontDoor { + if !iter.page.NotDone() { + return FrontDoor{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ListResultIterator type. +func NewListResultIterator(page ListResultPage) ListResultIterator { + return ListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (lr ListResult) IsEmpty() bool { + return lr.Value == nil || len(*lr.Value) == 0 +} + +// listResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (lr ListResult) listResultPreparer(ctx context.Context) (*http.Request, error) { + if lr.NextLink == nil || len(to.String(lr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(lr.NextLink))) +} + +// ListResultPage contains a page of FrontDoor values. +type ListResultPage struct { + fn func(context.Context, ListResult) (ListResult, error) + lr ListResult +} + +// 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 *ListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.lr) + if err != nil { + return err + } + page.lr = next + 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 *ListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ListResultPage) NotDone() bool { + return !page.lr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ListResultPage) Response() ListResult { + return page.lr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ListResultPage) Values() []FrontDoor { + if page.lr.IsEmpty() { + return nil + } + return *page.lr.Value +} + +// Creates a new instance of the ListResultPage type. +func NewListResultPage(getNextPage func(context.Context, ListResult) (ListResult, error)) ListResultPage { + return ListResultPage{fn: getNextPage} +} + +// LoadBalancingSettingsListResult result of the request to list load balancing settings. It contains a +// list of load balancing settings objects and a URL link to get the next set of results. +type LoadBalancingSettingsListResult struct { + // Value - READ-ONLY; List of Backend Pools within a Front Door. + Value *[]LoadBalancingSettingsModel `json:"value,omitempty"` + // NextLink - URL to get the next set of LoadBalancingSettings objects if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// LoadBalancingSettingsModel load balancing settings for a backend pool +type LoadBalancingSettingsModel struct { + // LoadBalancingSettingsProperties - Properties of the load balancing settings + *LoadBalancingSettingsProperties `json:"properties,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for LoadBalancingSettingsModel. +func (lbsm LoadBalancingSettingsModel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lbsm.LoadBalancingSettingsProperties != nil { + objectMap["properties"] = lbsm.LoadBalancingSettingsProperties + } + if lbsm.Name != nil { + objectMap["name"] = lbsm.Name + } + if lbsm.ID != nil { + objectMap["id"] = lbsm.ID + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for LoadBalancingSettingsModel struct. +func (lbsm *LoadBalancingSettingsModel) 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 loadBalancingSettingsProperties LoadBalancingSettingsProperties + err = json.Unmarshal(*v, &loadBalancingSettingsProperties) + if err != nil { + return err + } + lbsm.LoadBalancingSettingsProperties = &loadBalancingSettingsProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + lbsm.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + lbsm.Type = &typeVar + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + lbsm.ID = &ID + } + } + } + + return nil +} + +// LoadBalancingSettingsProperties the JSON object that contains the properties required to create load +// balancing settings +type LoadBalancingSettingsProperties struct { + // ResourceState - Resource status. Possible values include: 'ResourceStateCreating', 'ResourceStateEnabling', 'ResourceStateEnabled', 'ResourceStateDisabling', 'ResourceStateDisabled', 'ResourceStateDeleting' + ResourceState ResourceState `json:"resourceState,omitempty"` + // SampleSize - The number of samples to consider for load balancing decisions + SampleSize *int32 `json:"sampleSize,omitempty"` + // SuccessfulSamplesRequired - The number of samples within the sample period that must succeed + SuccessfulSamplesRequired *int32 `json:"successfulSamplesRequired,omitempty"` + // AdditionalLatencyMilliseconds - The additional latency in milliseconds for probes to fall into the lowest latency bucket + AdditionalLatencyMilliseconds *int32 `json:"additionalLatencyMilliseconds,omitempty"` +} + +// LoadBalancingSettingsUpdateParameters round-Robin load balancing settings for a backend pool +type LoadBalancingSettingsUpdateParameters struct { + // SampleSize - The number of samples to consider for load balancing decisions + SampleSize *int32 `json:"sampleSize,omitempty"` + // SuccessfulSamplesRequired - The number of samples within the sample period that must succeed + SuccessfulSamplesRequired *int32 `json:"successfulSamplesRequired,omitempty"` + // AdditionalLatencyMilliseconds - The additional latency in milliseconds for probes to fall into the lowest latency bucket + AdditionalLatencyMilliseconds *int32 `json:"additionalLatencyMilliseconds,omitempty"` +} + +// ManagedRuleDefinition describes a managed rule definition. +type ManagedRuleDefinition struct { + // RuleID - READ-ONLY; Identifier for the managed rule. + RuleID *string `json:"ruleId,omitempty"` + // DefaultState - READ-ONLY; Describes the default state for the managed rule. Possible values include: 'ManagedRuleEnabledStateDisabled', 'ManagedRuleEnabledStateEnabled' + DefaultState ManagedRuleEnabledState `json:"defaultState,omitempty"` + // DefaultAction - READ-ONLY; Describes the default action to be applied when the managed rule matches. Possible values include: 'Allow', 'Block', 'Log', 'Redirect' + DefaultAction ActionType `json:"defaultAction,omitempty"` + // Description - READ-ONLY; Describes the functionality of the managed rule. + Description *string `json:"description,omitempty"` +} + +// ManagedRuleExclusion exclude variables from managed rule evaluation. +type ManagedRuleExclusion struct { + // MatchVariable - The variable type to be excluded. Possible values include: 'RequestHeaderNames', 'RequestCookieNames', 'QueryStringArgNames', 'RequestBodyPostArgNames' + MatchVariable ManagedRuleExclusionMatchVariable `json:"matchVariable,omitempty"` + // SelectorMatchOperator - Comparison operator to apply to the selector when specifying which elements in the collection this exclusion applies to. Possible values include: 'Equals', 'Contains', 'StartsWith', 'EndsWith', 'EqualsAny' + SelectorMatchOperator ManagedRuleExclusionSelectorMatchOperator `json:"selectorMatchOperator,omitempty"` + // Selector - Selector value for which elements in the collection this exclusion applies to. + Selector *string `json:"selector,omitempty"` +} + +// ManagedRuleGroupDefinition describes a managed rule group. +type ManagedRuleGroupDefinition struct { + // RuleGroupName - READ-ONLY; Name of the managed rule group. + RuleGroupName *string `json:"ruleGroupName,omitempty"` + // Description - READ-ONLY; Description of the managed rule group. + Description *string `json:"description,omitempty"` + // Rules - READ-ONLY; List of rules within the managed rule group. + Rules *[]ManagedRuleDefinition `json:"rules,omitempty"` +} + +// ManagedRuleGroupOverride defines a managed rule group override setting. +type ManagedRuleGroupOverride struct { + // RuleGroupName - Describes the managed rule group to override. + RuleGroupName *string `json:"ruleGroupName,omitempty"` + // Exclusions - Describes the exclusions that are applied to all rules in the group. + Exclusions *[]ManagedRuleExclusion `json:"exclusions,omitempty"` + // Rules - List of rules that will be disabled. If none specified, all rules in the group will be disabled. + Rules *[]ManagedRuleOverride `json:"rules,omitempty"` +} + +// ManagedRuleOverride defines a managed rule group override setting. +type ManagedRuleOverride struct { + // RuleID - Identifier for the managed rule. + RuleID *string `json:"ruleId,omitempty"` + // EnabledState - Describes if the managed rule is in enabled or disabled state. Defaults to Disabled if not specified. Possible values include: 'ManagedRuleEnabledStateDisabled', 'ManagedRuleEnabledStateEnabled' + EnabledState ManagedRuleEnabledState `json:"enabledState,omitempty"` + // Action - Describes the override action to be applied when rule matches. Possible values include: 'Allow', 'Block', 'Log', 'Redirect' + Action ActionType `json:"action,omitempty"` + // Exclusions - Describes the exclusions that are applied to this specific rule. + Exclusions *[]ManagedRuleExclusion `json:"exclusions,omitempty"` +} + +// ManagedRuleSet defines a managed rule set. +type ManagedRuleSet struct { + // RuleSetType - Defines the rule set type to use. + RuleSetType *string `json:"ruleSetType,omitempty"` + // RuleSetVersion - Defines the version of the rule set to use. + RuleSetVersion *string `json:"ruleSetVersion,omitempty"` + // Exclusions - Describes the exclusions that are applied to all rules in the set. + Exclusions *[]ManagedRuleExclusion `json:"exclusions,omitempty"` + // RuleGroupOverrides - Defines the rule group overrides to apply to the rule set. + RuleGroupOverrides *[]ManagedRuleGroupOverride `json:"ruleGroupOverrides,omitempty"` +} + +// ManagedRuleSetDefinition describes the a managed rule set definition. +type ManagedRuleSetDefinition struct { + // ManagedRuleSetDefinitionProperties - Properties for a managed rule set definition. + *ManagedRuleSetDefinitionProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for ManagedRuleSetDefinition. +func (mrsd ManagedRuleSetDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mrsd.ManagedRuleSetDefinitionProperties != nil { + objectMap["properties"] = mrsd.ManagedRuleSetDefinitionProperties + } + if mrsd.Location != nil { + objectMap["location"] = mrsd.Location + } + if mrsd.Tags != nil { + objectMap["tags"] = mrsd.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ManagedRuleSetDefinition struct. +func (mrsd *ManagedRuleSetDefinition) 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 managedRuleSetDefinitionProperties ManagedRuleSetDefinitionProperties + err = json.Unmarshal(*v, &managedRuleSetDefinitionProperties) + if err != nil { + return err + } + mrsd.ManagedRuleSetDefinitionProperties = &managedRuleSetDefinitionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + mrsd.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mrsd.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mrsd.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + mrsd.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + mrsd.Tags = tags + } + } + } + + return nil +} + +// ManagedRuleSetDefinitionList list of managed rule set definitions available for use in a policy. +type ManagedRuleSetDefinitionList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of managed rule set definitions. + Value *[]ManagedRuleSetDefinition `json:"value,omitempty"` + // NextLink - URL to retrieve next set of managed rule set definitions. + NextLink *string `json:"nextLink,omitempty"` +} + +// ManagedRuleSetDefinitionListIterator provides access to a complete listing of ManagedRuleSetDefinition +// values. +type ManagedRuleSetDefinitionListIterator struct { + i int + page ManagedRuleSetDefinitionListPage +} + +// 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 *ManagedRuleSetDefinitionListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedRuleSetDefinitionListIterator.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 *ManagedRuleSetDefinitionListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ManagedRuleSetDefinitionListIterator) 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 ManagedRuleSetDefinitionListIterator) Response() ManagedRuleSetDefinitionList { + 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 ManagedRuleSetDefinitionListIterator) Value() ManagedRuleSetDefinition { + if !iter.page.NotDone() { + return ManagedRuleSetDefinition{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ManagedRuleSetDefinitionListIterator type. +func NewManagedRuleSetDefinitionListIterator(page ManagedRuleSetDefinitionListPage) ManagedRuleSetDefinitionListIterator { + return ManagedRuleSetDefinitionListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (mrsdl ManagedRuleSetDefinitionList) IsEmpty() bool { + return mrsdl.Value == nil || len(*mrsdl.Value) == 0 +} + +// managedRuleSetDefinitionListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (mrsdl ManagedRuleSetDefinitionList) managedRuleSetDefinitionListPreparer(ctx context.Context) (*http.Request, error) { + if mrsdl.NextLink == nil || len(to.String(mrsdl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(mrsdl.NextLink))) +} + +// ManagedRuleSetDefinitionListPage contains a page of ManagedRuleSetDefinition values. +type ManagedRuleSetDefinitionListPage struct { + fn func(context.Context, ManagedRuleSetDefinitionList) (ManagedRuleSetDefinitionList, error) + mrsdl ManagedRuleSetDefinitionList +} + +// 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 *ManagedRuleSetDefinitionListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedRuleSetDefinitionListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.mrsdl) + if err != nil { + return err + } + page.mrsdl = next + 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 *ManagedRuleSetDefinitionListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ManagedRuleSetDefinitionListPage) NotDone() bool { + return !page.mrsdl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ManagedRuleSetDefinitionListPage) Response() ManagedRuleSetDefinitionList { + return page.mrsdl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ManagedRuleSetDefinitionListPage) Values() []ManagedRuleSetDefinition { + if page.mrsdl.IsEmpty() { + return nil + } + return *page.mrsdl.Value +} + +// Creates a new instance of the ManagedRuleSetDefinitionListPage type. +func NewManagedRuleSetDefinitionListPage(getNextPage func(context.Context, ManagedRuleSetDefinitionList) (ManagedRuleSetDefinitionList, error)) ManagedRuleSetDefinitionListPage { + return ManagedRuleSetDefinitionListPage{fn: getNextPage} +} + +// ManagedRuleSetDefinitionProperties properties for a managed rule set definition. +type ManagedRuleSetDefinitionProperties struct { + // ProvisioningState - READ-ONLY; Provisioning state of the managed rule set. + ProvisioningState *string `json:"provisioningState,omitempty"` + // RuleSetID - READ-ONLY; Id of the managed rule set. + RuleSetID *string `json:"ruleSetId,omitempty"` + // RuleSetType - READ-ONLY; Type of the managed rule set. + RuleSetType *string `json:"ruleSetType,omitempty"` + // RuleSetVersion - READ-ONLY; Version of the managed rule set type. + RuleSetVersion *string `json:"ruleSetVersion,omitempty"` + // RuleGroups - READ-ONLY; Rule groups of the managed rule set. + RuleGroups *[]ManagedRuleGroupDefinition `json:"ruleGroups,omitempty"` +} + +// ManagedRuleSetList defines the list of managed rule sets for the policy. +type ManagedRuleSetList struct { + // ManagedRuleSets - List of rule sets. + ManagedRuleSets *[]ManagedRuleSet `json:"managedRuleSets,omitempty"` +} + +// MatchCondition define a match condition. +type MatchCondition struct { + // MatchVariable - Request variable to compare with. Possible values include: 'RemoteAddr', 'RequestMethod', 'QueryString', 'PostArgs', 'RequestURI', 'RequestHeader', 'RequestBody', 'Cookies', 'SocketAddr' + MatchVariable MatchVariable `json:"matchVariable,omitempty"` + // Selector - Match against a specific key from the QueryString, PostArgs, RequestHeader or Cookies variables. Default is null. + Selector *string `json:"selector,omitempty"` + // Operator - Comparison type to use for matching with the variable value. Possible values include: 'OperatorAny', 'OperatorIPMatch', 'OperatorGeoMatch', 'OperatorEqual', 'OperatorContains', 'OperatorLessThan', 'OperatorGreaterThan', 'OperatorLessThanOrEqual', 'OperatorGreaterThanOrEqual', 'OperatorBeginsWith', 'OperatorEndsWith', 'OperatorRegEx' + Operator Operator `json:"operator,omitempty"` + // NegateCondition - Describes if the result of this condition should be negated. + NegateCondition *bool `json:"negateCondition,omitempty"` + // MatchValue - List of possible match values. + MatchValue *[]string `json:"matchValue,omitempty"` + // Transforms - List of transforms. + Transforms *[]TransformType `json:"transforms,omitempty"` +} + +// NetworkExperimentProfilesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type NetworkExperimentProfilesCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *NetworkExperimentProfilesCreateOrUpdateFuture) Result(client NetworkExperimentProfilesClient) (p Profile, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("frontdoor.NetworkExperimentProfilesCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if p.Response.Response, err = future.GetResult(sender); err == nil && p.Response.Response.StatusCode != http.StatusNoContent { + p, err = client.CreateOrUpdateResponder(p.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesCreateOrUpdateFuture", "Result", p.Response.Response, "Failure responding to request") + } + } + return +} + +// NetworkExperimentProfilesDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type NetworkExperimentProfilesDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *NetworkExperimentProfilesDeleteFuture) Result(client NetworkExperimentProfilesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("frontdoor.NetworkExperimentProfilesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// NetworkExperimentProfilesUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type NetworkExperimentProfilesUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *NetworkExperimentProfilesUpdateFuture) Result(client NetworkExperimentProfilesClient) (p Profile, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("frontdoor.NetworkExperimentProfilesUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if p.Response.Response, err = future.GetResult(sender); err == nil && p.Response.Response.StatusCode != http.StatusNoContent { + p, err = client.UpdateResponder(p.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesUpdateFuture", "Result", p.Response.Response, "Failure responding to request") + } + } + return +} + +// PoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type PoliciesCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *PoliciesCreateOrUpdateFuture) Result(client PoliciesClient) (wafp WebApplicationFirewallPolicy, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.PoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("frontdoor.PoliciesCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if wafp.Response.Response, err = future.GetResult(sender); err == nil && wafp.Response.Response.StatusCode != http.StatusNoContent { + wafp, err = client.CreateOrUpdateResponder(wafp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.PoliciesCreateOrUpdateFuture", "Result", wafp.Response.Response, "Failure responding to request") + } + } + return +} + +// PoliciesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type PoliciesDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *PoliciesDeleteFuture) Result(client PoliciesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.PoliciesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("frontdoor.PoliciesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// PolicySettings defines top-level WebApplicationFirewallPolicy configuration settings. +type PolicySettings struct { + // EnabledState - Describes if the policy is in enabled or disabled state. Defaults to Enabled if not specified. Possible values include: 'PolicyEnabledStateDisabled', 'PolicyEnabledStateEnabled' + EnabledState PolicyEnabledState `json:"enabledState,omitempty"` + // Mode - Describes if it is in detection mode or prevention mode at policy level. Possible values include: 'Prevention', 'Detection' + Mode PolicyMode `json:"mode,omitempty"` + // RedirectURL - If action type is redirect, this field represents redirect URL for the client. + RedirectURL *string `json:"redirectUrl,omitempty"` + // CustomBlockResponseStatusCode - If the action type is block, customer can override the response status code. + CustomBlockResponseStatusCode *int32 `json:"customBlockResponseStatusCode,omitempty"` + // CustomBlockResponseBody - If the action type is block, customer can override the response body. The body must be specified in base64 encoding. + CustomBlockResponseBody *string `json:"customBlockResponseBody,omitempty"` +} + +// PreconfiguredEndpoint defines the properties of a preconfigured endpoint +type PreconfiguredEndpoint struct { + // PreconfiguredEndpointProperties - The properties of a preconfiguredEndpoint + *PreconfiguredEndpointProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for PreconfiguredEndpoint. +func (peVar PreconfiguredEndpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if peVar.PreconfiguredEndpointProperties != nil { + objectMap["properties"] = peVar.PreconfiguredEndpointProperties + } + if peVar.Location != nil { + objectMap["location"] = peVar.Location + } + if peVar.Tags != nil { + objectMap["tags"] = peVar.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PreconfiguredEndpoint struct. +func (peVar *PreconfiguredEndpoint) 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 preconfiguredEndpointProperties PreconfiguredEndpointProperties + err = json.Unmarshal(*v, &preconfiguredEndpointProperties) + if err != nil { + return err + } + peVar.PreconfiguredEndpointProperties = &preconfiguredEndpointProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + peVar.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + peVar.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + peVar.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + peVar.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + peVar.Tags = tags + } + } + } + + return nil +} + +// PreconfiguredEndpointList defines a list of preconfigured endpoints. +type PreconfiguredEndpointList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of PreconfiguredEndpoints supported by NetworkExperiment. + Value *[]PreconfiguredEndpoint `json:"value,omitempty"` + // NextLink - URL to get the next set of PreconfiguredEndpoints if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// PreconfiguredEndpointListIterator provides access to a complete listing of PreconfiguredEndpoint values. +type PreconfiguredEndpointListIterator struct { + i int + page PreconfiguredEndpointListPage +} + +// 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 *PreconfiguredEndpointListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PreconfiguredEndpointListIterator.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 *PreconfiguredEndpointListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter PreconfiguredEndpointListIterator) 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 PreconfiguredEndpointListIterator) Response() PreconfiguredEndpointList { + 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 PreconfiguredEndpointListIterator) Value() PreconfiguredEndpoint { + if !iter.page.NotDone() { + return PreconfiguredEndpoint{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the PreconfiguredEndpointListIterator type. +func NewPreconfiguredEndpointListIterator(page PreconfiguredEndpointListPage) PreconfiguredEndpointListIterator { + return PreconfiguredEndpointListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pel PreconfiguredEndpointList) IsEmpty() bool { + return pel.Value == nil || len(*pel.Value) == 0 +} + +// preconfiguredEndpointListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pel PreconfiguredEndpointList) preconfiguredEndpointListPreparer(ctx context.Context) (*http.Request, error) { + if pel.NextLink == nil || len(to.String(pel.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pel.NextLink))) +} + +// PreconfiguredEndpointListPage contains a page of PreconfiguredEndpoint values. +type PreconfiguredEndpointListPage struct { + fn func(context.Context, PreconfiguredEndpointList) (PreconfiguredEndpointList, error) + pel PreconfiguredEndpointList +} + +// 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 *PreconfiguredEndpointListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PreconfiguredEndpointListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.pel) + if err != nil { + return err + } + page.pel = next + 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 *PreconfiguredEndpointListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page PreconfiguredEndpointListPage) NotDone() bool { + return !page.pel.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page PreconfiguredEndpointListPage) Response() PreconfiguredEndpointList { + return page.pel +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page PreconfiguredEndpointListPage) Values() []PreconfiguredEndpoint { + if page.pel.IsEmpty() { + return nil + } + return *page.pel.Value +} + +// Creates a new instance of the PreconfiguredEndpointListPage type. +func NewPreconfiguredEndpointListPage(getNextPage func(context.Context, PreconfiguredEndpointList) (PreconfiguredEndpointList, error)) PreconfiguredEndpointListPage { + return PreconfiguredEndpointListPage{fn: getNextPage} +} + +// PreconfiguredEndpointProperties defines the properties of a preconfigured endpoint +type PreconfiguredEndpointProperties struct { + // Description - The description of the endpoint + Description *string `json:"description,omitempty"` + // Endpoint - The endpoint that is preconfigured + Endpoint *string `json:"endpoint,omitempty"` + // EndpointType - The type of endpoint. Possible values include: 'AFD', 'AzureRegion', 'CDN', 'ATM' + EndpointType EndpointType `json:"endpointType,omitempty"` + // Backend - The preconfigured endpoint backend + Backend *string `json:"backend,omitempty"` +} + +// Profile defines an Network Experiment Profile and lists of Experiments +type Profile struct { + autorest.Response `json:"-"` + // ProfileProperties - The properties of a Profile + *ProfileProperties `json:"properties,omitempty"` + // Etag - Gets a unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Profile. +func (p Profile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if p.ProfileProperties != nil { + objectMap["properties"] = p.ProfileProperties + } + if p.Etag != nil { + objectMap["etag"] = p.Etag + } + if p.Location != nil { + objectMap["location"] = p.Location + } + if p.Tags != nil { + objectMap["tags"] = p.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Profile struct. +func (p *Profile) 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 profileProperties ProfileProperties + err = json.Unmarshal(*v, &profileProperties) + if err != nil { + return err + } + p.ProfileProperties = &profileProperties + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + p.Etag = &etag + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + p.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + p.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + p.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + p.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + p.Tags = tags + } + } + } + + return nil +} + +// ProfileList defines a list of Profiles. It contains a list of Profile objects and a URL link to get the +// next set of results. +type ProfileList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of Profiles within a resource group. + Value *[]Profile `json:"value,omitempty"` + // NextLink - URL to get the next set of Profile objects if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// ProfileListIterator provides access to a complete listing of Profile values. +type ProfileListIterator struct { + i int + page ProfileListPage +} + +// 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 *ProfileListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProfileListIterator.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 *ProfileListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ProfileListIterator) 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 ProfileListIterator) Response() ProfileList { + 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 ProfileListIterator) Value() Profile { + if !iter.page.NotDone() { + return Profile{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ProfileListIterator type. +func NewProfileListIterator(page ProfileListPage) ProfileListIterator { + return ProfileListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pl ProfileList) IsEmpty() bool { + return pl.Value == nil || len(*pl.Value) == 0 +} + +// profileListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pl ProfileList) profileListPreparer(ctx context.Context) (*http.Request, error) { + if pl.NextLink == nil || len(to.String(pl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pl.NextLink))) +} + +// ProfileListPage contains a page of Profile values. +type ProfileListPage struct { + fn func(context.Context, ProfileList) (ProfileList, error) + pl ProfileList +} + +// 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 *ProfileListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProfileListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.pl) + if err != nil { + return err + } + page.pl = next + 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 *ProfileListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ProfileListPage) NotDone() bool { + return !page.pl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ProfileListPage) Response() ProfileList { + return page.pl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ProfileListPage) Values() []Profile { + if page.pl.IsEmpty() { + return nil + } + return *page.pl.Value +} + +// Creates a new instance of the ProfileListPage type. +func NewProfileListPage(getNextPage func(context.Context, ProfileList) (ProfileList, error)) ProfileListPage { + return ProfileListPage{fn: getNextPage} +} + +// ProfileProperties defines the properties of an experiment +type ProfileProperties struct { + // ResourceState - Resource status. Possible values include: 'NetworkExperimentResourceStateCreating', 'NetworkExperimentResourceStateEnabling', 'NetworkExperimentResourceStateEnabled', 'NetworkExperimentResourceStateDisabling', 'NetworkExperimentResourceStateDisabled', 'NetworkExperimentResourceStateDeleting' + ResourceState NetworkExperimentResourceState `json:"resourceState,omitempty"` + // EnabledState - The state of the Experiment. Possible values include: 'StateEnabled', 'StateDisabled' + EnabledState State `json:"enabledState,omitempty"` +} + +// ProfileUpdateModel defines modifiable attributes of a Profile +type ProfileUpdateModel struct { + // ProfileUpdateProperties - The properties of a Profile + *ProfileUpdateProperties `json:"properties,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for ProfileUpdateModel. +func (pum ProfileUpdateModel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pum.ProfileUpdateProperties != nil { + objectMap["properties"] = pum.ProfileUpdateProperties + } + if pum.Tags != nil { + objectMap["tags"] = pum.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ProfileUpdateModel struct. +func (pum *ProfileUpdateModel) 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 profileUpdateProperties ProfileUpdateProperties + err = json.Unmarshal(*v, &profileUpdateProperties) + if err != nil { + return err + } + pum.ProfileUpdateProperties = &profileUpdateProperties + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + pum.Tags = tags + } + } + } + + return nil +} + +// ProfileUpdateProperties defines the properties of an experiment +type ProfileUpdateProperties struct { + // EnabledState - The enabled state of the Profile. Possible values include: 'StateEnabled', 'StateDisabled' + EnabledState State `json:"enabledState,omitempty"` +} + +// Properties the JSON object that contains the properties required to create an endpoint. +type Properties struct { + // ResourceState - Resource status of the Front Door. Possible values include: 'ResourceStateCreating', 'ResourceStateEnabling', 'ResourceStateEnabled', 'ResourceStateDisabling', 'ResourceStateDisabled', 'ResourceStateDeleting' + ResourceState ResourceState `json:"resourceState,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the Front Door. + ProvisioningState *string `json:"provisioningState,omitempty"` + // Cname - READ-ONLY; The host that each frontendEndpoint must CNAME to. + Cname *string `json:"cname,omitempty"` + // FrontdoorID - READ-ONLY; The Id of the frontdoor. + FrontdoorID *string `json:"frontdoorId,omitempty"` + // RulesEngines - READ-ONLY; Rules Engine Configurations available to routing rules. + RulesEngines *[]RulesEngine `json:"rulesEngines,omitempty"` + // FriendlyName - A friendly name for the frontDoor + FriendlyName *string `json:"friendlyName,omitempty"` + // RoutingRules - Routing rules associated with this Front Door. + RoutingRules *[]RoutingRule `json:"routingRules,omitempty"` + // LoadBalancingSettings - Load balancing settings associated with this Front Door instance. + LoadBalancingSettings *[]LoadBalancingSettingsModel `json:"loadBalancingSettings,omitempty"` + // HealthProbeSettings - Health probe settings associated with this Front Door instance. + HealthProbeSettings *[]HealthProbeSettingsModel `json:"healthProbeSettings,omitempty"` + // BackendPools - Backend pools available to routing rules. + BackendPools *[]BackendPool `json:"backendPools,omitempty"` + // FrontendEndpoints - Frontend endpoints available to routing rules. + FrontendEndpoints *[]FrontendEndpoint `json:"frontendEndpoints,omitempty"` + // BackendPoolsSettings - Settings for all backendPools + BackendPoolsSettings *BackendPoolsSettings `json:"backendPoolsSettings,omitempty"` + // EnabledState - Operational status of the Front Door load balancer. Permitted values are 'Enabled' or 'Disabled'. Possible values include: 'EnabledStateEnabled', 'EnabledStateDisabled' + EnabledState EnabledState `json:"enabledState,omitempty"` +} + +// PurgeParameters parameters required for content purge. +type PurgeParameters struct { + // ContentPaths - The path to the content to be purged. Can describe a file path or a wild card directory. + ContentPaths *[]string `json:"contentPaths,omitempty"` +} + +// RedirectConfiguration describes Redirect Route. +type RedirectConfiguration struct { + // RedirectType - The redirect type the rule will use when redirecting traffic. Possible values include: 'Moved', 'Found', 'TemporaryRedirect', 'PermanentRedirect' + RedirectType RedirectType `json:"redirectType,omitempty"` + // RedirectProtocol - The protocol of the destination to where the traffic is redirected. Possible values include: 'RedirectProtocolHTTPOnly', 'RedirectProtocolHTTPSOnly', 'RedirectProtocolMatchRequest' + RedirectProtocol RedirectProtocol `json:"redirectProtocol,omitempty"` + // CustomHost - Host to redirect. Leave empty to use the incoming host as the destination host. + CustomHost *string `json:"customHost,omitempty"` + // CustomPath - The full path to redirect. Path cannot be empty and must start with /. Leave empty to use the incoming path as destination path. + CustomPath *string `json:"customPath,omitempty"` + // CustomFragment - Fragment to add to the redirect URL. Fragment is the part of the URL that comes after #. Do not include the #. + CustomFragment *string `json:"customFragment,omitempty"` + // CustomQueryString - The set of query strings to be placed in the redirect URL. Setting this value would replace any existing query string; leave empty to preserve the incoming query string. Query string must be in = format. The first ? and & will be added automatically so do not include them in the front, but do separate multiple query strings with &. + CustomQueryString *string `json:"customQueryString,omitempty"` + // OdataType - Possible values include: 'OdataTypeRouteConfiguration', 'OdataTypeMicrosoftAzureFrontDoorModelsFrontdoorForwardingConfiguration', 'OdataTypeMicrosoftAzureFrontDoorModelsFrontdoorRedirectConfiguration' + OdataType OdataType `json:"@odata.type,omitempty"` +} + +// MarshalJSON is the custom marshaler for RedirectConfiguration. +func (rc RedirectConfiguration) MarshalJSON() ([]byte, error) { + rc.OdataType = OdataTypeMicrosoftAzureFrontDoorModelsFrontdoorRedirectConfiguration + objectMap := make(map[string]interface{}) + if rc.RedirectType != "" { + objectMap["redirectType"] = rc.RedirectType + } + if rc.RedirectProtocol != "" { + objectMap["redirectProtocol"] = rc.RedirectProtocol + } + if rc.CustomHost != nil { + objectMap["customHost"] = rc.CustomHost + } + if rc.CustomPath != nil { + objectMap["customPath"] = rc.CustomPath + } + if rc.CustomFragment != nil { + objectMap["customFragment"] = rc.CustomFragment + } + if rc.CustomQueryString != nil { + objectMap["customQueryString"] = rc.CustomQueryString + } + if rc.OdataType != "" { + objectMap["@odata.type"] = rc.OdataType + } + return json.Marshal(objectMap) +} + +// AsForwardingConfiguration is the BasicRouteConfiguration implementation for RedirectConfiguration. +func (rc RedirectConfiguration) AsForwardingConfiguration() (*ForwardingConfiguration, bool) { + return nil, false +} + +// AsRedirectConfiguration is the BasicRouteConfiguration implementation for RedirectConfiguration. +func (rc RedirectConfiguration) AsRedirectConfiguration() (*RedirectConfiguration, bool) { + return &rc, true +} + +// AsRouteConfiguration is the BasicRouteConfiguration implementation for RedirectConfiguration. +func (rc RedirectConfiguration) AsRouteConfiguration() (*RouteConfiguration, bool) { + return nil, false +} + +// AsBasicRouteConfiguration is the BasicRouteConfiguration implementation for RedirectConfiguration. +func (rc RedirectConfiguration) AsBasicRouteConfiguration() (BasicRouteConfiguration, bool) { + return &rc, true +} + +// Resource common resource representation. +type Resource struct { + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,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.Location != nil { + objectMap["location"] = r.Location + } + if r.Tags != nil { + objectMap["tags"] = r.Tags + } + return json.Marshal(objectMap) +} + +// BasicRouteConfiguration base class for all types of Route. +type BasicRouteConfiguration interface { + AsForwardingConfiguration() (*ForwardingConfiguration, bool) + AsRedirectConfiguration() (*RedirectConfiguration, bool) + AsRouteConfiguration() (*RouteConfiguration, bool) +} + +// RouteConfiguration base class for all types of Route. +type RouteConfiguration struct { + // OdataType - Possible values include: 'OdataTypeRouteConfiguration', 'OdataTypeMicrosoftAzureFrontDoorModelsFrontdoorForwardingConfiguration', 'OdataTypeMicrosoftAzureFrontDoorModelsFrontdoorRedirectConfiguration' + OdataType OdataType `json:"@odata.type,omitempty"` +} + +func unmarshalBasicRouteConfiguration(body []byte) (BasicRouteConfiguration, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["@odata.type"] { + case string(OdataTypeMicrosoftAzureFrontDoorModelsFrontdoorForwardingConfiguration): + var fc ForwardingConfiguration + err := json.Unmarshal(body, &fc) + return fc, err + case string(OdataTypeMicrosoftAzureFrontDoorModelsFrontdoorRedirectConfiguration): + var rc RedirectConfiguration + err := json.Unmarshal(body, &rc) + return rc, err + default: + var rc RouteConfiguration + err := json.Unmarshal(body, &rc) + return rc, err + } +} +func unmarshalBasicRouteConfigurationArray(body []byte) ([]BasicRouteConfiguration, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rcArray := make([]BasicRouteConfiguration, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rc, err := unmarshalBasicRouteConfiguration(*rawMessage) + if err != nil { + return nil, err + } + rcArray[index] = rc + } + return rcArray, nil +} + +// MarshalJSON is the custom marshaler for RouteConfiguration. +func (rc RouteConfiguration) MarshalJSON() ([]byte, error) { + rc.OdataType = OdataTypeRouteConfiguration + objectMap := make(map[string]interface{}) + if rc.OdataType != "" { + objectMap["@odata.type"] = rc.OdataType + } + return json.Marshal(objectMap) +} + +// AsForwardingConfiguration is the BasicRouteConfiguration implementation for RouteConfiguration. +func (rc RouteConfiguration) AsForwardingConfiguration() (*ForwardingConfiguration, bool) { + return nil, false +} + +// AsRedirectConfiguration is the BasicRouteConfiguration implementation for RouteConfiguration. +func (rc RouteConfiguration) AsRedirectConfiguration() (*RedirectConfiguration, bool) { + return nil, false +} + +// AsRouteConfiguration is the BasicRouteConfiguration implementation for RouteConfiguration. +func (rc RouteConfiguration) AsRouteConfiguration() (*RouteConfiguration, bool) { + return &rc, true +} + +// AsBasicRouteConfiguration is the BasicRouteConfiguration implementation for RouteConfiguration. +func (rc RouteConfiguration) AsBasicRouteConfiguration() (BasicRouteConfiguration, bool) { + return &rc, true +} + +// RoutingRule a routing rule represents a specification for traffic to treat and where to send it, along +// with health probe information. +type RoutingRule struct { + // RoutingRuleProperties - Properties of the Front Door Routing Rule + *RoutingRuleProperties `json:"properties,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for RoutingRule. +func (rr RoutingRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rr.RoutingRuleProperties != nil { + objectMap["properties"] = rr.RoutingRuleProperties + } + if rr.Name != nil { + objectMap["name"] = rr.Name + } + if rr.ID != nil { + objectMap["id"] = rr.ID + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for RoutingRule struct. +func (rr *RoutingRule) 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 routingRuleProperties RoutingRuleProperties + err = json.Unmarshal(*v, &routingRuleProperties) + if err != nil { + return err + } + rr.RoutingRuleProperties = &routingRuleProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rr.Type = &typeVar + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rr.ID = &ID + } + } + } + + return nil +} + +// RoutingRuleLink defines the Resource ID for a Routing Rule. +type RoutingRuleLink struct { + // ID - Resource ID. + ID *string `json:"id,omitempty"` +} + +// RoutingRuleListResult result of the request to list Routing Rules. It contains a list of Routing Rule +// objects and a URL link to get the next set of results. +type RoutingRuleListResult struct { + // Value - READ-ONLY; List of Routing Rules within a Front Door. + Value *[]RoutingRule `json:"value,omitempty"` + // NextLink - URL to get the next set of RoutingRule objects if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// RoutingRuleProperties the JSON object that contains the properties required to create a routing rule. +type RoutingRuleProperties struct { + // ResourceState - Resource status. Possible values include: 'ResourceStateCreating', 'ResourceStateEnabling', 'ResourceStateEnabled', 'ResourceStateDisabling', 'ResourceStateDisabled', 'ResourceStateDeleting' + ResourceState ResourceState `json:"resourceState,omitempty"` + // FrontendEndpoints - Frontend endpoints associated with this rule + FrontendEndpoints *[]SubResource `json:"frontendEndpoints,omitempty"` + // AcceptedProtocols - Protocol schemes to match for this rule + AcceptedProtocols *[]Protocol `json:"acceptedProtocols,omitempty"` + // PatternsToMatch - The route patterns of the rule. + PatternsToMatch *[]string `json:"patternsToMatch,omitempty"` + // EnabledState - Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'. Possible values include: 'RoutingRuleEnabledStateEnabled', 'RoutingRuleEnabledStateDisabled' + EnabledState RoutingRuleEnabledState `json:"enabledState,omitempty"` + // RouteConfiguration - A reference to the routing configuration. + RouteConfiguration BasicRouteConfiguration `json:"routeConfiguration,omitempty"` + // RulesEngine - A reference to a specific Rules Engine Configuration to apply to this route. + RulesEngine *SubResource `json:"rulesEngine,omitempty"` + // WebApplicationFirewallPolicyLink - Defines the Web Application Firewall policy for each routing rule (if applicable) + WebApplicationFirewallPolicyLink *RoutingRuleUpdateParametersWebApplicationFirewallPolicyLink `json:"webApplicationFirewallPolicyLink,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RoutingRuleProperties struct. +func (rrp *RoutingRuleProperties) 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 "resourceState": + if v != nil { + var resourceState ResourceState + err = json.Unmarshal(*v, &resourceState) + if err != nil { + return err + } + rrp.ResourceState = resourceState + } + case "frontendEndpoints": + if v != nil { + var frontendEndpoints []SubResource + err = json.Unmarshal(*v, &frontendEndpoints) + if err != nil { + return err + } + rrp.FrontendEndpoints = &frontendEndpoints + } + case "acceptedProtocols": + if v != nil { + var acceptedProtocols []Protocol + err = json.Unmarshal(*v, &acceptedProtocols) + if err != nil { + return err + } + rrp.AcceptedProtocols = &acceptedProtocols + } + case "patternsToMatch": + if v != nil { + var patternsToMatch []string + err = json.Unmarshal(*v, &patternsToMatch) + if err != nil { + return err + } + rrp.PatternsToMatch = &patternsToMatch + } + case "enabledState": + if v != nil { + var enabledState RoutingRuleEnabledState + err = json.Unmarshal(*v, &enabledState) + if err != nil { + return err + } + rrp.EnabledState = enabledState + } + case "routeConfiguration": + if v != nil { + routeConfiguration, err := unmarshalBasicRouteConfiguration(*v) + if err != nil { + return err + } + rrp.RouteConfiguration = routeConfiguration + } + case "rulesEngine": + if v != nil { + var rulesEngine SubResource + err = json.Unmarshal(*v, &rulesEngine) + if err != nil { + return err + } + rrp.RulesEngine = &rulesEngine + } + case "webApplicationFirewallPolicyLink": + if v != nil { + var webApplicationFirewallPolicyLink RoutingRuleUpdateParametersWebApplicationFirewallPolicyLink + err = json.Unmarshal(*v, &webApplicationFirewallPolicyLink) + if err != nil { + return err + } + rrp.WebApplicationFirewallPolicyLink = &webApplicationFirewallPolicyLink + } + } + } + + return nil +} + +// RoutingRuleUpdateParameters routing rules to apply to an endpoint +type RoutingRuleUpdateParameters struct { + // FrontendEndpoints - Frontend endpoints associated with this rule + FrontendEndpoints *[]SubResource `json:"frontendEndpoints,omitempty"` + // AcceptedProtocols - Protocol schemes to match for this rule + AcceptedProtocols *[]Protocol `json:"acceptedProtocols,omitempty"` + // PatternsToMatch - The route patterns of the rule. + PatternsToMatch *[]string `json:"patternsToMatch,omitempty"` + // EnabledState - Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'. Possible values include: 'RoutingRuleEnabledStateEnabled', 'RoutingRuleEnabledStateDisabled' + EnabledState RoutingRuleEnabledState `json:"enabledState,omitempty"` + // RouteConfiguration - A reference to the routing configuration. + RouteConfiguration BasicRouteConfiguration `json:"routeConfiguration,omitempty"` + // RulesEngine - A reference to a specific Rules Engine Configuration to apply to this route. + RulesEngine *SubResource `json:"rulesEngine,omitempty"` + // WebApplicationFirewallPolicyLink - Defines the Web Application Firewall policy for each routing rule (if applicable) + WebApplicationFirewallPolicyLink *RoutingRuleUpdateParametersWebApplicationFirewallPolicyLink `json:"webApplicationFirewallPolicyLink,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RoutingRuleUpdateParameters struct. +func (rrup *RoutingRuleUpdateParameters) 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 "frontendEndpoints": + if v != nil { + var frontendEndpoints []SubResource + err = json.Unmarshal(*v, &frontendEndpoints) + if err != nil { + return err + } + rrup.FrontendEndpoints = &frontendEndpoints + } + case "acceptedProtocols": + if v != nil { + var acceptedProtocols []Protocol + err = json.Unmarshal(*v, &acceptedProtocols) + if err != nil { + return err + } + rrup.AcceptedProtocols = &acceptedProtocols + } + case "patternsToMatch": + if v != nil { + var patternsToMatch []string + err = json.Unmarshal(*v, &patternsToMatch) + if err != nil { + return err + } + rrup.PatternsToMatch = &patternsToMatch + } + case "enabledState": + if v != nil { + var enabledState RoutingRuleEnabledState + err = json.Unmarshal(*v, &enabledState) + if err != nil { + return err + } + rrup.EnabledState = enabledState + } + case "routeConfiguration": + if v != nil { + routeConfiguration, err := unmarshalBasicRouteConfiguration(*v) + if err != nil { + return err + } + rrup.RouteConfiguration = routeConfiguration + } + case "rulesEngine": + if v != nil { + var rulesEngine SubResource + err = json.Unmarshal(*v, &rulesEngine) + if err != nil { + return err + } + rrup.RulesEngine = &rulesEngine + } + case "webApplicationFirewallPolicyLink": + if v != nil { + var webApplicationFirewallPolicyLink RoutingRuleUpdateParametersWebApplicationFirewallPolicyLink + err = json.Unmarshal(*v, &webApplicationFirewallPolicyLink) + if err != nil { + return err + } + rrup.WebApplicationFirewallPolicyLink = &webApplicationFirewallPolicyLink + } + } + } + + return nil +} + +// RoutingRuleUpdateParametersWebApplicationFirewallPolicyLink defines the Web Application Firewall policy +// for each routing rule (if applicable) +type RoutingRuleUpdateParametersWebApplicationFirewallPolicyLink struct { + // ID - Resource ID. + ID *string `json:"id,omitempty"` +} + +// RulesEngine a rules engine configuration containing a list of rules that will run to modify the runtime +// behavior of the request and response. +type RulesEngine struct { + autorest.Response `json:"-"` + // RulesEngineProperties - Properties of the Rules Engine Configuration. + *RulesEngineProperties `json:"properties,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for RulesEngine. +func (re RulesEngine) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if re.RulesEngineProperties != nil { + objectMap["properties"] = re.RulesEngineProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for RulesEngine struct. +func (re *RulesEngine) 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 rulesEngineProperties RulesEngineProperties + err = json.Unmarshal(*v, &rulesEngineProperties) + if err != nil { + return err + } + re.RulesEngineProperties = &rulesEngineProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + re.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + re.Type = &typeVar + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + re.ID = &ID + } + } + } + + return nil +} + +// RulesEngineAction one or more actions that will execute, modifying the request and/or response. +type RulesEngineAction struct { + // RequestHeaderActions - A list of header actions to apply from the request from AFD to the origin. + RequestHeaderActions *[]HeaderAction `json:"requestHeaderActions,omitempty"` + // ResponseHeaderActions - A list of header actions to apply from the response from AFD to the client. + ResponseHeaderActions *[]HeaderAction `json:"responseHeaderActions,omitempty"` + // RouteConfigurationOverride - Override the route configuration. + RouteConfigurationOverride BasicRouteConfiguration `json:"routeConfigurationOverride,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RulesEngineAction struct. +func (rea *RulesEngineAction) 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 "requestHeaderActions": + if v != nil { + var requestHeaderActions []HeaderAction + err = json.Unmarshal(*v, &requestHeaderActions) + if err != nil { + return err + } + rea.RequestHeaderActions = &requestHeaderActions + } + case "responseHeaderActions": + if v != nil { + var responseHeaderActions []HeaderAction + err = json.Unmarshal(*v, &responseHeaderActions) + if err != nil { + return err + } + rea.ResponseHeaderActions = &responseHeaderActions + } + case "routeConfigurationOverride": + if v != nil { + routeConfigurationOverride, err := unmarshalBasicRouteConfiguration(*v) + if err != nil { + return err + } + rea.RouteConfigurationOverride = routeConfigurationOverride + } + } + } + + return nil +} + +// RulesEngineListResult result of the request to list Rules Engine Configurations. It contains a list of +// RulesEngine objects and a URL link to get the next set of results. +type RulesEngineListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of rulesEngines within a Front Door. + Value *[]RulesEngine `json:"value,omitempty"` + // NextLink - URL to get the next set of RulesEngine objects if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// RulesEngineListResultIterator provides access to a complete listing of RulesEngine values. +type RulesEngineListResultIterator struct { + i int + page RulesEngineListResultPage +} + +// 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 *RulesEngineListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RulesEngineListResultIterator.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 *RulesEngineListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter RulesEngineListResultIterator) 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 RulesEngineListResultIterator) Response() RulesEngineListResult { + 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 RulesEngineListResultIterator) Value() RulesEngine { + if !iter.page.NotDone() { + return RulesEngine{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the RulesEngineListResultIterator type. +func NewRulesEngineListResultIterator(page RulesEngineListResultPage) RulesEngineListResultIterator { + return RulesEngineListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (relr RulesEngineListResult) IsEmpty() bool { + return relr.Value == nil || len(*relr.Value) == 0 +} + +// rulesEngineListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (relr RulesEngineListResult) rulesEngineListResultPreparer(ctx context.Context) (*http.Request, error) { + if relr.NextLink == nil || len(to.String(relr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(relr.NextLink))) +} + +// RulesEngineListResultPage contains a page of RulesEngine values. +type RulesEngineListResultPage struct { + fn func(context.Context, RulesEngineListResult) (RulesEngineListResult, error) + relr RulesEngineListResult +} + +// 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 *RulesEngineListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RulesEngineListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.relr) + if err != nil { + return err + } + page.relr = next + 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 *RulesEngineListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page RulesEngineListResultPage) NotDone() bool { + return !page.relr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page RulesEngineListResultPage) Response() RulesEngineListResult { + return page.relr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page RulesEngineListResultPage) Values() []RulesEngine { + if page.relr.IsEmpty() { + return nil + } + return *page.relr.Value +} + +// Creates a new instance of the RulesEngineListResultPage type. +func NewRulesEngineListResultPage(getNextPage func(context.Context, RulesEngineListResult) (RulesEngineListResult, error)) RulesEngineListResultPage { + return RulesEngineListResultPage{fn: getNextPage} +} + +// RulesEngineMatchCondition define a match condition +type RulesEngineMatchCondition struct { + // RulesEngineMatchVariable - Match Variable. Possible values include: 'RulesEngineMatchVariableIsMobile', 'RulesEngineMatchVariableRemoteAddr', 'RulesEngineMatchVariableRequestMethod', 'RulesEngineMatchVariableQueryString', 'RulesEngineMatchVariablePostArgs', 'RulesEngineMatchVariableRequestURI', 'RulesEngineMatchVariableRequestPath', 'RulesEngineMatchVariableRequestFilename', 'RulesEngineMatchVariableRequestFilenameExtension', 'RulesEngineMatchVariableRequestHeader', 'RulesEngineMatchVariableRequestBody', 'RulesEngineMatchVariableRequestScheme' + RulesEngineMatchVariable RulesEngineMatchVariable `json:"rulesEngineMatchVariable,omitempty"` + // Selector - Name of selector in RequestHeader or RequestBody to be matched + Selector *string `json:"selector,omitempty"` + // RulesEngineOperator - Describes operator to apply to the match condition. Possible values include: 'RulesEngineOperatorAny', 'RulesEngineOperatorIPMatch', 'RulesEngineOperatorGeoMatch', 'RulesEngineOperatorEqual', 'RulesEngineOperatorContains', 'RulesEngineOperatorLessThan', 'RulesEngineOperatorGreaterThan', 'RulesEngineOperatorLessThanOrEqual', 'RulesEngineOperatorGreaterThanOrEqual', 'RulesEngineOperatorBeginsWith', 'RulesEngineOperatorEndsWith' + RulesEngineOperator RulesEngineOperator `json:"rulesEngineOperator,omitempty"` + // NegateCondition - Describes if this is negate condition or not + NegateCondition *bool `json:"negateCondition,omitempty"` + // RulesEngineMatchValue - Match values to match against. The operator will apply to each value in here with OR semantics. If any of them match the variable with the given operator this match condition is considered a match. + RulesEngineMatchValue *[]string `json:"rulesEngineMatchValue,omitempty"` + // Transforms - List of transforms + Transforms *[]Transform `json:"transforms,omitempty"` +} + +// RulesEngineProperties the JSON object that contains the properties required to create a Rules Engine +// Configuration. +type RulesEngineProperties struct { + // ResourceState - Resource status. Possible values include: 'ResourceStateCreating', 'ResourceStateEnabling', 'ResourceStateEnabled', 'ResourceStateDisabling', 'ResourceStateDisabled', 'ResourceStateDeleting' + ResourceState ResourceState `json:"resourceState,omitempty"` + // Rules - A list of rules that define a particular Rules Engine Configuration. + Rules *[]RulesEngineRule `json:"rules,omitempty"` +} + +// RulesEngineRule contains a list of match conditions, and an action on how to modify the +// request/response. If multiple rules match, the actions from one rule that conflict with a previous rule +// overwrite for a singular action, or append in the case of headers manipulation. +type RulesEngineRule struct { + // Name - A name to refer to this specific rule. + Name *string `json:"name,omitempty"` + // Priority - A priority assigned to this rule. + Priority *int32 `json:"priority,omitempty"` + // Action - Actions to perform on the request and response if all of the match conditions are met. + Action *RulesEngineAction `json:"action,omitempty"` + // MatchConditions - A list of match conditions that must meet in order for the actions of this rule to run. Having no match conditions means the actions will always run. + MatchConditions *[]RulesEngineMatchCondition `json:"matchConditions,omitempty"` + // MatchProcessingBehavior - If this rule is a match should the rules engine continue running the remaining rules or stop. If not present, defaults to Continue. Possible values include: 'Continue', 'Stop' + MatchProcessingBehavior MatchProcessingBehavior `json:"matchProcessingBehavior,omitempty"` +} + +// RulesEnginesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type RulesEnginesCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *RulesEnginesCreateOrUpdateFuture) Result(client RulesEnginesClient) (re RulesEngine, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.RulesEnginesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("frontdoor.RulesEnginesCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if re.Response.Response, err = future.GetResult(sender); err == nil && re.Response.Response.StatusCode != http.StatusNoContent { + re, err = client.CreateOrUpdateResponder(re.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.RulesEnginesCreateOrUpdateFuture", "Result", re.Response.Response, "Failure responding to request") + } + } + return +} + +// RulesEnginesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type RulesEnginesDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *RulesEnginesDeleteFuture) Result(client RulesEnginesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.RulesEnginesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("frontdoor.RulesEnginesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// RulesEngineUpdateParameters rules Engine Configuration to apply to a Routing Rule. +type RulesEngineUpdateParameters struct { + // Rules - A list of rules that define a particular Rules Engine Configuration. + Rules *[]RulesEngineRule `json:"rules,omitempty"` +} + +// SubResource reference to another subresource. +type SubResource struct { + // ID - Resource ID. + ID *string `json:"id,omitempty"` +} + +// TagsObject tags object for patch operations. +type TagsObject struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for TagsObject. +func (toVar TagsObject) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if toVar.Tags != nil { + objectMap["tags"] = toVar.Tags + } + return json.Marshal(objectMap) +} + +// Timeseries defines the Timeseries +type Timeseries struct { + autorest.Response `json:"-"` + // TimeseriesProperties - The properties of a Timeseries + *TimeseriesProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Timeseries. +func (t Timeseries) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if t.TimeseriesProperties != nil { + objectMap["properties"] = t.TimeseriesProperties + } + 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 Timeseries struct. +func (t *Timeseries) 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 timeseriesProperties TimeseriesProperties + err = json.Unmarshal(*v, ×eriesProperties) + if err != nil { + return err + } + t.TimeseriesProperties = ×eriesProperties + } + 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 + } + } + } + + return nil +} + +// TimeseriesDataPoint defines a timeseries datapoint used in a timeseries +type TimeseriesDataPoint struct { + // DateTimeUTC - The DateTime of the Timeseries data point in UTC + DateTimeUTC *string `json:"dateTimeUTC,omitempty"` + // Value - The Value of the Timeseries data point + Value *float64 `json:"value,omitempty"` +} + +// TimeseriesProperties defines the properties of a timeseries +type TimeseriesProperties struct { + // Endpoint - The endpoint associated with the Timeseries data point + Endpoint *string `json:"endpoint,omitempty"` + // StartDateTimeUTC - The start DateTime of the Timeseries in UTC + StartDateTimeUTC *string `json:"startDateTimeUTC,omitempty"` + // EndDateTimeUTC - The end DateTime of the Timeseries in UTC + EndDateTimeUTC *string `json:"endDateTimeUTC,omitempty"` + // AggregationInterval - The aggregation interval of the Timeseries. Possible values include: 'Hourly', 'Daily' + AggregationInterval AggregationInterval `json:"aggregationInterval,omitempty"` + // TimeseriesType - The type of Timeseries. Possible values include: 'MeasurementCounts', 'LatencyP50', 'LatencyP75', 'LatencyP95' + TimeseriesType TimeseriesType `json:"timeseriesType,omitempty"` + // Country - The country associated with the Timeseries. Values are country ISO codes as specified here- https://www.iso.org/iso-3166-country-codes.html + Country *string `json:"country,omitempty"` + // TimeseriesData - The set of data points for the timeseries + TimeseriesData *[]TimeseriesDataPoint `json:"timeseriesData,omitempty"` +} + +// UpdateParameters the properties needed to update a Front Door +type UpdateParameters struct { + // FriendlyName - A friendly name for the frontDoor + FriendlyName *string `json:"friendlyName,omitempty"` + // RoutingRules - Routing rules associated with this Front Door. + RoutingRules *[]RoutingRule `json:"routingRules,omitempty"` + // LoadBalancingSettings - Load balancing settings associated with this Front Door instance. + LoadBalancingSettings *[]LoadBalancingSettingsModel `json:"loadBalancingSettings,omitempty"` + // HealthProbeSettings - Health probe settings associated with this Front Door instance. + HealthProbeSettings *[]HealthProbeSettingsModel `json:"healthProbeSettings,omitempty"` + // BackendPools - Backend pools available to routing rules. + BackendPools *[]BackendPool `json:"backendPools,omitempty"` + // FrontendEndpoints - Frontend endpoints available to routing rules. + FrontendEndpoints *[]FrontendEndpoint `json:"frontendEndpoints,omitempty"` + // BackendPoolsSettings - Settings for all backendPools + BackendPoolsSettings *BackendPoolsSettings `json:"backendPoolsSettings,omitempty"` + // EnabledState - Operational status of the Front Door load balancer. Permitted values are 'Enabled' or 'Disabled'. Possible values include: 'EnabledStateEnabled', 'EnabledStateDisabled' + EnabledState EnabledState `json:"enabledState,omitempty"` +} + +// ValidateCustomDomainInput input of the custom domain to be validated for DNS mapping. +type ValidateCustomDomainInput struct { + // HostName - The host name of the custom domain. Must be a domain name. + HostName *string `json:"hostName,omitempty"` +} + +// ValidateCustomDomainOutput output of custom domain validation. +type ValidateCustomDomainOutput struct { + autorest.Response `json:"-"` + // CustomDomainValidated - READ-ONLY; Indicates whether the custom domain is valid or not. + CustomDomainValidated *bool `json:"customDomainValidated,omitempty"` + // Reason - READ-ONLY; The reason why the custom domain is not valid. + Reason *string `json:"reason,omitempty"` + // Message - READ-ONLY; Error message describing why the custom domain is not valid. + Message *string `json:"message,omitempty"` +} + +// WebApplicationFirewallPolicy defines web application firewall policy. +type WebApplicationFirewallPolicy struct { + autorest.Response `json:"-"` + // WebApplicationFirewallPolicyProperties - Properties of the web application firewall policy. + *WebApplicationFirewallPolicyProperties `json:"properties,omitempty"` + // Etag - Gets a unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for WebApplicationFirewallPolicy. +func (wafp WebApplicationFirewallPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wafp.WebApplicationFirewallPolicyProperties != nil { + objectMap["properties"] = wafp.WebApplicationFirewallPolicyProperties + } + if wafp.Etag != nil { + objectMap["etag"] = wafp.Etag + } + if wafp.Location != nil { + objectMap["location"] = wafp.Location + } + if wafp.Tags != nil { + objectMap["tags"] = wafp.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for WebApplicationFirewallPolicy struct. +func (wafp *WebApplicationFirewallPolicy) 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 webApplicationFirewallPolicyProperties WebApplicationFirewallPolicyProperties + err = json.Unmarshal(*v, &webApplicationFirewallPolicyProperties) + if err != nil { + return err + } + wafp.WebApplicationFirewallPolicyProperties = &webApplicationFirewallPolicyProperties + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + wafp.Etag = &etag + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + wafp.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + wafp.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + wafp.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + wafp.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + wafp.Tags = tags + } + } + } + + return nil +} + +// WebApplicationFirewallPolicyList defines a list of WebApplicationFirewallPolicies. It contains a list of +// WebApplicationFirewallPolicy objects and a URL link to get the next set of results. +type WebApplicationFirewallPolicyList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of WebApplicationFirewallPolicies within a resource group. + Value *[]WebApplicationFirewallPolicy `json:"value,omitempty"` + // NextLink - URL to get the next set of WebApplicationFirewallPolicy objects if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// WebApplicationFirewallPolicyListIterator provides access to a complete listing of +// WebApplicationFirewallPolicy values. +type WebApplicationFirewallPolicyListIterator struct { + i int + page WebApplicationFirewallPolicyListPage +} + +// 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 *WebApplicationFirewallPolicyListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WebApplicationFirewallPolicyListIterator.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 *WebApplicationFirewallPolicyListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter WebApplicationFirewallPolicyListIterator) 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 WebApplicationFirewallPolicyListIterator) Response() WebApplicationFirewallPolicyList { + 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 WebApplicationFirewallPolicyListIterator) Value() WebApplicationFirewallPolicy { + if !iter.page.NotDone() { + return WebApplicationFirewallPolicy{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the WebApplicationFirewallPolicyListIterator type. +func NewWebApplicationFirewallPolicyListIterator(page WebApplicationFirewallPolicyListPage) WebApplicationFirewallPolicyListIterator { + return WebApplicationFirewallPolicyListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (wafpl WebApplicationFirewallPolicyList) IsEmpty() bool { + return wafpl.Value == nil || len(*wafpl.Value) == 0 +} + +// webApplicationFirewallPolicyListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (wafpl WebApplicationFirewallPolicyList) webApplicationFirewallPolicyListPreparer(ctx context.Context) (*http.Request, error) { + if wafpl.NextLink == nil || len(to.String(wafpl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(wafpl.NextLink))) +} + +// WebApplicationFirewallPolicyListPage contains a page of WebApplicationFirewallPolicy values. +type WebApplicationFirewallPolicyListPage struct { + fn func(context.Context, WebApplicationFirewallPolicyList) (WebApplicationFirewallPolicyList, error) + wafpl WebApplicationFirewallPolicyList +} + +// 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 *WebApplicationFirewallPolicyListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WebApplicationFirewallPolicyListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.wafpl) + if err != nil { + return err + } + page.wafpl = next + 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 *WebApplicationFirewallPolicyListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page WebApplicationFirewallPolicyListPage) NotDone() bool { + return !page.wafpl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page WebApplicationFirewallPolicyListPage) Response() WebApplicationFirewallPolicyList { + return page.wafpl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page WebApplicationFirewallPolicyListPage) Values() []WebApplicationFirewallPolicy { + if page.wafpl.IsEmpty() { + return nil + } + return *page.wafpl.Value +} + +// Creates a new instance of the WebApplicationFirewallPolicyListPage type. +func NewWebApplicationFirewallPolicyListPage(getNextPage func(context.Context, WebApplicationFirewallPolicyList) (WebApplicationFirewallPolicyList, error)) WebApplicationFirewallPolicyListPage { + return WebApplicationFirewallPolicyListPage{fn: getNextPage} +} + +// WebApplicationFirewallPolicyProperties defines web application firewall policy properties. +type WebApplicationFirewallPolicyProperties struct { + // PolicySettings - Describes settings for the policy. + PolicySettings *PolicySettings `json:"policySettings,omitempty"` + // CustomRules - Describes custom rules inside the policy. + CustomRules *CustomRuleList `json:"customRules,omitempty"` + // ManagedRules - Describes managed rules inside the policy. + ManagedRules *ManagedRuleSetList `json:"managedRules,omitempty"` + // FrontendEndpointLinks - READ-ONLY; Describes Frontend Endpoints associated with this Web Application Firewall policy. + FrontendEndpointLinks *[]FrontendEndpointLink `json:"frontendEndpointLinks,omitempty"` + // RoutingRuleLinks - READ-ONLY; Describes Routing Rules associated with this Web Application Firewall policy. + RoutingRuleLinks *[]RoutingRuleLink `json:"routingRuleLinks,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the policy. + ProvisioningState *string `json:"provisioningState,omitempty"` + // ResourceState - READ-ONLY; Possible values include: 'PolicyResourceStateCreating', 'PolicyResourceStateEnabling', 'PolicyResourceStateEnabled', 'PolicyResourceStateDisabling', 'PolicyResourceStateDisabled', 'PolicyResourceStateDeleting' + ResourceState PolicyResourceState `json:"resourceState,omitempty"` +} diff --git a/services/frontdoor/mgmt/2020-04-01/frontdoor/networkexperimentprofiles.go b/services/frontdoor/mgmt/2020-04-01/frontdoor/networkexperimentprofiles.go new file mode 100644 index 000000000000..9397356bdc5a --- /dev/null +++ b/services/frontdoor/mgmt/2020-04-01/frontdoor/networkexperimentprofiles.go @@ -0,0 +1,622 @@ +package frontdoor + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// NetworkExperimentProfilesClient is the frontDoor Client +type NetworkExperimentProfilesClient struct { + BaseClient +} + +// NewNetworkExperimentProfilesClient creates an instance of the NetworkExperimentProfilesClient client. +func NewNetworkExperimentProfilesClient(subscriptionID string) NetworkExperimentProfilesClient { + return NewNetworkExperimentProfilesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewNetworkExperimentProfilesClientWithBaseURI creates an instance of the NetworkExperimentProfilesClient 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 NewNetworkExperimentProfilesClientWithBaseURI(baseURI string, subscriptionID string) NetworkExperimentProfilesClient { + return NetworkExperimentProfilesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate sends the create or update request. +// Parameters: +// profileName - the Profile identifier associated with the Tenant and Partner +// resourceGroupName - name of the Resource group within the Azure subscription. +// parameters - an Network Experiment Profile +func (client NetworkExperimentProfilesClient) CreateOrUpdate(ctx context.Context, profileName string, resourceGroupName string, parameters Profile) (result NetworkExperimentProfilesCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NetworkExperimentProfilesClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: profileName, + Constraints: []validation.Constraint{{Target: "profileName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.NetworkExperimentProfilesClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, profileName, resourceGroupName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client NetworkExperimentProfilesClient) CreateOrUpdatePreparer(ctx context.Context, profileName string, resourceGroupName string, parameters Profile) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-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.Network/NetworkExperimentProfiles/{profileName}", pathParameters), + autorest.WithJSON(parameters), + 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 NetworkExperimentProfilesClient) CreateOrUpdateSender(req *http.Request) (future NetworkExperimentProfilesCreateOrUpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client NetworkExperimentProfilesClient) CreateOrUpdateResponder(resp *http.Response) (result Profile, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete sends the delete request. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - the Profile identifier associated with the Tenant and Partner +func (client NetworkExperimentProfilesClient) Delete(ctx context.Context, resourceGroupName string, profileName string) (result NetworkExperimentProfilesDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NetworkExperimentProfilesClient.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: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: profileName, + Constraints: []validation.Constraint{{Target: "profileName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.NetworkExperimentProfilesClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, profileName) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client NetworkExperimentProfilesClient) DeletePreparer(ctx context.Context, resourceGroupName string, profileName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-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.Network/NetworkExperimentProfiles/{profileName}", 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 NetworkExperimentProfilesClient) DeleteSender(req *http.Request) (future NetworkExperimentProfilesDeleteFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client NetworkExperimentProfilesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 within the Azure subscription. +// profileName - the Profile identifier associated with the Tenant and Partner +func (client NetworkExperimentProfilesClient) Get(ctx context.Context, resourceGroupName string, profileName string) (result Profile, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NetworkExperimentProfilesClient.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: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: profileName, + Constraints: []validation.Constraint{{Target: "profileName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.NetworkExperimentProfilesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, profileName) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client NetworkExperimentProfilesClient) GetPreparer(ctx context.Context, resourceGroupName string, profileName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/NetworkExperimentProfiles/{profileName}", 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 NetworkExperimentProfilesClient) 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 NetworkExperimentProfilesClient) GetResponder(resp *http.Response) (result Profile, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List sends the list request. +func (client NetworkExperimentProfilesClient) List(ctx context.Context) (result ProfileListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NetworkExperimentProfilesClient.List") + defer func() { + sc := -1 + if result.pl.Response.Response != nil { + sc = result.pl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.pl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesClient", "List", resp, "Failure sending request") + return + } + + result.pl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client NetworkExperimentProfilesClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/NetworkExperimentProfiles", 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 NetworkExperimentProfilesClient) 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 NetworkExperimentProfilesClient) ListResponder(resp *http.Response) (result ProfileList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 NetworkExperimentProfilesClient) listNextResults(ctx context.Context, lastResults ProfileList) (result ProfileList, err error) { + req, err := lastResults.profileListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesClient", "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, "frontdoor.NetworkExperimentProfilesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client NetworkExperimentProfilesClient) ListComplete(ctx context.Context) (result ProfileListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NetworkExperimentProfilesClient.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 sends the list by resource group request. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +func (client NetworkExperimentProfilesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ProfileListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NetworkExperimentProfilesClient.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: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.NetworkExperimentProfilesClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesClient", "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, "frontdoor.NetworkExperimentProfilesClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.pl, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client NetworkExperimentProfilesClient) 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 = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/NetworkExperimentProfiles", 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 NetworkExperimentProfilesClient) 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 NetworkExperimentProfilesClient) ListByResourceGroupResponder(resp *http.Response) (result ProfileList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 NetworkExperimentProfilesClient) listByResourceGroupNextResults(ctx context.Context, lastResults ProfileList) (result ProfileList, err error) { + req, err := lastResults.profileListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesClient", "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, "frontdoor.NetworkExperimentProfilesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client NetworkExperimentProfilesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ProfileListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NetworkExperimentProfilesClient.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 updates an NetworkExperimentProfiles +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - the Profile identifier associated with the Tenant and Partner +// parameters - the Profile Update Model +func (client NetworkExperimentProfilesClient) Update(ctx context.Context, resourceGroupName string, profileName string, parameters ProfileUpdateModel) (result NetworkExperimentProfilesUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NetworkExperimentProfilesClient.Update") + 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: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: profileName, + Constraints: []validation.Constraint{{Target: "profileName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.NetworkExperimentProfilesClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, profileName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client NetworkExperimentProfilesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, profileName string, parameters ProfileUpdateModel) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-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.Network/NetworkExperimentProfiles/{profileName}", pathParameters), + autorest.WithJSON(parameters), + 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 NetworkExperimentProfilesClient) UpdateSender(req *http.Request) (future NetworkExperimentProfilesUpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client NetworkExperimentProfilesClient) UpdateResponder(resp *http.Response) (result Profile, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/frontdoor/mgmt/2020-04-01/frontdoor/policies.go b/services/frontdoor/mgmt/2020-04-01/frontdoor/policies.go new file mode 100644 index 000000000000..5eeae5b428cb --- /dev/null +++ b/services/frontdoor/mgmt/2020-04-01/frontdoor/policies.go @@ -0,0 +1,430 @@ +package frontdoor + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// PoliciesClient is the frontDoor Client +type PoliciesClient struct { + BaseClient +} + +// NewPoliciesClient creates an instance of the PoliciesClient client. +func NewPoliciesClient(subscriptionID string) PoliciesClient { + return NewPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPoliciesClientWithBaseURI creates an instance of the PoliciesClient 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 NewPoliciesClientWithBaseURI(baseURI string, subscriptionID string) PoliciesClient { + return PoliciesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create or update policy with specified rule set name within a resource group. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// policyName - the name of the Web Application Firewall Policy. +// parameters - policy to be created. +func (client PoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, policyName string, parameters WebApplicationFirewallPolicy) (result PoliciesCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PoliciesClient.CreateOrUpdate") + 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: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: policyName, + Constraints: []validation.Constraint{{Target: "policyName", Name: validation.MaxLength, Rule: 128, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.WebApplicationFirewallPolicyProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.WebApplicationFirewallPolicyProperties.PolicySettings", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.WebApplicationFirewallPolicyProperties.PolicySettings.CustomBlockResponseBody", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.WebApplicationFirewallPolicyProperties.PolicySettings.CustomBlockResponseBody", Name: validation.Pattern, Rule: `^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$`, Chain: nil}}}, + }}, + }}}}}); err != nil { + return result, validation.NewError("frontdoor.PoliciesClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, policyName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.PoliciesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.PoliciesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client PoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, policyName string, parameters WebApplicationFirewallPolicy) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-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.Network/FrontDoorWebApplicationFirewallPolicies/{policyName}", pathParameters), + autorest.WithJSON(parameters), + 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 PoliciesClient) CreateOrUpdateSender(req *http.Request) (future PoliciesCreateOrUpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client PoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result WebApplicationFirewallPolicy, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes Policy +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// policyName - the name of the Web Application Firewall Policy. +func (client PoliciesClient) Delete(ctx context.Context, resourceGroupName string, policyName string) (result PoliciesDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PoliciesClient.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: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: policyName, + Constraints: []validation.Constraint{{Target: "policyName", Name: validation.MaxLength, Rule: 128, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.PoliciesClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, policyName) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.PoliciesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.PoliciesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client PoliciesClient) DeletePreparer(ctx context.Context, resourceGroupName string, policyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-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.Network/FrontDoorWebApplicationFirewallPolicies/{policyName}", 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 PoliciesClient) DeleteSender(req *http.Request) (future PoliciesDeleteFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client PoliciesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieve protection policy with specified name within a resource group. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// policyName - the name of the Web Application Firewall Policy. +func (client PoliciesClient) Get(ctx context.Context, resourceGroupName string, policyName string) (result WebApplicationFirewallPolicy, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PoliciesClient.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: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: policyName, + Constraints: []validation.Constraint{{Target: "policyName", Name: validation.MaxLength, Rule: 128, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.PoliciesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, policyName) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.PoliciesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "frontdoor.PoliciesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.PoliciesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client PoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, policyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/FrontDoorWebApplicationFirewallPolicies/{policyName}", 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 PoliciesClient) 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 PoliciesClient) GetResponder(resp *http.Response) (result WebApplicationFirewallPolicy, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists all of the protection policies within a resource group. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +func (client PoliciesClient) List(ctx context.Context, resourceGroupName string) (result WebApplicationFirewallPolicyListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PoliciesClient.List") + defer func() { + sc := -1 + if result.wafpl.Response.Response != nil { + sc = result.wafpl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.PoliciesClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.PoliciesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.wafpl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "frontdoor.PoliciesClient", "List", resp, "Failure sending request") + return + } + + result.wafpl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.PoliciesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client PoliciesClient) ListPreparer(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 = "2020-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoorWebApplicationFirewallPolicies", 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 PoliciesClient) 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 PoliciesClient) ListResponder(resp *http.Response) (result WebApplicationFirewallPolicyList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 PoliciesClient) listNextResults(ctx context.Context, lastResults WebApplicationFirewallPolicyList) (result WebApplicationFirewallPolicyList, err error) { + req, err := lastResults.webApplicationFirewallPolicyListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "frontdoor.PoliciesClient", "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, "frontdoor.PoliciesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.PoliciesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client PoliciesClient) ListComplete(ctx context.Context, resourceGroupName string) (result WebApplicationFirewallPolicyListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PoliciesClient.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) + return +} diff --git a/services/frontdoor/mgmt/2020-04-01/frontdoor/preconfiguredendpoints.go b/services/frontdoor/mgmt/2020-04-01/frontdoor/preconfiguredendpoints.go new file mode 100644 index 000000000000..b19caf1ca5bb --- /dev/null +++ b/services/frontdoor/mgmt/2020-04-01/frontdoor/preconfiguredendpoints.go @@ -0,0 +1,168 @@ +package frontdoor + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// PreconfiguredEndpointsClient is the frontDoor Client +type PreconfiguredEndpointsClient struct { + BaseClient +} + +// NewPreconfiguredEndpointsClient creates an instance of the PreconfiguredEndpointsClient client. +func NewPreconfiguredEndpointsClient(subscriptionID string) PreconfiguredEndpointsClient { + return NewPreconfiguredEndpointsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPreconfiguredEndpointsClientWithBaseURI creates an instance of the PreconfiguredEndpointsClient 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 NewPreconfiguredEndpointsClientWithBaseURI(baseURI string, subscriptionID string) PreconfiguredEndpointsClient { + return PreconfiguredEndpointsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List sends the list request. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - the Profile identifier associated with the Tenant and Partner +func (client PreconfiguredEndpointsClient) List(ctx context.Context, resourceGroupName string, profileName string) (result PreconfiguredEndpointListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PreconfiguredEndpointsClient.List") + defer func() { + sc := -1 + if result.pel.Response.Response != nil { + sc = result.pel.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: profileName, + Constraints: []validation.Constraint{{Target: "profileName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.PreconfiguredEndpointsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, profileName) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.PreconfiguredEndpointsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.pel.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "frontdoor.PreconfiguredEndpointsClient", "List", resp, "Failure sending request") + return + } + + result.pel, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.PreconfiguredEndpointsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client PreconfiguredEndpointsClient) ListPreparer(ctx context.Context, resourceGroupName string, profileName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/NetworkExperimentProfiles/{profileName}/PreconfiguredEndpoints", 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 PreconfiguredEndpointsClient) 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 PreconfiguredEndpointsClient) ListResponder(resp *http.Response) (result PreconfiguredEndpointList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 PreconfiguredEndpointsClient) listNextResults(ctx context.Context, lastResults PreconfiguredEndpointList) (result PreconfiguredEndpointList, err error) { + req, err := lastResults.preconfiguredEndpointListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "frontdoor.PreconfiguredEndpointsClient", "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, "frontdoor.PreconfiguredEndpointsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.PreconfiguredEndpointsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client PreconfiguredEndpointsClient) ListComplete(ctx context.Context, resourceGroupName string, profileName string) (result PreconfiguredEndpointListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PreconfiguredEndpointsClient.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, profileName) + return +} diff --git a/services/frontdoor/mgmt/2020-04-01/frontdoor/reports.go b/services/frontdoor/mgmt/2020-04-01/frontdoor/reports.go new file mode 100644 index 000000000000..b97a0bb5489e --- /dev/null +++ b/services/frontdoor/mgmt/2020-04-01/frontdoor/reports.go @@ -0,0 +1,252 @@ +package frontdoor + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// ReportsClient is the frontDoor Client +type ReportsClient struct { + BaseClient +} + +// NewReportsClient creates an instance of the ReportsClient client. +func NewReportsClient(subscriptionID string) ReportsClient { + return NewReportsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewReportsClientWithBaseURI creates an instance of the ReportsClient 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 NewReportsClientWithBaseURI(baseURI string, subscriptionID string) ReportsClient { + return ReportsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// GetLatencyScorecards sends the get latency scorecards request. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - the Profile identifier associated with the Tenant and Partner +// experimentName - the Experiment identifier associated with the Experiment +// aggregationInterval - the aggregation interval of the Latency Scorecard +// endDateTimeUTC - the end DateTime of the Latency Scorecard in UTC +// country - the country associated with the Latency Scorecard. Values are country ISO codes as specified here- +// https://www.iso.org/iso-3166-country-codes.html +func (client ReportsClient) GetLatencyScorecards(ctx context.Context, resourceGroupName string, profileName string, experimentName string, aggregationInterval LatencyScorecardAggregationInterval, endDateTimeUTC string, country string) (result LatencyScorecard, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReportsClient.GetLatencyScorecards") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: profileName, + Constraints: []validation.Constraint{{Target: "profileName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: experimentName, + Constraints: []validation.Constraint{{Target: "experimentName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.ReportsClient", "GetLatencyScorecards", err.Error()) + } + + req, err := client.GetLatencyScorecardsPreparer(ctx, resourceGroupName, profileName, experimentName, aggregationInterval, endDateTimeUTC, country) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ReportsClient", "GetLatencyScorecards", nil, "Failure preparing request") + return + } + + resp, err := client.GetLatencyScorecardsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "frontdoor.ReportsClient", "GetLatencyScorecards", resp, "Failure sending request") + return + } + + result, err = client.GetLatencyScorecardsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ReportsClient", "GetLatencyScorecards", resp, "Failure responding to request") + } + + return +} + +// GetLatencyScorecardsPreparer prepares the GetLatencyScorecards request. +func (client ReportsClient) GetLatencyScorecardsPreparer(ctx context.Context, resourceGroupName string, profileName string, experimentName string, aggregationInterval LatencyScorecardAggregationInterval, endDateTimeUTC string, country string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "experimentName": autorest.Encode("path", experimentName), + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "aggregationInterval": autorest.Encode("query", aggregationInterval), + "api-version": APIVersion, + } + if len(endDateTimeUTC) > 0 { + queryParameters["endDateTimeUTC"] = autorest.Encode("query", endDateTimeUTC) + } + if len(country) > 0 { + queryParameters["country"] = autorest.Encode("query", country) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/NetworkExperimentProfiles/{profileName}/Experiments/{experimentName}/LatencyScorecard", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetLatencyScorecardsSender sends the GetLatencyScorecards request. The method will close the +// http.Response Body if it receives an error. +func (client ReportsClient) GetLatencyScorecardsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetLatencyScorecardsResponder handles the response to the GetLatencyScorecards request. The method always +// closes the http.Response Body. +func (client ReportsClient) GetLatencyScorecardsResponder(resp *http.Response) (result LatencyScorecard, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetTimeseries sends the get timeseries request. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - the Profile identifier associated with the Tenant and Partner +// experimentName - the Experiment identifier associated with the Experiment +// startDateTimeUTC - the start DateTime of the Timeseries in UTC +// endDateTimeUTC - the end DateTime of the Timeseries in UTC +// aggregationInterval - the aggregation interval of the Timeseries +// timeseriesType - the type of Timeseries +// endpoint - the specific endpoint +// country - the country associated with the Timeseries. Values are country ISO codes as specified here- +// https://www.iso.org/iso-3166-country-codes.html +func (client ReportsClient) GetTimeseries(ctx context.Context, resourceGroupName string, profileName string, experimentName string, startDateTimeUTC date.Time, endDateTimeUTC date.Time, aggregationInterval TimeseriesAggregationInterval, timeseriesType TimeseriesType, endpoint string, country string) (result Timeseries, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReportsClient.GetTimeseries") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: profileName, + Constraints: []validation.Constraint{{Target: "profileName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: experimentName, + Constraints: []validation.Constraint{{Target: "experimentName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.ReportsClient", "GetTimeseries", err.Error()) + } + + req, err := client.GetTimeseriesPreparer(ctx, resourceGroupName, profileName, experimentName, startDateTimeUTC, endDateTimeUTC, aggregationInterval, timeseriesType, endpoint, country) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ReportsClient", "GetTimeseries", nil, "Failure preparing request") + return + } + + resp, err := client.GetTimeseriesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "frontdoor.ReportsClient", "GetTimeseries", resp, "Failure sending request") + return + } + + result, err = client.GetTimeseriesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ReportsClient", "GetTimeseries", resp, "Failure responding to request") + } + + return +} + +// GetTimeseriesPreparer prepares the GetTimeseries request. +func (client ReportsClient) GetTimeseriesPreparer(ctx context.Context, resourceGroupName string, profileName string, experimentName string, startDateTimeUTC date.Time, endDateTimeUTC date.Time, aggregationInterval TimeseriesAggregationInterval, timeseriesType TimeseriesType, endpoint string, country string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "experimentName": autorest.Encode("path", experimentName), + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "aggregationInterval": autorest.Encode("query", aggregationInterval), + "api-version": APIVersion, + "endDateTimeUTC": autorest.Encode("query", endDateTimeUTC), + "startDateTimeUTC": autorest.Encode("query", startDateTimeUTC), + "timeseriesType": autorest.Encode("query", timeseriesType), + } + if len(endpoint) > 0 { + queryParameters["endpoint"] = autorest.Encode("query", endpoint) + } + if len(country) > 0 { + queryParameters["country"] = autorest.Encode("query", country) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/NetworkExperimentProfiles/{profileName}/Experiments/{experimentName}/Timeseries", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetTimeseriesSender sends the GetTimeseries request. The method will close the +// http.Response Body if it receives an error. +func (client ReportsClient) GetTimeseriesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetTimeseriesResponder handles the response to the GetTimeseries request. The method always +// closes the http.Response Body. +func (client ReportsClient) GetTimeseriesResponder(resp *http.Response) (result Timeseries, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/frontdoor/mgmt/2020-04-01/frontdoor/rulesengines.go b/services/frontdoor/mgmt/2020-04-01/frontdoor/rulesengines.go new file mode 100644 index 000000000000..78ca1ab5b19b --- /dev/null +++ b/services/frontdoor/mgmt/2020-04-01/frontdoor/rulesengines.go @@ -0,0 +1,457 @@ +package frontdoor + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// RulesEnginesClient is the frontDoor Client +type RulesEnginesClient struct { + BaseClient +} + +// NewRulesEnginesClient creates an instance of the RulesEnginesClient client. +func NewRulesEnginesClient(subscriptionID string) RulesEnginesClient { + return NewRulesEnginesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewRulesEnginesClientWithBaseURI creates an instance of the RulesEnginesClient 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 NewRulesEnginesClientWithBaseURI(baseURI string, subscriptionID string) RulesEnginesClient { + return RulesEnginesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates a new Rules Engine Configuration with the specified name within the specified Front Door. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// frontDoorName - name of the Front Door which is globally unique. +// rulesEngineName - name of the Rules Engine which is unique within the Front Door. +// rulesEngineParameters - rules Engine Configuration properties needed to create a new Rules Engine +// Configuration. +func (client RulesEnginesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, frontDoorName string, rulesEngineName string, rulesEngineParameters RulesEngine) (result RulesEnginesCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RulesEnginesClient.CreateOrUpdate") + 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: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: frontDoorName, + Constraints: []validation.Constraint{{Target: "frontDoorName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "frontDoorName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "frontDoorName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$`, Chain: nil}}}, + {TargetValue: rulesEngineName, + Constraints: []validation.Constraint{{Target: "rulesEngineName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "rulesEngineName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "rulesEngineName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.RulesEnginesClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, frontDoorName, rulesEngineName, rulesEngineParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.RulesEnginesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.RulesEnginesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client RulesEnginesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, frontDoorName string, rulesEngineName string, rulesEngineParameters RulesEngine) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "frontDoorName": autorest.Encode("path", frontDoorName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "rulesEngineName": autorest.Encode("path", rulesEngineName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + rulesEngineParameters.Name = nil + rulesEngineParameters.Type = nil + rulesEngineParameters.ID = 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.Network/frontDoors/{frontDoorName}/rulesEngines/{rulesEngineName}", pathParameters), + autorest.WithJSON(rulesEngineParameters), + 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 RulesEnginesClient) CreateOrUpdateSender(req *http.Request) (future RulesEnginesCreateOrUpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client RulesEnginesClient) CreateOrUpdateResponder(resp *http.Response) (result RulesEngine, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes an existing Rules Engine Configuration with the specified parameters. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// frontDoorName - name of the Front Door which is globally unique. +// rulesEngineName - name of the Rules Engine which is unique within the Front Door. +func (client RulesEnginesClient) Delete(ctx context.Context, resourceGroupName string, frontDoorName string, rulesEngineName string) (result RulesEnginesDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RulesEnginesClient.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: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: frontDoorName, + Constraints: []validation.Constraint{{Target: "frontDoorName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "frontDoorName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "frontDoorName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$`, Chain: nil}}}, + {TargetValue: rulesEngineName, + Constraints: []validation.Constraint{{Target: "rulesEngineName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "rulesEngineName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "rulesEngineName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.RulesEnginesClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, frontDoorName, rulesEngineName) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.RulesEnginesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.RulesEnginesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client RulesEnginesClient) DeletePreparer(ctx context.Context, resourceGroupName string, frontDoorName string, rulesEngineName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "frontDoorName": autorest.Encode("path", frontDoorName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "rulesEngineName": autorest.Encode("path", rulesEngineName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-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.Network/frontDoors/{frontDoorName}/rulesEngines/{rulesEngineName}", 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 RulesEnginesClient) DeleteSender(req *http.Request) (future RulesEnginesDeleteFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client RulesEnginesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets a Rules Engine Configuration with the specified name within the specified Front Door. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// frontDoorName - name of the Front Door which is globally unique. +// rulesEngineName - name of the Rules Engine which is unique within the Front Door. +func (client RulesEnginesClient) Get(ctx context.Context, resourceGroupName string, frontDoorName string, rulesEngineName string) (result RulesEngine, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RulesEnginesClient.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: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: frontDoorName, + Constraints: []validation.Constraint{{Target: "frontDoorName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "frontDoorName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "frontDoorName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$`, Chain: nil}}}, + {TargetValue: rulesEngineName, + Constraints: []validation.Constraint{{Target: "rulesEngineName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "rulesEngineName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "rulesEngineName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.RulesEnginesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, frontDoorName, rulesEngineName) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.RulesEnginesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "frontdoor.RulesEnginesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.RulesEnginesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client RulesEnginesClient) GetPreparer(ctx context.Context, resourceGroupName string, frontDoorName string, rulesEngineName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "frontDoorName": autorest.Encode("path", frontDoorName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "rulesEngineName": autorest.Encode("path", rulesEngineName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/rulesEngines/{rulesEngineName}", 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 RulesEnginesClient) 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 RulesEnginesClient) GetResponder(resp *http.Response) (result RulesEngine, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByFrontDoor lists all of the Rules Engine Configurations within a Front Door. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// frontDoorName - name of the Front Door which is globally unique. +func (client RulesEnginesClient) ListByFrontDoor(ctx context.Context, resourceGroupName string, frontDoorName string) (result RulesEngineListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RulesEnginesClient.ListByFrontDoor") + defer func() { + sc := -1 + if result.relr.Response.Response != nil { + sc = result.relr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: frontDoorName, + Constraints: []validation.Constraint{{Target: "frontDoorName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "frontDoorName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "frontDoorName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.RulesEnginesClient", "ListByFrontDoor", err.Error()) + } + + result.fn = client.listByFrontDoorNextResults + req, err := client.ListByFrontDoorPreparer(ctx, resourceGroupName, frontDoorName) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.RulesEnginesClient", "ListByFrontDoor", nil, "Failure preparing request") + return + } + + resp, err := client.ListByFrontDoorSender(req) + if err != nil { + result.relr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "frontdoor.RulesEnginesClient", "ListByFrontDoor", resp, "Failure sending request") + return + } + + result.relr, err = client.ListByFrontDoorResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.RulesEnginesClient", "ListByFrontDoor", resp, "Failure responding to request") + } + + return +} + +// ListByFrontDoorPreparer prepares the ListByFrontDoor request. +func (client RulesEnginesClient) ListByFrontDoorPreparer(ctx context.Context, resourceGroupName string, frontDoorName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "frontDoorName": autorest.Encode("path", frontDoorName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/rulesEngines", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByFrontDoorSender sends the ListByFrontDoor request. The method will close the +// http.Response Body if it receives an error. +func (client RulesEnginesClient) ListByFrontDoorSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByFrontDoorResponder handles the response to the ListByFrontDoor request. The method always +// closes the http.Response Body. +func (client RulesEnginesClient) ListByFrontDoorResponder(resp *http.Response) (result RulesEngineListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByFrontDoorNextResults retrieves the next set of results, if any. +func (client RulesEnginesClient) listByFrontDoorNextResults(ctx context.Context, lastResults RulesEngineListResult) (result RulesEngineListResult, err error) { + req, err := lastResults.rulesEngineListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "frontdoor.RulesEnginesClient", "listByFrontDoorNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByFrontDoorSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "frontdoor.RulesEnginesClient", "listByFrontDoorNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByFrontDoorResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.RulesEnginesClient", "listByFrontDoorNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByFrontDoorComplete enumerates all values, automatically crossing page boundaries as required. +func (client RulesEnginesClient) ListByFrontDoorComplete(ctx context.Context, resourceGroupName string, frontDoorName string) (result RulesEngineListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RulesEnginesClient.ListByFrontDoor") + 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.ListByFrontDoor(ctx, resourceGroupName, frontDoorName) + return +} diff --git a/services/frontdoor/mgmt/2020-04-01/frontdoor/version.go b/services/frontdoor/mgmt/2020-04-01/frontdoor/version.go new file mode 100644 index 000000000000..a81776a51bfa --- /dev/null +++ b/services/frontdoor/mgmt/2020-04-01/frontdoor/version.go @@ -0,0 +1,30 @@ +package frontdoor + +import "github.com/Azure/azure-sdk-for-go/version" + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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() + " frontdoor/2020-04-01" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/services/frontdoor/mgmt/2020-05-01/frontdoor/client.go b/services/frontdoor/mgmt/2020-05-01/frontdoor/client.go new file mode 100644 index 000000000000..2ffa5d1483d5 --- /dev/null +++ b/services/frontdoor/mgmt/2020-05-01/frontdoor/client.go @@ -0,0 +1,52 @@ +// Package frontdoor implements the Azure ARM Frontdoor service API version . +// +// FrontDoor Client +package frontdoor + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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 Frontdoor + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Frontdoor. +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/frontdoor/mgmt/2020-05-01/frontdoor/endpoints.go b/services/frontdoor/mgmt/2020-05-01/frontdoor/endpoints.go new file mode 100644 index 000000000000..908a49fde93a --- /dev/null +++ b/services/frontdoor/mgmt/2020-05-01/frontdoor/endpoints.go @@ -0,0 +1,137 @@ +package frontdoor + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// EndpointsClient is the frontDoor Client +type EndpointsClient struct { + BaseClient +} + +// NewEndpointsClient creates an instance of the EndpointsClient client. +func NewEndpointsClient(subscriptionID string) EndpointsClient { + return NewEndpointsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewEndpointsClientWithBaseURI creates an instance of the EndpointsClient 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 NewEndpointsClientWithBaseURI(baseURI string, subscriptionID string) EndpointsClient { + return EndpointsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// PurgeContent removes a content from Front Door. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// frontDoorName - name of the Front Door which is globally unique. +// contentFilePaths - the path to the content to be purged. Path can be a full URL, e.g. '/pictures/city.png' +// which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' which removes all folders +// and files in the directory. +func (client EndpointsClient) PurgeContent(ctx context.Context, resourceGroupName string, frontDoorName string, contentFilePaths PurgeParameters) (result EndpointsPurgeContentFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EndpointsClient.PurgeContent") + 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: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: frontDoorName, + Constraints: []validation.Constraint{{Target: "frontDoorName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "frontDoorName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "frontDoorName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$`, Chain: nil}}}, + {TargetValue: contentFilePaths, + Constraints: []validation.Constraint{{Target: "contentFilePaths.ContentPaths", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.EndpointsClient", "PurgeContent", err.Error()) + } + + req, err := client.PurgeContentPreparer(ctx, resourceGroupName, frontDoorName, contentFilePaths) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.EndpointsClient", "PurgeContent", nil, "Failure preparing request") + return + } + + result, err = client.PurgeContentSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.EndpointsClient", "PurgeContent", result.Response(), "Failure sending request") + return + } + + return +} + +// PurgeContentPreparer prepares the PurgeContent request. +func (client EndpointsClient) PurgeContentPreparer(ctx context.Context, resourceGroupName string, frontDoorName string, contentFilePaths PurgeParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "frontDoorName": autorest.Encode("path", frontDoorName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-05-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.Network/frontDoors/{frontDoorName}/purge", pathParameters), + autorest.WithJSON(contentFilePaths), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PurgeContentSender sends the PurgeContent request. The method will close the +// http.Response Body if it receives an error. +func (client EndpointsClient) PurgeContentSender(req *http.Request) (future EndpointsPurgeContentFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// PurgeContentResponder handles the response to the PurgeContent request. The method always +// closes the http.Response Body. +func (client EndpointsClient) PurgeContentResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/services/frontdoor/mgmt/2020-05-01/frontdoor/experiments.go b/services/frontdoor/mgmt/2020-05-01/frontdoor/experiments.go new file mode 100644 index 000000000000..b90056bcd2b1 --- /dev/null +++ b/services/frontdoor/mgmt/2020-05-01/frontdoor/experiments.go @@ -0,0 +1,532 @@ +package frontdoor + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// ExperimentsClient is the frontDoor Client +type ExperimentsClient struct { + BaseClient +} + +// NewExperimentsClient creates an instance of the ExperimentsClient client. +func NewExperimentsClient(subscriptionID string) ExperimentsClient { + return NewExperimentsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewExperimentsClientWithBaseURI creates an instance of the ExperimentsClient 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 NewExperimentsClientWithBaseURI(baseURI string, subscriptionID string) ExperimentsClient { + return ExperimentsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate sends the create or update request. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - the Profile identifier associated with the Tenant and Partner +// experimentName - the Experiment identifier associated with the Experiment +// parameters - the Experiment resource +func (client ExperimentsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, profileName string, experimentName string, parameters Experiment) (result ExperimentsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExperimentsClient.CreateOrUpdate") + 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: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: profileName, + Constraints: []validation.Constraint{{Target: "profileName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: experimentName, + Constraints: []validation.Constraint{{Target: "experimentName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.ExperimentsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, profileName, experimentName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ExperimentsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, profileName string, experimentName string, parameters Experiment) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "experimentName": autorest.Encode("path", experimentName), + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-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.Network/NetworkExperimentProfiles/{profileName}/Experiments/{experimentName}", pathParameters), + autorest.WithJSON(parameters), + 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 ExperimentsClient) CreateOrUpdateSender(req *http.Request) (future ExperimentsCreateOrUpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client ExperimentsClient) CreateOrUpdateResponder(resp *http.Response) (result Experiment, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete sends the delete request. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - the Profile identifier associated with the Tenant and Partner +// experimentName - the Experiment identifier associated with the Experiment +func (client ExperimentsClient) Delete(ctx context.Context, resourceGroupName string, profileName string, experimentName string) (result ExperimentsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExperimentsClient.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: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: profileName, + Constraints: []validation.Constraint{{Target: "profileName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: experimentName, + Constraints: []validation.Constraint{{Target: "experimentName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.ExperimentsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, profileName, experimentName) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ExperimentsClient) DeletePreparer(ctx context.Context, resourceGroupName string, profileName string, experimentName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "experimentName": autorest.Encode("path", experimentName), + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-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.Network/NetworkExperimentProfiles/{profileName}/Experiments/{experimentName}", 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 ExperimentsClient) DeleteSender(req *http.Request) (future ExperimentsDeleteFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ExperimentsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 within the Azure subscription. +// profileName - the Profile identifier associated with the Tenant and Partner +// experimentName - the Experiment identifier associated with the Experiment +func (client ExperimentsClient) Get(ctx context.Context, resourceGroupName string, profileName string, experimentName string) (result Experiment, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExperimentsClient.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: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: profileName, + Constraints: []validation.Constraint{{Target: "profileName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: experimentName, + Constraints: []validation.Constraint{{Target: "experimentName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.ExperimentsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, profileName, experimentName) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ExperimentsClient) GetPreparer(ctx context.Context, resourceGroupName string, profileName string, experimentName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "experimentName": autorest.Encode("path", experimentName), + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/NetworkExperimentProfiles/{profileName}/Experiments/{experimentName}", 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 ExperimentsClient) 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 ExperimentsClient) GetResponder(resp *http.Response) (result Experiment, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByProfile sends the list by profile request. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - the Profile identifier associated with the Tenant and Partner +func (client ExperimentsClient) ListByProfile(ctx context.Context, resourceGroupName string, profileName string) (result ExperimentListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExperimentsClient.ListByProfile") + defer func() { + sc := -1 + if result.el.Response.Response != nil { + sc = result.el.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: profileName, + Constraints: []validation.Constraint{{Target: "profileName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.ExperimentsClient", "ListByProfile", err.Error()) + } + + result.fn = client.listByProfileNextResults + req, err := client.ListByProfilePreparer(ctx, resourceGroupName, profileName) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsClient", "ListByProfile", nil, "Failure preparing request") + return + } + + resp, err := client.ListByProfileSender(req) + if err != nil { + result.el.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsClient", "ListByProfile", resp, "Failure sending request") + return + } + + result.el, err = client.ListByProfileResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsClient", "ListByProfile", resp, "Failure responding to request") + } + + return +} + +// ListByProfilePreparer prepares the ListByProfile request. +func (client ExperimentsClient) ListByProfilePreparer(ctx context.Context, resourceGroupName string, profileName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/NetworkExperimentProfiles/{profileName}/Experiments", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByProfileSender sends the ListByProfile request. The method will close the +// http.Response Body if it receives an error. +func (client ExperimentsClient) ListByProfileSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByProfileResponder handles the response to the ListByProfile request. The method always +// closes the http.Response Body. +func (client ExperimentsClient) ListByProfileResponder(resp *http.Response) (result ExperimentList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByProfileNextResults retrieves the next set of results, if any. +func (client ExperimentsClient) listByProfileNextResults(ctx context.Context, lastResults ExperimentList) (result ExperimentList, err error) { + req, err := lastResults.experimentListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "frontdoor.ExperimentsClient", "listByProfileNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByProfileSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "frontdoor.ExperimentsClient", "listByProfileNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByProfileResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsClient", "listByProfileNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByProfileComplete enumerates all values, automatically crossing page boundaries as required. +func (client ExperimentsClient) ListByProfileComplete(ctx context.Context, resourceGroupName string, profileName string) (result ExperimentListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExperimentsClient.ListByProfile") + 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.ListByProfile(ctx, resourceGroupName, profileName) + return +} + +// Update updates an Experiment +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - the Profile identifier associated with the Tenant and Partner +// experimentName - the Experiment identifier associated with the Experiment +// parameters - the Experiment Update Model +func (client ExperimentsClient) Update(ctx context.Context, resourceGroupName string, profileName string, experimentName string, parameters ExperimentUpdateModel) (result ExperimentsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExperimentsClient.Update") + 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: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: profileName, + Constraints: []validation.Constraint{{Target: "profileName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: experimentName, + Constraints: []validation.Constraint{{Target: "experimentName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.ExperimentsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, profileName, experimentName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ExperimentsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, profileName string, experimentName string, parameters ExperimentUpdateModel) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "experimentName": autorest.Encode("path", experimentName), + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-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.Network/NetworkExperimentProfiles/{profileName}/Experiments/{experimentName}", pathParameters), + autorest.WithJSON(parameters), + 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 ExperimentsClient) UpdateSender(req *http.Request) (future ExperimentsUpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ExperimentsClient) UpdateResponder(resp *http.Response) (result Experiment, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/frontdoor/mgmt/2020-05-01/frontdoor/frontdoorapi/interfaces.go b/services/frontdoor/mgmt/2020-05-01/frontdoor/frontdoorapi/interfaces.go new file mode 100644 index 000000000000..cc837586acd1 --- /dev/null +++ b/services/frontdoor/mgmt/2020-05-01/frontdoor/frontdoorapi/interfaces.go @@ -0,0 +1,142 @@ +package frontdoorapi + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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/frontdoor/mgmt/2020-05-01/frontdoor" + "github.com/Azure/go-autorest/autorest/date" +) + +// NetworkExperimentProfilesClientAPI contains the set of methods on the NetworkExperimentProfilesClient type. +type NetworkExperimentProfilesClientAPI interface { + CreateOrUpdate(ctx context.Context, profileName string, resourceGroupName string, parameters frontdoor.Profile) (result frontdoor.NetworkExperimentProfilesCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, profileName string) (result frontdoor.NetworkExperimentProfilesDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, profileName string) (result frontdoor.Profile, err error) + List(ctx context.Context) (result frontdoor.ProfileListPage, err error) + ListComplete(ctx context.Context) (result frontdoor.ProfileListIterator, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result frontdoor.ProfileListPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result frontdoor.ProfileListIterator, err error) + Update(ctx context.Context, resourceGroupName string, profileName string, parameters frontdoor.ProfileUpdateModel) (result frontdoor.NetworkExperimentProfilesUpdateFuture, err error) +} + +var _ NetworkExperimentProfilesClientAPI = (*frontdoor.NetworkExperimentProfilesClient)(nil) + +// PreconfiguredEndpointsClientAPI contains the set of methods on the PreconfiguredEndpointsClient type. +type PreconfiguredEndpointsClientAPI interface { + List(ctx context.Context, resourceGroupName string, profileName string) (result frontdoor.PreconfiguredEndpointListPage, err error) + ListComplete(ctx context.Context, resourceGroupName string, profileName string) (result frontdoor.PreconfiguredEndpointListIterator, err error) +} + +var _ PreconfiguredEndpointsClientAPI = (*frontdoor.PreconfiguredEndpointsClient)(nil) + +// ExperimentsClientAPI contains the set of methods on the ExperimentsClient type. +type ExperimentsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, profileName string, experimentName string, parameters frontdoor.Experiment) (result frontdoor.ExperimentsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, profileName string, experimentName string) (result frontdoor.ExperimentsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, profileName string, experimentName string) (result frontdoor.Experiment, err error) + ListByProfile(ctx context.Context, resourceGroupName string, profileName string) (result frontdoor.ExperimentListPage, err error) + ListByProfileComplete(ctx context.Context, resourceGroupName string, profileName string) (result frontdoor.ExperimentListIterator, err error) + Update(ctx context.Context, resourceGroupName string, profileName string, experimentName string, parameters frontdoor.ExperimentUpdateModel) (result frontdoor.ExperimentsUpdateFuture, err error) +} + +var _ ExperimentsClientAPI = (*frontdoor.ExperimentsClient)(nil) + +// ReportsClientAPI contains the set of methods on the ReportsClient type. +type ReportsClientAPI interface { + GetLatencyScorecards(ctx context.Context, resourceGroupName string, profileName string, experimentName string, aggregationInterval frontdoor.LatencyScorecardAggregationInterval, endDateTimeUTC string, country string) (result frontdoor.LatencyScorecard, err error) + GetTimeseries(ctx context.Context, resourceGroupName string, profileName string, experimentName string, startDateTimeUTC date.Time, endDateTimeUTC date.Time, aggregationInterval frontdoor.TimeseriesAggregationInterval, timeseriesType frontdoor.TimeseriesType, endpoint string, country string) (result frontdoor.Timeseries, err error) +} + +var _ ReportsClientAPI = (*frontdoor.ReportsClient)(nil) + +// NameAvailabilityClientAPI contains the set of methods on the NameAvailabilityClient type. +type NameAvailabilityClientAPI interface { + Check(ctx context.Context, checkFrontDoorNameAvailabilityInput frontdoor.CheckNameAvailabilityInput) (result frontdoor.CheckNameAvailabilityOutput, err error) +} + +var _ NameAvailabilityClientAPI = (*frontdoor.NameAvailabilityClient)(nil) + +// NameAvailabilityWithSubscriptionClientAPI contains the set of methods on the NameAvailabilityWithSubscriptionClient type. +type NameAvailabilityWithSubscriptionClientAPI interface { + Check(ctx context.Context, checkFrontDoorNameAvailabilityInput frontdoor.CheckNameAvailabilityInput) (result frontdoor.CheckNameAvailabilityOutput, err error) +} + +var _ NameAvailabilityWithSubscriptionClientAPI = (*frontdoor.NameAvailabilityWithSubscriptionClient)(nil) + +// FrontDoorsClientAPI contains the set of methods on the FrontDoorsClient type. +type FrontDoorsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, frontDoorName string, frontDoorParameters frontdoor.FrontDoor) (result frontdoor.FrontDoorsCreateOrUpdateFutureType, err error) + Delete(ctx context.Context, resourceGroupName string, frontDoorName string) (result frontdoor.FrontDoorsDeleteFutureType, err error) + Get(ctx context.Context, resourceGroupName string, frontDoorName string) (result frontdoor.FrontDoor, err error) + List(ctx context.Context) (result frontdoor.ListResultPage, err error) + ListComplete(ctx context.Context) (result frontdoor.ListResultIterator, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result frontdoor.ListResultPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result frontdoor.ListResultIterator, err error) + ValidateCustomDomain(ctx context.Context, resourceGroupName string, frontDoorName string, customDomainProperties frontdoor.ValidateCustomDomainInput) (result frontdoor.ValidateCustomDomainOutput, err error) +} + +var _ FrontDoorsClientAPI = (*frontdoor.FrontDoorsClient)(nil) + +// FrontendEndpointsClientAPI contains the set of methods on the FrontendEndpointsClient type. +type FrontendEndpointsClientAPI interface { + DisableHTTPS(ctx context.Context, resourceGroupName string, frontDoorName string, frontendEndpointName string) (result frontdoor.FrontendEndpointsDisableHTTPSFuture, err error) + EnableHTTPS(ctx context.Context, resourceGroupName string, frontDoorName string, frontendEndpointName string, customHTTPSConfiguration frontdoor.CustomHTTPSConfiguration) (result frontdoor.FrontendEndpointsEnableHTTPSFuture, err error) + Get(ctx context.Context, resourceGroupName string, frontDoorName string, frontendEndpointName string) (result frontdoor.FrontendEndpoint, err error) + ListByFrontDoor(ctx context.Context, resourceGroupName string, frontDoorName string) (result frontdoor.FrontendEndpointsListResultPage, err error) + ListByFrontDoorComplete(ctx context.Context, resourceGroupName string, frontDoorName string) (result frontdoor.FrontendEndpointsListResultIterator, err error) +} + +var _ FrontendEndpointsClientAPI = (*frontdoor.FrontendEndpointsClient)(nil) + +// EndpointsClientAPI contains the set of methods on the EndpointsClient type. +type EndpointsClientAPI interface { + PurgeContent(ctx context.Context, resourceGroupName string, frontDoorName string, contentFilePaths frontdoor.PurgeParameters) (result frontdoor.EndpointsPurgeContentFuture, err error) +} + +var _ EndpointsClientAPI = (*frontdoor.EndpointsClient)(nil) + +// RulesEnginesClientAPI contains the set of methods on the RulesEnginesClient type. +type RulesEnginesClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, frontDoorName string, rulesEngineName string, rulesEngineParameters frontdoor.RulesEngine) (result frontdoor.RulesEnginesCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, frontDoorName string, rulesEngineName string) (result frontdoor.RulesEnginesDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, frontDoorName string, rulesEngineName string) (result frontdoor.RulesEngine, err error) + ListByFrontDoor(ctx context.Context, resourceGroupName string, frontDoorName string) (result frontdoor.RulesEngineListResultPage, err error) + ListByFrontDoorComplete(ctx context.Context, resourceGroupName string, frontDoorName string) (result frontdoor.RulesEngineListResultIterator, err error) +} + +var _ RulesEnginesClientAPI = (*frontdoor.RulesEnginesClient)(nil) + +// PoliciesClientAPI contains the set of methods on the PoliciesClient type. +type PoliciesClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, policyName string, parameters frontdoor.WebApplicationFirewallPolicy) (result frontdoor.PoliciesCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, policyName string) (result frontdoor.PoliciesDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, policyName string) (result frontdoor.WebApplicationFirewallPolicy, err error) + List(ctx context.Context, resourceGroupName string) (result frontdoor.WebApplicationFirewallPolicyListPage, err error) + ListComplete(ctx context.Context, resourceGroupName string) (result frontdoor.WebApplicationFirewallPolicyListIterator, err error) +} + +var _ PoliciesClientAPI = (*frontdoor.PoliciesClient)(nil) + +// ManagedRuleSetsClientAPI contains the set of methods on the ManagedRuleSetsClient type. +type ManagedRuleSetsClientAPI interface { + List(ctx context.Context) (result frontdoor.ManagedRuleSetDefinitionListPage, err error) + ListComplete(ctx context.Context) (result frontdoor.ManagedRuleSetDefinitionListIterator, err error) +} + +var _ ManagedRuleSetsClientAPI = (*frontdoor.ManagedRuleSetsClient)(nil) diff --git a/services/frontdoor/mgmt/2020-05-01/frontdoor/frontdoors.go b/services/frontdoor/mgmt/2020-05-01/frontdoor/frontdoors.go new file mode 100644 index 000000000000..623f9769a224 --- /dev/null +++ b/services/frontdoor/mgmt/2020-05-01/frontdoor/frontdoors.go @@ -0,0 +1,632 @@ +package frontdoor + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// FrontDoorsClient is the frontDoor Client +type FrontDoorsClient struct { + BaseClient +} + +// NewFrontDoorsClient creates an instance of the FrontDoorsClient client. +func NewFrontDoorsClient(subscriptionID string) FrontDoorsClient { + return NewFrontDoorsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewFrontDoorsClientWithBaseURI creates an instance of the FrontDoorsClient 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 NewFrontDoorsClientWithBaseURI(baseURI string, subscriptionID string) FrontDoorsClient { + return FrontDoorsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates a new Front Door with a Front Door name under the specified subscription and resource group. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// frontDoorName - name of the Front Door which is globally unique. +// frontDoorParameters - front Door properties needed to create a new Front Door. +func (client FrontDoorsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, frontDoorName string, frontDoorParameters FrontDoor) (result FrontDoorsCreateOrUpdateFutureType, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FrontDoorsClient.CreateOrUpdate") + 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: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: frontDoorName, + Constraints: []validation.Constraint{{Target: "frontDoorName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "frontDoorName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "frontDoorName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.FrontDoorsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, frontDoorName, frontDoorParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.FrontDoorsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.FrontDoorsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client FrontDoorsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, frontDoorName string, frontDoorParameters FrontDoor) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "frontDoorName": autorest.Encode("path", frontDoorName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-05-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.Network/frontDoors/{frontDoorName}", pathParameters), + autorest.WithJSON(frontDoorParameters), + 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 FrontDoorsClient) CreateOrUpdateSender(req *http.Request) (future FrontDoorsCreateOrUpdateFutureType, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client FrontDoorsClient) CreateOrUpdateResponder(resp *http.Response) (result FrontDoor, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes an existing Front Door with the specified parameters. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// frontDoorName - name of the Front Door which is globally unique. +func (client FrontDoorsClient) Delete(ctx context.Context, resourceGroupName string, frontDoorName string) (result FrontDoorsDeleteFutureType, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FrontDoorsClient.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: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: frontDoorName, + Constraints: []validation.Constraint{{Target: "frontDoorName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "frontDoorName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "frontDoorName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.FrontDoorsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, frontDoorName) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.FrontDoorsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.FrontDoorsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client FrontDoorsClient) DeletePreparer(ctx context.Context, resourceGroupName string, frontDoorName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "frontDoorName": autorest.Encode("path", frontDoorName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-05-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.Network/frontDoors/{frontDoorName}", 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 FrontDoorsClient) DeleteSender(req *http.Request) (future FrontDoorsDeleteFutureType, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client FrontDoorsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets a Front Door with the specified Front Door name under the specified subscription and resource group. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// frontDoorName - name of the Front Door which is globally unique. +func (client FrontDoorsClient) Get(ctx context.Context, resourceGroupName string, frontDoorName string) (result FrontDoor, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FrontDoorsClient.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: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: frontDoorName, + Constraints: []validation.Constraint{{Target: "frontDoorName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "frontDoorName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "frontDoorName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.FrontDoorsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, frontDoorName) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.FrontDoorsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "frontdoor.FrontDoorsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.FrontDoorsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client FrontDoorsClient) GetPreparer(ctx context.Context, resourceGroupName string, frontDoorName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "frontDoorName": autorest.Encode("path", frontDoorName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}", 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 FrontDoorsClient) 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 FrontDoorsClient) GetResponder(resp *http.Response) (result FrontDoor, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists all of the Front Doors within an Azure subscription. +func (client FrontDoorsClient) List(ctx context.Context) (result ListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FrontDoorsClient.List") + defer func() { + sc := -1 + if result.lr.Response.Response != nil { + sc = result.lr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.FrontDoorsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.lr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "frontdoor.FrontDoorsClient", "List", resp, "Failure sending request") + return + } + + result.lr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.FrontDoorsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client FrontDoorsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/frontDoors", 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 FrontDoorsClient) 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 FrontDoorsClient) ListResponder(resp *http.Response) (result ListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 FrontDoorsClient) listNextResults(ctx context.Context, lastResults ListResult) (result ListResult, err error) { + req, err := lastResults.listResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "frontdoor.FrontDoorsClient", "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, "frontdoor.FrontDoorsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.FrontDoorsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client FrontDoorsClient) ListComplete(ctx context.Context) (result ListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FrontDoorsClient.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 of the Front Doors within a resource group under a subscription. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +func (client FrontDoorsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FrontDoorsClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.lr.Response.Response != nil { + sc = result.lr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.FrontDoorsClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.FrontDoorsClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.lr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "frontdoor.FrontDoorsClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.lr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.FrontDoorsClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client FrontDoorsClient) 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 = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors", 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 FrontDoorsClient) 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 FrontDoorsClient) ListByResourceGroupResponder(resp *http.Response) (result ListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 FrontDoorsClient) listByResourceGroupNextResults(ctx context.Context, lastResults ListResult) (result ListResult, err error) { + req, err := lastResults.listResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "frontdoor.FrontDoorsClient", "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, "frontdoor.FrontDoorsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.FrontDoorsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client FrontDoorsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FrontDoorsClient.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 +} + +// ValidateCustomDomain validates the custom domain mapping to ensure it maps to the correct Front Door endpoint in +// DNS. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// frontDoorName - name of the Front Door which is globally unique. +// customDomainProperties - custom domain to be validated. +func (client FrontDoorsClient) ValidateCustomDomain(ctx context.Context, resourceGroupName string, frontDoorName string, customDomainProperties ValidateCustomDomainInput) (result ValidateCustomDomainOutput, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FrontDoorsClient.ValidateCustomDomain") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: frontDoorName, + Constraints: []validation.Constraint{{Target: "frontDoorName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "frontDoorName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "frontDoorName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$`, Chain: nil}}}, + {TargetValue: customDomainProperties, + Constraints: []validation.Constraint{{Target: "customDomainProperties.HostName", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.FrontDoorsClient", "ValidateCustomDomain", err.Error()) + } + + req, err := client.ValidateCustomDomainPreparer(ctx, resourceGroupName, frontDoorName, customDomainProperties) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.FrontDoorsClient", "ValidateCustomDomain", nil, "Failure preparing request") + return + } + + resp, err := client.ValidateCustomDomainSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "frontdoor.FrontDoorsClient", "ValidateCustomDomain", resp, "Failure sending request") + return + } + + result, err = client.ValidateCustomDomainResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.FrontDoorsClient", "ValidateCustomDomain", resp, "Failure responding to request") + } + + return +} + +// ValidateCustomDomainPreparer prepares the ValidateCustomDomain request. +func (client FrontDoorsClient) ValidateCustomDomainPreparer(ctx context.Context, resourceGroupName string, frontDoorName string, customDomainProperties ValidateCustomDomainInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "frontDoorName": autorest.Encode("path", frontDoorName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-05-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.Network/frontDoors/{frontDoorName}/validateCustomDomain", pathParameters), + autorest.WithJSON(customDomainProperties), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ValidateCustomDomainSender sends the ValidateCustomDomain request. The method will close the +// http.Response Body if it receives an error. +func (client FrontDoorsClient) ValidateCustomDomainSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ValidateCustomDomainResponder handles the response to the ValidateCustomDomain request. The method always +// closes the http.Response Body. +func (client FrontDoorsClient) ValidateCustomDomainResponder(resp *http.Response) (result ValidateCustomDomainOutput, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/frontdoor/mgmt/2020-05-01/frontdoor/frontendendpoints.go b/services/frontdoor/mgmt/2020-05-01/frontdoor/frontendendpoints.go new file mode 100644 index 000000000000..5d4d8956950e --- /dev/null +++ b/services/frontdoor/mgmt/2020-05-01/frontdoor/frontendendpoints.go @@ -0,0 +1,455 @@ +package frontdoor + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// FrontendEndpointsClient is the frontDoor Client +type FrontendEndpointsClient struct { + BaseClient +} + +// NewFrontendEndpointsClient creates an instance of the FrontendEndpointsClient client. +func NewFrontendEndpointsClient(subscriptionID string) FrontendEndpointsClient { + return NewFrontendEndpointsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewFrontendEndpointsClientWithBaseURI creates an instance of the FrontendEndpointsClient 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 NewFrontendEndpointsClientWithBaseURI(baseURI string, subscriptionID string) FrontendEndpointsClient { + return FrontendEndpointsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// DisableHTTPS disables a frontendEndpoint for HTTPS traffic +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// frontDoorName - name of the Front Door which is globally unique. +// frontendEndpointName - name of the Frontend endpoint which is unique within the Front Door. +func (client FrontendEndpointsClient) DisableHTTPS(ctx context.Context, resourceGroupName string, frontDoorName string, frontendEndpointName string) (result FrontendEndpointsDisableHTTPSFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FrontendEndpointsClient.DisableHTTPS") + 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: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: frontDoorName, + Constraints: []validation.Constraint{{Target: "frontDoorName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "frontDoorName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "frontDoorName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$`, Chain: nil}}}, + {TargetValue: frontendEndpointName, + Constraints: []validation.Constraint{{Target: "frontendEndpointName", Name: validation.MaxLength, Rule: 255, Chain: nil}, + {Target: "frontendEndpointName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "frontendEndpointName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.FrontendEndpointsClient", "DisableHTTPS", err.Error()) + } + + req, err := client.DisableHTTPSPreparer(ctx, resourceGroupName, frontDoorName, frontendEndpointName) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.FrontendEndpointsClient", "DisableHTTPS", nil, "Failure preparing request") + return + } + + result, err = client.DisableHTTPSSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.FrontendEndpointsClient", "DisableHTTPS", result.Response(), "Failure sending request") + return + } + + return +} + +// DisableHTTPSPreparer prepares the DisableHTTPS request. +func (client FrontendEndpointsClient) DisableHTTPSPreparer(ctx context.Context, resourceGroupName string, frontDoorName string, frontendEndpointName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "frontDoorName": autorest.Encode("path", frontDoorName), + "frontendEndpointName": autorest.Encode("path", frontendEndpointName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-05-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.Network/frontDoors/{frontDoorName}/frontendEndpoints/{frontendEndpointName}/disableHttps", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DisableHTTPSSender sends the DisableHTTPS request. The method will close the +// http.Response Body if it receives an error. +func (client FrontendEndpointsClient) DisableHTTPSSender(req *http.Request) (future FrontendEndpointsDisableHTTPSFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DisableHTTPSResponder handles the response to the DisableHTTPS request. The method always +// closes the http.Response Body. +func (client FrontendEndpointsClient) DisableHTTPSResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// EnableHTTPS enables a frontendEndpoint for HTTPS traffic +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// frontDoorName - name of the Front Door which is globally unique. +// frontendEndpointName - name of the Frontend endpoint which is unique within the Front Door. +// customHTTPSConfiguration - the configuration specifying how to enable HTTPS +func (client FrontendEndpointsClient) EnableHTTPS(ctx context.Context, resourceGroupName string, frontDoorName string, frontendEndpointName string, customHTTPSConfiguration CustomHTTPSConfiguration) (result FrontendEndpointsEnableHTTPSFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FrontendEndpointsClient.EnableHTTPS") + 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: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: frontDoorName, + Constraints: []validation.Constraint{{Target: "frontDoorName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "frontDoorName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "frontDoorName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$`, Chain: nil}}}, + {TargetValue: frontendEndpointName, + Constraints: []validation.Constraint{{Target: "frontendEndpointName", Name: validation.MaxLength, Rule: 255, Chain: nil}, + {Target: "frontendEndpointName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "frontendEndpointName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}, + {TargetValue: customHTTPSConfiguration, + Constraints: []validation.Constraint{{Target: "customHTTPSConfiguration.ProtocolType", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.FrontendEndpointsClient", "EnableHTTPS", err.Error()) + } + + req, err := client.EnableHTTPSPreparer(ctx, resourceGroupName, frontDoorName, frontendEndpointName, customHTTPSConfiguration) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.FrontendEndpointsClient", "EnableHTTPS", nil, "Failure preparing request") + return + } + + result, err = client.EnableHTTPSSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.FrontendEndpointsClient", "EnableHTTPS", result.Response(), "Failure sending request") + return + } + + return +} + +// EnableHTTPSPreparer prepares the EnableHTTPS request. +func (client FrontendEndpointsClient) EnableHTTPSPreparer(ctx context.Context, resourceGroupName string, frontDoorName string, frontendEndpointName string, customHTTPSConfiguration CustomHTTPSConfiguration) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "frontDoorName": autorest.Encode("path", frontDoorName), + "frontendEndpointName": autorest.Encode("path", frontendEndpointName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-05-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.Network/frontDoors/{frontDoorName}/frontendEndpoints/{frontendEndpointName}/enableHttps", pathParameters), + autorest.WithJSON(customHTTPSConfiguration), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// EnableHTTPSSender sends the EnableHTTPS request. The method will close the +// http.Response Body if it receives an error. +func (client FrontendEndpointsClient) EnableHTTPSSender(req *http.Request) (future FrontendEndpointsEnableHTTPSFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// EnableHTTPSResponder handles the response to the EnableHTTPS request. The method always +// closes the http.Response Body. +func (client FrontendEndpointsClient) EnableHTTPSResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets a Frontend endpoint with the specified name within the specified Front Door. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// frontDoorName - name of the Front Door which is globally unique. +// frontendEndpointName - name of the Frontend endpoint which is unique within the Front Door. +func (client FrontendEndpointsClient) Get(ctx context.Context, resourceGroupName string, frontDoorName string, frontendEndpointName string) (result FrontendEndpoint, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FrontendEndpointsClient.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: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: frontDoorName, + Constraints: []validation.Constraint{{Target: "frontDoorName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "frontDoorName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "frontDoorName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$`, Chain: nil}}}, + {TargetValue: frontendEndpointName, + Constraints: []validation.Constraint{{Target: "frontendEndpointName", Name: validation.MaxLength, Rule: 255, Chain: nil}, + {Target: "frontendEndpointName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "frontendEndpointName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.FrontendEndpointsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, frontDoorName, frontendEndpointName) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.FrontendEndpointsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "frontdoor.FrontendEndpointsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.FrontendEndpointsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client FrontendEndpointsClient) GetPreparer(ctx context.Context, resourceGroupName string, frontDoorName string, frontendEndpointName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "frontDoorName": autorest.Encode("path", frontDoorName), + "frontendEndpointName": autorest.Encode("path", frontendEndpointName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/frontendEndpoints/{frontendEndpointName}", 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 FrontendEndpointsClient) 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 FrontendEndpointsClient) GetResponder(resp *http.Response) (result FrontendEndpoint, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByFrontDoor lists all of the frontend endpoints within a Front Door. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// frontDoorName - name of the Front Door which is globally unique. +func (client FrontendEndpointsClient) ListByFrontDoor(ctx context.Context, resourceGroupName string, frontDoorName string) (result FrontendEndpointsListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FrontendEndpointsClient.ListByFrontDoor") + defer func() { + sc := -1 + if result.felr.Response.Response != nil { + sc = result.felr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: frontDoorName, + Constraints: []validation.Constraint{{Target: "frontDoorName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "frontDoorName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "frontDoorName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.FrontendEndpointsClient", "ListByFrontDoor", err.Error()) + } + + result.fn = client.listByFrontDoorNextResults + req, err := client.ListByFrontDoorPreparer(ctx, resourceGroupName, frontDoorName) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.FrontendEndpointsClient", "ListByFrontDoor", nil, "Failure preparing request") + return + } + + resp, err := client.ListByFrontDoorSender(req) + if err != nil { + result.felr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "frontdoor.FrontendEndpointsClient", "ListByFrontDoor", resp, "Failure sending request") + return + } + + result.felr, err = client.ListByFrontDoorResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.FrontendEndpointsClient", "ListByFrontDoor", resp, "Failure responding to request") + } + + return +} + +// ListByFrontDoorPreparer prepares the ListByFrontDoor request. +func (client FrontendEndpointsClient) ListByFrontDoorPreparer(ctx context.Context, resourceGroupName string, frontDoorName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "frontDoorName": autorest.Encode("path", frontDoorName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/frontendEndpoints", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByFrontDoorSender sends the ListByFrontDoor request. The method will close the +// http.Response Body if it receives an error. +func (client FrontendEndpointsClient) ListByFrontDoorSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByFrontDoorResponder handles the response to the ListByFrontDoor request. The method always +// closes the http.Response Body. +func (client FrontendEndpointsClient) ListByFrontDoorResponder(resp *http.Response) (result FrontendEndpointsListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByFrontDoorNextResults retrieves the next set of results, if any. +func (client FrontendEndpointsClient) listByFrontDoorNextResults(ctx context.Context, lastResults FrontendEndpointsListResult) (result FrontendEndpointsListResult, err error) { + req, err := lastResults.frontendEndpointsListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "frontdoor.FrontendEndpointsClient", "listByFrontDoorNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByFrontDoorSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "frontdoor.FrontendEndpointsClient", "listByFrontDoorNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByFrontDoorResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.FrontendEndpointsClient", "listByFrontDoorNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByFrontDoorComplete enumerates all values, automatically crossing page boundaries as required. +func (client FrontendEndpointsClient) ListByFrontDoorComplete(ctx context.Context, resourceGroupName string, frontDoorName string) (result FrontendEndpointsListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FrontendEndpointsClient.ListByFrontDoor") + 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.ListByFrontDoor(ctx, resourceGroupName, frontDoorName) + return +} diff --git a/services/frontdoor/mgmt/2020-05-01/frontdoor/managedrulesets.go b/services/frontdoor/mgmt/2020-05-01/frontdoor/managedrulesets.go new file mode 100644 index 000000000000..ea8be6ec00f0 --- /dev/null +++ b/services/frontdoor/mgmt/2020-05-01/frontdoor/managedrulesets.go @@ -0,0 +1,151 @@ +package frontdoor + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// ManagedRuleSetsClient is the frontDoor Client +type ManagedRuleSetsClient struct { + BaseClient +} + +// NewManagedRuleSetsClient creates an instance of the ManagedRuleSetsClient client. +func NewManagedRuleSetsClient(subscriptionID string) ManagedRuleSetsClient { + return NewManagedRuleSetsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewManagedRuleSetsClientWithBaseURI creates an instance of the ManagedRuleSetsClient 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 NewManagedRuleSetsClientWithBaseURI(baseURI string, subscriptionID string) ManagedRuleSetsClient { + return ManagedRuleSetsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List lists all available managed rule sets. +func (client ManagedRuleSetsClient) List(ctx context.Context) (result ManagedRuleSetDefinitionListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedRuleSetsClient.List") + defer func() { + sc := -1 + if result.mrsdl.Response.Response != nil { + sc = result.mrsdl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ManagedRuleSetsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.mrsdl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "frontdoor.ManagedRuleSetsClient", "List", resp, "Failure sending request") + return + } + + result.mrsdl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ManagedRuleSetsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client ManagedRuleSetsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/FrontDoorWebApplicationFirewallManagedRuleSets", 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 ManagedRuleSetsClient) 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 ManagedRuleSetsClient) ListResponder(resp *http.Response) (result ManagedRuleSetDefinitionList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 ManagedRuleSetsClient) listNextResults(ctx context.Context, lastResults ManagedRuleSetDefinitionList) (result ManagedRuleSetDefinitionList, err error) { + req, err := lastResults.managedRuleSetDefinitionListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "frontdoor.ManagedRuleSetsClient", "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, "frontdoor.ManagedRuleSetsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ManagedRuleSetsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ManagedRuleSetsClient) ListComplete(ctx context.Context) (result ManagedRuleSetDefinitionListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedRuleSetsClient.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/frontdoor/mgmt/2020-05-01/frontdoor/models.go b/services/frontdoor/mgmt/2020-05-01/frontdoor/models.go new file mode 100644 index 000000000000..b2709a28cf0a --- /dev/null +++ b/services/frontdoor/mgmt/2020-05-01/frontdoor/models.go @@ -0,0 +1,5187 @@ +package frontdoor + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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/frontdoor/mgmt/2020-05-01/frontdoor" + +// ActionType enumerates the values for action type. +type ActionType string + +const ( + // Allow ... + Allow ActionType = "Allow" + // Block ... + Block ActionType = "Block" + // Log ... + Log ActionType = "Log" + // Redirect ... + Redirect ActionType = "Redirect" +) + +// PossibleActionTypeValues returns an array of possible values for the ActionType const type. +func PossibleActionTypeValues() []ActionType { + return []ActionType{Allow, Block, Log, Redirect} +} + +// AggregationInterval enumerates the values for aggregation interval. +type AggregationInterval string + +const ( + // Daily ... + Daily AggregationInterval = "Daily" + // Hourly ... + Hourly AggregationInterval = "Hourly" +) + +// PossibleAggregationIntervalValues returns an array of possible values for the AggregationInterval const type. +func PossibleAggregationIntervalValues() []AggregationInterval { + return []AggregationInterval{Daily, Hourly} +} + +// Availability enumerates the values for availability. +type Availability string + +const ( + // Available ... + Available Availability = "Available" + // Unavailable ... + Unavailable Availability = "Unavailable" +) + +// PossibleAvailabilityValues returns an array of possible values for the Availability const type. +func PossibleAvailabilityValues() []Availability { + return []Availability{Available, Unavailable} +} + +// BackendEnabledState enumerates the values for backend enabled state. +type BackendEnabledState string + +const ( + // Disabled ... + Disabled BackendEnabledState = "Disabled" + // Enabled ... + Enabled BackendEnabledState = "Enabled" +) + +// PossibleBackendEnabledStateValues returns an array of possible values for the BackendEnabledState const type. +func PossibleBackendEnabledStateValues() []BackendEnabledState { + return []BackendEnabledState{Disabled, Enabled} +} + +// CertificateSource enumerates the values for certificate source. +type CertificateSource string + +const ( + // CertificateSourceAzureKeyVault ... + CertificateSourceAzureKeyVault CertificateSource = "AzureKeyVault" + // CertificateSourceFrontDoor ... + CertificateSourceFrontDoor CertificateSource = "FrontDoor" +) + +// PossibleCertificateSourceValues returns an array of possible values for the CertificateSource const type. +func PossibleCertificateSourceValues() []CertificateSource { + return []CertificateSource{CertificateSourceAzureKeyVault, CertificateSourceFrontDoor} +} + +// CertificateType enumerates the values for certificate type. +type CertificateType string + +const ( + // Dedicated ... + Dedicated CertificateType = "Dedicated" +) + +// PossibleCertificateTypeValues returns an array of possible values for the CertificateType const type. +func PossibleCertificateTypeValues() []CertificateType { + return []CertificateType{Dedicated} +} + +// CustomHTTPSProvisioningState enumerates the values for custom https provisioning state. +type CustomHTTPSProvisioningState string + +const ( + // CustomHTTPSProvisioningStateDisabled ... + CustomHTTPSProvisioningStateDisabled CustomHTTPSProvisioningState = "Disabled" + // CustomHTTPSProvisioningStateDisabling ... + CustomHTTPSProvisioningStateDisabling CustomHTTPSProvisioningState = "Disabling" + // CustomHTTPSProvisioningStateEnabled ... + CustomHTTPSProvisioningStateEnabled CustomHTTPSProvisioningState = "Enabled" + // CustomHTTPSProvisioningStateEnabling ... + CustomHTTPSProvisioningStateEnabling CustomHTTPSProvisioningState = "Enabling" + // CustomHTTPSProvisioningStateFailed ... + CustomHTTPSProvisioningStateFailed CustomHTTPSProvisioningState = "Failed" +) + +// PossibleCustomHTTPSProvisioningStateValues returns an array of possible values for the CustomHTTPSProvisioningState const type. +func PossibleCustomHTTPSProvisioningStateValues() []CustomHTTPSProvisioningState { + return []CustomHTTPSProvisioningState{CustomHTTPSProvisioningStateDisabled, CustomHTTPSProvisioningStateDisabling, CustomHTTPSProvisioningStateEnabled, CustomHTTPSProvisioningStateEnabling, CustomHTTPSProvisioningStateFailed} +} + +// CustomHTTPSProvisioningSubstate enumerates the values for custom https provisioning substate. +type CustomHTTPSProvisioningSubstate string + +const ( + // CertificateDeleted ... + CertificateDeleted CustomHTTPSProvisioningSubstate = "CertificateDeleted" + // CertificateDeployed ... + CertificateDeployed CustomHTTPSProvisioningSubstate = "CertificateDeployed" + // DeletingCertificate ... + DeletingCertificate CustomHTTPSProvisioningSubstate = "DeletingCertificate" + // DeployingCertificate ... + DeployingCertificate CustomHTTPSProvisioningSubstate = "DeployingCertificate" + // DomainControlValidationRequestApproved ... + DomainControlValidationRequestApproved CustomHTTPSProvisioningSubstate = "DomainControlValidationRequestApproved" + // DomainControlValidationRequestRejected ... + DomainControlValidationRequestRejected CustomHTTPSProvisioningSubstate = "DomainControlValidationRequestRejected" + // DomainControlValidationRequestTimedOut ... + DomainControlValidationRequestTimedOut CustomHTTPSProvisioningSubstate = "DomainControlValidationRequestTimedOut" + // IssuingCertificate ... + IssuingCertificate CustomHTTPSProvisioningSubstate = "IssuingCertificate" + // PendingDomainControlValidationREquestApproval ... + PendingDomainControlValidationREquestApproval CustomHTTPSProvisioningSubstate = "PendingDomainControlValidationREquestApproval" + // SubmittingDomainControlValidationRequest ... + SubmittingDomainControlValidationRequest CustomHTTPSProvisioningSubstate = "SubmittingDomainControlValidationRequest" +) + +// PossibleCustomHTTPSProvisioningSubstateValues returns an array of possible values for the CustomHTTPSProvisioningSubstate const type. +func PossibleCustomHTTPSProvisioningSubstateValues() []CustomHTTPSProvisioningSubstate { + return []CustomHTTPSProvisioningSubstate{CertificateDeleted, CertificateDeployed, DeletingCertificate, DeployingCertificate, DomainControlValidationRequestApproved, DomainControlValidationRequestRejected, DomainControlValidationRequestTimedOut, IssuingCertificate, PendingDomainControlValidationREquestApproval, SubmittingDomainControlValidationRequest} +} + +// CustomRuleEnabledState enumerates the values for custom rule enabled state. +type CustomRuleEnabledState string + +const ( + // CustomRuleEnabledStateDisabled ... + CustomRuleEnabledStateDisabled CustomRuleEnabledState = "Disabled" + // CustomRuleEnabledStateEnabled ... + CustomRuleEnabledStateEnabled CustomRuleEnabledState = "Enabled" +) + +// PossibleCustomRuleEnabledStateValues returns an array of possible values for the CustomRuleEnabledState const type. +func PossibleCustomRuleEnabledStateValues() []CustomRuleEnabledState { + return []CustomRuleEnabledState{CustomRuleEnabledStateDisabled, CustomRuleEnabledStateEnabled} +} + +// DynamicCompressionEnabled enumerates the values for dynamic compression enabled. +type DynamicCompressionEnabled string + +const ( + // DynamicCompressionEnabledDisabled ... + DynamicCompressionEnabledDisabled DynamicCompressionEnabled = "Disabled" + // DynamicCompressionEnabledEnabled ... + DynamicCompressionEnabledEnabled DynamicCompressionEnabled = "Enabled" +) + +// PossibleDynamicCompressionEnabledValues returns an array of possible values for the DynamicCompressionEnabled const type. +func PossibleDynamicCompressionEnabledValues() []DynamicCompressionEnabled { + return []DynamicCompressionEnabled{DynamicCompressionEnabledDisabled, DynamicCompressionEnabledEnabled} +} + +// EnabledState enumerates the values for enabled state. +type EnabledState string + +const ( + // EnabledStateDisabled ... + EnabledStateDisabled EnabledState = "Disabled" + // EnabledStateEnabled ... + EnabledStateEnabled EnabledState = "Enabled" +) + +// PossibleEnabledStateValues returns an array of possible values for the EnabledState const type. +func PossibleEnabledStateValues() []EnabledState { + return []EnabledState{EnabledStateDisabled, EnabledStateEnabled} +} + +// EndpointType enumerates the values for endpoint type. +type EndpointType string + +const ( + // AFD ... + AFD EndpointType = "AFD" + // ATM ... + ATM EndpointType = "ATM" + // AzureRegion ... + AzureRegion EndpointType = "AzureRegion" + // CDN ... + CDN EndpointType = "CDN" +) + +// PossibleEndpointTypeValues returns an array of possible values for the EndpointType const type. +func PossibleEndpointTypeValues() []EndpointType { + return []EndpointType{AFD, ATM, AzureRegion, CDN} +} + +// EnforceCertificateNameCheckEnabledState enumerates the values for enforce certificate name check enabled +// state. +type EnforceCertificateNameCheckEnabledState string + +const ( + // EnforceCertificateNameCheckEnabledStateDisabled ... + EnforceCertificateNameCheckEnabledStateDisabled EnforceCertificateNameCheckEnabledState = "Disabled" + // EnforceCertificateNameCheckEnabledStateEnabled ... + EnforceCertificateNameCheckEnabledStateEnabled EnforceCertificateNameCheckEnabledState = "Enabled" +) + +// PossibleEnforceCertificateNameCheckEnabledStateValues returns an array of possible values for the EnforceCertificateNameCheckEnabledState const type. +func PossibleEnforceCertificateNameCheckEnabledStateValues() []EnforceCertificateNameCheckEnabledState { + return []EnforceCertificateNameCheckEnabledState{EnforceCertificateNameCheckEnabledStateDisabled, EnforceCertificateNameCheckEnabledStateEnabled} +} + +// ForwardingProtocol enumerates the values for forwarding protocol. +type ForwardingProtocol string + +const ( + // HTTPOnly ... + HTTPOnly ForwardingProtocol = "HttpOnly" + // HTTPSOnly ... + HTTPSOnly ForwardingProtocol = "HttpsOnly" + // MatchRequest ... + MatchRequest ForwardingProtocol = "MatchRequest" +) + +// PossibleForwardingProtocolValues returns an array of possible values for the ForwardingProtocol const type. +func PossibleForwardingProtocolValues() []ForwardingProtocol { + return []ForwardingProtocol{HTTPOnly, HTTPSOnly, MatchRequest} +} + +// HeaderActionType enumerates the values for header action type. +type HeaderActionType string + +const ( + // Append ... + Append HeaderActionType = "Append" + // Delete ... + Delete HeaderActionType = "Delete" + // Overwrite ... + Overwrite HeaderActionType = "Overwrite" +) + +// PossibleHeaderActionTypeValues returns an array of possible values for the HeaderActionType const type. +func PossibleHeaderActionTypeValues() []HeaderActionType { + return []HeaderActionType{Append, Delete, Overwrite} +} + +// HealthProbeEnabled enumerates the values for health probe enabled. +type HealthProbeEnabled string + +const ( + // HealthProbeEnabledDisabled ... + HealthProbeEnabledDisabled HealthProbeEnabled = "Disabled" + // HealthProbeEnabledEnabled ... + HealthProbeEnabledEnabled HealthProbeEnabled = "Enabled" +) + +// PossibleHealthProbeEnabledValues returns an array of possible values for the HealthProbeEnabled const type. +func PossibleHealthProbeEnabledValues() []HealthProbeEnabled { + return []HealthProbeEnabled{HealthProbeEnabledDisabled, HealthProbeEnabledEnabled} +} + +// HealthProbeMethod enumerates the values for health probe method. +type HealthProbeMethod string + +const ( + // GET ... + GET HealthProbeMethod = "GET" + // HEAD ... + HEAD HealthProbeMethod = "HEAD" +) + +// PossibleHealthProbeMethodValues returns an array of possible values for the HealthProbeMethod const type. +func PossibleHealthProbeMethodValues() []HealthProbeMethod { + return []HealthProbeMethod{GET, HEAD} +} + +// LatencyScorecardAggregationInterval enumerates the values for latency scorecard aggregation interval. +type LatencyScorecardAggregationInterval string + +const ( + // LatencyScorecardAggregationIntervalDaily ... + LatencyScorecardAggregationIntervalDaily LatencyScorecardAggregationInterval = "Daily" + // LatencyScorecardAggregationIntervalMonthly ... + LatencyScorecardAggregationIntervalMonthly LatencyScorecardAggregationInterval = "Monthly" + // LatencyScorecardAggregationIntervalWeekly ... + LatencyScorecardAggregationIntervalWeekly LatencyScorecardAggregationInterval = "Weekly" +) + +// PossibleLatencyScorecardAggregationIntervalValues returns an array of possible values for the LatencyScorecardAggregationInterval const type. +func PossibleLatencyScorecardAggregationIntervalValues() []LatencyScorecardAggregationInterval { + return []LatencyScorecardAggregationInterval{LatencyScorecardAggregationIntervalDaily, LatencyScorecardAggregationIntervalMonthly, LatencyScorecardAggregationIntervalWeekly} +} + +// ManagedRuleEnabledState enumerates the values for managed rule enabled state. +type ManagedRuleEnabledState string + +const ( + // ManagedRuleEnabledStateDisabled ... + ManagedRuleEnabledStateDisabled ManagedRuleEnabledState = "Disabled" + // ManagedRuleEnabledStateEnabled ... + ManagedRuleEnabledStateEnabled ManagedRuleEnabledState = "Enabled" +) + +// PossibleManagedRuleEnabledStateValues returns an array of possible values for the ManagedRuleEnabledState const type. +func PossibleManagedRuleEnabledStateValues() []ManagedRuleEnabledState { + return []ManagedRuleEnabledState{ManagedRuleEnabledStateDisabled, ManagedRuleEnabledStateEnabled} +} + +// ManagedRuleExclusionMatchVariable enumerates the values for managed rule exclusion match variable. +type ManagedRuleExclusionMatchVariable string + +const ( + // QueryStringArgNames ... + QueryStringArgNames ManagedRuleExclusionMatchVariable = "QueryStringArgNames" + // RequestBodyPostArgNames ... + RequestBodyPostArgNames ManagedRuleExclusionMatchVariable = "RequestBodyPostArgNames" + // RequestCookieNames ... + RequestCookieNames ManagedRuleExclusionMatchVariable = "RequestCookieNames" + // RequestHeaderNames ... + RequestHeaderNames ManagedRuleExclusionMatchVariable = "RequestHeaderNames" +) + +// PossibleManagedRuleExclusionMatchVariableValues returns an array of possible values for the ManagedRuleExclusionMatchVariable const type. +func PossibleManagedRuleExclusionMatchVariableValues() []ManagedRuleExclusionMatchVariable { + return []ManagedRuleExclusionMatchVariable{QueryStringArgNames, RequestBodyPostArgNames, RequestCookieNames, RequestHeaderNames} +} + +// ManagedRuleExclusionSelectorMatchOperator enumerates the values for managed rule exclusion selector match +// operator. +type ManagedRuleExclusionSelectorMatchOperator string + +const ( + // Contains ... + Contains ManagedRuleExclusionSelectorMatchOperator = "Contains" + // EndsWith ... + EndsWith ManagedRuleExclusionSelectorMatchOperator = "EndsWith" + // Equals ... + Equals ManagedRuleExclusionSelectorMatchOperator = "Equals" + // EqualsAny ... + EqualsAny ManagedRuleExclusionSelectorMatchOperator = "EqualsAny" + // StartsWith ... + StartsWith ManagedRuleExclusionSelectorMatchOperator = "StartsWith" +) + +// PossibleManagedRuleExclusionSelectorMatchOperatorValues returns an array of possible values for the ManagedRuleExclusionSelectorMatchOperator const type. +func PossibleManagedRuleExclusionSelectorMatchOperatorValues() []ManagedRuleExclusionSelectorMatchOperator { + return []ManagedRuleExclusionSelectorMatchOperator{Contains, EndsWith, Equals, EqualsAny, StartsWith} +} + +// MatchProcessingBehavior enumerates the values for match processing behavior. +type MatchProcessingBehavior string + +const ( + // Continue ... + Continue MatchProcessingBehavior = "Continue" + // Stop ... + Stop MatchProcessingBehavior = "Stop" +) + +// PossibleMatchProcessingBehaviorValues returns an array of possible values for the MatchProcessingBehavior const type. +func PossibleMatchProcessingBehaviorValues() []MatchProcessingBehavior { + return []MatchProcessingBehavior{Continue, Stop} +} + +// MatchVariable enumerates the values for match variable. +type MatchVariable string + +const ( + // Cookies ... + Cookies MatchVariable = "Cookies" + // PostArgs ... + PostArgs MatchVariable = "PostArgs" + // QueryString ... + QueryString MatchVariable = "QueryString" + // RemoteAddr ... + RemoteAddr MatchVariable = "RemoteAddr" + // RequestBody ... + RequestBody MatchVariable = "RequestBody" + // RequestHeader ... + RequestHeader MatchVariable = "RequestHeader" + // RequestMethod ... + RequestMethod MatchVariable = "RequestMethod" + // RequestURI ... + RequestURI MatchVariable = "RequestUri" + // SocketAddr ... + SocketAddr MatchVariable = "SocketAddr" +) + +// PossibleMatchVariableValues returns an array of possible values for the MatchVariable const type. +func PossibleMatchVariableValues() []MatchVariable { + return []MatchVariable{Cookies, PostArgs, QueryString, RemoteAddr, RequestBody, RequestHeader, RequestMethod, RequestURI, SocketAddr} +} + +// MinimumTLSVersion enumerates the values for minimum tls version. +type MinimumTLSVersion string + +const ( + // OneFullStopTwo ... + OneFullStopTwo MinimumTLSVersion = "1.2" + // OneFullStopZero ... + OneFullStopZero MinimumTLSVersion = "1.0" +) + +// PossibleMinimumTLSVersionValues returns an array of possible values for the MinimumTLSVersion const type. +func PossibleMinimumTLSVersionValues() []MinimumTLSVersion { + return []MinimumTLSVersion{OneFullStopTwo, OneFullStopZero} +} + +// NetworkExperimentResourceState enumerates the values for network experiment resource state. +type NetworkExperimentResourceState string + +const ( + // NetworkExperimentResourceStateCreating ... + NetworkExperimentResourceStateCreating NetworkExperimentResourceState = "Creating" + // NetworkExperimentResourceStateDeleting ... + NetworkExperimentResourceStateDeleting NetworkExperimentResourceState = "Deleting" + // NetworkExperimentResourceStateDisabled ... + NetworkExperimentResourceStateDisabled NetworkExperimentResourceState = "Disabled" + // NetworkExperimentResourceStateDisabling ... + NetworkExperimentResourceStateDisabling NetworkExperimentResourceState = "Disabling" + // NetworkExperimentResourceStateEnabled ... + NetworkExperimentResourceStateEnabled NetworkExperimentResourceState = "Enabled" + // NetworkExperimentResourceStateEnabling ... + NetworkExperimentResourceStateEnabling NetworkExperimentResourceState = "Enabling" +) + +// PossibleNetworkExperimentResourceStateValues returns an array of possible values for the NetworkExperimentResourceState const type. +func PossibleNetworkExperimentResourceStateValues() []NetworkExperimentResourceState { + return []NetworkExperimentResourceState{NetworkExperimentResourceStateCreating, NetworkExperimentResourceStateDeleting, NetworkExperimentResourceStateDisabled, NetworkExperimentResourceStateDisabling, NetworkExperimentResourceStateEnabled, NetworkExperimentResourceStateEnabling} +} + +// NetworkOperationStatus enumerates the values for network operation status. +type NetworkOperationStatus string + +const ( + // Failed ... + Failed NetworkOperationStatus = "Failed" + // InProgress ... + InProgress NetworkOperationStatus = "InProgress" + // Succeeded ... + Succeeded NetworkOperationStatus = "Succeeded" +) + +// PossibleNetworkOperationStatusValues returns an array of possible values for the NetworkOperationStatus const type. +func PossibleNetworkOperationStatusValues() []NetworkOperationStatus { + return []NetworkOperationStatus{Failed, InProgress, Succeeded} +} + +// OdataType enumerates the values for odata type. +type OdataType string + +const ( + // OdataTypeMicrosoftAzureFrontDoorModelsFrontdoorForwardingConfiguration ... + OdataTypeMicrosoftAzureFrontDoorModelsFrontdoorForwardingConfiguration OdataType = "#Microsoft.Azure.FrontDoor.Models.FrontdoorForwardingConfiguration" + // OdataTypeMicrosoftAzureFrontDoorModelsFrontdoorRedirectConfiguration ... + OdataTypeMicrosoftAzureFrontDoorModelsFrontdoorRedirectConfiguration OdataType = "#Microsoft.Azure.FrontDoor.Models.FrontdoorRedirectConfiguration" + // OdataTypeRouteConfiguration ... + OdataTypeRouteConfiguration OdataType = "RouteConfiguration" +) + +// PossibleOdataTypeValues returns an array of possible values for the OdataType const type. +func PossibleOdataTypeValues() []OdataType { + return []OdataType{OdataTypeMicrosoftAzureFrontDoorModelsFrontdoorForwardingConfiguration, OdataTypeMicrosoftAzureFrontDoorModelsFrontdoorRedirectConfiguration, OdataTypeRouteConfiguration} +} + +// Operator enumerates the values for operator. +type Operator string + +const ( + // OperatorAny ... + OperatorAny Operator = "Any" + // OperatorBeginsWith ... + OperatorBeginsWith Operator = "BeginsWith" + // OperatorContains ... + OperatorContains Operator = "Contains" + // OperatorEndsWith ... + OperatorEndsWith Operator = "EndsWith" + // OperatorEqual ... + OperatorEqual Operator = "Equal" + // OperatorGeoMatch ... + OperatorGeoMatch Operator = "GeoMatch" + // OperatorGreaterThan ... + OperatorGreaterThan Operator = "GreaterThan" + // OperatorGreaterThanOrEqual ... + OperatorGreaterThanOrEqual Operator = "GreaterThanOrEqual" + // OperatorIPMatch ... + OperatorIPMatch Operator = "IPMatch" + // OperatorLessThan ... + OperatorLessThan Operator = "LessThan" + // OperatorLessThanOrEqual ... + OperatorLessThanOrEqual Operator = "LessThanOrEqual" + // OperatorRegEx ... + OperatorRegEx Operator = "RegEx" +) + +// PossibleOperatorValues returns an array of possible values for the Operator const type. +func PossibleOperatorValues() []Operator { + return []Operator{OperatorAny, OperatorBeginsWith, OperatorContains, OperatorEndsWith, OperatorEqual, OperatorGeoMatch, OperatorGreaterThan, OperatorGreaterThanOrEqual, OperatorIPMatch, OperatorLessThan, OperatorLessThanOrEqual, OperatorRegEx} +} + +// PolicyEnabledState enumerates the values for policy enabled state. +type PolicyEnabledState string + +const ( + // PolicyEnabledStateDisabled ... + PolicyEnabledStateDisabled PolicyEnabledState = "Disabled" + // PolicyEnabledStateEnabled ... + PolicyEnabledStateEnabled PolicyEnabledState = "Enabled" +) + +// PossiblePolicyEnabledStateValues returns an array of possible values for the PolicyEnabledState const type. +func PossiblePolicyEnabledStateValues() []PolicyEnabledState { + return []PolicyEnabledState{PolicyEnabledStateDisabled, PolicyEnabledStateEnabled} +} + +// PolicyMode enumerates the values for policy mode. +type PolicyMode string + +const ( + // Detection ... + Detection PolicyMode = "Detection" + // Prevention ... + Prevention PolicyMode = "Prevention" +) + +// PossiblePolicyModeValues returns an array of possible values for the PolicyMode const type. +func PossiblePolicyModeValues() []PolicyMode { + return []PolicyMode{Detection, Prevention} +} + +// PolicyResourceState enumerates the values for policy resource state. +type PolicyResourceState string + +const ( + // PolicyResourceStateCreating ... + PolicyResourceStateCreating PolicyResourceState = "Creating" + // PolicyResourceStateDeleting ... + PolicyResourceStateDeleting PolicyResourceState = "Deleting" + // PolicyResourceStateDisabled ... + PolicyResourceStateDisabled PolicyResourceState = "Disabled" + // PolicyResourceStateDisabling ... + PolicyResourceStateDisabling PolicyResourceState = "Disabling" + // PolicyResourceStateEnabled ... + PolicyResourceStateEnabled PolicyResourceState = "Enabled" + // PolicyResourceStateEnabling ... + PolicyResourceStateEnabling PolicyResourceState = "Enabling" +) + +// PossiblePolicyResourceStateValues returns an array of possible values for the PolicyResourceState const type. +func PossiblePolicyResourceStateValues() []PolicyResourceState { + return []PolicyResourceState{PolicyResourceStateCreating, PolicyResourceStateDeleting, PolicyResourceStateDisabled, PolicyResourceStateDisabling, PolicyResourceStateEnabled, PolicyResourceStateEnabling} +} + +// PrivateEndpointStatus enumerates the values for private endpoint status. +type PrivateEndpointStatus string + +const ( + // Approved ... + Approved PrivateEndpointStatus = "Approved" + // Disconnected ... + Disconnected PrivateEndpointStatus = "Disconnected" + // Pending ... + Pending PrivateEndpointStatus = "Pending" + // Rejected ... + Rejected PrivateEndpointStatus = "Rejected" + // Timeout ... + Timeout PrivateEndpointStatus = "Timeout" +) + +// PossiblePrivateEndpointStatusValues returns an array of possible values for the PrivateEndpointStatus const type. +func PossiblePrivateEndpointStatusValues() []PrivateEndpointStatus { + return []PrivateEndpointStatus{Approved, Disconnected, Pending, Rejected, Timeout} +} + +// Protocol enumerates the values for protocol. +type Protocol string + +const ( + // HTTP ... + HTTP Protocol = "Http" + // HTTPS ... + HTTPS Protocol = "Https" +) + +// PossibleProtocolValues returns an array of possible values for the Protocol const type. +func PossibleProtocolValues() []Protocol { + return []Protocol{HTTP, HTTPS} +} + +// Query enumerates the values for query. +type Query string + +const ( + // StripAll ... + StripAll Query = "StripAll" + // StripAllExcept ... + StripAllExcept Query = "StripAllExcept" + // StripNone ... + StripNone Query = "StripNone" + // StripOnly ... + StripOnly Query = "StripOnly" +) + +// PossibleQueryValues returns an array of possible values for the Query const type. +func PossibleQueryValues() []Query { + return []Query{StripAll, StripAllExcept, StripNone, StripOnly} +} + +// RedirectProtocol enumerates the values for redirect protocol. +type RedirectProtocol string + +const ( + // RedirectProtocolHTTPOnly ... + RedirectProtocolHTTPOnly RedirectProtocol = "HttpOnly" + // RedirectProtocolHTTPSOnly ... + RedirectProtocolHTTPSOnly RedirectProtocol = "HttpsOnly" + // RedirectProtocolMatchRequest ... + RedirectProtocolMatchRequest RedirectProtocol = "MatchRequest" +) + +// PossibleRedirectProtocolValues returns an array of possible values for the RedirectProtocol const type. +func PossibleRedirectProtocolValues() []RedirectProtocol { + return []RedirectProtocol{RedirectProtocolHTTPOnly, RedirectProtocolHTTPSOnly, RedirectProtocolMatchRequest} +} + +// RedirectType enumerates the values for redirect type. +type RedirectType string + +const ( + // Found ... + Found RedirectType = "Found" + // Moved ... + Moved RedirectType = "Moved" + // PermanentRedirect ... + PermanentRedirect RedirectType = "PermanentRedirect" + // TemporaryRedirect ... + TemporaryRedirect RedirectType = "TemporaryRedirect" +) + +// PossibleRedirectTypeValues returns an array of possible values for the RedirectType const type. +func PossibleRedirectTypeValues() []RedirectType { + return []RedirectType{Found, Moved, PermanentRedirect, TemporaryRedirect} +} + +// ResourceState enumerates the values for resource state. +type ResourceState string + +const ( + // ResourceStateCreating ... + ResourceStateCreating ResourceState = "Creating" + // ResourceStateDeleting ... + ResourceStateDeleting ResourceState = "Deleting" + // ResourceStateDisabled ... + ResourceStateDisabled ResourceState = "Disabled" + // ResourceStateDisabling ... + ResourceStateDisabling ResourceState = "Disabling" + // ResourceStateEnabled ... + ResourceStateEnabled ResourceState = "Enabled" + // ResourceStateEnabling ... + ResourceStateEnabling ResourceState = "Enabling" +) + +// PossibleResourceStateValues returns an array of possible values for the ResourceState const type. +func PossibleResourceStateValues() []ResourceState { + return []ResourceState{ResourceStateCreating, ResourceStateDeleting, ResourceStateDisabled, ResourceStateDisabling, ResourceStateEnabled, ResourceStateEnabling} +} + +// ResourceType enumerates the values for resource type. +type ResourceType string + +const ( + // MicrosoftNetworkfrontDoors ... + MicrosoftNetworkfrontDoors ResourceType = "Microsoft.Network/frontDoors" + // MicrosoftNetworkfrontDoorsfrontendEndpoints ... + MicrosoftNetworkfrontDoorsfrontendEndpoints ResourceType = "Microsoft.Network/frontDoors/frontendEndpoints" +) + +// PossibleResourceTypeValues returns an array of possible values for the ResourceType const type. +func PossibleResourceTypeValues() []ResourceType { + return []ResourceType{MicrosoftNetworkfrontDoors, MicrosoftNetworkfrontDoorsfrontendEndpoints} +} + +// RoutingRuleEnabledState enumerates the values for routing rule enabled state. +type RoutingRuleEnabledState string + +const ( + // RoutingRuleEnabledStateDisabled ... + RoutingRuleEnabledStateDisabled RoutingRuleEnabledState = "Disabled" + // RoutingRuleEnabledStateEnabled ... + RoutingRuleEnabledStateEnabled RoutingRuleEnabledState = "Enabled" +) + +// PossibleRoutingRuleEnabledStateValues returns an array of possible values for the RoutingRuleEnabledState const type. +func PossibleRoutingRuleEnabledStateValues() []RoutingRuleEnabledState { + return []RoutingRuleEnabledState{RoutingRuleEnabledStateDisabled, RoutingRuleEnabledStateEnabled} +} + +// RulesEngineMatchVariable enumerates the values for rules engine match variable. +type RulesEngineMatchVariable string + +const ( + // RulesEngineMatchVariableIsMobile ... + RulesEngineMatchVariableIsMobile RulesEngineMatchVariable = "IsMobile" + // RulesEngineMatchVariablePostArgs ... + RulesEngineMatchVariablePostArgs RulesEngineMatchVariable = "PostArgs" + // RulesEngineMatchVariableQueryString ... + RulesEngineMatchVariableQueryString RulesEngineMatchVariable = "QueryString" + // RulesEngineMatchVariableRemoteAddr ... + RulesEngineMatchVariableRemoteAddr RulesEngineMatchVariable = "RemoteAddr" + // RulesEngineMatchVariableRequestBody ... + RulesEngineMatchVariableRequestBody RulesEngineMatchVariable = "RequestBody" + // RulesEngineMatchVariableRequestFilename ... + RulesEngineMatchVariableRequestFilename RulesEngineMatchVariable = "RequestFilename" + // RulesEngineMatchVariableRequestFilenameExtension ... + RulesEngineMatchVariableRequestFilenameExtension RulesEngineMatchVariable = "RequestFilenameExtension" + // RulesEngineMatchVariableRequestHeader ... + RulesEngineMatchVariableRequestHeader RulesEngineMatchVariable = "RequestHeader" + // RulesEngineMatchVariableRequestMethod ... + RulesEngineMatchVariableRequestMethod RulesEngineMatchVariable = "RequestMethod" + // RulesEngineMatchVariableRequestPath ... + RulesEngineMatchVariableRequestPath RulesEngineMatchVariable = "RequestPath" + // RulesEngineMatchVariableRequestScheme ... + RulesEngineMatchVariableRequestScheme RulesEngineMatchVariable = "RequestScheme" + // RulesEngineMatchVariableRequestURI ... + RulesEngineMatchVariableRequestURI RulesEngineMatchVariable = "RequestUri" +) + +// PossibleRulesEngineMatchVariableValues returns an array of possible values for the RulesEngineMatchVariable const type. +func PossibleRulesEngineMatchVariableValues() []RulesEngineMatchVariable { + return []RulesEngineMatchVariable{RulesEngineMatchVariableIsMobile, RulesEngineMatchVariablePostArgs, RulesEngineMatchVariableQueryString, RulesEngineMatchVariableRemoteAddr, RulesEngineMatchVariableRequestBody, RulesEngineMatchVariableRequestFilename, RulesEngineMatchVariableRequestFilenameExtension, RulesEngineMatchVariableRequestHeader, RulesEngineMatchVariableRequestMethod, RulesEngineMatchVariableRequestPath, RulesEngineMatchVariableRequestScheme, RulesEngineMatchVariableRequestURI} +} + +// RulesEngineOperator enumerates the values for rules engine operator. +type RulesEngineOperator string + +const ( + // RulesEngineOperatorAny ... + RulesEngineOperatorAny RulesEngineOperator = "Any" + // RulesEngineOperatorBeginsWith ... + RulesEngineOperatorBeginsWith RulesEngineOperator = "BeginsWith" + // RulesEngineOperatorContains ... + RulesEngineOperatorContains RulesEngineOperator = "Contains" + // RulesEngineOperatorEndsWith ... + RulesEngineOperatorEndsWith RulesEngineOperator = "EndsWith" + // RulesEngineOperatorEqual ... + RulesEngineOperatorEqual RulesEngineOperator = "Equal" + // RulesEngineOperatorGeoMatch ... + RulesEngineOperatorGeoMatch RulesEngineOperator = "GeoMatch" + // RulesEngineOperatorGreaterThan ... + RulesEngineOperatorGreaterThan RulesEngineOperator = "GreaterThan" + // RulesEngineOperatorGreaterThanOrEqual ... + RulesEngineOperatorGreaterThanOrEqual RulesEngineOperator = "GreaterThanOrEqual" + // RulesEngineOperatorIPMatch ... + RulesEngineOperatorIPMatch RulesEngineOperator = "IPMatch" + // RulesEngineOperatorLessThan ... + RulesEngineOperatorLessThan RulesEngineOperator = "LessThan" + // RulesEngineOperatorLessThanOrEqual ... + RulesEngineOperatorLessThanOrEqual RulesEngineOperator = "LessThanOrEqual" +) + +// PossibleRulesEngineOperatorValues returns an array of possible values for the RulesEngineOperator const type. +func PossibleRulesEngineOperatorValues() []RulesEngineOperator { + return []RulesEngineOperator{RulesEngineOperatorAny, RulesEngineOperatorBeginsWith, RulesEngineOperatorContains, RulesEngineOperatorEndsWith, RulesEngineOperatorEqual, RulesEngineOperatorGeoMatch, RulesEngineOperatorGreaterThan, RulesEngineOperatorGreaterThanOrEqual, RulesEngineOperatorIPMatch, RulesEngineOperatorLessThan, RulesEngineOperatorLessThanOrEqual} +} + +// RuleType enumerates the values for rule type. +type RuleType string + +const ( + // MatchRule ... + MatchRule RuleType = "MatchRule" + // RateLimitRule ... + RateLimitRule RuleType = "RateLimitRule" +) + +// PossibleRuleTypeValues returns an array of possible values for the RuleType const type. +func PossibleRuleTypeValues() []RuleType { + return []RuleType{MatchRule, RateLimitRule} +} + +// SessionAffinityEnabledState enumerates the values for session affinity enabled state. +type SessionAffinityEnabledState string + +const ( + // SessionAffinityEnabledStateDisabled ... + SessionAffinityEnabledStateDisabled SessionAffinityEnabledState = "Disabled" + // SessionAffinityEnabledStateEnabled ... + SessionAffinityEnabledStateEnabled SessionAffinityEnabledState = "Enabled" +) + +// PossibleSessionAffinityEnabledStateValues returns an array of possible values for the SessionAffinityEnabledState const type. +func PossibleSessionAffinityEnabledStateValues() []SessionAffinityEnabledState { + return []SessionAffinityEnabledState{SessionAffinityEnabledStateDisabled, SessionAffinityEnabledStateEnabled} +} + +// State enumerates the values for state. +type State string + +const ( + // StateDisabled ... + StateDisabled State = "Disabled" + // StateEnabled ... + StateEnabled State = "Enabled" +) + +// PossibleStateValues returns an array of possible values for the State const type. +func PossibleStateValues() []State { + return []State{StateDisabled, StateEnabled} +} + +// TimeseriesAggregationInterval enumerates the values for timeseries aggregation interval. +type TimeseriesAggregationInterval string + +const ( + // TimeseriesAggregationIntervalDaily ... + TimeseriesAggregationIntervalDaily TimeseriesAggregationInterval = "Daily" + // TimeseriesAggregationIntervalHourly ... + TimeseriesAggregationIntervalHourly TimeseriesAggregationInterval = "Hourly" +) + +// PossibleTimeseriesAggregationIntervalValues returns an array of possible values for the TimeseriesAggregationInterval const type. +func PossibleTimeseriesAggregationIntervalValues() []TimeseriesAggregationInterval { + return []TimeseriesAggregationInterval{TimeseriesAggregationIntervalDaily, TimeseriesAggregationIntervalHourly} +} + +// TimeseriesType enumerates the values for timeseries type. +type TimeseriesType string + +const ( + // LatencyP50 ... + LatencyP50 TimeseriesType = "LatencyP50" + // LatencyP75 ... + LatencyP75 TimeseriesType = "LatencyP75" + // LatencyP95 ... + LatencyP95 TimeseriesType = "LatencyP95" + // MeasurementCounts ... + MeasurementCounts TimeseriesType = "MeasurementCounts" +) + +// PossibleTimeseriesTypeValues returns an array of possible values for the TimeseriesType const type. +func PossibleTimeseriesTypeValues() []TimeseriesType { + return []TimeseriesType{LatencyP50, LatencyP75, LatencyP95, MeasurementCounts} +} + +// Transform enumerates the values for transform. +type Transform string + +const ( + // Lowercase ... + Lowercase Transform = "Lowercase" + // RemoveNulls ... + RemoveNulls Transform = "RemoveNulls" + // Trim ... + Trim Transform = "Trim" + // Uppercase ... + Uppercase Transform = "Uppercase" + // URLDecode ... + URLDecode Transform = "UrlDecode" + // URLEncode ... + URLEncode Transform = "UrlEncode" +) + +// PossibleTransformValues returns an array of possible values for the Transform const type. +func PossibleTransformValues() []Transform { + return []Transform{Lowercase, RemoveNulls, Trim, Uppercase, URLDecode, URLEncode} +} + +// TransformType enumerates the values for transform type. +type TransformType string + +const ( + // TransformTypeLowercase ... + TransformTypeLowercase TransformType = "Lowercase" + // TransformTypeRemoveNulls ... + TransformTypeRemoveNulls TransformType = "RemoveNulls" + // TransformTypeTrim ... + TransformTypeTrim TransformType = "Trim" + // TransformTypeUppercase ... + TransformTypeUppercase TransformType = "Uppercase" + // TransformTypeURLDecode ... + TransformTypeURLDecode TransformType = "UrlDecode" + // TransformTypeURLEncode ... + TransformTypeURLEncode TransformType = "UrlEncode" +) + +// PossibleTransformTypeValues returns an array of possible values for the TransformType const type. +func PossibleTransformTypeValues() []TransformType { + return []TransformType{TransformTypeLowercase, TransformTypeRemoveNulls, TransformTypeTrim, TransformTypeUppercase, TransformTypeURLDecode, TransformTypeURLEncode} +} + +// AzureAsyncOperationResult the response body contains the status of the specified asynchronous operation, +// indicating whether it has succeeded, is in progress, or has failed. Note that this status is distinct +// from the HTTP status code returned for the Get Operation Status operation itself. If the asynchronous +// operation succeeded, the response body includes the HTTP status code for the successful request. If the +// asynchronous operation failed, the response body includes the HTTP status code for the failed request +// and error information regarding the failure. +type AzureAsyncOperationResult struct { + // Status - Status of the Azure async operation. Possible values are: 'InProgress', 'Succeeded', and 'Failed'. Possible values include: 'InProgress', 'Succeeded', 'Failed' + Status NetworkOperationStatus `json:"status,omitempty"` + Error *Error `json:"error,omitempty"` +} + +// Backend backend address of a frontDoor load balancer. +type Backend struct { + // Address - Location of the backend (IP address or FQDN) + Address *string `json:"address,omitempty"` + // PrivateLinkAlias - The Alias of the Private Link resource. Populating this optional field indicates that this backend is 'Private' + PrivateLinkAlias *string `json:"privateLinkAlias,omitempty"` + // PrivateLinkResourceID - The Resource Id of the Private Link resource. Populating this optional field indicates that this backend is 'Private' + PrivateLinkResourceID *string `json:"privateLinkResourceId,omitempty"` + // PrivateLinkLocation - The location of the Private Link resource. Required only if 'privateLinkResourceId' is populated + PrivateLinkLocation *string `json:"privateLinkLocation,omitempty"` + // PrivateEndpointStatus - READ-ONLY; The Approval status for the connection to the Private Link. Possible values include: 'Pending', 'Approved', 'Rejected', 'Disconnected', 'Timeout' + PrivateEndpointStatus PrivateEndpointStatus `json:"privateEndpointStatus,omitempty"` + // PrivateLinkApprovalMessage - A custom message to be included in the approval request to connect to the Private Link + PrivateLinkApprovalMessage *string `json:"privateLinkApprovalMessage,omitempty"` + // HTTPPort - The HTTP TCP port number. Must be between 1 and 65535. + HTTPPort *int32 `json:"httpPort,omitempty"` + // HTTPSPort - The HTTPS TCP port number. Must be between 1 and 65535. + HTTPSPort *int32 `json:"httpsPort,omitempty"` + // EnabledState - Whether to enable use of this backend. Permitted values are 'Enabled' or 'Disabled'. Possible values include: 'Enabled', 'Disabled' + EnabledState BackendEnabledState `json:"enabledState,omitempty"` + // Priority - Priority to use for load balancing. Higher priorities will not be used for load balancing if any lower priority backend is healthy. + Priority *int32 `json:"priority,omitempty"` + // Weight - Weight of this endpoint for load balancing purposes. + Weight *int32 `json:"weight,omitempty"` + // BackendHostHeader - The value to use as the host header sent to the backend. If blank or unspecified, this defaults to the incoming host. + BackendHostHeader *string `json:"backendHostHeader,omitempty"` +} + +// BackendPool a backend pool is a collection of backends that can be routed to. +type BackendPool struct { + // BackendPoolProperties - Properties of the Front Door Backend Pool + *BackendPoolProperties `json:"properties,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for BackendPool. +func (bp BackendPool) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if bp.BackendPoolProperties != nil { + objectMap["properties"] = bp.BackendPoolProperties + } + if bp.Name != nil { + objectMap["name"] = bp.Name + } + if bp.ID != nil { + objectMap["id"] = bp.ID + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for BackendPool struct. +func (bp *BackendPool) 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 backendPoolProperties BackendPoolProperties + err = json.Unmarshal(*v, &backendPoolProperties) + if err != nil { + return err + } + bp.BackendPoolProperties = &backendPoolProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + bp.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + bp.Type = &typeVar + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + bp.ID = &ID + } + } + } + + return nil +} + +// BackendPoolListResult result of the request to list Backend Pools. It contains a list of Backend Pools +// objects and a URL link to get the next set of results. +type BackendPoolListResult struct { + // Value - READ-ONLY; List of Backend Pools within a Front Door. + Value *[]BackendPool `json:"value,omitempty"` + // NextLink - URL to get the next set of BackendPool objects if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// BackendPoolProperties the JSON object that contains the properties required to create a Backend Pool. +type BackendPoolProperties struct { + // ResourceState - Resource status. Possible values include: 'ResourceStateCreating', 'ResourceStateEnabling', 'ResourceStateEnabled', 'ResourceStateDisabling', 'ResourceStateDisabled', 'ResourceStateDeleting' + ResourceState ResourceState `json:"resourceState,omitempty"` + // Backends - The set of backends for this pool + Backends *[]Backend `json:"backends,omitempty"` + // LoadBalancingSettings - Load balancing settings for a backend pool + LoadBalancingSettings *SubResource `json:"loadBalancingSettings,omitempty"` + // HealthProbeSettings - L7 health probe settings for a backend pool + HealthProbeSettings *SubResource `json:"healthProbeSettings,omitempty"` +} + +// BackendPoolsSettings settings that apply to all backend pools. +type BackendPoolsSettings struct { + // EnforceCertificateNameCheck - Whether to enforce certificate name check on HTTPS requests to all backend pools. No effect on non-HTTPS requests. Possible values include: 'EnforceCertificateNameCheckEnabledStateEnabled', 'EnforceCertificateNameCheckEnabledStateDisabled' + EnforceCertificateNameCheck EnforceCertificateNameCheckEnabledState `json:"enforceCertificateNameCheck,omitempty"` + // SendRecvTimeoutSeconds - Send and receive timeout on forwarding request to the backend. When timeout is reached, the request fails and returns. + SendRecvTimeoutSeconds *int32 `json:"sendRecvTimeoutSeconds,omitempty"` +} + +// BackendPoolUpdateParameters a collection of backends that can be routed to. +type BackendPoolUpdateParameters struct { + // Backends - The set of backends for this pool + Backends *[]Backend `json:"backends,omitempty"` + // LoadBalancingSettings - Load balancing settings for a backend pool + LoadBalancingSettings *SubResource `json:"loadBalancingSettings,omitempty"` + // HealthProbeSettings - L7 health probe settings for a backend pool + HealthProbeSettings *SubResource `json:"healthProbeSettings,omitempty"` +} + +// CacheConfiguration caching settings for a caching-type route. To disable caching, do not provide a +// cacheConfiguration object. +type CacheConfiguration struct { + // QueryParameterStripDirective - Treatment of URL query terms when forming the cache key. Possible values include: 'StripNone', 'StripAll', 'StripOnly', 'StripAllExcept' + QueryParameterStripDirective Query `json:"queryParameterStripDirective,omitempty"` + // QueryParameters - query parameters to include or exclude (comma separated). + QueryParameters *string `json:"queryParameters,omitempty"` + // DynamicCompression - Whether to use dynamic compression for cached content. Possible values include: 'DynamicCompressionEnabledEnabled', 'DynamicCompressionEnabledDisabled' + DynamicCompression DynamicCompressionEnabled `json:"dynamicCompression,omitempty"` + // CacheDuration - The duration for which the content needs to be cached. Allowed format is in ISO 8601 format (http://en.wikipedia.org/wiki/ISO_8601#Durations). HTTP requires the value to be no more than a year + CacheDuration *string `json:"cacheDuration,omitempty"` +} + +// CertificateSourceParameters parameters required for enabling SSL with Front Door-managed certificates +type CertificateSourceParameters struct { + // CertificateType - Defines the type of the certificate used for secure connections to a frontendEndpoint. Possible values include: 'Dedicated' + CertificateType CertificateType `json:"certificateType,omitempty"` +} + +// CheckNameAvailabilityInput input of CheckNameAvailability API. +type CheckNameAvailabilityInput struct { + // Name - The resource name to validate. + Name *string `json:"name,omitempty"` + // Type - The type of the resource whose name is to be validated. Possible values include: 'MicrosoftNetworkfrontDoors', 'MicrosoftNetworkfrontDoorsfrontendEndpoints' + Type ResourceType `json:"type,omitempty"` +} + +// CheckNameAvailabilityOutput output of check name availability API. +type CheckNameAvailabilityOutput struct { + autorest.Response `json:"-"` + // NameAvailability - READ-ONLY; Indicates whether the name is available. Possible values include: 'Available', 'Unavailable' + NameAvailability Availability `json:"nameAvailability,omitempty"` + // Reason - READ-ONLY; The reason why the name is not available. + Reason *string `json:"reason,omitempty"` + // Message - READ-ONLY; The detailed error message describing why the name is not available. + Message *string `json:"message,omitempty"` +} + +// CustomHTTPSConfiguration https settings for a domain +type CustomHTTPSConfiguration struct { + // CertificateSource - Defines the source of the SSL certificate. Possible values include: 'CertificateSourceAzureKeyVault', 'CertificateSourceFrontDoor' + CertificateSource CertificateSource `json:"certificateSource,omitempty"` + // ProtocolType - Defines the TLS extension protocol that is used for secure delivery + ProtocolType *string `json:"protocolType,omitempty"` + // MinimumTLSVersion - The minimum TLS version required from the clients to establish an SSL handshake with Front Door. Possible values include: 'OneFullStopZero', 'OneFullStopTwo' + MinimumTLSVersion MinimumTLSVersion `json:"minimumTlsVersion,omitempty"` + // KeyVaultCertificateSourceParameters - KeyVault certificate source parameters (if certificateSource=AzureKeyVault) + *KeyVaultCertificateSourceParameters `json:"keyVaultCertificateSourceParameters,omitempty"` + // CertificateSourceParameters - Parameters required for enabling SSL with Front Door-managed certificates (if certificateSource=FrontDoor) + *CertificateSourceParameters `json:"frontDoorCertificateSourceParameters,omitempty"` +} + +// MarshalJSON is the custom marshaler for CustomHTTPSConfiguration. +func (chc CustomHTTPSConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if chc.CertificateSource != "" { + objectMap["certificateSource"] = chc.CertificateSource + } + if chc.ProtocolType != nil { + objectMap["protocolType"] = chc.ProtocolType + } + if chc.MinimumTLSVersion != "" { + objectMap["minimumTlsVersion"] = chc.MinimumTLSVersion + } + if chc.KeyVaultCertificateSourceParameters != nil { + objectMap["keyVaultCertificateSourceParameters"] = chc.KeyVaultCertificateSourceParameters + } + if chc.CertificateSourceParameters != nil { + objectMap["frontDoorCertificateSourceParameters"] = chc.CertificateSourceParameters + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CustomHTTPSConfiguration struct. +func (chc *CustomHTTPSConfiguration) 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 "certificateSource": + if v != nil { + var certificateSource CertificateSource + err = json.Unmarshal(*v, &certificateSource) + if err != nil { + return err + } + chc.CertificateSource = certificateSource + } + case "protocolType": + if v != nil { + var protocolType string + err = json.Unmarshal(*v, &protocolType) + if err != nil { + return err + } + chc.ProtocolType = &protocolType + } + case "minimumTlsVersion": + if v != nil { + var minimumTLSVersion MinimumTLSVersion + err = json.Unmarshal(*v, &minimumTLSVersion) + if err != nil { + return err + } + chc.MinimumTLSVersion = minimumTLSVersion + } + case "keyVaultCertificateSourceParameters": + if v != nil { + var keyVaultCertificateSourceParameters KeyVaultCertificateSourceParameters + err = json.Unmarshal(*v, &keyVaultCertificateSourceParameters) + if err != nil { + return err + } + chc.KeyVaultCertificateSourceParameters = &keyVaultCertificateSourceParameters + } + case "frontDoorCertificateSourceParameters": + if v != nil { + var certificateSourceParameters CertificateSourceParameters + err = json.Unmarshal(*v, &certificateSourceParameters) + if err != nil { + return err + } + chc.CertificateSourceParameters = &certificateSourceParameters + } + } + } + + return nil +} + +// CustomRule defines contents of a web application rule +type CustomRule struct { + // Name - Describes the name of the rule. + Name *string `json:"name,omitempty"` + // Priority - Describes priority of the rule. Rules with a lower value will be evaluated before rules with a higher value. + Priority *int32 `json:"priority,omitempty"` + // EnabledState - Describes if the custom rule is in enabled or disabled state. Defaults to Enabled if not specified. Possible values include: 'CustomRuleEnabledStateDisabled', 'CustomRuleEnabledStateEnabled' + EnabledState CustomRuleEnabledState `json:"enabledState,omitempty"` + // RuleType - Describes type of rule. Possible values include: 'MatchRule', 'RateLimitRule' + RuleType RuleType `json:"ruleType,omitempty"` + // RateLimitDurationInMinutes - Time window for resetting the rate limit count. Default is 1 minute. + RateLimitDurationInMinutes *int32 `json:"rateLimitDurationInMinutes,omitempty"` + // RateLimitThreshold - Number of allowed requests per client within the time window. + RateLimitThreshold *int32 `json:"rateLimitThreshold,omitempty"` + // MatchConditions - List of match conditions. + MatchConditions *[]MatchCondition `json:"matchConditions,omitempty"` + // Action - Describes what action to be applied when rule matches. Possible values include: 'Allow', 'Block', 'Log', 'Redirect' + Action ActionType `json:"action,omitempty"` +} + +// CustomRuleList defines contents of custom rules +type CustomRuleList struct { + // Rules - List of rules + Rules *[]CustomRule `json:"rules,omitempty"` +} + +// Endpoint defines the endpoint properties +type Endpoint struct { + // Name - The name of the endpoint + Name *string `json:"name,omitempty"` + // Endpoint - The endpoint URL + Endpoint *string `json:"endpoint,omitempty"` +} + +// EndpointsPurgeContentFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type EndpointsPurgeContentFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *EndpointsPurgeContentFuture) Result(client EndpointsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.EndpointsPurgeContentFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("frontdoor.EndpointsPurgeContentFuture") + return + } + ar.Response = future.Response() + return +} + +// Error ... +type Error struct { + Code *string `json:"code,omitempty"` + Message *string `json:"message,omitempty"` + Target *string `json:"target,omitempty"` + Details *[]ErrorDetails `json:"details,omitempty"` + InnerError *string `json:"innerError,omitempty"` +} + +// ErrorDetails ... +type ErrorDetails struct { + Code *string `json:"code,omitempty"` + Target *string `json:"target,omitempty"` + Message *string `json:"message,omitempty"` +} + +// ErrorResponse error response indicates Front Door service is not able to process the incoming request. +// The reason is provided in the error message. +type ErrorResponse struct { + // Code - READ-ONLY; Error code. + Code *string `json:"code,omitempty"` + // Message - READ-ONLY; Error message indicating why the operation failed. + Message *string `json:"message,omitempty"` +} + +// Experiment defines the properties of an Experiment +type Experiment struct { + autorest.Response `json:"-"` + // ExperimentProperties - The properties of an Experiment + *ExperimentProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Experiment. +func (e Experiment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if e.ExperimentProperties != nil { + objectMap["properties"] = e.ExperimentProperties + } + if e.Location != nil { + objectMap["location"] = e.Location + } + if e.Tags != nil { + objectMap["tags"] = e.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Experiment struct. +func (e *Experiment) 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 experimentProperties ExperimentProperties + err = json.Unmarshal(*v, &experimentProperties) + if err != nil { + return err + } + e.ExperimentProperties = &experimentProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + e.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + e.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + e.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + e.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + e.Tags = tags + } + } + } + + return nil +} + +// ExperimentList defines a list of Experiments. It contains a list of Experiment objects and a URL link to +// get the next set of results. +type ExperimentList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of Experiments within a resource group. + Value *[]Experiment `json:"value,omitempty"` + // NextLink - URL to get the next set of Experiment objects if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// ExperimentListIterator provides access to a complete listing of Experiment values. +type ExperimentListIterator struct { + i int + page ExperimentListPage +} + +// 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 *ExperimentListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExperimentListIterator.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 *ExperimentListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ExperimentListIterator) 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 ExperimentListIterator) Response() ExperimentList { + 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 ExperimentListIterator) Value() Experiment { + if !iter.page.NotDone() { + return Experiment{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ExperimentListIterator type. +func NewExperimentListIterator(page ExperimentListPage) ExperimentListIterator { + return ExperimentListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (el ExperimentList) IsEmpty() bool { + return el.Value == nil || len(*el.Value) == 0 +} + +// experimentListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (el ExperimentList) experimentListPreparer(ctx context.Context) (*http.Request, error) { + if el.NextLink == nil || len(to.String(el.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(el.NextLink))) +} + +// ExperimentListPage contains a page of Experiment values. +type ExperimentListPage struct { + fn func(context.Context, ExperimentList) (ExperimentList, error) + el ExperimentList +} + +// 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 *ExperimentListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExperimentListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.el) + if err != nil { + return err + } + page.el = next + 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 *ExperimentListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ExperimentListPage) NotDone() bool { + return !page.el.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ExperimentListPage) Response() ExperimentList { + return page.el +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ExperimentListPage) Values() []Experiment { + if page.el.IsEmpty() { + return nil + } + return *page.el.Value +} + +// Creates a new instance of the ExperimentListPage type. +func NewExperimentListPage(getNextPage func(context.Context, ExperimentList) (ExperimentList, error)) ExperimentListPage { + return ExperimentListPage{fn: getNextPage} +} + +// ExperimentProperties defines the properties of an experiment +type ExperimentProperties struct { + // Description - The description of the details or intents of the Experiment + Description *string `json:"description,omitempty"` + // EndpointA - The endpoint A of an experiment + EndpointA *Endpoint `json:"endpointA,omitempty"` + // EndpointB - The endpoint B of an experiment + EndpointB *Endpoint `json:"endpointB,omitempty"` + // EnabledState - The state of the Experiment. Possible values include: 'StateEnabled', 'StateDisabled' + EnabledState State `json:"enabledState,omitempty"` + // ResourceState - Resource status. Possible values include: 'NetworkExperimentResourceStateCreating', 'NetworkExperimentResourceStateEnabling', 'NetworkExperimentResourceStateEnabled', 'NetworkExperimentResourceStateDisabling', 'NetworkExperimentResourceStateDisabled', 'NetworkExperimentResourceStateDeleting' + ResourceState NetworkExperimentResourceState `json:"resourceState,omitempty"` + // Status - READ-ONLY; The description of Experiment status from the server side + Status *string `json:"status,omitempty"` + // ScriptFileURI - READ-ONLY; The uri to the Script used in the Experiment + ScriptFileURI *string `json:"scriptFileUri,omitempty"` +} + +// ExperimentsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ExperimentsCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ExperimentsCreateOrUpdateFuture) Result(client ExperimentsClient) (e Experiment, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("frontdoor.ExperimentsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if e.Response.Response, err = future.GetResult(sender); err == nil && e.Response.Response.StatusCode != http.StatusNoContent { + e, err = client.CreateOrUpdateResponder(e.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsCreateOrUpdateFuture", "Result", e.Response.Response, "Failure responding to request") + } + } + return +} + +// ExperimentsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ExperimentsDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ExperimentsDeleteFuture) Result(client ExperimentsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("frontdoor.ExperimentsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ExperimentsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ExperimentsUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ExperimentsUpdateFuture) Result(client ExperimentsClient) (e Experiment, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("frontdoor.ExperimentsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if e.Response.Response, err = future.GetResult(sender); err == nil && e.Response.Response.StatusCode != http.StatusNoContent { + e, err = client.UpdateResponder(e.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ExperimentsUpdateFuture", "Result", e.Response.Response, "Failure responding to request") + } + } + return +} + +// ExperimentUpdateModel defines modifiable attributes of an Experiment +type ExperimentUpdateModel struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ExperimentUpdateProperties - The properties of a Profile + *ExperimentUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExperimentUpdateModel. +func (eum ExperimentUpdateModel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if eum.Tags != nil { + objectMap["tags"] = eum.Tags + } + if eum.ExperimentUpdateProperties != nil { + objectMap["properties"] = eum.ExperimentUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ExperimentUpdateModel struct. +func (eum *ExperimentUpdateModel) 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 + } + eum.Tags = tags + } + case "properties": + if v != nil { + var experimentUpdateProperties ExperimentUpdateProperties + err = json.Unmarshal(*v, &experimentUpdateProperties) + if err != nil { + return err + } + eum.ExperimentUpdateProperties = &experimentUpdateProperties + } + } + } + + return nil +} + +// ExperimentUpdateProperties defines the properties of an experiment +type ExperimentUpdateProperties struct { + // Description - The description of the intent or details of the Experiment + Description *string `json:"description,omitempty"` + // EnabledState - The state of the Experiment. Possible values include: 'StateEnabled', 'StateDisabled' + EnabledState State `json:"enabledState,omitempty"` +} + +// ForwardingConfiguration describes Forwarding Route. +type ForwardingConfiguration struct { + // CustomForwardingPath - A custom path used to rewrite resource paths matched by this rule. Leave empty to use incoming path. + CustomForwardingPath *string `json:"customForwardingPath,omitempty"` + // ForwardingProtocol - Protocol this rule will use when forwarding traffic to backends. Possible values include: 'HTTPOnly', 'HTTPSOnly', 'MatchRequest' + ForwardingProtocol ForwardingProtocol `json:"forwardingProtocol,omitempty"` + // CacheConfiguration - The caching configuration associated with this rule. + CacheConfiguration *CacheConfiguration `json:"cacheConfiguration,omitempty"` + // BackendPool - A reference to the BackendPool which this rule routes to. + BackendPool *SubResource `json:"backendPool,omitempty"` + // OdataType - Possible values include: 'OdataTypeRouteConfiguration', 'OdataTypeMicrosoftAzureFrontDoorModelsFrontdoorForwardingConfiguration', 'OdataTypeMicrosoftAzureFrontDoorModelsFrontdoorRedirectConfiguration' + OdataType OdataType `json:"@odata.type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ForwardingConfiguration. +func (fc ForwardingConfiguration) MarshalJSON() ([]byte, error) { + fc.OdataType = OdataTypeMicrosoftAzureFrontDoorModelsFrontdoorForwardingConfiguration + objectMap := make(map[string]interface{}) + if fc.CustomForwardingPath != nil { + objectMap["customForwardingPath"] = fc.CustomForwardingPath + } + if fc.ForwardingProtocol != "" { + objectMap["forwardingProtocol"] = fc.ForwardingProtocol + } + if fc.CacheConfiguration != nil { + objectMap["cacheConfiguration"] = fc.CacheConfiguration + } + if fc.BackendPool != nil { + objectMap["backendPool"] = fc.BackendPool + } + if fc.OdataType != "" { + objectMap["@odata.type"] = fc.OdataType + } + return json.Marshal(objectMap) +} + +// AsForwardingConfiguration is the BasicRouteConfiguration implementation for ForwardingConfiguration. +func (fc ForwardingConfiguration) AsForwardingConfiguration() (*ForwardingConfiguration, bool) { + return &fc, true +} + +// AsRedirectConfiguration is the BasicRouteConfiguration implementation for ForwardingConfiguration. +func (fc ForwardingConfiguration) AsRedirectConfiguration() (*RedirectConfiguration, bool) { + return nil, false +} + +// AsRouteConfiguration is the BasicRouteConfiguration implementation for ForwardingConfiguration. +func (fc ForwardingConfiguration) AsRouteConfiguration() (*RouteConfiguration, bool) { + return nil, false +} + +// AsBasicRouteConfiguration is the BasicRouteConfiguration implementation for ForwardingConfiguration. +func (fc ForwardingConfiguration) AsBasicRouteConfiguration() (BasicRouteConfiguration, bool) { + return &fc, true +} + +// FrontDoor front Door represents a collection of backend endpoints to route traffic to along with rules +// that specify how traffic is sent there. +type FrontDoor struct { + autorest.Response `json:"-"` + // Properties - Properties of the Front Door Load Balancer + *Properties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for FrontDoor. +func (fd FrontDoor) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if fd.Properties != nil { + objectMap["properties"] = fd.Properties + } + if fd.Location != nil { + objectMap["location"] = fd.Location + } + if fd.Tags != nil { + objectMap["tags"] = fd.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for FrontDoor struct. +func (fd *FrontDoor) 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 properties Properties + err = json.Unmarshal(*v, &properties) + if err != nil { + return err + } + fd.Properties = &properties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + fd.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + fd.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + fd.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + fd.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + fd.Tags = tags + } + } + } + + return nil +} + +// FrontDoorsCreateOrUpdateFutureType an abstraction for monitoring and retrieving the results of a +// long-running operation. +type FrontDoorsCreateOrUpdateFutureType struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *FrontDoorsCreateOrUpdateFutureType) Result(client FrontDoorsClient) (fd FrontDoor, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.FrontDoorsCreateOrUpdateFutureType", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("frontdoor.FrontDoorsCreateOrUpdateFutureType") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if fd.Response.Response, err = future.GetResult(sender); err == nil && fd.Response.Response.StatusCode != http.StatusNoContent { + fd, err = client.CreateOrUpdateResponder(fd.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.FrontDoorsCreateOrUpdateFutureType", "Result", fd.Response.Response, "Failure responding to request") + } + } + return +} + +// FrontDoorsDeleteFutureType an abstraction for monitoring and retrieving the results of a long-running +// operation. +type FrontDoorsDeleteFutureType struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *FrontDoorsDeleteFutureType) Result(client FrontDoorsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.FrontDoorsDeleteFutureType", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("frontdoor.FrontDoorsDeleteFutureType") + return + } + ar.Response = future.Response() + return +} + +// FrontendEndpoint a frontend endpoint used for routing. +type FrontendEndpoint struct { + autorest.Response `json:"-"` + // FrontendEndpointProperties - Properties of the Frontend endpoint + *FrontendEndpointProperties `json:"properties,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for FrontendEndpoint. +func (fe FrontendEndpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if fe.FrontendEndpointProperties != nil { + objectMap["properties"] = fe.FrontendEndpointProperties + } + if fe.Name != nil { + objectMap["name"] = fe.Name + } + if fe.ID != nil { + objectMap["id"] = fe.ID + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for FrontendEndpoint struct. +func (fe *FrontendEndpoint) 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 frontendEndpointProperties FrontendEndpointProperties + err = json.Unmarshal(*v, &frontendEndpointProperties) + if err != nil { + return err + } + fe.FrontendEndpointProperties = &frontendEndpointProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + fe.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + fe.Type = &typeVar + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + fe.ID = &ID + } + } + } + + return nil +} + +// FrontendEndpointLink defines the Resource ID for a Frontend Endpoint. +type FrontendEndpointLink struct { + // ID - Resource ID. + ID *string `json:"id,omitempty"` +} + +// FrontendEndpointProperties the JSON object that contains the properties required to create a frontend +// endpoint. +type FrontendEndpointProperties struct { + // ResourceState - Resource status. Possible values include: 'ResourceStateCreating', 'ResourceStateEnabling', 'ResourceStateEnabled', 'ResourceStateDisabling', 'ResourceStateDisabled', 'ResourceStateDeleting' + ResourceState ResourceState `json:"resourceState,omitempty"` + // CustomHTTPSProvisioningState - READ-ONLY; Provisioning status of Custom Https of the frontendEndpoint. Possible values include: 'CustomHTTPSProvisioningStateEnabling', 'CustomHTTPSProvisioningStateEnabled', 'CustomHTTPSProvisioningStateDisabling', 'CustomHTTPSProvisioningStateDisabled', 'CustomHTTPSProvisioningStateFailed' + CustomHTTPSProvisioningState CustomHTTPSProvisioningState `json:"customHttpsProvisioningState,omitempty"` + // CustomHTTPSProvisioningSubstate - READ-ONLY; Provisioning substate shows the progress of custom HTTPS enabling/disabling process step by step. Possible values include: 'SubmittingDomainControlValidationRequest', 'PendingDomainControlValidationREquestApproval', 'DomainControlValidationRequestApproved', 'DomainControlValidationRequestRejected', 'DomainControlValidationRequestTimedOut', 'IssuingCertificate', 'DeployingCertificate', 'CertificateDeployed', 'DeletingCertificate', 'CertificateDeleted' + CustomHTTPSProvisioningSubstate CustomHTTPSProvisioningSubstate `json:"customHttpsProvisioningSubstate,omitempty"` + // CustomHTTPSConfiguration - READ-ONLY; The configuration specifying how to enable HTTPS + CustomHTTPSConfiguration *CustomHTTPSConfiguration `json:"customHttpsConfiguration,omitempty"` + // HostName - The host name of the frontendEndpoint. Must be a domain name. + HostName *string `json:"hostName,omitempty"` + // SessionAffinityEnabledState - Whether to allow session affinity on this host. Valid options are 'Enabled' or 'Disabled'. Possible values include: 'SessionAffinityEnabledStateEnabled', 'SessionAffinityEnabledStateDisabled' + SessionAffinityEnabledState SessionAffinityEnabledState `json:"sessionAffinityEnabledState,omitempty"` + // SessionAffinityTTLSeconds - UNUSED. This field will be ignored. The TTL to use in seconds for session affinity, if applicable. + SessionAffinityTTLSeconds *int32 `json:"sessionAffinityTtlSeconds,omitempty"` + // WebApplicationFirewallPolicyLink - Defines the Web Application Firewall policy for each host (if applicable) + WebApplicationFirewallPolicyLink *FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink `json:"webApplicationFirewallPolicyLink,omitempty"` +} + +// FrontendEndpointsDisableHTTPSFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type FrontendEndpointsDisableHTTPSFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *FrontendEndpointsDisableHTTPSFuture) Result(client FrontendEndpointsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.FrontendEndpointsDisableHTTPSFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("frontdoor.FrontendEndpointsDisableHTTPSFuture") + return + } + ar.Response = future.Response() + return +} + +// FrontendEndpointsEnableHTTPSFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type FrontendEndpointsEnableHTTPSFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *FrontendEndpointsEnableHTTPSFuture) Result(client FrontendEndpointsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.FrontendEndpointsEnableHTTPSFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("frontdoor.FrontendEndpointsEnableHTTPSFuture") + return + } + ar.Response = future.Response() + return +} + +// FrontendEndpointsListResult result of the request to list frontend endpoints. It contains a list of +// Frontend endpoint objects and a URL link to get the next set of results. +type FrontendEndpointsListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of Frontend endpoints within a Front Door. + Value *[]FrontendEndpoint `json:"value,omitempty"` + // NextLink - URL to get the next set of frontend endpoints if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// FrontendEndpointsListResultIterator provides access to a complete listing of FrontendEndpoint values. +type FrontendEndpointsListResultIterator struct { + i int + page FrontendEndpointsListResultPage +} + +// 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 *FrontendEndpointsListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FrontendEndpointsListResultIterator.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 *FrontendEndpointsListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter FrontendEndpointsListResultIterator) 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 FrontendEndpointsListResultIterator) Response() FrontendEndpointsListResult { + 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 FrontendEndpointsListResultIterator) Value() FrontendEndpoint { + if !iter.page.NotDone() { + return FrontendEndpoint{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the FrontendEndpointsListResultIterator type. +func NewFrontendEndpointsListResultIterator(page FrontendEndpointsListResultPage) FrontendEndpointsListResultIterator { + return FrontendEndpointsListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (felr FrontendEndpointsListResult) IsEmpty() bool { + return felr.Value == nil || len(*felr.Value) == 0 +} + +// frontendEndpointsListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (felr FrontendEndpointsListResult) frontendEndpointsListResultPreparer(ctx context.Context) (*http.Request, error) { + if felr.NextLink == nil || len(to.String(felr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(felr.NextLink))) +} + +// FrontendEndpointsListResultPage contains a page of FrontendEndpoint values. +type FrontendEndpointsListResultPage struct { + fn func(context.Context, FrontendEndpointsListResult) (FrontendEndpointsListResult, error) + felr FrontendEndpointsListResult +} + +// 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 *FrontendEndpointsListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FrontendEndpointsListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.felr) + if err != nil { + return err + } + page.felr = next + 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 *FrontendEndpointsListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page FrontendEndpointsListResultPage) NotDone() bool { + return !page.felr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page FrontendEndpointsListResultPage) Response() FrontendEndpointsListResult { + return page.felr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page FrontendEndpointsListResultPage) Values() []FrontendEndpoint { + if page.felr.IsEmpty() { + return nil + } + return *page.felr.Value +} + +// Creates a new instance of the FrontendEndpointsListResultPage type. +func NewFrontendEndpointsListResultPage(getNextPage func(context.Context, FrontendEndpointsListResult) (FrontendEndpointsListResult, error)) FrontendEndpointsListResultPage { + return FrontendEndpointsListResultPage{fn: getNextPage} +} + +// FrontendEndpointUpdateParameters frontend endpoint used in routing rule +type FrontendEndpointUpdateParameters struct { + // HostName - The host name of the frontendEndpoint. Must be a domain name. + HostName *string `json:"hostName,omitempty"` + // SessionAffinityEnabledState - Whether to allow session affinity on this host. Valid options are 'Enabled' or 'Disabled'. Possible values include: 'SessionAffinityEnabledStateEnabled', 'SessionAffinityEnabledStateDisabled' + SessionAffinityEnabledState SessionAffinityEnabledState `json:"sessionAffinityEnabledState,omitempty"` + // SessionAffinityTTLSeconds - UNUSED. This field will be ignored. The TTL to use in seconds for session affinity, if applicable. + SessionAffinityTTLSeconds *int32 `json:"sessionAffinityTtlSeconds,omitempty"` + // WebApplicationFirewallPolicyLink - Defines the Web Application Firewall policy for each host (if applicable) + WebApplicationFirewallPolicyLink *FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink `json:"webApplicationFirewallPolicyLink,omitempty"` +} + +// FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink defines the Web Application Firewall +// policy for each host (if applicable) +type FrontendEndpointUpdateParametersWebApplicationFirewallPolicyLink struct { + // ID - Resource ID. + ID *string `json:"id,omitempty"` +} + +// HeaderAction an action that can manipulate an http header. +type HeaderAction struct { + // HeaderActionType - Which type of manipulation to apply to the header. Possible values include: 'Append', 'Delete', 'Overwrite' + HeaderActionType HeaderActionType `json:"headerActionType,omitempty"` + // HeaderName - The name of the header this action will apply to. + HeaderName *string `json:"headerName,omitempty"` + // Value - The value to update the given header name with. This value is not used if the actionType is Delete. + Value *string `json:"value,omitempty"` +} + +// HealthProbeSettingsListResult result of the request to list HealthProbeSettings. It contains a list of +// HealthProbeSettings objects and a URL link to get the next set of results. +type HealthProbeSettingsListResult struct { + // Value - READ-ONLY; List of HealthProbeSettings within a Front Door. + Value *[]HealthProbeSettingsModel `json:"value,omitempty"` + // NextLink - URL to get the next set of HealthProbeSettings objects if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// HealthProbeSettingsModel load balancing settings for a backend pool +type HealthProbeSettingsModel struct { + // HealthProbeSettingsProperties - Properties of the health probe settings + *HealthProbeSettingsProperties `json:"properties,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for HealthProbeSettingsModel. +func (hpsm HealthProbeSettingsModel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if hpsm.HealthProbeSettingsProperties != nil { + objectMap["properties"] = hpsm.HealthProbeSettingsProperties + } + if hpsm.Name != nil { + objectMap["name"] = hpsm.Name + } + if hpsm.ID != nil { + objectMap["id"] = hpsm.ID + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for HealthProbeSettingsModel struct. +func (hpsm *HealthProbeSettingsModel) 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 healthProbeSettingsProperties HealthProbeSettingsProperties + err = json.Unmarshal(*v, &healthProbeSettingsProperties) + if err != nil { + return err + } + hpsm.HealthProbeSettingsProperties = &healthProbeSettingsProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + hpsm.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + hpsm.Type = &typeVar + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + hpsm.ID = &ID + } + } + } + + return nil +} + +// HealthProbeSettingsProperties the JSON object that contains the properties required to create a health +// probe settings. +type HealthProbeSettingsProperties struct { + // ResourceState - Resource status. Possible values include: 'ResourceStateCreating', 'ResourceStateEnabling', 'ResourceStateEnabled', 'ResourceStateDisabling', 'ResourceStateDisabled', 'ResourceStateDeleting' + ResourceState ResourceState `json:"resourceState,omitempty"` + // Path - The path to use for the health probe. Default is / + Path *string `json:"path,omitempty"` + // Protocol - Protocol scheme to use for this probe. Possible values include: 'HTTP', 'HTTPS' + Protocol Protocol `json:"protocol,omitempty"` + // IntervalInSeconds - The number of seconds between health probes. + IntervalInSeconds *int32 `json:"intervalInSeconds,omitempty"` + // HealthProbeMethod - Configures which HTTP method to use to probe the backends defined under backendPools. Possible values include: 'GET', 'HEAD' + HealthProbeMethod HealthProbeMethod `json:"healthProbeMethod,omitempty"` + // EnabledState - Whether to enable health probes to be made against backends defined under backendPools. Health probes can only be disabled if there is a single enabled backend in single enabled backend pool. Possible values include: 'HealthProbeEnabledEnabled', 'HealthProbeEnabledDisabled' + EnabledState HealthProbeEnabled `json:"enabledState,omitempty"` +} + +// HealthProbeSettingsUpdateParameters l7 health probe settings for a backend pool +type HealthProbeSettingsUpdateParameters struct { + // Path - The path to use for the health probe. Default is / + Path *string `json:"path,omitempty"` + // Protocol - Protocol scheme to use for this probe. Possible values include: 'HTTP', 'HTTPS' + Protocol Protocol `json:"protocol,omitempty"` + // IntervalInSeconds - The number of seconds between health probes. + IntervalInSeconds *int32 `json:"intervalInSeconds,omitempty"` + // HealthProbeMethod - Configures which HTTP method to use to probe the backends defined under backendPools. Possible values include: 'GET', 'HEAD' + HealthProbeMethod HealthProbeMethod `json:"healthProbeMethod,omitempty"` + // EnabledState - Whether to enable health probes to be made against backends defined under backendPools. Health probes can only be disabled if there is a single enabled backend in single enabled backend pool. Possible values include: 'HealthProbeEnabledEnabled', 'HealthProbeEnabledDisabled' + EnabledState HealthProbeEnabled `json:"enabledState,omitempty"` +} + +// KeyVaultCertificateSourceParameters parameters required for bring-your-own-certification via Key Vault +type KeyVaultCertificateSourceParameters struct { + // Vault - The Key Vault containing the SSL certificate + Vault *KeyVaultCertificateSourceParametersVault `json:"vault,omitempty"` + // SecretName - The name of the Key Vault secret representing the full certificate PFX + SecretName *string `json:"secretName,omitempty"` + // SecretVersion - The version of the Key Vault secret representing the full certificate PFX + SecretVersion *string `json:"secretVersion,omitempty"` +} + +// KeyVaultCertificateSourceParametersVault the Key Vault containing the SSL certificate +type KeyVaultCertificateSourceParametersVault struct { + // ID - Resource ID. + ID *string `json:"id,omitempty"` +} + +// LatencyMetric defines the properties of a latency metric used in the latency scorecard +type LatencyMetric struct { + // Name - READ-ONLY; The name of the Latency Metric + Name *string `json:"name,omitempty"` + // EndDateTimeUTC - READ-ONLY; The end time of the Latency Scorecard in UTC + EndDateTimeUTC *string `json:"endDateTimeUTC,omitempty"` + // AValue - READ-ONLY; The metric value of the A endpoint + AValue *float64 `json:"aValue,omitempty"` + // BValue - READ-ONLY; The metric value of the B endpoint + BValue *float64 `json:"bValue,omitempty"` + // Delta - READ-ONLY; The difference in value between endpoint A and B + Delta *float64 `json:"delta,omitempty"` + // DeltaPercent - READ-ONLY; The percent difference between endpoint A and B + DeltaPercent *float64 `json:"deltaPercent,omitempty"` + // ACLower95CI - READ-ONLY; The lower end of the 95% confidence interval for endpoint A + ACLower95CI *float64 `json:"aCLower95CI,omitempty"` + // AHUpper95CI - READ-ONLY; The upper end of the 95% confidence interval for endpoint A + AHUpper95CI *float64 `json:"aHUpper95CI,omitempty"` + // BCLower95CI - READ-ONLY; The lower end of the 95% confidence interval for endpoint B + BCLower95CI *float64 `json:"bCLower95CI,omitempty"` + // BUpper95CI - READ-ONLY; The upper end of the 95% confidence interval for endpoint B + BUpper95CI *float64 `json:"bUpper95CI,omitempty"` +} + +// LatencyScorecard defines the LatencyScorecard +type LatencyScorecard struct { + autorest.Response `json:"-"` + // LatencyScorecardProperties - The properties of a latency scorecard + *LatencyScorecardProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for LatencyScorecard. +func (ls LatencyScorecard) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ls.LatencyScorecardProperties != nil { + objectMap["properties"] = ls.LatencyScorecardProperties + } + if ls.Location != nil { + objectMap["location"] = ls.Location + } + if ls.Tags != nil { + objectMap["tags"] = ls.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for LatencyScorecard struct. +func (ls *LatencyScorecard) 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 latencyScorecardProperties LatencyScorecardProperties + err = json.Unmarshal(*v, &latencyScorecardProperties) + if err != nil { + return err + } + ls.LatencyScorecardProperties = &latencyScorecardProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ls.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ls.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ls.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + ls.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + ls.Tags = tags + } + } + } + + return nil +} + +// LatencyScorecardProperties defines a the properties of a Latency Scorecard +type LatencyScorecardProperties struct { + // ID - READ-ONLY; The unique identifier of the Latency Scorecard + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the Latency Scorecard + Name *string `json:"name,omitempty"` + // Description - READ-ONLY; The description of the Latency Scorecard + Description *string `json:"description,omitempty"` + // EndpointA - READ-ONLY; The A endpoint in the scorecard + EndpointA *string `json:"endpointA,omitempty"` + // EndpointB - READ-ONLY; The B endpoint in the scorecard + EndpointB *string `json:"endpointB,omitempty"` + // StartDateTimeUTC - READ-ONLY; The start time of the Latency Scorecard in UTC + StartDateTimeUTC *date.Time `json:"startDateTimeUTC,omitempty"` + // EndDateTimeUTC - READ-ONLY; The end time of the Latency Scorecard in UTC + EndDateTimeUTC *date.Time `json:"endDateTimeUTC,omitempty"` + // Country - READ-ONLY; The country associated with the Latency Scorecard. Values are country ISO codes as specified here- https://www.iso.org/iso-3166-country-codes.html + Country *string `json:"country,omitempty"` + // LatencyMetrics - The latency metrics of the Latency Scorecard + LatencyMetrics *[]LatencyMetric `json:"latencyMetrics,omitempty"` +} + +// ListResult result of the request to list Front Doors. It contains a list of Front Door objects and a URL +// link to get the next set of results. +type ListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of Front Doors within a resource group. + Value *[]FrontDoor `json:"value,omitempty"` + // NextLink - URL to get the next set of Front Door objects if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// ListResultIterator provides access to a complete listing of FrontDoor values. +type ListResultIterator struct { + i int + page ListResultPage +} + +// 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 *ListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ListResultIterator.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 *ListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ListResultIterator) 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 ListResultIterator) Response() ListResult { + 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 ListResultIterator) Value() FrontDoor { + if !iter.page.NotDone() { + return FrontDoor{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ListResultIterator type. +func NewListResultIterator(page ListResultPage) ListResultIterator { + return ListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (lr ListResult) IsEmpty() bool { + return lr.Value == nil || len(*lr.Value) == 0 +} + +// listResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (lr ListResult) listResultPreparer(ctx context.Context) (*http.Request, error) { + if lr.NextLink == nil || len(to.String(lr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(lr.NextLink))) +} + +// ListResultPage contains a page of FrontDoor values. +type ListResultPage struct { + fn func(context.Context, ListResult) (ListResult, error) + lr ListResult +} + +// 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 *ListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.lr) + if err != nil { + return err + } + page.lr = next + 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 *ListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ListResultPage) NotDone() bool { + return !page.lr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ListResultPage) Response() ListResult { + return page.lr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ListResultPage) Values() []FrontDoor { + if page.lr.IsEmpty() { + return nil + } + return *page.lr.Value +} + +// Creates a new instance of the ListResultPage type. +func NewListResultPage(getNextPage func(context.Context, ListResult) (ListResult, error)) ListResultPage { + return ListResultPage{fn: getNextPage} +} + +// LoadBalancingSettingsListResult result of the request to list load balancing settings. It contains a +// list of load balancing settings objects and a URL link to get the next set of results. +type LoadBalancingSettingsListResult struct { + // Value - READ-ONLY; List of Backend Pools within a Front Door. + Value *[]LoadBalancingSettingsModel `json:"value,omitempty"` + // NextLink - URL to get the next set of LoadBalancingSettings objects if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// LoadBalancingSettingsModel load balancing settings for a backend pool +type LoadBalancingSettingsModel struct { + // LoadBalancingSettingsProperties - Properties of the load balancing settings + *LoadBalancingSettingsProperties `json:"properties,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for LoadBalancingSettingsModel. +func (lbsm LoadBalancingSettingsModel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lbsm.LoadBalancingSettingsProperties != nil { + objectMap["properties"] = lbsm.LoadBalancingSettingsProperties + } + if lbsm.Name != nil { + objectMap["name"] = lbsm.Name + } + if lbsm.ID != nil { + objectMap["id"] = lbsm.ID + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for LoadBalancingSettingsModel struct. +func (lbsm *LoadBalancingSettingsModel) 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 loadBalancingSettingsProperties LoadBalancingSettingsProperties + err = json.Unmarshal(*v, &loadBalancingSettingsProperties) + if err != nil { + return err + } + lbsm.LoadBalancingSettingsProperties = &loadBalancingSettingsProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + lbsm.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + lbsm.Type = &typeVar + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + lbsm.ID = &ID + } + } + } + + return nil +} + +// LoadBalancingSettingsProperties the JSON object that contains the properties required to create load +// balancing settings +type LoadBalancingSettingsProperties struct { + // ResourceState - Resource status. Possible values include: 'ResourceStateCreating', 'ResourceStateEnabling', 'ResourceStateEnabled', 'ResourceStateDisabling', 'ResourceStateDisabled', 'ResourceStateDeleting' + ResourceState ResourceState `json:"resourceState,omitempty"` + // SampleSize - The number of samples to consider for load balancing decisions + SampleSize *int32 `json:"sampleSize,omitempty"` + // SuccessfulSamplesRequired - The number of samples within the sample period that must succeed + SuccessfulSamplesRequired *int32 `json:"successfulSamplesRequired,omitempty"` + // AdditionalLatencyMilliseconds - The additional latency in milliseconds for probes to fall into the lowest latency bucket + AdditionalLatencyMilliseconds *int32 `json:"additionalLatencyMilliseconds,omitempty"` +} + +// LoadBalancingSettingsUpdateParameters round-Robin load balancing settings for a backend pool +type LoadBalancingSettingsUpdateParameters struct { + // SampleSize - The number of samples to consider for load balancing decisions + SampleSize *int32 `json:"sampleSize,omitempty"` + // SuccessfulSamplesRequired - The number of samples within the sample period that must succeed + SuccessfulSamplesRequired *int32 `json:"successfulSamplesRequired,omitempty"` + // AdditionalLatencyMilliseconds - The additional latency in milliseconds for probes to fall into the lowest latency bucket + AdditionalLatencyMilliseconds *int32 `json:"additionalLatencyMilliseconds,omitempty"` +} + +// ManagedRuleDefinition describes a managed rule definition. +type ManagedRuleDefinition struct { + // RuleID - READ-ONLY; Identifier for the managed rule. + RuleID *string `json:"ruleId,omitempty"` + // DefaultState - READ-ONLY; Describes the default state for the managed rule. Possible values include: 'ManagedRuleEnabledStateDisabled', 'ManagedRuleEnabledStateEnabled' + DefaultState ManagedRuleEnabledState `json:"defaultState,omitempty"` + // DefaultAction - READ-ONLY; Describes the default action to be applied when the managed rule matches. Possible values include: 'Allow', 'Block', 'Log', 'Redirect' + DefaultAction ActionType `json:"defaultAction,omitempty"` + // Description - READ-ONLY; Describes the functionality of the managed rule. + Description *string `json:"description,omitempty"` +} + +// ManagedRuleExclusion exclude variables from managed rule evaluation. +type ManagedRuleExclusion struct { + // MatchVariable - The variable type to be excluded. Possible values include: 'RequestHeaderNames', 'RequestCookieNames', 'QueryStringArgNames', 'RequestBodyPostArgNames' + MatchVariable ManagedRuleExclusionMatchVariable `json:"matchVariable,omitempty"` + // SelectorMatchOperator - Comparison operator to apply to the selector when specifying which elements in the collection this exclusion applies to. Possible values include: 'Equals', 'Contains', 'StartsWith', 'EndsWith', 'EqualsAny' + SelectorMatchOperator ManagedRuleExclusionSelectorMatchOperator `json:"selectorMatchOperator,omitempty"` + // Selector - Selector value for which elements in the collection this exclusion applies to. + Selector *string `json:"selector,omitempty"` +} + +// ManagedRuleGroupDefinition describes a managed rule group. +type ManagedRuleGroupDefinition struct { + // RuleGroupName - READ-ONLY; Name of the managed rule group. + RuleGroupName *string `json:"ruleGroupName,omitempty"` + // Description - READ-ONLY; Description of the managed rule group. + Description *string `json:"description,omitempty"` + // Rules - READ-ONLY; List of rules within the managed rule group. + Rules *[]ManagedRuleDefinition `json:"rules,omitempty"` +} + +// ManagedRuleGroupOverride defines a managed rule group override setting. +type ManagedRuleGroupOverride struct { + // RuleGroupName - Describes the managed rule group to override. + RuleGroupName *string `json:"ruleGroupName,omitempty"` + // Exclusions - Describes the exclusions that are applied to all rules in the group. + Exclusions *[]ManagedRuleExclusion `json:"exclusions,omitempty"` + // Rules - List of rules that will be disabled. If none specified, all rules in the group will be disabled. + Rules *[]ManagedRuleOverride `json:"rules,omitempty"` +} + +// ManagedRuleOverride defines a managed rule group override setting. +type ManagedRuleOverride struct { + // RuleID - Identifier for the managed rule. + RuleID *string `json:"ruleId,omitempty"` + // EnabledState - Describes if the managed rule is in enabled or disabled state. Defaults to Disabled if not specified. Possible values include: 'ManagedRuleEnabledStateDisabled', 'ManagedRuleEnabledStateEnabled' + EnabledState ManagedRuleEnabledState `json:"enabledState,omitempty"` + // Action - Describes the override action to be applied when rule matches. Possible values include: 'Allow', 'Block', 'Log', 'Redirect' + Action ActionType `json:"action,omitempty"` + // Exclusions - Describes the exclusions that are applied to this specific rule. + Exclusions *[]ManagedRuleExclusion `json:"exclusions,omitempty"` +} + +// ManagedRuleSet defines a managed rule set. +type ManagedRuleSet struct { + // RuleSetType - Defines the rule set type to use. + RuleSetType *string `json:"ruleSetType,omitempty"` + // RuleSetVersion - Defines the version of the rule set to use. + RuleSetVersion *string `json:"ruleSetVersion,omitempty"` + // Exclusions - Describes the exclusions that are applied to all rules in the set. + Exclusions *[]ManagedRuleExclusion `json:"exclusions,omitempty"` + // RuleGroupOverrides - Defines the rule group overrides to apply to the rule set. + RuleGroupOverrides *[]ManagedRuleGroupOverride `json:"ruleGroupOverrides,omitempty"` +} + +// ManagedRuleSetDefinition describes the a managed rule set definition. +type ManagedRuleSetDefinition struct { + // ManagedRuleSetDefinitionProperties - Properties for a managed rule set definition. + *ManagedRuleSetDefinitionProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for ManagedRuleSetDefinition. +func (mrsd ManagedRuleSetDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mrsd.ManagedRuleSetDefinitionProperties != nil { + objectMap["properties"] = mrsd.ManagedRuleSetDefinitionProperties + } + if mrsd.Location != nil { + objectMap["location"] = mrsd.Location + } + if mrsd.Tags != nil { + objectMap["tags"] = mrsd.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ManagedRuleSetDefinition struct. +func (mrsd *ManagedRuleSetDefinition) 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 managedRuleSetDefinitionProperties ManagedRuleSetDefinitionProperties + err = json.Unmarshal(*v, &managedRuleSetDefinitionProperties) + if err != nil { + return err + } + mrsd.ManagedRuleSetDefinitionProperties = &managedRuleSetDefinitionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + mrsd.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mrsd.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mrsd.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + mrsd.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + mrsd.Tags = tags + } + } + } + + return nil +} + +// ManagedRuleSetDefinitionList list of managed rule set definitions available for use in a policy. +type ManagedRuleSetDefinitionList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of managed rule set definitions. + Value *[]ManagedRuleSetDefinition `json:"value,omitempty"` + // NextLink - URL to retrieve next set of managed rule set definitions. + NextLink *string `json:"nextLink,omitempty"` +} + +// ManagedRuleSetDefinitionListIterator provides access to a complete listing of ManagedRuleSetDefinition +// values. +type ManagedRuleSetDefinitionListIterator struct { + i int + page ManagedRuleSetDefinitionListPage +} + +// 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 *ManagedRuleSetDefinitionListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedRuleSetDefinitionListIterator.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 *ManagedRuleSetDefinitionListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ManagedRuleSetDefinitionListIterator) 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 ManagedRuleSetDefinitionListIterator) Response() ManagedRuleSetDefinitionList { + 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 ManagedRuleSetDefinitionListIterator) Value() ManagedRuleSetDefinition { + if !iter.page.NotDone() { + return ManagedRuleSetDefinition{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ManagedRuleSetDefinitionListIterator type. +func NewManagedRuleSetDefinitionListIterator(page ManagedRuleSetDefinitionListPage) ManagedRuleSetDefinitionListIterator { + return ManagedRuleSetDefinitionListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (mrsdl ManagedRuleSetDefinitionList) IsEmpty() bool { + return mrsdl.Value == nil || len(*mrsdl.Value) == 0 +} + +// managedRuleSetDefinitionListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (mrsdl ManagedRuleSetDefinitionList) managedRuleSetDefinitionListPreparer(ctx context.Context) (*http.Request, error) { + if mrsdl.NextLink == nil || len(to.String(mrsdl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(mrsdl.NextLink))) +} + +// ManagedRuleSetDefinitionListPage contains a page of ManagedRuleSetDefinition values. +type ManagedRuleSetDefinitionListPage struct { + fn func(context.Context, ManagedRuleSetDefinitionList) (ManagedRuleSetDefinitionList, error) + mrsdl ManagedRuleSetDefinitionList +} + +// 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 *ManagedRuleSetDefinitionListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedRuleSetDefinitionListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.mrsdl) + if err != nil { + return err + } + page.mrsdl = next + 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 *ManagedRuleSetDefinitionListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ManagedRuleSetDefinitionListPage) NotDone() bool { + return !page.mrsdl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ManagedRuleSetDefinitionListPage) Response() ManagedRuleSetDefinitionList { + return page.mrsdl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ManagedRuleSetDefinitionListPage) Values() []ManagedRuleSetDefinition { + if page.mrsdl.IsEmpty() { + return nil + } + return *page.mrsdl.Value +} + +// Creates a new instance of the ManagedRuleSetDefinitionListPage type. +func NewManagedRuleSetDefinitionListPage(getNextPage func(context.Context, ManagedRuleSetDefinitionList) (ManagedRuleSetDefinitionList, error)) ManagedRuleSetDefinitionListPage { + return ManagedRuleSetDefinitionListPage{fn: getNextPage} +} + +// ManagedRuleSetDefinitionProperties properties for a managed rule set definition. +type ManagedRuleSetDefinitionProperties struct { + // ProvisioningState - READ-ONLY; Provisioning state of the managed rule set. + ProvisioningState *string `json:"provisioningState,omitempty"` + // RuleSetID - READ-ONLY; Id of the managed rule set. + RuleSetID *string `json:"ruleSetId,omitempty"` + // RuleSetType - READ-ONLY; Type of the managed rule set. + RuleSetType *string `json:"ruleSetType,omitempty"` + // RuleSetVersion - READ-ONLY; Version of the managed rule set type. + RuleSetVersion *string `json:"ruleSetVersion,omitempty"` + // RuleGroups - READ-ONLY; Rule groups of the managed rule set. + RuleGroups *[]ManagedRuleGroupDefinition `json:"ruleGroups,omitempty"` +} + +// ManagedRuleSetList defines the list of managed rule sets for the policy. +type ManagedRuleSetList struct { + // ManagedRuleSets - List of rule sets. + ManagedRuleSets *[]ManagedRuleSet `json:"managedRuleSets,omitempty"` +} + +// MatchCondition define a match condition. +type MatchCondition struct { + // MatchVariable - Request variable to compare with. Possible values include: 'RemoteAddr', 'RequestMethod', 'QueryString', 'PostArgs', 'RequestURI', 'RequestHeader', 'RequestBody', 'Cookies', 'SocketAddr' + MatchVariable MatchVariable `json:"matchVariable,omitempty"` + // Selector - Match against a specific key from the QueryString, PostArgs, RequestHeader or Cookies variables. Default is null. + Selector *string `json:"selector,omitempty"` + // Operator - Comparison type to use for matching with the variable value. Possible values include: 'OperatorAny', 'OperatorIPMatch', 'OperatorGeoMatch', 'OperatorEqual', 'OperatorContains', 'OperatorLessThan', 'OperatorGreaterThan', 'OperatorLessThanOrEqual', 'OperatorGreaterThanOrEqual', 'OperatorBeginsWith', 'OperatorEndsWith', 'OperatorRegEx' + Operator Operator `json:"operator,omitempty"` + // NegateCondition - Describes if the result of this condition should be negated. + NegateCondition *bool `json:"negateCondition,omitempty"` + // MatchValue - List of possible match values. + MatchValue *[]string `json:"matchValue,omitempty"` + // Transforms - List of transforms. + Transforms *[]TransformType `json:"transforms,omitempty"` +} + +// NetworkExperimentProfilesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type NetworkExperimentProfilesCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *NetworkExperimentProfilesCreateOrUpdateFuture) Result(client NetworkExperimentProfilesClient) (p Profile, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("frontdoor.NetworkExperimentProfilesCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if p.Response.Response, err = future.GetResult(sender); err == nil && p.Response.Response.StatusCode != http.StatusNoContent { + p, err = client.CreateOrUpdateResponder(p.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesCreateOrUpdateFuture", "Result", p.Response.Response, "Failure responding to request") + } + } + return +} + +// NetworkExperimentProfilesDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type NetworkExperimentProfilesDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *NetworkExperimentProfilesDeleteFuture) Result(client NetworkExperimentProfilesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("frontdoor.NetworkExperimentProfilesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// NetworkExperimentProfilesUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type NetworkExperimentProfilesUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *NetworkExperimentProfilesUpdateFuture) Result(client NetworkExperimentProfilesClient) (p Profile, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("frontdoor.NetworkExperimentProfilesUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if p.Response.Response, err = future.GetResult(sender); err == nil && p.Response.Response.StatusCode != http.StatusNoContent { + p, err = client.UpdateResponder(p.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesUpdateFuture", "Result", p.Response.Response, "Failure responding to request") + } + } + return +} + +// PoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type PoliciesCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *PoliciesCreateOrUpdateFuture) Result(client PoliciesClient) (wafp WebApplicationFirewallPolicy, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.PoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("frontdoor.PoliciesCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if wafp.Response.Response, err = future.GetResult(sender); err == nil && wafp.Response.Response.StatusCode != http.StatusNoContent { + wafp, err = client.CreateOrUpdateResponder(wafp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.PoliciesCreateOrUpdateFuture", "Result", wafp.Response.Response, "Failure responding to request") + } + } + return +} + +// PoliciesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type PoliciesDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *PoliciesDeleteFuture) Result(client PoliciesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.PoliciesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("frontdoor.PoliciesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// PolicySettings defines top-level WebApplicationFirewallPolicy configuration settings. +type PolicySettings struct { + // EnabledState - Describes if the policy is in enabled or disabled state. Defaults to Enabled if not specified. Possible values include: 'PolicyEnabledStateDisabled', 'PolicyEnabledStateEnabled' + EnabledState PolicyEnabledState `json:"enabledState,omitempty"` + // Mode - Describes if it is in detection mode or prevention mode at policy level. Possible values include: 'Prevention', 'Detection' + Mode PolicyMode `json:"mode,omitempty"` + // RedirectURL - If action type is redirect, this field represents redirect URL for the client. + RedirectURL *string `json:"redirectUrl,omitempty"` + // CustomBlockResponseStatusCode - If the action type is block, customer can override the response status code. + CustomBlockResponseStatusCode *int32 `json:"customBlockResponseStatusCode,omitempty"` + // CustomBlockResponseBody - If the action type is block, customer can override the response body. The body must be specified in base64 encoding. + CustomBlockResponseBody *string `json:"customBlockResponseBody,omitempty"` +} + +// PreconfiguredEndpoint defines the properties of a preconfigured endpoint +type PreconfiguredEndpoint struct { + // PreconfiguredEndpointProperties - The properties of a preconfiguredEndpoint + *PreconfiguredEndpointProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for PreconfiguredEndpoint. +func (peVar PreconfiguredEndpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if peVar.PreconfiguredEndpointProperties != nil { + objectMap["properties"] = peVar.PreconfiguredEndpointProperties + } + if peVar.Location != nil { + objectMap["location"] = peVar.Location + } + if peVar.Tags != nil { + objectMap["tags"] = peVar.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PreconfiguredEndpoint struct. +func (peVar *PreconfiguredEndpoint) 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 preconfiguredEndpointProperties PreconfiguredEndpointProperties + err = json.Unmarshal(*v, &preconfiguredEndpointProperties) + if err != nil { + return err + } + peVar.PreconfiguredEndpointProperties = &preconfiguredEndpointProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + peVar.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + peVar.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + peVar.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + peVar.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + peVar.Tags = tags + } + } + } + + return nil +} + +// PreconfiguredEndpointList defines a list of preconfigured endpoints. +type PreconfiguredEndpointList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of PreconfiguredEndpoints supported by NetworkExperiment. + Value *[]PreconfiguredEndpoint `json:"value,omitempty"` + // NextLink - URL to get the next set of PreconfiguredEndpoints if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// PreconfiguredEndpointListIterator provides access to a complete listing of PreconfiguredEndpoint values. +type PreconfiguredEndpointListIterator struct { + i int + page PreconfiguredEndpointListPage +} + +// 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 *PreconfiguredEndpointListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PreconfiguredEndpointListIterator.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 *PreconfiguredEndpointListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter PreconfiguredEndpointListIterator) 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 PreconfiguredEndpointListIterator) Response() PreconfiguredEndpointList { + 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 PreconfiguredEndpointListIterator) Value() PreconfiguredEndpoint { + if !iter.page.NotDone() { + return PreconfiguredEndpoint{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the PreconfiguredEndpointListIterator type. +func NewPreconfiguredEndpointListIterator(page PreconfiguredEndpointListPage) PreconfiguredEndpointListIterator { + return PreconfiguredEndpointListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pel PreconfiguredEndpointList) IsEmpty() bool { + return pel.Value == nil || len(*pel.Value) == 0 +} + +// preconfiguredEndpointListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pel PreconfiguredEndpointList) preconfiguredEndpointListPreparer(ctx context.Context) (*http.Request, error) { + if pel.NextLink == nil || len(to.String(pel.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pel.NextLink))) +} + +// PreconfiguredEndpointListPage contains a page of PreconfiguredEndpoint values. +type PreconfiguredEndpointListPage struct { + fn func(context.Context, PreconfiguredEndpointList) (PreconfiguredEndpointList, error) + pel PreconfiguredEndpointList +} + +// 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 *PreconfiguredEndpointListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PreconfiguredEndpointListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.pel) + if err != nil { + return err + } + page.pel = next + 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 *PreconfiguredEndpointListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page PreconfiguredEndpointListPage) NotDone() bool { + return !page.pel.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page PreconfiguredEndpointListPage) Response() PreconfiguredEndpointList { + return page.pel +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page PreconfiguredEndpointListPage) Values() []PreconfiguredEndpoint { + if page.pel.IsEmpty() { + return nil + } + return *page.pel.Value +} + +// Creates a new instance of the PreconfiguredEndpointListPage type. +func NewPreconfiguredEndpointListPage(getNextPage func(context.Context, PreconfiguredEndpointList) (PreconfiguredEndpointList, error)) PreconfiguredEndpointListPage { + return PreconfiguredEndpointListPage{fn: getNextPage} +} + +// PreconfiguredEndpointProperties defines the properties of a preconfigured endpoint +type PreconfiguredEndpointProperties struct { + // Description - The description of the endpoint + Description *string `json:"description,omitempty"` + // Endpoint - The endpoint that is preconfigured + Endpoint *string `json:"endpoint,omitempty"` + // EndpointType - The type of endpoint. Possible values include: 'AFD', 'AzureRegion', 'CDN', 'ATM' + EndpointType EndpointType `json:"endpointType,omitempty"` + // Backend - The preconfigured endpoint backend + Backend *string `json:"backend,omitempty"` +} + +// Profile defines an Network Experiment Profile and lists of Experiments +type Profile struct { + autorest.Response `json:"-"` + // ProfileProperties - The properties of a Profile + *ProfileProperties `json:"properties,omitempty"` + // Etag - Gets a unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Profile. +func (p Profile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if p.ProfileProperties != nil { + objectMap["properties"] = p.ProfileProperties + } + if p.Etag != nil { + objectMap["etag"] = p.Etag + } + if p.Location != nil { + objectMap["location"] = p.Location + } + if p.Tags != nil { + objectMap["tags"] = p.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Profile struct. +func (p *Profile) 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 profileProperties ProfileProperties + err = json.Unmarshal(*v, &profileProperties) + if err != nil { + return err + } + p.ProfileProperties = &profileProperties + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + p.Etag = &etag + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + p.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + p.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + p.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + p.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + p.Tags = tags + } + } + } + + return nil +} + +// ProfileList defines a list of Profiles. It contains a list of Profile objects and a URL link to get the +// next set of results. +type ProfileList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of Profiles within a resource group. + Value *[]Profile `json:"value,omitempty"` + // NextLink - URL to get the next set of Profile objects if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// ProfileListIterator provides access to a complete listing of Profile values. +type ProfileListIterator struct { + i int + page ProfileListPage +} + +// 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 *ProfileListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProfileListIterator.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 *ProfileListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ProfileListIterator) 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 ProfileListIterator) Response() ProfileList { + 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 ProfileListIterator) Value() Profile { + if !iter.page.NotDone() { + return Profile{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ProfileListIterator type. +func NewProfileListIterator(page ProfileListPage) ProfileListIterator { + return ProfileListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pl ProfileList) IsEmpty() bool { + return pl.Value == nil || len(*pl.Value) == 0 +} + +// profileListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pl ProfileList) profileListPreparer(ctx context.Context) (*http.Request, error) { + if pl.NextLink == nil || len(to.String(pl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pl.NextLink))) +} + +// ProfileListPage contains a page of Profile values. +type ProfileListPage struct { + fn func(context.Context, ProfileList) (ProfileList, error) + pl ProfileList +} + +// 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 *ProfileListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProfileListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.pl) + if err != nil { + return err + } + page.pl = next + 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 *ProfileListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ProfileListPage) NotDone() bool { + return !page.pl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ProfileListPage) Response() ProfileList { + return page.pl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ProfileListPage) Values() []Profile { + if page.pl.IsEmpty() { + return nil + } + return *page.pl.Value +} + +// Creates a new instance of the ProfileListPage type. +func NewProfileListPage(getNextPage func(context.Context, ProfileList) (ProfileList, error)) ProfileListPage { + return ProfileListPage{fn: getNextPage} +} + +// ProfileProperties defines the properties of an experiment +type ProfileProperties struct { + // ResourceState - Resource status. Possible values include: 'NetworkExperimentResourceStateCreating', 'NetworkExperimentResourceStateEnabling', 'NetworkExperimentResourceStateEnabled', 'NetworkExperimentResourceStateDisabling', 'NetworkExperimentResourceStateDisabled', 'NetworkExperimentResourceStateDeleting' + ResourceState NetworkExperimentResourceState `json:"resourceState,omitempty"` + // EnabledState - The state of the Experiment. Possible values include: 'StateEnabled', 'StateDisabled' + EnabledState State `json:"enabledState,omitempty"` +} + +// ProfileUpdateModel defines modifiable attributes of a Profile +type ProfileUpdateModel struct { + // ProfileUpdateProperties - The properties of a Profile + *ProfileUpdateProperties `json:"properties,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for ProfileUpdateModel. +func (pum ProfileUpdateModel) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pum.ProfileUpdateProperties != nil { + objectMap["properties"] = pum.ProfileUpdateProperties + } + if pum.Tags != nil { + objectMap["tags"] = pum.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ProfileUpdateModel struct. +func (pum *ProfileUpdateModel) 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 profileUpdateProperties ProfileUpdateProperties + err = json.Unmarshal(*v, &profileUpdateProperties) + if err != nil { + return err + } + pum.ProfileUpdateProperties = &profileUpdateProperties + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + pum.Tags = tags + } + } + } + + return nil +} + +// ProfileUpdateProperties defines the properties of an experiment +type ProfileUpdateProperties struct { + // EnabledState - The enabled state of the Profile. Possible values include: 'StateEnabled', 'StateDisabled' + EnabledState State `json:"enabledState,omitempty"` +} + +// Properties the JSON object that contains the properties required to create an endpoint. +type Properties struct { + // ResourceState - Resource status of the Front Door. Possible values include: 'ResourceStateCreating', 'ResourceStateEnabling', 'ResourceStateEnabled', 'ResourceStateDisabling', 'ResourceStateDisabled', 'ResourceStateDeleting' + ResourceState ResourceState `json:"resourceState,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the Front Door. + ProvisioningState *string `json:"provisioningState,omitempty"` + // Cname - READ-ONLY; The host that each frontendEndpoint must CNAME to. + Cname *string `json:"cname,omitempty"` + // FrontdoorID - READ-ONLY; The Id of the frontdoor. + FrontdoorID *string `json:"frontdoorId,omitempty"` + // RulesEngines - READ-ONLY; Rules Engine Configurations available to routing rules. + RulesEngines *[]RulesEngine `json:"rulesEngines,omitempty"` + // FriendlyName - A friendly name for the frontDoor + FriendlyName *string `json:"friendlyName,omitempty"` + // RoutingRules - Routing rules associated with this Front Door. + RoutingRules *[]RoutingRule `json:"routingRules,omitempty"` + // LoadBalancingSettings - Load balancing settings associated with this Front Door instance. + LoadBalancingSettings *[]LoadBalancingSettingsModel `json:"loadBalancingSettings,omitempty"` + // HealthProbeSettings - Health probe settings associated with this Front Door instance. + HealthProbeSettings *[]HealthProbeSettingsModel `json:"healthProbeSettings,omitempty"` + // BackendPools - Backend pools available to routing rules. + BackendPools *[]BackendPool `json:"backendPools,omitempty"` + // FrontendEndpoints - Frontend endpoints available to routing rules. + FrontendEndpoints *[]FrontendEndpoint `json:"frontendEndpoints,omitempty"` + // BackendPoolsSettings - Settings for all backendPools + BackendPoolsSettings *BackendPoolsSettings `json:"backendPoolsSettings,omitempty"` + // EnabledState - Operational status of the Front Door load balancer. Permitted values are 'Enabled' or 'Disabled'. Possible values include: 'EnabledStateEnabled', 'EnabledStateDisabled' + EnabledState EnabledState `json:"enabledState,omitempty"` +} + +// PurgeParameters parameters required for content purge. +type PurgeParameters struct { + // ContentPaths - The path to the content to be purged. Can describe a file path or a wild card directory. + ContentPaths *[]string `json:"contentPaths,omitempty"` +} + +// RedirectConfiguration describes Redirect Route. +type RedirectConfiguration struct { + // RedirectType - The redirect type the rule will use when redirecting traffic. Possible values include: 'Moved', 'Found', 'TemporaryRedirect', 'PermanentRedirect' + RedirectType RedirectType `json:"redirectType,omitempty"` + // RedirectProtocol - The protocol of the destination to where the traffic is redirected. Possible values include: 'RedirectProtocolHTTPOnly', 'RedirectProtocolHTTPSOnly', 'RedirectProtocolMatchRequest' + RedirectProtocol RedirectProtocol `json:"redirectProtocol,omitempty"` + // CustomHost - Host to redirect. Leave empty to use the incoming host as the destination host. + CustomHost *string `json:"customHost,omitempty"` + // CustomPath - The full path to redirect. Path cannot be empty and must start with /. Leave empty to use the incoming path as destination path. + CustomPath *string `json:"customPath,omitempty"` + // CustomFragment - Fragment to add to the redirect URL. Fragment is the part of the URL that comes after #. Do not include the #. + CustomFragment *string `json:"customFragment,omitempty"` + // CustomQueryString - The set of query strings to be placed in the redirect URL. Setting this value would replace any existing query string; leave empty to preserve the incoming query string. Query string must be in = format. The first ? and & will be added automatically so do not include them in the front, but do separate multiple query strings with &. + CustomQueryString *string `json:"customQueryString,omitempty"` + // OdataType - Possible values include: 'OdataTypeRouteConfiguration', 'OdataTypeMicrosoftAzureFrontDoorModelsFrontdoorForwardingConfiguration', 'OdataTypeMicrosoftAzureFrontDoorModelsFrontdoorRedirectConfiguration' + OdataType OdataType `json:"@odata.type,omitempty"` +} + +// MarshalJSON is the custom marshaler for RedirectConfiguration. +func (rc RedirectConfiguration) MarshalJSON() ([]byte, error) { + rc.OdataType = OdataTypeMicrosoftAzureFrontDoorModelsFrontdoorRedirectConfiguration + objectMap := make(map[string]interface{}) + if rc.RedirectType != "" { + objectMap["redirectType"] = rc.RedirectType + } + if rc.RedirectProtocol != "" { + objectMap["redirectProtocol"] = rc.RedirectProtocol + } + if rc.CustomHost != nil { + objectMap["customHost"] = rc.CustomHost + } + if rc.CustomPath != nil { + objectMap["customPath"] = rc.CustomPath + } + if rc.CustomFragment != nil { + objectMap["customFragment"] = rc.CustomFragment + } + if rc.CustomQueryString != nil { + objectMap["customQueryString"] = rc.CustomQueryString + } + if rc.OdataType != "" { + objectMap["@odata.type"] = rc.OdataType + } + return json.Marshal(objectMap) +} + +// AsForwardingConfiguration is the BasicRouteConfiguration implementation for RedirectConfiguration. +func (rc RedirectConfiguration) AsForwardingConfiguration() (*ForwardingConfiguration, bool) { + return nil, false +} + +// AsRedirectConfiguration is the BasicRouteConfiguration implementation for RedirectConfiguration. +func (rc RedirectConfiguration) AsRedirectConfiguration() (*RedirectConfiguration, bool) { + return &rc, true +} + +// AsRouteConfiguration is the BasicRouteConfiguration implementation for RedirectConfiguration. +func (rc RedirectConfiguration) AsRouteConfiguration() (*RouteConfiguration, bool) { + return nil, false +} + +// AsBasicRouteConfiguration is the BasicRouteConfiguration implementation for RedirectConfiguration. +func (rc RedirectConfiguration) AsBasicRouteConfiguration() (BasicRouteConfiguration, bool) { + return &rc, true +} + +// Resource common resource representation. +type Resource struct { + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,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.Location != nil { + objectMap["location"] = r.Location + } + if r.Tags != nil { + objectMap["tags"] = r.Tags + } + return json.Marshal(objectMap) +} + +// BasicRouteConfiguration base class for all types of Route. +type BasicRouteConfiguration interface { + AsForwardingConfiguration() (*ForwardingConfiguration, bool) + AsRedirectConfiguration() (*RedirectConfiguration, bool) + AsRouteConfiguration() (*RouteConfiguration, bool) +} + +// RouteConfiguration base class for all types of Route. +type RouteConfiguration struct { + // OdataType - Possible values include: 'OdataTypeRouteConfiguration', 'OdataTypeMicrosoftAzureFrontDoorModelsFrontdoorForwardingConfiguration', 'OdataTypeMicrosoftAzureFrontDoorModelsFrontdoorRedirectConfiguration' + OdataType OdataType `json:"@odata.type,omitempty"` +} + +func unmarshalBasicRouteConfiguration(body []byte) (BasicRouteConfiguration, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["@odata.type"] { + case string(OdataTypeMicrosoftAzureFrontDoorModelsFrontdoorForwardingConfiguration): + var fc ForwardingConfiguration + err := json.Unmarshal(body, &fc) + return fc, err + case string(OdataTypeMicrosoftAzureFrontDoorModelsFrontdoorRedirectConfiguration): + var rc RedirectConfiguration + err := json.Unmarshal(body, &rc) + return rc, err + default: + var rc RouteConfiguration + err := json.Unmarshal(body, &rc) + return rc, err + } +} +func unmarshalBasicRouteConfigurationArray(body []byte) ([]BasicRouteConfiguration, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rcArray := make([]BasicRouteConfiguration, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rc, err := unmarshalBasicRouteConfiguration(*rawMessage) + if err != nil { + return nil, err + } + rcArray[index] = rc + } + return rcArray, nil +} + +// MarshalJSON is the custom marshaler for RouteConfiguration. +func (rc RouteConfiguration) MarshalJSON() ([]byte, error) { + rc.OdataType = OdataTypeRouteConfiguration + objectMap := make(map[string]interface{}) + if rc.OdataType != "" { + objectMap["@odata.type"] = rc.OdataType + } + return json.Marshal(objectMap) +} + +// AsForwardingConfiguration is the BasicRouteConfiguration implementation for RouteConfiguration. +func (rc RouteConfiguration) AsForwardingConfiguration() (*ForwardingConfiguration, bool) { + return nil, false +} + +// AsRedirectConfiguration is the BasicRouteConfiguration implementation for RouteConfiguration. +func (rc RouteConfiguration) AsRedirectConfiguration() (*RedirectConfiguration, bool) { + return nil, false +} + +// AsRouteConfiguration is the BasicRouteConfiguration implementation for RouteConfiguration. +func (rc RouteConfiguration) AsRouteConfiguration() (*RouteConfiguration, bool) { + return &rc, true +} + +// AsBasicRouteConfiguration is the BasicRouteConfiguration implementation for RouteConfiguration. +func (rc RouteConfiguration) AsBasicRouteConfiguration() (BasicRouteConfiguration, bool) { + return &rc, true +} + +// RoutingRule a routing rule represents a specification for traffic to treat and where to send it, along +// with health probe information. +type RoutingRule struct { + // RoutingRuleProperties - Properties of the Front Door Routing Rule + *RoutingRuleProperties `json:"properties,omitempty"` + // Name - Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // ID - Resource ID. + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for RoutingRule. +func (rr RoutingRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rr.RoutingRuleProperties != nil { + objectMap["properties"] = rr.RoutingRuleProperties + } + if rr.Name != nil { + objectMap["name"] = rr.Name + } + if rr.ID != nil { + objectMap["id"] = rr.ID + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for RoutingRule struct. +func (rr *RoutingRule) 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 routingRuleProperties RoutingRuleProperties + err = json.Unmarshal(*v, &routingRuleProperties) + if err != nil { + return err + } + rr.RoutingRuleProperties = &routingRuleProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rr.Type = &typeVar + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rr.ID = &ID + } + } + } + + return nil +} + +// RoutingRuleListResult result of the request to list Routing Rules. It contains a list of Routing Rule +// objects and a URL link to get the next set of results. +type RoutingRuleListResult struct { + // Value - READ-ONLY; List of Routing Rules within a Front Door. + Value *[]RoutingRule `json:"value,omitempty"` + // NextLink - URL to get the next set of RoutingRule objects if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// RoutingRuleProperties the JSON object that contains the properties required to create a routing rule. +type RoutingRuleProperties struct { + // ResourceState - Resource status. Possible values include: 'ResourceStateCreating', 'ResourceStateEnabling', 'ResourceStateEnabled', 'ResourceStateDisabling', 'ResourceStateDisabled', 'ResourceStateDeleting' + ResourceState ResourceState `json:"resourceState,omitempty"` + // FrontendEndpoints - Frontend endpoints associated with this rule + FrontendEndpoints *[]SubResource `json:"frontendEndpoints,omitempty"` + // AcceptedProtocols - Protocol schemes to match for this rule + AcceptedProtocols *[]Protocol `json:"acceptedProtocols,omitempty"` + // PatternsToMatch - The route patterns of the rule. + PatternsToMatch *[]string `json:"patternsToMatch,omitempty"` + // EnabledState - Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'. Possible values include: 'RoutingRuleEnabledStateEnabled', 'RoutingRuleEnabledStateDisabled' + EnabledState RoutingRuleEnabledState `json:"enabledState,omitempty"` + // RouteConfiguration - A reference to the routing configuration. + RouteConfiguration BasicRouteConfiguration `json:"routeConfiguration,omitempty"` + // RulesEngine - A reference to a specific Rules Engine Configuration to apply to this route. + RulesEngine *SubResource `json:"rulesEngine,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RoutingRuleProperties struct. +func (rrp *RoutingRuleProperties) 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 "resourceState": + if v != nil { + var resourceState ResourceState + err = json.Unmarshal(*v, &resourceState) + if err != nil { + return err + } + rrp.ResourceState = resourceState + } + case "frontendEndpoints": + if v != nil { + var frontendEndpoints []SubResource + err = json.Unmarshal(*v, &frontendEndpoints) + if err != nil { + return err + } + rrp.FrontendEndpoints = &frontendEndpoints + } + case "acceptedProtocols": + if v != nil { + var acceptedProtocols []Protocol + err = json.Unmarshal(*v, &acceptedProtocols) + if err != nil { + return err + } + rrp.AcceptedProtocols = &acceptedProtocols + } + case "patternsToMatch": + if v != nil { + var patternsToMatch []string + err = json.Unmarshal(*v, &patternsToMatch) + if err != nil { + return err + } + rrp.PatternsToMatch = &patternsToMatch + } + case "enabledState": + if v != nil { + var enabledState RoutingRuleEnabledState + err = json.Unmarshal(*v, &enabledState) + if err != nil { + return err + } + rrp.EnabledState = enabledState + } + case "routeConfiguration": + if v != nil { + routeConfiguration, err := unmarshalBasicRouteConfiguration(*v) + if err != nil { + return err + } + rrp.RouteConfiguration = routeConfiguration + } + case "rulesEngine": + if v != nil { + var rulesEngine SubResource + err = json.Unmarshal(*v, &rulesEngine) + if err != nil { + return err + } + rrp.RulesEngine = &rulesEngine + } + } + } + + return nil +} + +// RoutingRuleUpdateParameters routing rules to apply to an endpoint +type RoutingRuleUpdateParameters struct { + // FrontendEndpoints - Frontend endpoints associated with this rule + FrontendEndpoints *[]SubResource `json:"frontendEndpoints,omitempty"` + // AcceptedProtocols - Protocol schemes to match for this rule + AcceptedProtocols *[]Protocol `json:"acceptedProtocols,omitempty"` + // PatternsToMatch - The route patterns of the rule. + PatternsToMatch *[]string `json:"patternsToMatch,omitempty"` + // EnabledState - Whether to enable use of this rule. Permitted values are 'Enabled' or 'Disabled'. Possible values include: 'RoutingRuleEnabledStateEnabled', 'RoutingRuleEnabledStateDisabled' + EnabledState RoutingRuleEnabledState `json:"enabledState,omitempty"` + // RouteConfiguration - A reference to the routing configuration. + RouteConfiguration BasicRouteConfiguration `json:"routeConfiguration,omitempty"` + // RulesEngine - A reference to a specific Rules Engine Configuration to apply to this route. + RulesEngine *SubResource `json:"rulesEngine,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RoutingRuleUpdateParameters struct. +func (rrup *RoutingRuleUpdateParameters) 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 "frontendEndpoints": + if v != nil { + var frontendEndpoints []SubResource + err = json.Unmarshal(*v, &frontendEndpoints) + if err != nil { + return err + } + rrup.FrontendEndpoints = &frontendEndpoints + } + case "acceptedProtocols": + if v != nil { + var acceptedProtocols []Protocol + err = json.Unmarshal(*v, &acceptedProtocols) + if err != nil { + return err + } + rrup.AcceptedProtocols = &acceptedProtocols + } + case "patternsToMatch": + if v != nil { + var patternsToMatch []string + err = json.Unmarshal(*v, &patternsToMatch) + if err != nil { + return err + } + rrup.PatternsToMatch = &patternsToMatch + } + case "enabledState": + if v != nil { + var enabledState RoutingRuleEnabledState + err = json.Unmarshal(*v, &enabledState) + if err != nil { + return err + } + rrup.EnabledState = enabledState + } + case "routeConfiguration": + if v != nil { + routeConfiguration, err := unmarshalBasicRouteConfiguration(*v) + if err != nil { + return err + } + rrup.RouteConfiguration = routeConfiguration + } + case "rulesEngine": + if v != nil { + var rulesEngine SubResource + err = json.Unmarshal(*v, &rulesEngine) + if err != nil { + return err + } + rrup.RulesEngine = &rulesEngine + } + } + } + + return nil +} + +// RulesEngine a rules engine configuration containing a list of rules that will run to modify the runtime +// behavior of the request and response. +type RulesEngine struct { + autorest.Response `json:"-"` + // RulesEngineProperties - Properties of the Rules Engine Configuration. + *RulesEngineProperties `json:"properties,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for RulesEngine. +func (re RulesEngine) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if re.RulesEngineProperties != nil { + objectMap["properties"] = re.RulesEngineProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for RulesEngine struct. +func (re *RulesEngine) 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 rulesEngineProperties RulesEngineProperties + err = json.Unmarshal(*v, &rulesEngineProperties) + if err != nil { + return err + } + re.RulesEngineProperties = &rulesEngineProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + re.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + re.Type = &typeVar + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + re.ID = &ID + } + } + } + + return nil +} + +// RulesEngineAction one or more actions that will execute, modifying the request and/or response. +type RulesEngineAction struct { + // RequestHeaderActions - A list of header actions to apply from the request from AFD to the origin. + RequestHeaderActions *[]HeaderAction `json:"requestHeaderActions,omitempty"` + // ResponseHeaderActions - A list of header actions to apply from the response from AFD to the client. + ResponseHeaderActions *[]HeaderAction `json:"responseHeaderActions,omitempty"` + // RouteConfigurationOverride - Override the route configuration. + RouteConfigurationOverride BasicRouteConfiguration `json:"routeConfigurationOverride,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for RulesEngineAction struct. +func (rea *RulesEngineAction) 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 "requestHeaderActions": + if v != nil { + var requestHeaderActions []HeaderAction + err = json.Unmarshal(*v, &requestHeaderActions) + if err != nil { + return err + } + rea.RequestHeaderActions = &requestHeaderActions + } + case "responseHeaderActions": + if v != nil { + var responseHeaderActions []HeaderAction + err = json.Unmarshal(*v, &responseHeaderActions) + if err != nil { + return err + } + rea.ResponseHeaderActions = &responseHeaderActions + } + case "routeConfigurationOverride": + if v != nil { + routeConfigurationOverride, err := unmarshalBasicRouteConfiguration(*v) + if err != nil { + return err + } + rea.RouteConfigurationOverride = routeConfigurationOverride + } + } + } + + return nil +} + +// RulesEngineListResult result of the request to list Rules Engine Configurations. It contains a list of +// RulesEngine objects and a URL link to get the next set of results. +type RulesEngineListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of rulesEngines within a Front Door. + Value *[]RulesEngine `json:"value,omitempty"` + // NextLink - URL to get the next set of RulesEngine objects if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// RulesEngineListResultIterator provides access to a complete listing of RulesEngine values. +type RulesEngineListResultIterator struct { + i int + page RulesEngineListResultPage +} + +// 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 *RulesEngineListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RulesEngineListResultIterator.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 *RulesEngineListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter RulesEngineListResultIterator) 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 RulesEngineListResultIterator) Response() RulesEngineListResult { + 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 RulesEngineListResultIterator) Value() RulesEngine { + if !iter.page.NotDone() { + return RulesEngine{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the RulesEngineListResultIterator type. +func NewRulesEngineListResultIterator(page RulesEngineListResultPage) RulesEngineListResultIterator { + return RulesEngineListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (relr RulesEngineListResult) IsEmpty() bool { + return relr.Value == nil || len(*relr.Value) == 0 +} + +// rulesEngineListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (relr RulesEngineListResult) rulesEngineListResultPreparer(ctx context.Context) (*http.Request, error) { + if relr.NextLink == nil || len(to.String(relr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(relr.NextLink))) +} + +// RulesEngineListResultPage contains a page of RulesEngine values. +type RulesEngineListResultPage struct { + fn func(context.Context, RulesEngineListResult) (RulesEngineListResult, error) + relr RulesEngineListResult +} + +// 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 *RulesEngineListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RulesEngineListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.relr) + if err != nil { + return err + } + page.relr = next + 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 *RulesEngineListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page RulesEngineListResultPage) NotDone() bool { + return !page.relr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page RulesEngineListResultPage) Response() RulesEngineListResult { + return page.relr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page RulesEngineListResultPage) Values() []RulesEngine { + if page.relr.IsEmpty() { + return nil + } + return *page.relr.Value +} + +// Creates a new instance of the RulesEngineListResultPage type. +func NewRulesEngineListResultPage(getNextPage func(context.Context, RulesEngineListResult) (RulesEngineListResult, error)) RulesEngineListResultPage { + return RulesEngineListResultPage{fn: getNextPage} +} + +// RulesEngineMatchCondition define a match condition +type RulesEngineMatchCondition struct { + // RulesEngineMatchVariable - Match Variable. Possible values include: 'RulesEngineMatchVariableIsMobile', 'RulesEngineMatchVariableRemoteAddr', 'RulesEngineMatchVariableRequestMethod', 'RulesEngineMatchVariableQueryString', 'RulesEngineMatchVariablePostArgs', 'RulesEngineMatchVariableRequestURI', 'RulesEngineMatchVariableRequestPath', 'RulesEngineMatchVariableRequestFilename', 'RulesEngineMatchVariableRequestFilenameExtension', 'RulesEngineMatchVariableRequestHeader', 'RulesEngineMatchVariableRequestBody', 'RulesEngineMatchVariableRequestScheme' + RulesEngineMatchVariable RulesEngineMatchVariable `json:"rulesEngineMatchVariable,omitempty"` + // Selector - Name of selector in RequestHeader or RequestBody to be matched + Selector *string `json:"selector,omitempty"` + // RulesEngineOperator - Describes operator to apply to the match condition. Possible values include: 'RulesEngineOperatorAny', 'RulesEngineOperatorIPMatch', 'RulesEngineOperatorGeoMatch', 'RulesEngineOperatorEqual', 'RulesEngineOperatorContains', 'RulesEngineOperatorLessThan', 'RulesEngineOperatorGreaterThan', 'RulesEngineOperatorLessThanOrEqual', 'RulesEngineOperatorGreaterThanOrEqual', 'RulesEngineOperatorBeginsWith', 'RulesEngineOperatorEndsWith' + RulesEngineOperator RulesEngineOperator `json:"rulesEngineOperator,omitempty"` + // NegateCondition - Describes if this is negate condition or not + NegateCondition *bool `json:"negateCondition,omitempty"` + // RulesEngineMatchValue - Match values to match against. The operator will apply to each value in here with OR semantics. If any of them match the variable with the given operator this match condition is considered a match. + RulesEngineMatchValue *[]string `json:"rulesEngineMatchValue,omitempty"` + // Transforms - List of transforms + Transforms *[]Transform `json:"transforms,omitempty"` +} + +// RulesEngineProperties the JSON object that contains the properties required to create a Rules Engine +// Configuration. +type RulesEngineProperties struct { + // ResourceState - Resource status. Possible values include: 'ResourceStateCreating', 'ResourceStateEnabling', 'ResourceStateEnabled', 'ResourceStateDisabling', 'ResourceStateDisabled', 'ResourceStateDeleting' + ResourceState ResourceState `json:"resourceState,omitempty"` + // Rules - A list of rules that define a particular Rules Engine Configuration. + Rules *[]RulesEngineRule `json:"rules,omitempty"` +} + +// RulesEngineRule contains a list of match conditions, and an action on how to modify the +// request/response. If multiple rules match, the actions from one rule that conflict with a previous rule +// overwrite for a singular action, or append in the case of headers manipulation. +type RulesEngineRule struct { + // Name - A name to refer to this specific rule. + Name *string `json:"name,omitempty"` + // Priority - A priority assigned to this rule. + Priority *int32 `json:"priority,omitempty"` + // Action - Actions to perform on the request and response if all of the match conditions are met. + Action *RulesEngineAction `json:"action,omitempty"` + // MatchConditions - A list of match conditions that must meet in order for the actions of this rule to run. Having no match conditions means the actions will always run. + MatchConditions *[]RulesEngineMatchCondition `json:"matchConditions,omitempty"` + // MatchProcessingBehavior - If this rule is a match should the rules engine continue running the remaining rules or stop. If not present, defaults to Continue. Possible values include: 'Continue', 'Stop' + MatchProcessingBehavior MatchProcessingBehavior `json:"matchProcessingBehavior,omitempty"` +} + +// RulesEnginesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type RulesEnginesCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *RulesEnginesCreateOrUpdateFuture) Result(client RulesEnginesClient) (re RulesEngine, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.RulesEnginesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("frontdoor.RulesEnginesCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if re.Response.Response, err = future.GetResult(sender); err == nil && re.Response.Response.StatusCode != http.StatusNoContent { + re, err = client.CreateOrUpdateResponder(re.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.RulesEnginesCreateOrUpdateFuture", "Result", re.Response.Response, "Failure responding to request") + } + } + return +} + +// RulesEnginesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type RulesEnginesDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *RulesEnginesDeleteFuture) Result(client RulesEnginesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.RulesEnginesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("frontdoor.RulesEnginesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// RulesEngineUpdateParameters rules Engine Configuration to apply to a Routing Rule. +type RulesEngineUpdateParameters struct { + // Rules - A list of rules that define a particular Rules Engine Configuration. + Rules *[]RulesEngineRule `json:"rules,omitempty"` +} + +// SubResource reference to another subresource. +type SubResource struct { + // ID - Resource ID. + ID *string `json:"id,omitempty"` +} + +// TagsObject tags object for patch operations. +type TagsObject struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for TagsObject. +func (toVar TagsObject) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if toVar.Tags != nil { + objectMap["tags"] = toVar.Tags + } + return json.Marshal(objectMap) +} + +// Timeseries defines the Timeseries +type Timeseries struct { + autorest.Response `json:"-"` + // TimeseriesProperties - The properties of a Timeseries + *TimeseriesProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Timeseries. +func (t Timeseries) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if t.TimeseriesProperties != nil { + objectMap["properties"] = t.TimeseriesProperties + } + 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 Timeseries struct. +func (t *Timeseries) 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 timeseriesProperties TimeseriesProperties + err = json.Unmarshal(*v, ×eriesProperties) + if err != nil { + return err + } + t.TimeseriesProperties = ×eriesProperties + } + 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 + } + } + } + + return nil +} + +// TimeseriesDataPoint defines a timeseries datapoint used in a timeseries +type TimeseriesDataPoint struct { + // DateTimeUTC - The DateTime of the Timeseries data point in UTC + DateTimeUTC *string `json:"dateTimeUTC,omitempty"` + // Value - The Value of the Timeseries data point + Value *float64 `json:"value,omitempty"` +} + +// TimeseriesProperties defines the properties of a timeseries +type TimeseriesProperties struct { + // Endpoint - The endpoint associated with the Timeseries data point + Endpoint *string `json:"endpoint,omitempty"` + // StartDateTimeUTC - The start DateTime of the Timeseries in UTC + StartDateTimeUTC *string `json:"startDateTimeUTC,omitempty"` + // EndDateTimeUTC - The end DateTime of the Timeseries in UTC + EndDateTimeUTC *string `json:"endDateTimeUTC,omitempty"` + // AggregationInterval - The aggregation interval of the Timeseries. Possible values include: 'Hourly', 'Daily' + AggregationInterval AggregationInterval `json:"aggregationInterval,omitempty"` + // TimeseriesType - The type of Timeseries. Possible values include: 'MeasurementCounts', 'LatencyP50', 'LatencyP75', 'LatencyP95' + TimeseriesType TimeseriesType `json:"timeseriesType,omitempty"` + // Country - The country associated with the Timeseries. Values are country ISO codes as specified here- https://www.iso.org/iso-3166-country-codes.html + Country *string `json:"country,omitempty"` + // TimeseriesData - The set of data points for the timeseries + TimeseriesData *[]TimeseriesDataPoint `json:"timeseriesData,omitempty"` +} + +// UpdateParameters the properties needed to update a Front Door +type UpdateParameters struct { + // FriendlyName - A friendly name for the frontDoor + FriendlyName *string `json:"friendlyName,omitempty"` + // RoutingRules - Routing rules associated with this Front Door. + RoutingRules *[]RoutingRule `json:"routingRules,omitempty"` + // LoadBalancingSettings - Load balancing settings associated with this Front Door instance. + LoadBalancingSettings *[]LoadBalancingSettingsModel `json:"loadBalancingSettings,omitempty"` + // HealthProbeSettings - Health probe settings associated with this Front Door instance. + HealthProbeSettings *[]HealthProbeSettingsModel `json:"healthProbeSettings,omitempty"` + // BackendPools - Backend pools available to routing rules. + BackendPools *[]BackendPool `json:"backendPools,omitempty"` + // FrontendEndpoints - Frontend endpoints available to routing rules. + FrontendEndpoints *[]FrontendEndpoint `json:"frontendEndpoints,omitempty"` + // BackendPoolsSettings - Settings for all backendPools + BackendPoolsSettings *BackendPoolsSettings `json:"backendPoolsSettings,omitempty"` + // EnabledState - Operational status of the Front Door load balancer. Permitted values are 'Enabled' or 'Disabled'. Possible values include: 'EnabledStateEnabled', 'EnabledStateDisabled' + EnabledState EnabledState `json:"enabledState,omitempty"` +} + +// ValidateCustomDomainInput input of the custom domain to be validated for DNS mapping. +type ValidateCustomDomainInput struct { + // HostName - The host name of the custom domain. Must be a domain name. + HostName *string `json:"hostName,omitempty"` +} + +// ValidateCustomDomainOutput output of custom domain validation. +type ValidateCustomDomainOutput struct { + autorest.Response `json:"-"` + // CustomDomainValidated - READ-ONLY; Indicates whether the custom domain is valid or not. + CustomDomainValidated *bool `json:"customDomainValidated,omitempty"` + // Reason - READ-ONLY; The reason why the custom domain is not valid. + Reason *string `json:"reason,omitempty"` + // Message - READ-ONLY; Error message describing why the custom domain is not valid. + Message *string `json:"message,omitempty"` +} + +// WebApplicationFirewallPolicy defines web application firewall policy. +type WebApplicationFirewallPolicy struct { + autorest.Response `json:"-"` + // WebApplicationFirewallPolicyProperties - Properties of the web application firewall policy. + *WebApplicationFirewallPolicyProperties `json:"properties,omitempty"` + // Etag - Gets a unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for WebApplicationFirewallPolicy. +func (wafp WebApplicationFirewallPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wafp.WebApplicationFirewallPolicyProperties != nil { + objectMap["properties"] = wafp.WebApplicationFirewallPolicyProperties + } + if wafp.Etag != nil { + objectMap["etag"] = wafp.Etag + } + if wafp.Location != nil { + objectMap["location"] = wafp.Location + } + if wafp.Tags != nil { + objectMap["tags"] = wafp.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for WebApplicationFirewallPolicy struct. +func (wafp *WebApplicationFirewallPolicy) 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 webApplicationFirewallPolicyProperties WebApplicationFirewallPolicyProperties + err = json.Unmarshal(*v, &webApplicationFirewallPolicyProperties) + if err != nil { + return err + } + wafp.WebApplicationFirewallPolicyProperties = &webApplicationFirewallPolicyProperties + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + wafp.Etag = &etag + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + wafp.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + wafp.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + wafp.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + wafp.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + wafp.Tags = tags + } + } + } + + return nil +} + +// WebApplicationFirewallPolicyList defines a list of WebApplicationFirewallPolicies. It contains a list of +// WebApplicationFirewallPolicy objects and a URL link to get the next set of results. +type WebApplicationFirewallPolicyList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of WebApplicationFirewallPolicies within a resource group. + Value *[]WebApplicationFirewallPolicy `json:"value,omitempty"` + // NextLink - URL to get the next set of WebApplicationFirewallPolicy objects if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// WebApplicationFirewallPolicyListIterator provides access to a complete listing of +// WebApplicationFirewallPolicy values. +type WebApplicationFirewallPolicyListIterator struct { + i int + page WebApplicationFirewallPolicyListPage +} + +// 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 *WebApplicationFirewallPolicyListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WebApplicationFirewallPolicyListIterator.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 *WebApplicationFirewallPolicyListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter WebApplicationFirewallPolicyListIterator) 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 WebApplicationFirewallPolicyListIterator) Response() WebApplicationFirewallPolicyList { + 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 WebApplicationFirewallPolicyListIterator) Value() WebApplicationFirewallPolicy { + if !iter.page.NotDone() { + return WebApplicationFirewallPolicy{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the WebApplicationFirewallPolicyListIterator type. +func NewWebApplicationFirewallPolicyListIterator(page WebApplicationFirewallPolicyListPage) WebApplicationFirewallPolicyListIterator { + return WebApplicationFirewallPolicyListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (wafpl WebApplicationFirewallPolicyList) IsEmpty() bool { + return wafpl.Value == nil || len(*wafpl.Value) == 0 +} + +// webApplicationFirewallPolicyListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (wafpl WebApplicationFirewallPolicyList) webApplicationFirewallPolicyListPreparer(ctx context.Context) (*http.Request, error) { + if wafpl.NextLink == nil || len(to.String(wafpl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(wafpl.NextLink))) +} + +// WebApplicationFirewallPolicyListPage contains a page of WebApplicationFirewallPolicy values. +type WebApplicationFirewallPolicyListPage struct { + fn func(context.Context, WebApplicationFirewallPolicyList) (WebApplicationFirewallPolicyList, error) + wafpl WebApplicationFirewallPolicyList +} + +// 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 *WebApplicationFirewallPolicyListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WebApplicationFirewallPolicyListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.wafpl) + if err != nil { + return err + } + page.wafpl = next + 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 *WebApplicationFirewallPolicyListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page WebApplicationFirewallPolicyListPage) NotDone() bool { + return !page.wafpl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page WebApplicationFirewallPolicyListPage) Response() WebApplicationFirewallPolicyList { + return page.wafpl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page WebApplicationFirewallPolicyListPage) Values() []WebApplicationFirewallPolicy { + if page.wafpl.IsEmpty() { + return nil + } + return *page.wafpl.Value +} + +// Creates a new instance of the WebApplicationFirewallPolicyListPage type. +func NewWebApplicationFirewallPolicyListPage(getNextPage func(context.Context, WebApplicationFirewallPolicyList) (WebApplicationFirewallPolicyList, error)) WebApplicationFirewallPolicyListPage { + return WebApplicationFirewallPolicyListPage{fn: getNextPage} +} + +// WebApplicationFirewallPolicyProperties defines web application firewall policy properties. +type WebApplicationFirewallPolicyProperties struct { + // PolicySettings - Describes settings for the policy. + PolicySettings *PolicySettings `json:"policySettings,omitempty"` + // CustomRules - Describes custom rules inside the policy. + CustomRules *CustomRuleList `json:"customRules,omitempty"` + // ManagedRules - Describes managed rules inside the policy. + ManagedRules *ManagedRuleSetList `json:"managedRules,omitempty"` + // FrontendEndpointLinks - READ-ONLY; Describes Frontend Endpoints associated with this Web Application Firewall policy. + FrontendEndpointLinks *[]FrontendEndpointLink `json:"frontendEndpointLinks,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the policy. + ProvisioningState *string `json:"provisioningState,omitempty"` + // ResourceState - READ-ONLY; Possible values include: 'PolicyResourceStateCreating', 'PolicyResourceStateEnabling', 'PolicyResourceStateEnabled', 'PolicyResourceStateDisabling', 'PolicyResourceStateDisabled', 'PolicyResourceStateDeleting' + ResourceState PolicyResourceState `json:"resourceState,omitempty"` +} diff --git a/services/frontdoor/mgmt/2020-05-01/frontdoor/nameavailability.go b/services/frontdoor/mgmt/2020-05-01/frontdoor/nameavailability.go new file mode 100644 index 000000000000..37f219c3fb89 --- /dev/null +++ b/services/frontdoor/mgmt/2020-05-01/frontdoor/nameavailability.go @@ -0,0 +1,121 @@ +package frontdoor + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// NameAvailabilityClient is the frontDoor Client +type NameAvailabilityClient struct { + BaseClient +} + +// NewNameAvailabilityClient creates an instance of the NameAvailabilityClient client. +func NewNameAvailabilityClient(subscriptionID string) NameAvailabilityClient { + return NewNameAvailabilityClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewNameAvailabilityClientWithBaseURI creates an instance of the NameAvailabilityClient 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 NewNameAvailabilityClientWithBaseURI(baseURI string, subscriptionID string) NameAvailabilityClient { + return NameAvailabilityClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Check check the availability of a Front Door resource name. +// Parameters: +// checkFrontDoorNameAvailabilityInput - input to check. +func (client NameAvailabilityClient) Check(ctx context.Context, checkFrontDoorNameAvailabilityInput CheckNameAvailabilityInput) (result CheckNameAvailabilityOutput, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NameAvailabilityClient.Check") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: checkFrontDoorNameAvailabilityInput, + Constraints: []validation.Constraint{{Target: "checkFrontDoorNameAvailabilityInput.Name", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.NameAvailabilityClient", "Check", err.Error()) + } + + req, err := client.CheckPreparer(ctx, checkFrontDoorNameAvailabilityInput) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.NameAvailabilityClient", "Check", nil, "Failure preparing request") + return + } + + resp, err := client.CheckSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "frontdoor.NameAvailabilityClient", "Check", resp, "Failure sending request") + return + } + + result, err = client.CheckResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.NameAvailabilityClient", "Check", resp, "Failure responding to request") + } + + return +} + +// CheckPreparer prepares the Check request. +func (client NameAvailabilityClient) CheckPreparer(ctx context.Context, checkFrontDoorNameAvailabilityInput CheckNameAvailabilityInput) (*http.Request, error) { + const APIVersion = "2020-05-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.WithPath("/providers/Microsoft.Network/checkFrontDoorNameAvailability"), + autorest.WithJSON(checkFrontDoorNameAvailabilityInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CheckSender sends the Check request. The method will close the +// http.Response Body if it receives an error. +func (client NameAvailabilityClient) CheckSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// CheckResponder handles the response to the Check request. The method always +// closes the http.Response Body. +func (client NameAvailabilityClient) CheckResponder(resp *http.Response) (result CheckNameAvailabilityOutput, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/frontdoor/mgmt/2020-05-01/frontdoor/nameavailabilitywithsubscription.go b/services/frontdoor/mgmt/2020-05-01/frontdoor/nameavailabilitywithsubscription.go new file mode 100644 index 000000000000..0054344f1de3 --- /dev/null +++ b/services/frontdoor/mgmt/2020-05-01/frontdoor/nameavailabilitywithsubscription.go @@ -0,0 +1,125 @@ +package frontdoor + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// NameAvailabilityWithSubscriptionClient is the frontDoor Client +type NameAvailabilityWithSubscriptionClient struct { + BaseClient +} + +// NewNameAvailabilityWithSubscriptionClient creates an instance of the NameAvailabilityWithSubscriptionClient client. +func NewNameAvailabilityWithSubscriptionClient(subscriptionID string) NameAvailabilityWithSubscriptionClient { + return NewNameAvailabilityWithSubscriptionClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewNameAvailabilityWithSubscriptionClientWithBaseURI creates an instance of the +// NameAvailabilityWithSubscriptionClient 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 NewNameAvailabilityWithSubscriptionClientWithBaseURI(baseURI string, subscriptionID string) NameAvailabilityWithSubscriptionClient { + return NameAvailabilityWithSubscriptionClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Check check the availability of a Front Door subdomain. +// Parameters: +// checkFrontDoorNameAvailabilityInput - input to check. +func (client NameAvailabilityWithSubscriptionClient) Check(ctx context.Context, checkFrontDoorNameAvailabilityInput CheckNameAvailabilityInput) (result CheckNameAvailabilityOutput, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NameAvailabilityWithSubscriptionClient.Check") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: checkFrontDoorNameAvailabilityInput, + Constraints: []validation.Constraint{{Target: "checkFrontDoorNameAvailabilityInput.Name", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.NameAvailabilityWithSubscriptionClient", "Check", err.Error()) + } + + req, err := client.CheckPreparer(ctx, checkFrontDoorNameAvailabilityInput) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.NameAvailabilityWithSubscriptionClient", "Check", nil, "Failure preparing request") + return + } + + resp, err := client.CheckSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "frontdoor.NameAvailabilityWithSubscriptionClient", "Check", resp, "Failure sending request") + return + } + + result, err = client.CheckResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.NameAvailabilityWithSubscriptionClient", "Check", resp, "Failure responding to request") + } + + return +} + +// CheckPreparer prepares the Check request. +func (client NameAvailabilityWithSubscriptionClient) CheckPreparer(ctx context.Context, checkFrontDoorNameAvailabilityInput CheckNameAvailabilityInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-05-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.Network/checkFrontDoorNameAvailability", pathParameters), + autorest.WithJSON(checkFrontDoorNameAvailabilityInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CheckSender sends the Check request. The method will close the +// http.Response Body if it receives an error. +func (client NameAvailabilityWithSubscriptionClient) CheckSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CheckResponder handles the response to the Check request. The method always +// closes the http.Response Body. +func (client NameAvailabilityWithSubscriptionClient) CheckResponder(resp *http.Response) (result CheckNameAvailabilityOutput, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/frontdoor/mgmt/2020-05-01/frontdoor/networkexperimentprofiles.go b/services/frontdoor/mgmt/2020-05-01/frontdoor/networkexperimentprofiles.go new file mode 100644 index 000000000000..9397356bdc5a --- /dev/null +++ b/services/frontdoor/mgmt/2020-05-01/frontdoor/networkexperimentprofiles.go @@ -0,0 +1,622 @@ +package frontdoor + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// NetworkExperimentProfilesClient is the frontDoor Client +type NetworkExperimentProfilesClient struct { + BaseClient +} + +// NewNetworkExperimentProfilesClient creates an instance of the NetworkExperimentProfilesClient client. +func NewNetworkExperimentProfilesClient(subscriptionID string) NetworkExperimentProfilesClient { + return NewNetworkExperimentProfilesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewNetworkExperimentProfilesClientWithBaseURI creates an instance of the NetworkExperimentProfilesClient 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 NewNetworkExperimentProfilesClientWithBaseURI(baseURI string, subscriptionID string) NetworkExperimentProfilesClient { + return NetworkExperimentProfilesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate sends the create or update request. +// Parameters: +// profileName - the Profile identifier associated with the Tenant and Partner +// resourceGroupName - name of the Resource group within the Azure subscription. +// parameters - an Network Experiment Profile +func (client NetworkExperimentProfilesClient) CreateOrUpdate(ctx context.Context, profileName string, resourceGroupName string, parameters Profile) (result NetworkExperimentProfilesCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NetworkExperimentProfilesClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: profileName, + Constraints: []validation.Constraint{{Target: "profileName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.NetworkExperimentProfilesClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, profileName, resourceGroupName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client NetworkExperimentProfilesClient) CreateOrUpdatePreparer(ctx context.Context, profileName string, resourceGroupName string, parameters Profile) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-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.Network/NetworkExperimentProfiles/{profileName}", pathParameters), + autorest.WithJSON(parameters), + 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 NetworkExperimentProfilesClient) CreateOrUpdateSender(req *http.Request) (future NetworkExperimentProfilesCreateOrUpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client NetworkExperimentProfilesClient) CreateOrUpdateResponder(resp *http.Response) (result Profile, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete sends the delete request. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - the Profile identifier associated with the Tenant and Partner +func (client NetworkExperimentProfilesClient) Delete(ctx context.Context, resourceGroupName string, profileName string) (result NetworkExperimentProfilesDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NetworkExperimentProfilesClient.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: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: profileName, + Constraints: []validation.Constraint{{Target: "profileName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.NetworkExperimentProfilesClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, profileName) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client NetworkExperimentProfilesClient) DeletePreparer(ctx context.Context, resourceGroupName string, profileName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-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.Network/NetworkExperimentProfiles/{profileName}", 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 NetworkExperimentProfilesClient) DeleteSender(req *http.Request) (future NetworkExperimentProfilesDeleteFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client NetworkExperimentProfilesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 within the Azure subscription. +// profileName - the Profile identifier associated with the Tenant and Partner +func (client NetworkExperimentProfilesClient) Get(ctx context.Context, resourceGroupName string, profileName string) (result Profile, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NetworkExperimentProfilesClient.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: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: profileName, + Constraints: []validation.Constraint{{Target: "profileName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.NetworkExperimentProfilesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, profileName) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client NetworkExperimentProfilesClient) GetPreparer(ctx context.Context, resourceGroupName string, profileName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/NetworkExperimentProfiles/{profileName}", 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 NetworkExperimentProfilesClient) 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 NetworkExperimentProfilesClient) GetResponder(resp *http.Response) (result Profile, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List sends the list request. +func (client NetworkExperimentProfilesClient) List(ctx context.Context) (result ProfileListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NetworkExperimentProfilesClient.List") + defer func() { + sc := -1 + if result.pl.Response.Response != nil { + sc = result.pl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.pl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesClient", "List", resp, "Failure sending request") + return + } + + result.pl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client NetworkExperimentProfilesClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Network/NetworkExperimentProfiles", 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 NetworkExperimentProfilesClient) 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 NetworkExperimentProfilesClient) ListResponder(resp *http.Response) (result ProfileList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 NetworkExperimentProfilesClient) listNextResults(ctx context.Context, lastResults ProfileList) (result ProfileList, err error) { + req, err := lastResults.profileListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesClient", "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, "frontdoor.NetworkExperimentProfilesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client NetworkExperimentProfilesClient) ListComplete(ctx context.Context) (result ProfileListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NetworkExperimentProfilesClient.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 sends the list by resource group request. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +func (client NetworkExperimentProfilesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ProfileListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NetworkExperimentProfilesClient.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: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.NetworkExperimentProfilesClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesClient", "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, "frontdoor.NetworkExperimentProfilesClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.pl, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client NetworkExperimentProfilesClient) 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 = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/NetworkExperimentProfiles", 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 NetworkExperimentProfilesClient) 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 NetworkExperimentProfilesClient) ListByResourceGroupResponder(resp *http.Response) (result ProfileList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 NetworkExperimentProfilesClient) listByResourceGroupNextResults(ctx context.Context, lastResults ProfileList) (result ProfileList, err error) { + req, err := lastResults.profileListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesClient", "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, "frontdoor.NetworkExperimentProfilesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client NetworkExperimentProfilesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ProfileListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NetworkExperimentProfilesClient.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 updates an NetworkExperimentProfiles +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - the Profile identifier associated with the Tenant and Partner +// parameters - the Profile Update Model +func (client NetworkExperimentProfilesClient) Update(ctx context.Context, resourceGroupName string, profileName string, parameters ProfileUpdateModel) (result NetworkExperimentProfilesUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NetworkExperimentProfilesClient.Update") + 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: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: profileName, + Constraints: []validation.Constraint{{Target: "profileName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.NetworkExperimentProfilesClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, profileName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.NetworkExperimentProfilesClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client NetworkExperimentProfilesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, profileName string, parameters ProfileUpdateModel) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-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.Network/NetworkExperimentProfiles/{profileName}", pathParameters), + autorest.WithJSON(parameters), + 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 NetworkExperimentProfilesClient) UpdateSender(req *http.Request) (future NetworkExperimentProfilesUpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client NetworkExperimentProfilesClient) UpdateResponder(resp *http.Response) (result Profile, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/frontdoor/mgmt/2020-05-01/frontdoor/policies.go b/services/frontdoor/mgmt/2020-05-01/frontdoor/policies.go new file mode 100644 index 000000000000..edd638f7053e --- /dev/null +++ b/services/frontdoor/mgmt/2020-05-01/frontdoor/policies.go @@ -0,0 +1,430 @@ +package frontdoor + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// PoliciesClient is the frontDoor Client +type PoliciesClient struct { + BaseClient +} + +// NewPoliciesClient creates an instance of the PoliciesClient client. +func NewPoliciesClient(subscriptionID string) PoliciesClient { + return NewPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPoliciesClientWithBaseURI creates an instance of the PoliciesClient 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 NewPoliciesClientWithBaseURI(baseURI string, subscriptionID string) PoliciesClient { + return PoliciesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create or update policy with specified rule set name within a resource group. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// policyName - the name of the Web Application Firewall Policy. +// parameters - policy to be created. +func (client PoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, policyName string, parameters WebApplicationFirewallPolicy) (result PoliciesCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PoliciesClient.CreateOrUpdate") + 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: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: policyName, + Constraints: []validation.Constraint{{Target: "policyName", Name: validation.MaxLength, Rule: 128, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.WebApplicationFirewallPolicyProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.WebApplicationFirewallPolicyProperties.PolicySettings", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.WebApplicationFirewallPolicyProperties.PolicySettings.CustomBlockResponseBody", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.WebApplicationFirewallPolicyProperties.PolicySettings.CustomBlockResponseBody", Name: validation.Pattern, Rule: `^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$`, Chain: nil}}}, + }}, + }}}}}); err != nil { + return result, validation.NewError("frontdoor.PoliciesClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, policyName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.PoliciesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.PoliciesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client PoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, policyName string, parameters WebApplicationFirewallPolicy) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-10-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.Network/FrontDoorWebApplicationFirewallPolicies/{policyName}", pathParameters), + autorest.WithJSON(parameters), + 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 PoliciesClient) CreateOrUpdateSender(req *http.Request) (future PoliciesCreateOrUpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client PoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result WebApplicationFirewallPolicy, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes Policy +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// policyName - the name of the Web Application Firewall Policy. +func (client PoliciesClient) Delete(ctx context.Context, resourceGroupName string, policyName string) (result PoliciesDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PoliciesClient.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: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: policyName, + Constraints: []validation.Constraint{{Target: "policyName", Name: validation.MaxLength, Rule: 128, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.PoliciesClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, policyName) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.PoliciesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.PoliciesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client PoliciesClient) DeletePreparer(ctx context.Context, resourceGroupName string, policyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-10-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.Network/FrontDoorWebApplicationFirewallPolicies/{policyName}", 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 PoliciesClient) DeleteSender(req *http.Request) (future PoliciesDeleteFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client PoliciesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieve protection policy with specified name within a resource group. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// policyName - the name of the Web Application Firewall Policy. +func (client PoliciesClient) Get(ctx context.Context, resourceGroupName string, policyName string) (result WebApplicationFirewallPolicy, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PoliciesClient.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: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: policyName, + Constraints: []validation.Constraint{{Target: "policyName", Name: validation.MaxLength, Rule: 128, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.PoliciesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, policyName) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.PoliciesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "frontdoor.PoliciesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.PoliciesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client PoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, policyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/FrontDoorWebApplicationFirewallPolicies/{policyName}", 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 PoliciesClient) 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 PoliciesClient) GetResponder(resp *http.Response) (result WebApplicationFirewallPolicy, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists all of the protection policies within a resource group. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +func (client PoliciesClient) List(ctx context.Context, resourceGroupName string) (result WebApplicationFirewallPolicyListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PoliciesClient.List") + defer func() { + sc := -1 + if result.wafpl.Response.Response != nil { + sc = result.wafpl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.PoliciesClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.PoliciesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.wafpl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "frontdoor.PoliciesClient", "List", resp, "Failure sending request") + return + } + + result.wafpl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.PoliciesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client PoliciesClient) ListPreparer(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 = "2019-10-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/FrontDoorWebApplicationFirewallPolicies", 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 PoliciesClient) 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 PoliciesClient) ListResponder(resp *http.Response) (result WebApplicationFirewallPolicyList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 PoliciesClient) listNextResults(ctx context.Context, lastResults WebApplicationFirewallPolicyList) (result WebApplicationFirewallPolicyList, err error) { + req, err := lastResults.webApplicationFirewallPolicyListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "frontdoor.PoliciesClient", "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, "frontdoor.PoliciesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.PoliciesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client PoliciesClient) ListComplete(ctx context.Context, resourceGroupName string) (result WebApplicationFirewallPolicyListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PoliciesClient.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) + return +} diff --git a/services/frontdoor/mgmt/2020-05-01/frontdoor/preconfiguredendpoints.go b/services/frontdoor/mgmt/2020-05-01/frontdoor/preconfiguredendpoints.go new file mode 100644 index 000000000000..b19caf1ca5bb --- /dev/null +++ b/services/frontdoor/mgmt/2020-05-01/frontdoor/preconfiguredendpoints.go @@ -0,0 +1,168 @@ +package frontdoor + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// PreconfiguredEndpointsClient is the frontDoor Client +type PreconfiguredEndpointsClient struct { + BaseClient +} + +// NewPreconfiguredEndpointsClient creates an instance of the PreconfiguredEndpointsClient client. +func NewPreconfiguredEndpointsClient(subscriptionID string) PreconfiguredEndpointsClient { + return NewPreconfiguredEndpointsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPreconfiguredEndpointsClientWithBaseURI creates an instance of the PreconfiguredEndpointsClient 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 NewPreconfiguredEndpointsClientWithBaseURI(baseURI string, subscriptionID string) PreconfiguredEndpointsClient { + return PreconfiguredEndpointsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List sends the list request. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - the Profile identifier associated with the Tenant and Partner +func (client PreconfiguredEndpointsClient) List(ctx context.Context, resourceGroupName string, profileName string) (result PreconfiguredEndpointListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PreconfiguredEndpointsClient.List") + defer func() { + sc := -1 + if result.pel.Response.Response != nil { + sc = result.pel.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: profileName, + Constraints: []validation.Constraint{{Target: "profileName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.PreconfiguredEndpointsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, profileName) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.PreconfiguredEndpointsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.pel.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "frontdoor.PreconfiguredEndpointsClient", "List", resp, "Failure sending request") + return + } + + result.pel, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.PreconfiguredEndpointsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client PreconfiguredEndpointsClient) ListPreparer(ctx context.Context, resourceGroupName string, profileName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/NetworkExperimentProfiles/{profileName}/PreconfiguredEndpoints", 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 PreconfiguredEndpointsClient) 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 PreconfiguredEndpointsClient) ListResponder(resp *http.Response) (result PreconfiguredEndpointList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 PreconfiguredEndpointsClient) listNextResults(ctx context.Context, lastResults PreconfiguredEndpointList) (result PreconfiguredEndpointList, err error) { + req, err := lastResults.preconfiguredEndpointListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "frontdoor.PreconfiguredEndpointsClient", "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, "frontdoor.PreconfiguredEndpointsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.PreconfiguredEndpointsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client PreconfiguredEndpointsClient) ListComplete(ctx context.Context, resourceGroupName string, profileName string) (result PreconfiguredEndpointListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PreconfiguredEndpointsClient.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, profileName) + return +} diff --git a/services/frontdoor/mgmt/2020-05-01/frontdoor/reports.go b/services/frontdoor/mgmt/2020-05-01/frontdoor/reports.go new file mode 100644 index 000000000000..b97a0bb5489e --- /dev/null +++ b/services/frontdoor/mgmt/2020-05-01/frontdoor/reports.go @@ -0,0 +1,252 @@ +package frontdoor + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// ReportsClient is the frontDoor Client +type ReportsClient struct { + BaseClient +} + +// NewReportsClient creates an instance of the ReportsClient client. +func NewReportsClient(subscriptionID string) ReportsClient { + return NewReportsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewReportsClientWithBaseURI creates an instance of the ReportsClient 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 NewReportsClientWithBaseURI(baseURI string, subscriptionID string) ReportsClient { + return ReportsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// GetLatencyScorecards sends the get latency scorecards request. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - the Profile identifier associated with the Tenant and Partner +// experimentName - the Experiment identifier associated with the Experiment +// aggregationInterval - the aggregation interval of the Latency Scorecard +// endDateTimeUTC - the end DateTime of the Latency Scorecard in UTC +// country - the country associated with the Latency Scorecard. Values are country ISO codes as specified here- +// https://www.iso.org/iso-3166-country-codes.html +func (client ReportsClient) GetLatencyScorecards(ctx context.Context, resourceGroupName string, profileName string, experimentName string, aggregationInterval LatencyScorecardAggregationInterval, endDateTimeUTC string, country string) (result LatencyScorecard, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReportsClient.GetLatencyScorecards") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: profileName, + Constraints: []validation.Constraint{{Target: "profileName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: experimentName, + Constraints: []validation.Constraint{{Target: "experimentName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.ReportsClient", "GetLatencyScorecards", err.Error()) + } + + req, err := client.GetLatencyScorecardsPreparer(ctx, resourceGroupName, profileName, experimentName, aggregationInterval, endDateTimeUTC, country) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ReportsClient", "GetLatencyScorecards", nil, "Failure preparing request") + return + } + + resp, err := client.GetLatencyScorecardsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "frontdoor.ReportsClient", "GetLatencyScorecards", resp, "Failure sending request") + return + } + + result, err = client.GetLatencyScorecardsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ReportsClient", "GetLatencyScorecards", resp, "Failure responding to request") + } + + return +} + +// GetLatencyScorecardsPreparer prepares the GetLatencyScorecards request. +func (client ReportsClient) GetLatencyScorecardsPreparer(ctx context.Context, resourceGroupName string, profileName string, experimentName string, aggregationInterval LatencyScorecardAggregationInterval, endDateTimeUTC string, country string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "experimentName": autorest.Encode("path", experimentName), + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "aggregationInterval": autorest.Encode("query", aggregationInterval), + "api-version": APIVersion, + } + if len(endDateTimeUTC) > 0 { + queryParameters["endDateTimeUTC"] = autorest.Encode("query", endDateTimeUTC) + } + if len(country) > 0 { + queryParameters["country"] = autorest.Encode("query", country) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/NetworkExperimentProfiles/{profileName}/Experiments/{experimentName}/LatencyScorecard", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetLatencyScorecardsSender sends the GetLatencyScorecards request. The method will close the +// http.Response Body if it receives an error. +func (client ReportsClient) GetLatencyScorecardsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetLatencyScorecardsResponder handles the response to the GetLatencyScorecards request. The method always +// closes the http.Response Body. +func (client ReportsClient) GetLatencyScorecardsResponder(resp *http.Response) (result LatencyScorecard, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetTimeseries sends the get timeseries request. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - the Profile identifier associated with the Tenant and Partner +// experimentName - the Experiment identifier associated with the Experiment +// startDateTimeUTC - the start DateTime of the Timeseries in UTC +// endDateTimeUTC - the end DateTime of the Timeseries in UTC +// aggregationInterval - the aggregation interval of the Timeseries +// timeseriesType - the type of Timeseries +// endpoint - the specific endpoint +// country - the country associated with the Timeseries. Values are country ISO codes as specified here- +// https://www.iso.org/iso-3166-country-codes.html +func (client ReportsClient) GetTimeseries(ctx context.Context, resourceGroupName string, profileName string, experimentName string, startDateTimeUTC date.Time, endDateTimeUTC date.Time, aggregationInterval TimeseriesAggregationInterval, timeseriesType TimeseriesType, endpoint string, country string) (result Timeseries, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReportsClient.GetTimeseries") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: profileName, + Constraints: []validation.Constraint{{Target: "profileName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: experimentName, + Constraints: []validation.Constraint{{Target: "experimentName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.ReportsClient", "GetTimeseries", err.Error()) + } + + req, err := client.GetTimeseriesPreparer(ctx, resourceGroupName, profileName, experimentName, startDateTimeUTC, endDateTimeUTC, aggregationInterval, timeseriesType, endpoint, country) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ReportsClient", "GetTimeseries", nil, "Failure preparing request") + return + } + + resp, err := client.GetTimeseriesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "frontdoor.ReportsClient", "GetTimeseries", resp, "Failure sending request") + return + } + + result, err = client.GetTimeseriesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.ReportsClient", "GetTimeseries", resp, "Failure responding to request") + } + + return +} + +// GetTimeseriesPreparer prepares the GetTimeseries request. +func (client ReportsClient) GetTimeseriesPreparer(ctx context.Context, resourceGroupName string, profileName string, experimentName string, startDateTimeUTC date.Time, endDateTimeUTC date.Time, aggregationInterval TimeseriesAggregationInterval, timeseriesType TimeseriesType, endpoint string, country string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "experimentName": autorest.Encode("path", experimentName), + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-11-01" + queryParameters := map[string]interface{}{ + "aggregationInterval": autorest.Encode("query", aggregationInterval), + "api-version": APIVersion, + "endDateTimeUTC": autorest.Encode("query", endDateTimeUTC), + "startDateTimeUTC": autorest.Encode("query", startDateTimeUTC), + "timeseriesType": autorest.Encode("query", timeseriesType), + } + if len(endpoint) > 0 { + queryParameters["endpoint"] = autorest.Encode("query", endpoint) + } + if len(country) > 0 { + queryParameters["country"] = autorest.Encode("query", country) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/NetworkExperimentProfiles/{profileName}/Experiments/{experimentName}/Timeseries", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetTimeseriesSender sends the GetTimeseries request. The method will close the +// http.Response Body if it receives an error. +func (client ReportsClient) GetTimeseriesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetTimeseriesResponder handles the response to the GetTimeseries request. The method always +// closes the http.Response Body. +func (client ReportsClient) GetTimeseriesResponder(resp *http.Response) (result Timeseries, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/frontdoor/mgmt/2020-05-01/frontdoor/rulesengines.go b/services/frontdoor/mgmt/2020-05-01/frontdoor/rulesengines.go new file mode 100644 index 000000000000..a5e5f2938ef3 --- /dev/null +++ b/services/frontdoor/mgmt/2020-05-01/frontdoor/rulesengines.go @@ -0,0 +1,457 @@ +package frontdoor + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// RulesEnginesClient is the frontDoor Client +type RulesEnginesClient struct { + BaseClient +} + +// NewRulesEnginesClient creates an instance of the RulesEnginesClient client. +func NewRulesEnginesClient(subscriptionID string) RulesEnginesClient { + return NewRulesEnginesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewRulesEnginesClientWithBaseURI creates an instance of the RulesEnginesClient 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 NewRulesEnginesClientWithBaseURI(baseURI string, subscriptionID string) RulesEnginesClient { + return RulesEnginesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates a new Rules Engine Configuration with the specified name within the specified Front Door. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// frontDoorName - name of the Front Door which is globally unique. +// rulesEngineName - name of the Rules Engine which is unique within the Front Door. +// rulesEngineParameters - rules Engine Configuration properties needed to create a new Rules Engine +// Configuration. +func (client RulesEnginesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, frontDoorName string, rulesEngineName string, rulesEngineParameters RulesEngine) (result RulesEnginesCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RulesEnginesClient.CreateOrUpdate") + 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: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: frontDoorName, + Constraints: []validation.Constraint{{Target: "frontDoorName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "frontDoorName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "frontDoorName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$`, Chain: nil}}}, + {TargetValue: rulesEngineName, + Constraints: []validation.Constraint{{Target: "rulesEngineName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "rulesEngineName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "rulesEngineName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.RulesEnginesClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, frontDoorName, rulesEngineName, rulesEngineParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.RulesEnginesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.RulesEnginesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client RulesEnginesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, frontDoorName string, rulesEngineName string, rulesEngineParameters RulesEngine) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "frontDoorName": autorest.Encode("path", frontDoorName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "rulesEngineName": autorest.Encode("path", rulesEngineName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + rulesEngineParameters.Name = nil + rulesEngineParameters.Type = nil + rulesEngineParameters.ID = 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.Network/frontDoors/{frontDoorName}/rulesEngines/{rulesEngineName}", pathParameters), + autorest.WithJSON(rulesEngineParameters), + 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 RulesEnginesClient) CreateOrUpdateSender(req *http.Request) (future RulesEnginesCreateOrUpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client RulesEnginesClient) CreateOrUpdateResponder(resp *http.Response) (result RulesEngine, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes an existing Rules Engine Configuration with the specified parameters. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// frontDoorName - name of the Front Door which is globally unique. +// rulesEngineName - name of the Rules Engine which is unique within the Front Door. +func (client RulesEnginesClient) Delete(ctx context.Context, resourceGroupName string, frontDoorName string, rulesEngineName string) (result RulesEnginesDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RulesEnginesClient.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: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: frontDoorName, + Constraints: []validation.Constraint{{Target: "frontDoorName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "frontDoorName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "frontDoorName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$`, Chain: nil}}}, + {TargetValue: rulesEngineName, + Constraints: []validation.Constraint{{Target: "rulesEngineName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "rulesEngineName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "rulesEngineName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.RulesEnginesClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, frontDoorName, rulesEngineName) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.RulesEnginesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.RulesEnginesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client RulesEnginesClient) DeletePreparer(ctx context.Context, resourceGroupName string, frontDoorName string, rulesEngineName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "frontDoorName": autorest.Encode("path", frontDoorName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "rulesEngineName": autorest.Encode("path", rulesEngineName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-05-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.Network/frontDoors/{frontDoorName}/rulesEngines/{rulesEngineName}", 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 RulesEnginesClient) DeleteSender(req *http.Request) (future RulesEnginesDeleteFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client RulesEnginesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets a Rules Engine Configuration with the specified name within the specified Front Door. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// frontDoorName - name of the Front Door which is globally unique. +// rulesEngineName - name of the Rules Engine which is unique within the Front Door. +func (client RulesEnginesClient) Get(ctx context.Context, resourceGroupName string, frontDoorName string, rulesEngineName string) (result RulesEngine, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RulesEnginesClient.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: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: frontDoorName, + Constraints: []validation.Constraint{{Target: "frontDoorName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "frontDoorName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "frontDoorName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$`, Chain: nil}}}, + {TargetValue: rulesEngineName, + Constraints: []validation.Constraint{{Target: "rulesEngineName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "rulesEngineName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "rulesEngineName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.RulesEnginesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, frontDoorName, rulesEngineName) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.RulesEnginesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "frontdoor.RulesEnginesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.RulesEnginesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client RulesEnginesClient) GetPreparer(ctx context.Context, resourceGroupName string, frontDoorName string, rulesEngineName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "frontDoorName": autorest.Encode("path", frontDoorName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "rulesEngineName": autorest.Encode("path", rulesEngineName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/rulesEngines/{rulesEngineName}", 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 RulesEnginesClient) 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 RulesEnginesClient) GetResponder(resp *http.Response) (result RulesEngine, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByFrontDoor lists all of the Rules Engine Configurations within a Front Door. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// frontDoorName - name of the Front Door which is globally unique. +func (client RulesEnginesClient) ListByFrontDoor(ctx context.Context, resourceGroupName string, frontDoorName string) (result RulesEngineListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RulesEnginesClient.ListByFrontDoor") + defer func() { + sc := -1 + if result.relr.Response.Response != nil { + sc = result.relr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: frontDoorName, + Constraints: []validation.Constraint{{Target: "frontDoorName", Name: validation.MaxLength, Rule: 64, Chain: nil}, + {Target: "frontDoorName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "frontDoorName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]+([-a-zA-Z0-9]?[a-zA-Z0-9])*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("frontdoor.RulesEnginesClient", "ListByFrontDoor", err.Error()) + } + + result.fn = client.listByFrontDoorNextResults + req, err := client.ListByFrontDoorPreparer(ctx, resourceGroupName, frontDoorName) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.RulesEnginesClient", "ListByFrontDoor", nil, "Failure preparing request") + return + } + + resp, err := client.ListByFrontDoorSender(req) + if err != nil { + result.relr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "frontdoor.RulesEnginesClient", "ListByFrontDoor", resp, "Failure sending request") + return + } + + result.relr, err = client.ListByFrontDoorResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.RulesEnginesClient", "ListByFrontDoor", resp, "Failure responding to request") + } + + return +} + +// ListByFrontDoorPreparer prepares the ListByFrontDoor request. +func (client RulesEnginesClient) ListByFrontDoorPreparer(ctx context.Context, resourceGroupName string, frontDoorName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "frontDoorName": autorest.Encode("path", frontDoorName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/frontDoors/{frontDoorName}/rulesEngines", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByFrontDoorSender sends the ListByFrontDoor request. The method will close the +// http.Response Body if it receives an error. +func (client RulesEnginesClient) ListByFrontDoorSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByFrontDoorResponder handles the response to the ListByFrontDoor request. The method always +// closes the http.Response Body. +func (client RulesEnginesClient) ListByFrontDoorResponder(resp *http.Response) (result RulesEngineListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByFrontDoorNextResults retrieves the next set of results, if any. +func (client RulesEnginesClient) listByFrontDoorNextResults(ctx context.Context, lastResults RulesEngineListResult) (result RulesEngineListResult, err error) { + req, err := lastResults.rulesEngineListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "frontdoor.RulesEnginesClient", "listByFrontDoorNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByFrontDoorSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "frontdoor.RulesEnginesClient", "listByFrontDoorNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByFrontDoorResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "frontdoor.RulesEnginesClient", "listByFrontDoorNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByFrontDoorComplete enumerates all values, automatically crossing page boundaries as required. +func (client RulesEnginesClient) ListByFrontDoorComplete(ctx context.Context, resourceGroupName string, frontDoorName string) (result RulesEngineListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RulesEnginesClient.ListByFrontDoor") + 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.ListByFrontDoor(ctx, resourceGroupName, frontDoorName) + return +} diff --git a/services/frontdoor/mgmt/2020-05-01/frontdoor/version.go b/services/frontdoor/mgmt/2020-05-01/frontdoor/version.go new file mode 100644 index 000000000000..5fb592f937dc --- /dev/null +++ b/services/frontdoor/mgmt/2020-05-01/frontdoor/version.go @@ -0,0 +1,30 @@ +package frontdoor + +import "github.com/Azure/azure-sdk-for-go/version" + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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() + " frontdoor/2020-05-01" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/services/healthcareapis/mgmt/2019-09-16/healthcareapis/services.go b/services/healthcareapis/mgmt/2019-09-16/healthcareapis/services.go index fbb467b7d5c8..cb69107840de 100644 --- a/services/healthcareapis/mgmt/2019-09-16/healthcareapis/services.go +++ b/services/healthcareapis/mgmt/2019-09-16/healthcareapis/services.go @@ -151,13 +151,12 @@ func (client ServicesClient) CreateOrUpdate(ctx context.Context, resourceGroupNa {Target: "resourceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, {TargetValue: serviceDescription, Constraints: []validation.Constraint{{Target: "serviceDescription.Properties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "serviceDescription.Properties.AccessPolicies", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "serviceDescription.Properties.CosmosDbConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "serviceDescription.Properties.CosmosDbConfiguration.OfferThroughput", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "serviceDescription.Properties.CosmosDbConfiguration.OfferThroughput", Name: validation.InclusiveMaximum, Rule: int64(10000), Chain: nil}, - {Target: "serviceDescription.Properties.CosmosDbConfiguration.OfferThroughput", Name: validation.InclusiveMinimum, Rule: int64(400), Chain: nil}, - }}, + Chain: []validation.Constraint{{Target: "serviceDescription.Properties.CosmosDbConfiguration", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "serviceDescription.Properties.CosmosDbConfiguration.OfferThroughput", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "serviceDescription.Properties.CosmosDbConfiguration.OfferThroughput", Name: validation.InclusiveMaximum, Rule: int64(10000), Chain: nil}, + {Target: "serviceDescription.Properties.CosmosDbConfiguration.OfferThroughput", Name: validation.InclusiveMinimum, Rule: int64(400), Chain: nil}, }}, + }}, {Target: "serviceDescription.Properties.CorsConfiguration", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "serviceDescription.Properties.CorsConfiguration.MaxAge", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "serviceDescription.Properties.CorsConfiguration.MaxAge", Name: validation.InclusiveMaximum, Rule: int64(99999), Chain: nil}, diff --git a/services/iothub/mgmt/2020-03-01/devices/certificates.go b/services/iothub/mgmt/2020-03-01/devices/certificates.go new file mode 100644 index 000000000000..4201bdc31535 --- /dev/null +++ b/services/iothub/mgmt/2020-03-01/devices/certificates.go @@ -0,0 +1,558 @@ +package devices + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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 CertificateBodyDescription, 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 +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client CertificatesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, resourceName string, certificateName string, certificateDescription CertificateBodyDescription, 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 = "2020-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.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, + client.ByInspecting(), + 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 +} + +// 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 = "2020-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.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, + client.ByInspecting(), + 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 +} + +// 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 = "2020-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.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, + client.ByInspecting(), + 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 +} + +// 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 = "2020-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.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, + client.ByInspecting(), + 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 +} + +// 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 = "2020-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.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, + client.ByInspecting(), + 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 +} + +// 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 = "2020-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.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, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/iothub/mgmt/2020-03-01/devices/client.go b/services/iothub/mgmt/2020-03-01/devices/client.go new file mode 100644 index 000000000000..16c99e0e2882 --- /dev/null +++ b/services/iothub/mgmt/2020-03-01/devices/client.go @@ -0,0 +1,52 @@ +// Package devices implements the Azure ARM Devices service API version 2020-03-01. +// +// Use this API to manage the IoT hubs in your Azure subscription. +package devices + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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/2020-03-01/devices/devicesapi/interfaces.go b/services/iothub/mgmt/2020-03-01/devices/devicesapi/interfaces.go new file mode 100644 index 000000000000..6c55e2daadbd --- /dev/null +++ b/services/iothub/mgmt/2020-03-01/devices/devicesapi/interfaces.go @@ -0,0 +1,113 @@ +package devicesapi + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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/2020-03-01/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) (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.CertificateBodyDescription, 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/2020-03-01/devices/iothub.go b/services/iothub/mgmt/2020-03-01/devices/iothub.go new file mode 100644 index 000000000000..0c136d7243cf --- /dev/null +++ b/services/iothub/mgmt/2020-03-01/devices/iothub.go @@ -0,0 +1,129 @@ +package devices + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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.Response() != nil { + sc = result.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 = "2020-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.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 + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + 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, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/services/iothub/mgmt/2020-03-01/devices/iothubresource.go b/services/iothub/mgmt/2020-03-01/devices/iothubresource.go new file mode 100644 index 000000000000..e5f62715b169 --- /dev/null +++ b/services/iothub/mgmt/2020-03-01/devices/iothubresource.go @@ -0,0 +1,2201 @@ +package devices + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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 +} + +// 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 = "2020-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.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, + client.ByInspecting(), + 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. +func (client IotHubResourceClient) CreateEventHubConsumerGroup(ctx context.Context, resourceGroupName string, resourceName string, eventHubEndpointName string, name string) (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) + }() + } + req, err := client.CreateEventHubConsumerGroupPreparer(ctx, resourceGroupName, resourceName, eventHubEndpointName, name) + 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 +} + +// CreateEventHubConsumerGroupPreparer prepares the CreateEventHubConsumerGroup request. +func (client IotHubResourceClient) CreateEventHubConsumerGroupPreparer(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 = "2020-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.Devices/IotHubs/{resourceName}/eventHubEndpoints/{eventHubEndpointName}/ConsumerGroups/{name}", pathParameters), + 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, + client.ByInspecting(), + 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. +// 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.Response() != nil { + sc = result.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.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 = "2020-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.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 + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + 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, + client.ByInspecting(), + 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.Response() != nil { + sc = result.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 = "2020-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.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 + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + 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, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent, http.StatusNotFound), + autorest.ByUnmarshallingJSON(&result), + 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 +} + +// 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 = "2020-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.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, + client.ByInspecting(), + 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 +} + +// 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 = "2020-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.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, + client.ByInspecting(), + 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 +} + +// 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 = "2020-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.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, + client.ByInspecting(), + 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 +} + +// 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 = "2020-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.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, + client.ByInspecting(), + 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 +} + +// 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 = "2020-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.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, + client.ByInspecting(), + 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 +} + +// 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 = "2020-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.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, + client.ByInspecting(), + 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 +} + +// 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 = "2020-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.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, + client.ByInspecting(), + 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 +} + +// 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 = "2020-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.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, + client.ByInspecting(), + 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 +} + +// 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 = "2020-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.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, + client.ByInspecting(), + 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 +} + +// 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 = "2020-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.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, + client.ByInspecting(), + 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 +} + +// 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 = "2020-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.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, + client.ByInspecting(), + 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 +} + +// 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 = "2020-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.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, + client.ByInspecting(), + 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 +} + +// 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 = "2020-03-01" + 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, + client.ByInspecting(), + 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 +} + +// 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 = "2020-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.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, + client.ByInspecting(), + 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 +} + +// 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 = "2020-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.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, + client.ByInspecting(), + 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 +} + +// 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 = "2020-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.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, + client.ByInspecting(), + 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 +} + +// 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 = "2020-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.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, + client.ByInspecting(), + 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 +} + +// 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 = "2020-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.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, + client.ByInspecting(), + 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.Response() != nil { + sc = result.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 = "2020-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.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 + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + 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, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/iothub/mgmt/2020-03-01/devices/models.go b/services/iothub/mgmt/2020-03-01/devices/models.go new file mode 100644 index 000000000000..45afaf376dda --- /dev/null +++ b/services/iothub/mgmt/2020-03-01/devices/models.go @@ -0,0 +1,2628 @@ +package devices + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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/2020-03-01/devices" + +// AccessRights enumerates the values for access rights. +type AccessRights string + +const ( + // DeviceConnect ... + DeviceConnect AccessRights = "DeviceConnect" + // RegistryRead ... + RegistryRead AccessRights = "RegistryRead" + // RegistryReadDeviceConnect ... + RegistryReadDeviceConnect AccessRights = "RegistryRead, DeviceConnect" + // RegistryReadRegistryWrite ... + RegistryReadRegistryWrite AccessRights = "RegistryRead, RegistryWrite" + // RegistryReadRegistryWriteDeviceConnect ... + RegistryReadRegistryWriteDeviceConnect AccessRights = "RegistryRead, RegistryWrite, DeviceConnect" + // RegistryReadRegistryWriteServiceConnect ... + RegistryReadRegistryWriteServiceConnect AccessRights = "RegistryRead, RegistryWrite, ServiceConnect" + // RegistryReadRegistryWriteServiceConnectDeviceConnect ... + RegistryReadRegistryWriteServiceConnectDeviceConnect AccessRights = "RegistryRead, RegistryWrite, ServiceConnect, DeviceConnect" + // RegistryReadServiceConnect ... + RegistryReadServiceConnect AccessRights = "RegistryRead, ServiceConnect" + // RegistryReadServiceConnectDeviceConnect ... + RegistryReadServiceConnectDeviceConnect AccessRights = "RegistryRead, ServiceConnect, DeviceConnect" + // RegistryWrite ... + RegistryWrite AccessRights = "RegistryWrite" + // RegistryWriteDeviceConnect ... + RegistryWriteDeviceConnect AccessRights = "RegistryWrite, DeviceConnect" + // RegistryWriteServiceConnect ... + RegistryWriteServiceConnect AccessRights = "RegistryWrite, ServiceConnect" + // RegistryWriteServiceConnectDeviceConnect ... + RegistryWriteServiceConnectDeviceConnect AccessRights = "RegistryWrite, ServiceConnect, DeviceConnect" + // ServiceConnect ... + ServiceConnect AccessRights = "ServiceConnect" + // ServiceConnectDeviceConnect ... + ServiceConnectDeviceConnect AccessRights = "ServiceConnect, DeviceConnect" +) + +// PossibleAccessRightsValues returns an array of possible values for the AccessRights const type. +func PossibleAccessRightsValues() []AccessRights { + return []AccessRights{DeviceConnect, RegistryRead, RegistryReadDeviceConnect, RegistryReadRegistryWrite, RegistryReadRegistryWriteDeviceConnect, RegistryReadRegistryWriteServiceConnect, RegistryReadRegistryWriteServiceConnectDeviceConnect, RegistryReadServiceConnect, RegistryReadServiceConnectDeviceConnect, RegistryWrite, RegistryWriteDeviceConnect, RegistryWriteServiceConnect, RegistryWriteServiceConnectDeviceConnect, ServiceConnect, ServiceConnectDeviceConnect} +} + +// AuthenticationType enumerates the values for authentication type. +type AuthenticationType string + +const ( + // IdentityBased ... + IdentityBased AuthenticationType = "identityBased" + // KeyBased ... + KeyBased AuthenticationType = "keyBased" +) + +// PossibleAuthenticationTypeValues returns an array of possible values for the AuthenticationType const type. +func PossibleAuthenticationTypeValues() []AuthenticationType { + return []AuthenticationType{IdentityBased, KeyBased} +} + +// Capabilities enumerates the values for capabilities. +type Capabilities string + +const ( + // DeviceManagement ... + DeviceManagement Capabilities = "DeviceManagement" + // None ... + None Capabilities = "None" +) + +// PossibleCapabilitiesValues returns an array of possible values for the Capabilities const type. +func PossibleCapabilitiesValues() []Capabilities { + return []Capabilities{DeviceManagement, None} +} + +// Encoding enumerates the values for encoding. +type Encoding string + +const ( + // Avro ... + Avro Encoding = "Avro" + // AvroDeflate ... + AvroDeflate Encoding = "AvroDeflate" + // JSON ... + JSON Encoding = "JSON" +) + +// PossibleEncodingValues returns an array of possible values for the Encoding const type. +func PossibleEncodingValues() []Encoding { + return []Encoding{Avro, AvroDeflate, JSON} +} + +// EndpointHealthStatus enumerates the values for endpoint health status. +type EndpointHealthStatus string + +const ( + // Dead ... + Dead EndpointHealthStatus = "dead" + // Healthy ... + Healthy EndpointHealthStatus = "healthy" + // Unhealthy ... + Unhealthy EndpointHealthStatus = "unhealthy" + // Unknown ... + Unknown EndpointHealthStatus = "unknown" +) + +// PossibleEndpointHealthStatusValues returns an array of possible values for the EndpointHealthStatus const type. +func PossibleEndpointHealthStatusValues() []EndpointHealthStatus { + return []EndpointHealthStatus{Dead, Healthy, Unhealthy, Unknown} +} + +// IotHubNameUnavailabilityReason enumerates the values for iot hub name unavailability reason. +type IotHubNameUnavailabilityReason string + +const ( + // AlreadyExists ... + AlreadyExists IotHubNameUnavailabilityReason = "AlreadyExists" + // Invalid ... + Invalid IotHubNameUnavailabilityReason = "Invalid" +) + +// PossibleIotHubNameUnavailabilityReasonValues returns an array of possible values for the IotHubNameUnavailabilityReason const type. +func PossibleIotHubNameUnavailabilityReasonValues() []IotHubNameUnavailabilityReason { + return []IotHubNameUnavailabilityReason{AlreadyExists, Invalid} +} + +// IotHubReplicaRoleType enumerates the values for iot hub replica role type. +type IotHubReplicaRoleType string + +const ( + // Primary ... + Primary IotHubReplicaRoleType = "primary" + // Secondary ... + Secondary IotHubReplicaRoleType = "secondary" +) + +// PossibleIotHubReplicaRoleTypeValues returns an array of possible values for the IotHubReplicaRoleType const type. +func PossibleIotHubReplicaRoleTypeValues() []IotHubReplicaRoleType { + return []IotHubReplicaRoleType{Primary, Secondary} +} + +// 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 ( + // B1 ... + B1 IotHubSku = "B1" + // B2 ... + B2 IotHubSku = "B2" + // B3 ... + B3 IotHubSku = "B3" + // F1 ... + F1 IotHubSku = "F1" + // S1 ... + S1 IotHubSku = "S1" + // S2 ... + S2 IotHubSku = "S2" + // S3 ... + S3 IotHubSku = "S3" +) + +// PossibleIotHubSkuValues returns an array of possible values for the IotHubSku const type. +func PossibleIotHubSkuValues() []IotHubSku { + return []IotHubSku{B1, B2, B3, F1, S1, S2, S3} +} + +// IotHubSkuTier enumerates the values for iot hub sku tier. +type IotHubSkuTier string + +const ( + // Basic ... + Basic IotHubSkuTier = "Basic" + // Free ... + Free IotHubSkuTier = "Free" + // Standard ... + Standard IotHubSkuTier = "Standard" +) + +// PossibleIotHubSkuTierValues returns an array of possible values for the IotHubSkuTier const type. +func PossibleIotHubSkuTierValues() []IotHubSkuTier { + return []IotHubSkuTier{Basic, Free, Standard} +} + +// IPFilterActionType enumerates the values for ip filter action type. +type IPFilterActionType string + +const ( + // Accept ... + Accept IPFilterActionType = "Accept" + // Reject ... + Reject IPFilterActionType = "Reject" +) + +// PossibleIPFilterActionTypeValues returns an array of possible values for the IPFilterActionType const type. +func PossibleIPFilterActionTypeValues() []IPFilterActionType { + return []IPFilterActionType{Accept, Reject} +} + +// 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} +} + +// PrivateLinkServiceConnectionStatus enumerates the values for private link service connection status. +type PrivateLinkServiceConnectionStatus string + +const ( + // Approved ... + Approved PrivateLinkServiceConnectionStatus = "Approved" + // Disconnected ... + Disconnected PrivateLinkServiceConnectionStatus = "Disconnected" + // Pending ... + Pending PrivateLinkServiceConnectionStatus = "Pending" + // Rejected ... + Rejected PrivateLinkServiceConnectionStatus = "Rejected" +) + +// PossiblePrivateLinkServiceConnectionStatusValues returns an array of possible values for the PrivateLinkServiceConnectionStatus const type. +func PossiblePrivateLinkServiceConnectionStatusValues() []PrivateLinkServiceConnectionStatus { + return []PrivateLinkServiceConnectionStatus{Approved, Disconnected, Pending, Rejected} +} + +// PublicNetworkAccess enumerates the values for public network access. +type PublicNetworkAccess string + +const ( + // Disabled ... + Disabled PublicNetworkAccess = "Disabled" + // Enabled ... + Enabled PublicNetworkAccess = "Enabled" +) + +// PossiblePublicNetworkAccessValues returns an array of possible values for the PublicNetworkAccess const type. +func PossiblePublicNetworkAccessValues() []PublicNetworkAccess { + return []PublicNetworkAccess{Disabled, Enabled} +} + +// RouteErrorSeverity enumerates the values for route error severity. +type RouteErrorSeverity string + +const ( + // Error ... + Error RouteErrorSeverity = "error" + // Warning ... + Warning RouteErrorSeverity = "warning" +) + +// PossibleRouteErrorSeverityValues returns an array of possible values for the RouteErrorSeverity const type. +func PossibleRouteErrorSeverityValues() []RouteErrorSeverity { + return []RouteErrorSeverity{Error, Warning} +} + +// RoutingSource enumerates the values for routing source. +type RoutingSource string + +const ( + // 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{RoutingSourceDeviceJobLifecycleEvents, RoutingSourceDeviceLifecycleEvents, RoutingSourceDeviceMessages, RoutingSourceInvalid, RoutingSourceTwinChangeEvents} +} + +// TestResultStatus enumerates the values for test result status. +type TestResultStatus string + +const ( + // False ... + False TestResultStatus = "false" + // True ... + True TestResultStatus = "true" + // Undefined ... + Undefined TestResultStatus = "undefined" +) + +// PossibleTestResultStatusValues returns an array of possible values for the TestResultStatus const type. +func PossibleTestResultStatusValues() []TestResultStatus { + return []TestResultStatus{False, True, Undefined} +} + +// 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"` +} + +// 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"` +} + +// 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 - 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"` + // Certificate - The certificate content + Certificate *string `json:"certificate,omitempty"` +} + +// 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"` +} + +// 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"` +} + +// 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: 'Unknown', 'Healthy', 'Unhealthy', 'Dead' + HealthStatus EndpointHealthStatus `json:"healthStatus,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"` +} + +// 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 +} + +// 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.NextLink == nil || len(to.String(ehdlr.NextLink)) < 1 { + 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) + }() + } + next, err := page.fn(ctx, page.ehdlr) + if err != nil { + return err + } + page.ehdlr = next + 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(getNextPage func(context.Context, EndpointHealthDataListResult) (EndpointHealthDataListResult, error)) EndpointHealthDataListResultPage { + return EndpointHealthDataListResultPage{fn: getNextPage} +} + +// 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"` +} + +// EventHubConsumerGroupInfo the properties of the EventHubConsumerGroupInfo object. +type EventHubConsumerGroupInfo struct { + autorest.Response `json:"-"` + // Properties - The tags. + Properties map[string]*string `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) +} + +// 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"` +} + +// 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 +} + +// 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.NextLink == nil || len(to.String(ehcglr.NextLink)) < 1 { + 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) + }() + } + next, err := page.fn(ctx, page.ehcglr) + if err != nil { + return err + } + page.ehcglr = next + 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(getNextPage func(context.Context, EventHubConsumerGroupsListResult) (EventHubConsumerGroupsListResult, error)) EventHubConsumerGroupsListResultPage { + return EventHubConsumerGroupsListResultPage{fn: getNextPage} +} + +// 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"` +} + +// 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: 'KeyBased', 'IdentityBased' + AuthenticationType AuthenticationType `json:"authenticationType,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"` +} + +// 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: 'KeyBased', 'IdentityBased' + AuthenticationType AuthenticationType `json:"authenticationType,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"` +} + +// 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"` + // 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.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"` +} + +// 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 +} + +// 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.NextLink == nil || len(to.String(ihdlr.NextLink)) < 1 { + 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) + }() + } + next, err := page.fn(ctx, page.ihdlr) + if err != nil { + return err + } + page.ihdlr = next + 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(getNextPage func(context.Context, IotHubDescriptionListResult) (IotHubDescriptionListResult, error)) IotHubDescriptionListResultPage { + return IotHubDescriptionListResultPage{fn: getNextPage} +} + +// 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: 'Primary', 'Secondary' + Role IotHubReplicaRoleType `json:"role,omitempty"` +} + +// IotHubManualFailoverFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type IotHubManualFailoverFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +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 { + 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: 'Invalid', 'AlreadyExists' + Reason IotHubNameUnavailabilityReason `json:"reason,omitempty"` + // Message - The detailed reason message. + Message *string `json:"message,omitempty"` +} + +// 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"` + // PublicNetworkAccess - Whether requests from Public Network are allowed. Possible values include: 'Enabled', 'Disabled' + PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` + // IPFilterRules - The IP filter rules. + IPFilterRules *[]IPFilterRule `json:"ipFilterRules,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: 'None', 'DeviceManagement' + Features Capabilities `json:"features,omitempty"` + // Locations - READ-ONLY; Primary and secondary location for iot hub + Locations *[]IotHubLocationDescription `json:"locations,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.PublicNetworkAccess != "" { + objectMap["publicNetworkAccess"] = ihp.PublicNetworkAccess + } + if ihp.IPFilterRules != nil { + objectMap["ipFilterRules"] = ihp.IPFilterRules + } + 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 + } + 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"` +} + +// 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"` +} + +// 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 +} + +// 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.NextLink == nil || len(to.String(ihqmilr.NextLink)) < 1 { + 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) + }() + } + next, err := page.fn(ctx, page.ihqmilr) + if err != nil { + return err + } + page.ihqmilr = next + 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(getNextPage func(context.Context, IotHubQuotaMetricInfoListResult) (IotHubQuotaMetricInfoListResult, error)) IotHubQuotaMetricInfoListResultPage { + return IotHubQuotaMetricInfoListResultPage{fn: getNextPage} +} + +// IotHubResourceCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type IotHubResourceCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +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 { + 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.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +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 { + 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.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +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 { + 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"` +} + +// 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"` +} + +// 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 +} + +// 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.NextLink == nil || len(to.String(ihsdlr.NextLink)) < 1 { + 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) + }() + } + next, err := page.fn(ctx, page.ihsdlr) + if err != nil { + return err + } + page.ihsdlr = next + 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(getNextPage func(context.Context, IotHubSkuDescriptionListResult) (IotHubSkuDescriptionListResult, error)) IotHubSkuDescriptionListResultPage { + return IotHubSkuDescriptionListResultPage{fn: getNextPage} +} + +// IotHubSkuInfo information about the SKU of the IoT hub. +type IotHubSkuInfo struct { + // Name - The name of the SKU. Possible values include: 'F1', 'S1', 'S2', 'S3', 'B1', 'B2', 'B3' + Name IotHubSku `json:"name,omitempty"` + // Tier - READ-ONLY; The billing tier for the IoT hub. Possible values include: 'Free', 'Standard', 'Basic' + 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"` +} + +// 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: 'Accept', 'Reject' + 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"` +} + +// 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"` +} + +// 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 +} + +// 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.NextLink == nil || len(to.String(jrlr.NextLink)) < 1 { + 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) + }() + } + next, err := page.fn(ctx, page.jrlr) + if err != nil { + return err + } + page.jrlr = next + 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(getNextPage func(context.Context, JobResponseListResult) (JobResponseListResult, error)) JobResponseListResultPage { + return JobResponseListResultPage{fn: getNextPage} +} + +// ListPrivateEndpointConnection ... +type ListPrivateEndpointConnection struct { + autorest.Response `json:"-"` + Value *[]PrivateEndpointConnection `json:"value,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"` +} + +// 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"` +} + +// 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"` +} + +// 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"` +} + +// 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 +} + +// 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.NextLink == nil || len(to.String(olr.NextLink)) < 1 { + 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) + }() + } + next, err := page.fn(ctx, page.olr) + if err != nil { + return err + } + page.olr = next + 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(getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { + return OperationListResultPage{fn: getNextPage} +} + +// PrivateEndpoint the private endpoint property of a private endpoint connection +type PrivateEndpoint struct { + // ID - READ-ONLY; The resource identifier. + ID *string `json:"id,omitempty"` +} + +// 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"` +} + +// 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.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +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 { + 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.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +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 { + 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: 'Pending', 'Approved', 'Rejected', 'Disconnected' + 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"` +} + +// 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: 'Error', 'Warning' + 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' + 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: 'KeyBased', 'IdentityBased' + AuthenticationType AuthenticationType `json:"authenticationType,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: 'KeyBased', 'IdentityBased' + AuthenticationType AuthenticationType `json:"authenticationType,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: 'KeyBased', 'IdentityBased' + AuthenticationType AuthenticationType `json:"authenticationType,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: 'KeyBased', 'IdentityBased' + AuthenticationType AuthenticationType `json:"authenticationType,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: 'Avro', 'AvroDeflate', 'JSON' + 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: 'RegistryRead', 'RegistryWrite', 'ServiceConnect', 'DeviceConnect', 'RegistryReadRegistryWrite', 'RegistryReadServiceConnect', 'RegistryReadDeviceConnect', 'RegistryWriteServiceConnect', 'RegistryWriteDeviceConnect', 'ServiceConnectDeviceConnect', 'RegistryReadRegistryWriteServiceConnect', 'RegistryReadRegistryWriteDeviceConnect', 'RegistryReadServiceConnectDeviceConnect', 'RegistryWriteServiceConnectDeviceConnect', 'RegistryReadRegistryWriteServiceConnectDeviceConnect' + 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"` +} + +// 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 +} + +// 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.NextLink == nil || len(to.String(sasarlr.NextLink)) < 1 { + 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) + }() + } + next, err := page.fn(ctx, page.sasarlr) + if err != nil { + return err + } + page.sasarlr = next + 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(getNextPage func(context.Context, SharedAccessSignatureAuthorizationRuleListResult) (SharedAccessSignatureAuthorizationRuleListResult, error)) SharedAccessSignatureAuthorizationRuleListResultPage { + return SharedAccessSignatureAuthorizationRuleListResultPage{fn: getNextPage} +} + +// 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: 'KeyBased', 'IdentityBased' + AuthenticationType AuthenticationType `json:"authenticationType,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' + 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: 'Undefined', 'False', 'True' + 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"` +} diff --git a/services/iothub/mgmt/2020-03-01/devices/operations.go b/services/iothub/mgmt/2020-03-01/devices/operations.go new file mode 100644 index 000000000000..73b16b716776 --- /dev/null +++ b/services/iothub/mgmt/2020-03-01/devices/operations.go @@ -0,0 +1,147 @@ +package devices + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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 +} + +// ListPreparer prepares the List request. +func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2020-03-01" + 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, + client.ByInspecting(), + 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/2020-03-01/devices/privateendpointconnections.go b/services/iothub/mgmt/2020-03-01/devices/privateendpointconnections.go new file mode 100644 index 000000000000..6e411c4b7a7a --- /dev/null +++ b/services/iothub/mgmt/2020-03-01/devices/privateendpointconnections.go @@ -0,0 +1,369 @@ +package devices + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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.Response() != nil { + sc = result.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 = "2020-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.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 + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + 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, + client.ByInspecting(), + 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 +} + +// 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 = "2020-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.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, + client.ByInspecting(), + 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 +} + +// 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 = "2020-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.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, + client.ByInspecting(), + 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.Response() != nil { + sc = result.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 = "2020-03-01" + 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 + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + 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, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/iothub/mgmt/2020-03-01/devices/privatelinkresources.go b/services/iothub/mgmt/2020-03-01/devices/privatelinkresources.go new file mode 100644 index 000000000000..74acd088e6da --- /dev/null +++ b/services/iothub/mgmt/2020-03-01/devices/privatelinkresources.go @@ -0,0 +1,197 @@ +package devices + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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 +} + +// 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 = "2020-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.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, + client.ByInspecting(), + 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 +} + +// 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 = "2020-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.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, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/iothub/mgmt/2020-03-01/devices/resourceprovidercommon.go b/services/iothub/mgmt/2020-03-01/devices/resourceprovidercommon.go new file mode 100644 index 000000000000..c67517a68a3a --- /dev/null +++ b/services/iothub/mgmt/2020-03-01/devices/resourceprovidercommon.go @@ -0,0 +1,114 @@ +package devices + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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 +} + +// 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 = "2020-03-01" + 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, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/iothub/mgmt/2020-03-01/devices/version.go b/services/iothub/mgmt/2020-03-01/devices/version.go new file mode 100644 index 000000000000..a98fc73f66b1 --- /dev/null +++ b/services/iothub/mgmt/2020-03-01/devices/version.go @@ -0,0 +1,30 @@ +package devices + +import "github.com/Azure/azure-sdk-for-go/version" + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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/2020-03-01" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/services/kusto/mgmt/2020-02-15/kusto/models.go b/services/kusto/mgmt/2020-02-15/kusto/models.go index 5ab08d809ed6..222dd5e1972b 100644 --- a/services/kusto/mgmt/2020-02-15/kusto/models.go +++ b/services/kusto/mgmt/2020-02-15/kusto/models.go @@ -3129,7 +3129,7 @@ type ReadWriteDatabaseProperties struct { // Statistics - The statistics of the database. Statistics *DatabaseStatistics `json:"statistics,omitempty"` // IsFollowed - READ-ONLY; Indicates whether the database is followed. - IsFollowed *string `json:"isFollowed,omitempty"` + IsFollowed *bool `json:"isFollowed,omitempty"` } // Resource ... diff --git a/services/machinelearningservices/mgmt/2020-03-01/machinelearningservices/machinelearningservicesapi/interfaces.go b/services/machinelearningservices/mgmt/2020-03-01/machinelearningservices/machinelearningservicesapi/interfaces.go index f39148eaedb4..e97bea99f998 100644 --- a/services/machinelearningservices/mgmt/2020-03-01/machinelearningservices/machinelearningservicesapi/interfaces.go +++ b/services/machinelearningservices/mgmt/2020-03-01/machinelearningservices/machinelearningservicesapi/interfaces.go @@ -62,6 +62,13 @@ type WorkspaceFeaturesClientAPI interface { var _ WorkspaceFeaturesClientAPI = (*machinelearningservices.WorkspaceFeaturesClient)(nil) +// NotebooksClientAPI contains the set of methods on the NotebooksClient type. +type NotebooksClientAPI interface { + Prepare(ctx context.Context, resourceGroupName string, workspaceName string) (result machinelearningservices.NotebooksPrepareFuture, err error) +} + +var _ NotebooksClientAPI = (*machinelearningservices.NotebooksClient)(nil) + // UsagesClientAPI contains the set of methods on the UsagesClient type. type UsagesClientAPI interface { List(ctx context.Context, location string) (result machinelearningservices.ListUsagesResultPage, err error) diff --git a/services/machinelearningservices/mgmt/2020-03-01/machinelearningservices/models.go b/services/machinelearningservices/mgmt/2020-03-01/machinelearningservices/models.go index dd077455ac2b..89ca944658b7 100644 --- a/services/machinelearningservices/mgmt/2020-03-01/machinelearningservices/models.go +++ b/services/machinelearningservices/mgmt/2020-03-01/machinelearningservices/models.go @@ -2037,6 +2037,7 @@ type ListWorkspaceKeysResult struct { AppInsightsInstrumentationKey *string `json:"appInsightsInstrumentationKey,omitempty"` // ContainerRegistryCredentials - READ-ONLY ContainerRegistryCredentials *RegistryListCredentialsResult `json:"containerRegistryCredentials,omitempty"` + NotebookAccessKeys *NotebookListCredentialsResult `json:"notebookAccessKeys,omitempty"` } // ListWorkspaceQuotas the List WorkspaceQuotasByVMFamily operation response. @@ -2282,6 +2283,57 @@ type NodeStateCounts struct { PreemptedNodeCount *int32 `json:"preemptedNodeCount,omitempty"` } +// NotebookListCredentialsResult ... +type NotebookListCredentialsResult struct { + PrimaryAccessKey *string `json:"primaryAccessKey,omitempty"` + SecondaryAccessKey *string `json:"secondaryAccessKey,omitempty"` +} + +// NotebookPreparationError ... +type NotebookPreparationError struct { + ErrorMessage *string `json:"errorMessage,omitempty"` + StatusCode *int32 `json:"statusCode,omitempty"` +} + +// NotebookResourceInfo ... +type NotebookResourceInfo struct { + autorest.Response `json:"-"` + Fqdn *string `json:"fqdn,omitempty"` + // ResourceID - the data plane resourceId that used to initialize notebook component + ResourceID *string `json:"resourceId,omitempty"` + // NotebookPreparationError - The error that occurs when preparing notebook. + NotebookPreparationError *NotebookPreparationError `json:"notebookPreparationError,omitempty"` +} + +// NotebooksPrepareFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type NotebooksPrepareFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *NotebooksPrepareFuture) Result(client NotebooksClient) (nri NotebookResourceInfo, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.NotebooksPrepareFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("machinelearningservices.NotebooksPrepareFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if nri.Response.Response, err = future.GetResult(sender); err == nil && nri.Response.Response.StatusCode != http.StatusNoContent { + nri, err = client.PrepareResponder(nri.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.NotebooksPrepareFuture", "Result", nri.Response.Response, "Failure responding to request") + } + } + return +} + // Operation azure Machine Learning workspace REST API operation type Operation struct { // Name - Operation name: {provider}/{resource}/{operation} @@ -3709,6 +3761,8 @@ type WorkspaceProperties struct { PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` // SharedPrivateLinkResources - The list of shared private link resources in this workspace. SharedPrivateLinkResources *[]SharedPrivateLinkResource `json:"sharedPrivateLinkResources,omitempty"` + // NotebookInfo - READ-ONLY; The notebook info of Azure ML workspace. + NotebookInfo *NotebookResourceInfo `json:"notebookInfo,omitempty"` } // WorkspacePropertiesUpdateParameters the parameters for updating the properties of a machine learning diff --git a/services/machinelearningservices/mgmt/2020-03-01/machinelearningservices/notebooks.go b/services/machinelearningservices/mgmt/2020-03-01/machinelearningservices/notebooks.go new file mode 100644 index 000000000000..159f6af5a473 --- /dev/null +++ b/services/machinelearningservices/mgmt/2020-03-01/machinelearningservices/notebooks.go @@ -0,0 +1,118 @@ +package machinelearningservices + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// NotebooksClient is the these APIs allow end users to operate on Azure Machine Learning Workspace resources. +type NotebooksClient struct { + BaseClient +} + +// NewNotebooksClient creates an instance of the NotebooksClient client. +func NewNotebooksClient(subscriptionID string) NotebooksClient { + return NewNotebooksClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewNotebooksClientWithBaseURI creates an instance of the NotebooksClient 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 NewNotebooksClientWithBaseURI(baseURI string, subscriptionID string) NotebooksClient { + return NotebooksClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Prepare sends the prepare request. +// Parameters: +// resourceGroupName - name of the resource group in which workspace is located. +// workspaceName - name of Azure Machine Learning workspace. +func (client NotebooksClient) Prepare(ctx context.Context, resourceGroupName string, workspaceName string) (result NotebooksPrepareFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NotebooksClient.Prepare") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PreparePreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.NotebooksClient", "Prepare", nil, "Failure preparing request") + return + } + + result, err = client.PrepareSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.NotebooksClient", "Prepare", result.Response(), "Failure sending request") + return + } + + return +} + +// PreparePreparer prepares the Prepare request. +func (client NotebooksClient) PreparePreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-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.MachineLearningServices/workspaces/{workspaceName}/prepareNotebook", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PrepareSender sends the Prepare request. The method will close the +// http.Response Body if it receives an error. +func (client NotebooksClient) PrepareSender(req *http.Request) (future NotebooksPrepareFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// PrepareResponder handles the response to the Prepare request. The method always +// closes the http.Response Body. +func (client NotebooksClient) PrepareResponder(resp *http.Response) (result NotebookResourceInfo, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/machinelearningservices/mgmt/2020-04-01/machinelearningservices/client.go b/services/machinelearningservices/mgmt/2020-04-01/machinelearningservices/client.go new file mode 100644 index 000000000000..5f1d9ca37833 --- /dev/null +++ b/services/machinelearningservices/mgmt/2020-04-01/machinelearningservices/client.go @@ -0,0 +1,165 @@ +// Package machinelearningservices implements the Azure ARM Machinelearningservices service API version 2020-04-01. +// +// These APIs allow end users to operate on Azure Machine Learning Workspace resources. +package machinelearningservices + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +const ( + // DefaultBaseURI is the default URI used for the service Machinelearningservices + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Machinelearningservices. +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, + } +} + +// ListSkus lists all skus with associated features +func (client BaseClient) ListSkus(ctx context.Context) (result SkuListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ListSkus") + defer func() { + sc := -1 + if result.slr.Response.Response != nil { + sc = result.slr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listSkusNextResults + req, err := client.ListSkusPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.BaseClient", "ListSkus", nil, "Failure preparing request") + return + } + + resp, err := client.ListSkusSender(req) + if err != nil { + result.slr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "machinelearningservices.BaseClient", "ListSkus", resp, "Failure sending request") + return + } + + result.slr, err = client.ListSkusResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.BaseClient", "ListSkus", resp, "Failure responding to request") + } + + 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 = "2020-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces/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 SkuListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listSkusNextResults retrieves the next set of results, if any. +func (client BaseClient) listSkusNextResults(ctx context.Context, lastResults SkuListResult) (result SkuListResult, err error) { + req, err := lastResults.skuListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "machinelearningservices.BaseClient", "listSkusNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSkusSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "machinelearningservices.BaseClient", "listSkusNextResults", resp, "Failure sending next results request") + } + result, err = client.ListSkusResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.BaseClient", "listSkusNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListSkusComplete enumerates all values, automatically crossing page boundaries as required. +func (client BaseClient) ListSkusComplete(ctx context.Context) (result SkuListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ListSkus") + 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.ListSkus(ctx) + return +} diff --git a/services/machinelearningservices/mgmt/2020-04-01/machinelearningservices/machinelearningcompute.go b/services/machinelearningservices/mgmt/2020-04-01/machinelearningservices/machinelearningcompute.go new file mode 100644 index 000000000000..c88fc040084d --- /dev/null +++ b/services/machinelearningservices/mgmt/2020-04-01/machinelearningservices/machinelearningcompute.go @@ -0,0 +1,641 @@ +package machinelearningservices + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// MachineLearningComputeClient is the these APIs allow end users to operate on Azure Machine Learning Workspace +// resources. +type MachineLearningComputeClient struct { + BaseClient +} + +// NewMachineLearningComputeClient creates an instance of the MachineLearningComputeClient client. +func NewMachineLearningComputeClient(subscriptionID string) MachineLearningComputeClient { + return NewMachineLearningComputeClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewMachineLearningComputeClientWithBaseURI creates an instance of the MachineLearningComputeClient 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 NewMachineLearningComputeClientWithBaseURI(baseURI string, subscriptionID string) MachineLearningComputeClient { + return MachineLearningComputeClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates compute. This call will overwrite a compute if it exists. This is a nonrecoverable +// operation. If your intent is to create a new compute, do a GET first to verify that it does not exist yet. +// Parameters: +// resourceGroupName - name of the resource group in which workspace is located. +// workspaceName - name of Azure Machine Learning workspace. +// computeName - name of the Azure Machine Learning compute. +// parameters - payload with Machine Learning compute definition. +func (client MachineLearningComputeClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, parameters ComputeResource) (result MachineLearningComputeCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MachineLearningComputeClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, workspaceName, computeName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client MachineLearningComputeClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, parameters ComputeResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "computeName": autorest.Encode("path", computeName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-04-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.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}", pathParameters), + autorest.WithJSON(parameters), + 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 MachineLearningComputeClient) CreateOrUpdateSender(req *http.Request) (future MachineLearningComputeCreateOrUpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client MachineLearningComputeClient) CreateOrUpdateResponder(resp *http.Response) (result ComputeResource, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes specified Machine Learning compute. +// Parameters: +// resourceGroupName - name of the resource group in which workspace is located. +// workspaceName - name of Azure Machine Learning workspace. +// computeName - name of the Azure Machine Learning compute. +// underlyingResourceAction - delete the underlying compute if 'Delete', or detach the underlying compute from +// workspace if 'Detach'. +func (client MachineLearningComputeClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, underlyingResourceAction UnderlyingResourceAction) (result MachineLearningComputeDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MachineLearningComputeClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, workspaceName, computeName, underlyingResourceAction) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client MachineLearningComputeClient) DeletePreparer(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, underlyingResourceAction UnderlyingResourceAction) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "computeName": autorest.Encode("path", computeName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + "underlyingResourceAction": autorest.Encode("query", underlyingResourceAction), + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}", 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 MachineLearningComputeClient) DeleteSender(req *http.Request) (future MachineLearningComputeDeleteFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client MachineLearningComputeClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets compute definition by its name. Any secrets (storage keys, service credentials, etc) are not returned - use +// 'keys' nested resource to get them. +// Parameters: +// resourceGroupName - name of the resource group in which workspace is located. +// workspaceName - name of Azure Machine Learning workspace. +// computeName - name of the Azure Machine Learning compute. +func (client MachineLearningComputeClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, computeName string) (result ComputeResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MachineLearningComputeClient.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, workspaceName, computeName) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client MachineLearningComputeClient) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string, computeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "computeName": autorest.Encode("path", computeName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}", 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 MachineLearningComputeClient) 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 MachineLearningComputeClient) GetResponder(resp *http.Response) (result ComputeResource, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByWorkspace gets computes in specified workspace. +// Parameters: +// resourceGroupName - name of the resource group in which workspace is located. +// workspaceName - name of Azure Machine Learning workspace. +// skiptoken - continuation token for pagination. +func (client MachineLearningComputeClient) ListByWorkspace(ctx context.Context, resourceGroupName string, workspaceName string, skiptoken string) (result PaginatedComputeResourcesListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MachineLearningComputeClient.ListByWorkspace") + defer func() { + sc := -1 + if result.pcrl.Response.Response != nil { + sc = result.pcrl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByWorkspaceNextResults + req, err := client.ListByWorkspacePreparer(ctx, resourceGroupName, workspaceName, skiptoken) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeClient", "ListByWorkspace", nil, "Failure preparing request") + return + } + + resp, err := client.ListByWorkspaceSender(req) + if err != nil { + result.pcrl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeClient", "ListByWorkspace", resp, "Failure sending request") + return + } + + result.pcrl, err = client.ListByWorkspaceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeClient", "ListByWorkspace", resp, "Failure responding to request") + } + + return +} + +// ListByWorkspacePreparer prepares the ListByWorkspace request. +func (client MachineLearningComputeClient) ListByWorkspacePreparer(ctx context.Context, resourceGroupName string, workspaceName string, skiptoken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skiptoken) > 0 { + queryParameters["$skiptoken"] = autorest.Encode("query", skiptoken) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/computes", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByWorkspaceSender sends the ListByWorkspace request. The method will close the +// http.Response Body if it receives an error. +func (client MachineLearningComputeClient) ListByWorkspaceSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByWorkspaceResponder handles the response to the ListByWorkspace request. The method always +// closes the http.Response Body. +func (client MachineLearningComputeClient) ListByWorkspaceResponder(resp *http.Response) (result PaginatedComputeResourcesList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByWorkspaceNextResults retrieves the next set of results, if any. +func (client MachineLearningComputeClient) listByWorkspaceNextResults(ctx context.Context, lastResults PaginatedComputeResourcesList) (result PaginatedComputeResourcesList, err error) { + req, err := lastResults.paginatedComputeResourcesListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeClient", "listByWorkspaceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByWorkspaceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeClient", "listByWorkspaceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByWorkspaceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeClient", "listByWorkspaceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByWorkspaceComplete enumerates all values, automatically crossing page boundaries as required. +func (client MachineLearningComputeClient) ListByWorkspaceComplete(ctx context.Context, resourceGroupName string, workspaceName string, skiptoken string) (result PaginatedComputeResourcesListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MachineLearningComputeClient.ListByWorkspace") + 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.ListByWorkspace(ctx, resourceGroupName, workspaceName, skiptoken) + return +} + +// ListKeys gets secrets related to Machine Learning compute (storage keys, service credentials, etc). +// Parameters: +// resourceGroupName - name of the resource group in which workspace is located. +// workspaceName - name of Azure Machine Learning workspace. +// computeName - name of the Azure Machine Learning compute. +func (client MachineLearningComputeClient) ListKeys(ctx context.Context, resourceGroupName string, workspaceName string, computeName string) (result ComputeSecretsModel, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MachineLearningComputeClient.ListKeys") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListKeysPreparer(ctx, resourceGroupName, workspaceName, computeName) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeClient", "ListKeys", nil, "Failure preparing request") + return + } + + resp, err := client.ListKeysSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeClient", "ListKeys", resp, "Failure sending request") + return + } + + result, err = client.ListKeysResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeClient", "ListKeys", resp, "Failure responding to request") + } + + return +} + +// ListKeysPreparer prepares the ListKeys request. +func (client MachineLearningComputeClient) ListKeysPreparer(ctx context.Context, resourceGroupName string, workspaceName string, computeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "computeName": autorest.Encode("path", computeName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-04-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.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/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 MachineLearningComputeClient) 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 MachineLearningComputeClient) ListKeysResponder(resp *http.Response) (result ComputeSecretsModel, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListNodes get the details (e.g IP address, port etc) of all the compute nodes in the compute. +// Parameters: +// resourceGroupName - name of the resource group in which workspace is located. +// workspaceName - name of Azure Machine Learning workspace. +// computeName - name of the Azure Machine Learning compute. +func (client MachineLearningComputeClient) ListNodes(ctx context.Context, resourceGroupName string, workspaceName string, computeName string) (result AmlComputeNodesInformation, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MachineLearningComputeClient.ListNodes") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListNodesPreparer(ctx, resourceGroupName, workspaceName, computeName) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeClient", "ListNodes", nil, "Failure preparing request") + return + } + + resp, err := client.ListNodesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeClient", "ListNodes", resp, "Failure sending request") + return + } + + result, err = client.ListNodesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeClient", "ListNodes", resp, "Failure responding to request") + } + + return +} + +// ListNodesPreparer prepares the ListNodes request. +func (client MachineLearningComputeClient) ListNodesPreparer(ctx context.Context, resourceGroupName string, workspaceName string, computeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "computeName": autorest.Encode("path", computeName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-04-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.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}/listNodes", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListNodesSender sends the ListNodes request. The method will close the +// http.Response Body if it receives an error. +func (client MachineLearningComputeClient) ListNodesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListNodesResponder handles the response to the ListNodes request. The method always +// closes the http.Response Body. +func (client MachineLearningComputeClient) ListNodesResponder(resp *http.Response) (result AmlComputeNodesInformation, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update updates properties of a compute. This call will overwrite a compute if it exists. This is a nonrecoverable +// operation. +// Parameters: +// resourceGroupName - name of the resource group in which workspace is located. +// workspaceName - name of Azure Machine Learning workspace. +// computeName - name of the Azure Machine Learning compute. +// parameters - additional parameters for cluster update. +func (client MachineLearningComputeClient) Update(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, parameters ClusterUpdateParameters) (result MachineLearningComputeUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MachineLearningComputeClient.Update") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, workspaceName, computeName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client MachineLearningComputeClient) UpdatePreparer(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, parameters ClusterUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "computeName": autorest.Encode("path", computeName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-04-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.MachineLearningServices/workspaces/{workspaceName}/computes/{computeName}", pathParameters), + autorest.WithJSON(parameters), + 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 MachineLearningComputeClient) UpdateSender(req *http.Request) (future MachineLearningComputeUpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client MachineLearningComputeClient) UpdateResponder(resp *http.Response) (result ComputeResource, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/machinelearningservices/mgmt/2020-04-01/machinelearningservices/machinelearningservicesapi/interfaces.go b/services/machinelearningservices/mgmt/2020-04-01/machinelearningservices/machinelearningservicesapi/interfaces.go new file mode 100644 index 000000000000..05b04b9442a2 --- /dev/null +++ b/services/machinelearningservices/mgmt/2020-04-01/machinelearningservices/machinelearningservicesapi/interfaces.go @@ -0,0 +1,117 @@ +package machinelearningservicesapi + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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/machinelearningservices/mgmt/2020-04-01/machinelearningservices" + "github.com/Azure/go-autorest/autorest" +) + +// BaseClientAPI contains the set of methods on the BaseClient type. +type BaseClientAPI interface { + ListSkus(ctx context.Context) (result machinelearningservices.SkuListResultPage, err error) + ListSkusComplete(ctx context.Context) (result machinelearningservices.SkuListResultIterator, err error) +} + +var _ BaseClientAPI = (*machinelearningservices.BaseClient)(nil) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result machinelearningservices.OperationListResult, err error) +} + +var _ OperationsClientAPI = (*machinelearningservices.OperationsClient)(nil) + +// WorkspacesClientAPI contains the set of methods on the WorkspacesClient type. +type WorkspacesClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, parameters machinelearningservices.Workspace) (result machinelearningservices.WorkspacesCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, workspaceName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, workspaceName string) (result machinelearningservices.Workspace, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string, skiptoken string) (result machinelearningservices.WorkspaceListResultPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, skiptoken string) (result machinelearningservices.WorkspaceListResultIterator, err error) + ListBySubscription(ctx context.Context, skiptoken string) (result machinelearningservices.WorkspaceListResultPage, err error) + ListBySubscriptionComplete(ctx context.Context, skiptoken string) (result machinelearningservices.WorkspaceListResultIterator, err error) + ListKeys(ctx context.Context, resourceGroupName string, workspaceName string) (result machinelearningservices.ListWorkspaceKeysResult, err error) + ResyncKeys(ctx context.Context, resourceGroupName string, workspaceName string) (result autorest.Response, err error) + Update(ctx context.Context, resourceGroupName string, workspaceName string, parameters machinelearningservices.WorkspaceUpdateParameters) (result machinelearningservices.Workspace, err error) +} + +var _ WorkspacesClientAPI = (*machinelearningservices.WorkspacesClient)(nil) + +// WorkspaceFeaturesClientAPI contains the set of methods on the WorkspaceFeaturesClient type. +type WorkspaceFeaturesClientAPI interface { + List(ctx context.Context, resourceGroupName string, workspaceName string) (result machinelearningservices.ListAmlUserFeatureResultPage, err error) + ListComplete(ctx context.Context, resourceGroupName string, workspaceName string) (result machinelearningservices.ListAmlUserFeatureResultIterator, err error) +} + +var _ WorkspaceFeaturesClientAPI = (*machinelearningservices.WorkspaceFeaturesClient)(nil) + +// UsagesClientAPI contains the set of methods on the UsagesClient type. +type UsagesClientAPI interface { + List(ctx context.Context, location string) (result machinelearningservices.ListUsagesResultPage, err error) + ListComplete(ctx context.Context, location string) (result machinelearningservices.ListUsagesResultIterator, err error) +} + +var _ UsagesClientAPI = (*machinelearningservices.UsagesClient)(nil) + +// VirtualMachineSizesClientAPI contains the set of methods on the VirtualMachineSizesClient type. +type VirtualMachineSizesClientAPI interface { + List(ctx context.Context, location string) (result machinelearningservices.VirtualMachineSizeListResult, err error) +} + +var _ VirtualMachineSizesClientAPI = (*machinelearningservices.VirtualMachineSizesClient)(nil) + +// QuotasClientAPI contains the set of methods on the QuotasClient type. +type QuotasClientAPI interface { + List(ctx context.Context, location string) (result machinelearningservices.ListWorkspaceQuotasPage, err error) + ListComplete(ctx context.Context, location string) (result machinelearningservices.ListWorkspaceQuotasIterator, err error) + Update(ctx context.Context, location string, parameters machinelearningservices.QuotaUpdateParameters) (result machinelearningservices.UpdateWorkspaceQuotasResult, err error) +} + +var _ QuotasClientAPI = (*machinelearningservices.QuotasClient)(nil) + +// MachineLearningComputeClientAPI contains the set of methods on the MachineLearningComputeClient type. +type MachineLearningComputeClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, parameters machinelearningservices.ComputeResource) (result machinelearningservices.MachineLearningComputeCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, underlyingResourceAction machinelearningservices.UnderlyingResourceAction) (result machinelearningservices.MachineLearningComputeDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, workspaceName string, computeName string) (result machinelearningservices.ComputeResource, err error) + ListByWorkspace(ctx context.Context, resourceGroupName string, workspaceName string, skiptoken string) (result machinelearningservices.PaginatedComputeResourcesListPage, err error) + ListByWorkspaceComplete(ctx context.Context, resourceGroupName string, workspaceName string, skiptoken string) (result machinelearningservices.PaginatedComputeResourcesListIterator, err error) + ListKeys(ctx context.Context, resourceGroupName string, workspaceName string, computeName string) (result machinelearningservices.ComputeSecretsModel, err error) + ListNodes(ctx context.Context, resourceGroupName string, workspaceName string, computeName string) (result machinelearningservices.AmlComputeNodesInformation, err error) + Update(ctx context.Context, resourceGroupName string, workspaceName string, computeName string, parameters machinelearningservices.ClusterUpdateParameters) (result machinelearningservices.MachineLearningComputeUpdateFuture, err error) +} + +var _ MachineLearningComputeClientAPI = (*machinelearningservices.MachineLearningComputeClient)(nil) + +// PrivateEndpointConnectionsClientAPI contains the set of methods on the PrivateEndpointConnectionsClient type. +type PrivateEndpointConnectionsClientAPI interface { + Delete(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string) (result machinelearningservices.PrivateEndpointConnection, err error) + Put(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string, properties machinelearningservices.PrivateEndpointConnection) (result machinelearningservices.PrivateEndpointConnection, err error) +} + +var _ PrivateEndpointConnectionsClientAPI = (*machinelearningservices.PrivateEndpointConnectionsClient)(nil) + +// PrivateLinkResourcesClientAPI contains the set of methods on the PrivateLinkResourcesClient type. +type PrivateLinkResourcesClientAPI interface { + ListByWorkspace(ctx context.Context, resourceGroupName string, workspaceName string) (result machinelearningservices.PrivateLinkResourceListResult, err error) +} + +var _ PrivateLinkResourcesClientAPI = (*machinelearningservices.PrivateLinkResourcesClient)(nil) diff --git a/services/machinelearningservices/mgmt/2020-04-01/machinelearningservices/models.go b/services/machinelearningservices/mgmt/2020-04-01/machinelearningservices/models.go new file mode 100644 index 000000000000..60fa81575f59 --- /dev/null +++ b/services/machinelearningservices/mgmt/2020-04-01/machinelearningservices/models.go @@ -0,0 +1,3863 @@ +package machinelearningservices + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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/machinelearningservices/mgmt/2020-04-01/machinelearningservices" + +// AllocationState enumerates the values for allocation state. +type AllocationState string + +const ( + // Resizing ... + Resizing AllocationState = "Resizing" + // Steady ... + Steady AllocationState = "Steady" +) + +// PossibleAllocationStateValues returns an array of possible values for the AllocationState const type. +func PossibleAllocationStateValues() []AllocationState { + return []AllocationState{Resizing, Steady} +} + +// ComputeType enumerates the values for compute type. +type ComputeType string + +const ( + // ComputeTypeAKS ... + ComputeTypeAKS ComputeType = "AKS" + // ComputeTypeAmlCompute ... + ComputeTypeAmlCompute ComputeType = "AmlCompute" + // ComputeTypeDatabricks ... + ComputeTypeDatabricks ComputeType = "Databricks" + // ComputeTypeDataFactory ... + ComputeTypeDataFactory ComputeType = "DataFactory" + // ComputeTypeDataLakeAnalytics ... + ComputeTypeDataLakeAnalytics ComputeType = "DataLakeAnalytics" + // ComputeTypeHDInsight ... + ComputeTypeHDInsight ComputeType = "HDInsight" + // ComputeTypeVirtualMachine ... + ComputeTypeVirtualMachine ComputeType = "VirtualMachine" +) + +// PossibleComputeTypeValues returns an array of possible values for the ComputeType const type. +func PossibleComputeTypeValues() []ComputeType { + return []ComputeType{ComputeTypeAKS, ComputeTypeAmlCompute, ComputeTypeDatabricks, ComputeTypeDataFactory, ComputeTypeDataLakeAnalytics, ComputeTypeHDInsight, ComputeTypeVirtualMachine} +} + +// ComputeTypeBasicCompute enumerates the values for compute type basic compute. +type ComputeTypeBasicCompute string + +const ( + // ComputeTypeAKS1 ... + ComputeTypeAKS1 ComputeTypeBasicCompute = "AKS" + // ComputeTypeAmlCompute1 ... + ComputeTypeAmlCompute1 ComputeTypeBasicCompute = "AmlCompute" + // ComputeTypeCompute ... + ComputeTypeCompute ComputeTypeBasicCompute = "Compute" + // ComputeTypeDatabricks1 ... + ComputeTypeDatabricks1 ComputeTypeBasicCompute = "Databricks" + // ComputeTypeDataFactory1 ... + ComputeTypeDataFactory1 ComputeTypeBasicCompute = "DataFactory" + // ComputeTypeDataLakeAnalytics1 ... + ComputeTypeDataLakeAnalytics1 ComputeTypeBasicCompute = "DataLakeAnalytics" + // ComputeTypeHDInsight1 ... + ComputeTypeHDInsight1 ComputeTypeBasicCompute = "HDInsight" + // ComputeTypeVirtualMachine1 ... + ComputeTypeVirtualMachine1 ComputeTypeBasicCompute = "VirtualMachine" +) + +// PossibleComputeTypeBasicComputeValues returns an array of possible values for the ComputeTypeBasicCompute const type. +func PossibleComputeTypeBasicComputeValues() []ComputeTypeBasicCompute { + return []ComputeTypeBasicCompute{ComputeTypeAKS1, ComputeTypeAmlCompute1, ComputeTypeCompute, ComputeTypeDatabricks1, ComputeTypeDataFactory1, ComputeTypeDataLakeAnalytics1, ComputeTypeHDInsight1, ComputeTypeVirtualMachine1} +} + +// ComputeTypeBasicComputeNodesInformation enumerates the values for compute type basic compute nodes +// information. +type ComputeTypeBasicComputeNodesInformation string + +const ( + // ComputeTypeBasicComputeNodesInformationComputeTypeAmlCompute ... + ComputeTypeBasicComputeNodesInformationComputeTypeAmlCompute ComputeTypeBasicComputeNodesInformation = "AmlCompute" + // ComputeTypeBasicComputeNodesInformationComputeTypeComputeNodesInformation ... + ComputeTypeBasicComputeNodesInformationComputeTypeComputeNodesInformation ComputeTypeBasicComputeNodesInformation = "ComputeNodesInformation" +) + +// PossibleComputeTypeBasicComputeNodesInformationValues returns an array of possible values for the ComputeTypeBasicComputeNodesInformation const type. +func PossibleComputeTypeBasicComputeNodesInformationValues() []ComputeTypeBasicComputeNodesInformation { + return []ComputeTypeBasicComputeNodesInformation{ComputeTypeBasicComputeNodesInformationComputeTypeAmlCompute, ComputeTypeBasicComputeNodesInformationComputeTypeComputeNodesInformation} +} + +// ComputeTypeBasicComputeSecrets enumerates the values for compute type basic compute secrets. +type ComputeTypeBasicComputeSecrets string + +const ( + // ComputeTypeBasicComputeSecretsComputeTypeAKS ... + ComputeTypeBasicComputeSecretsComputeTypeAKS ComputeTypeBasicComputeSecrets = "AKS" + // ComputeTypeBasicComputeSecretsComputeTypeComputeSecrets ... + ComputeTypeBasicComputeSecretsComputeTypeComputeSecrets ComputeTypeBasicComputeSecrets = "ComputeSecrets" + // ComputeTypeBasicComputeSecretsComputeTypeDatabricks ... + ComputeTypeBasicComputeSecretsComputeTypeDatabricks ComputeTypeBasicComputeSecrets = "Databricks" + // ComputeTypeBasicComputeSecretsComputeTypeVirtualMachine ... + ComputeTypeBasicComputeSecretsComputeTypeVirtualMachine ComputeTypeBasicComputeSecrets = "VirtualMachine" +) + +// PossibleComputeTypeBasicComputeSecretsValues returns an array of possible values for the ComputeTypeBasicComputeSecrets const type. +func PossibleComputeTypeBasicComputeSecretsValues() []ComputeTypeBasicComputeSecrets { + return []ComputeTypeBasicComputeSecrets{ComputeTypeBasicComputeSecretsComputeTypeAKS, ComputeTypeBasicComputeSecretsComputeTypeComputeSecrets, ComputeTypeBasicComputeSecretsComputeTypeDatabricks, ComputeTypeBasicComputeSecretsComputeTypeVirtualMachine} +} + +// EncryptionStatus enumerates the values for encryption status. +type EncryptionStatus string + +const ( + // Disabled ... + Disabled EncryptionStatus = "Disabled" + // Enabled ... + Enabled EncryptionStatus = "Enabled" +) + +// PossibleEncryptionStatusValues returns an array of possible values for the EncryptionStatus const type. +func PossibleEncryptionStatusValues() []EncryptionStatus { + return []EncryptionStatus{Disabled, Enabled} +} + +// NodeState enumerates the values for node state. +type NodeState string + +const ( + // Idle ... + Idle NodeState = "idle" + // Leaving ... + Leaving NodeState = "leaving" + // Preempted ... + Preempted NodeState = "preempted" + // Preparing ... + Preparing NodeState = "preparing" + // Running ... + Running NodeState = "running" + // Unusable ... + Unusable NodeState = "unusable" +) + +// PossibleNodeStateValues returns an array of possible values for the NodeState const type. +func PossibleNodeStateValues() []NodeState { + return []NodeState{Idle, Leaving, Preempted, Preparing, Running, Unusable} +} + +// PrivateEndpointConnectionProvisioningState enumerates the values for private endpoint connection +// provisioning state. +type PrivateEndpointConnectionProvisioningState string + +const ( + // Creating ... + Creating PrivateEndpointConnectionProvisioningState = "Creating" + // Deleting ... + Deleting PrivateEndpointConnectionProvisioningState = "Deleting" + // Failed ... + Failed PrivateEndpointConnectionProvisioningState = "Failed" + // Succeeded ... + Succeeded PrivateEndpointConnectionProvisioningState = "Succeeded" +) + +// PossiblePrivateEndpointConnectionProvisioningStateValues returns an array of possible values for the PrivateEndpointConnectionProvisioningState const type. +func PossiblePrivateEndpointConnectionProvisioningStateValues() []PrivateEndpointConnectionProvisioningState { + return []PrivateEndpointConnectionProvisioningState{Creating, Deleting, Failed, Succeeded} +} + +// PrivateEndpointServiceConnectionStatus enumerates the values for private endpoint service connection status. +type PrivateEndpointServiceConnectionStatus string + +const ( + // Approved ... + Approved PrivateEndpointServiceConnectionStatus = "Approved" + // Disconnected ... + Disconnected PrivateEndpointServiceConnectionStatus = "Disconnected" + // Pending ... + Pending PrivateEndpointServiceConnectionStatus = "Pending" + // Rejected ... + Rejected PrivateEndpointServiceConnectionStatus = "Rejected" + // Timeout ... + Timeout PrivateEndpointServiceConnectionStatus = "Timeout" +) + +// PossiblePrivateEndpointServiceConnectionStatusValues returns an array of possible values for the PrivateEndpointServiceConnectionStatus const type. +func PossiblePrivateEndpointServiceConnectionStatusValues() []PrivateEndpointServiceConnectionStatus { + return []PrivateEndpointServiceConnectionStatus{Approved, Disconnected, Pending, Rejected, Timeout} +} + +// 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" + // ProvisioningStateUnknown ... + ProvisioningStateUnknown ProvisioningState = "Unknown" + // 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, ProvisioningStateUnknown, ProvisioningStateUpdating} +} + +// QuotaUnit enumerates the values for quota unit. +type QuotaUnit string + +const ( + // Count ... + Count QuotaUnit = "Count" +) + +// PossibleQuotaUnitValues returns an array of possible values for the QuotaUnit const type. +func PossibleQuotaUnitValues() []QuotaUnit { + return []QuotaUnit{Count} +} + +// ReasonCode enumerates the values for reason code. +type ReasonCode string + +const ( + // NotAvailableForRegion ... + NotAvailableForRegion ReasonCode = "NotAvailableForRegion" + // NotAvailableForSubscription ... + NotAvailableForSubscription ReasonCode = "NotAvailableForSubscription" + // NotSpecified ... + NotSpecified ReasonCode = "NotSpecified" +) + +// PossibleReasonCodeValues returns an array of possible values for the ReasonCode const type. +func PossibleReasonCodeValues() []ReasonCode { + return []ReasonCode{NotAvailableForRegion, NotAvailableForSubscription, NotSpecified} +} + +// RemoteLoginPortPublicAccess enumerates the values for remote login port public access. +type RemoteLoginPortPublicAccess string + +const ( + // RemoteLoginPortPublicAccessDisabled ... + RemoteLoginPortPublicAccessDisabled RemoteLoginPortPublicAccess = "Disabled" + // RemoteLoginPortPublicAccessEnabled ... + RemoteLoginPortPublicAccessEnabled RemoteLoginPortPublicAccess = "Enabled" + // RemoteLoginPortPublicAccessNotSpecified ... + RemoteLoginPortPublicAccessNotSpecified RemoteLoginPortPublicAccess = "NotSpecified" +) + +// PossibleRemoteLoginPortPublicAccessValues returns an array of possible values for the RemoteLoginPortPublicAccess const type. +func PossibleRemoteLoginPortPublicAccessValues() []RemoteLoginPortPublicAccess { + return []RemoteLoginPortPublicAccess{RemoteLoginPortPublicAccessDisabled, RemoteLoginPortPublicAccessEnabled, RemoteLoginPortPublicAccessNotSpecified} +} + +// ResourceIdentityType enumerates the values for resource identity type. +type ResourceIdentityType string + +const ( + // None ... + None ResourceIdentityType = "None" + // SystemAssigned ... + SystemAssigned ResourceIdentityType = "SystemAssigned" + // SystemAssignedUserAssigned ... + SystemAssignedUserAssigned ResourceIdentityType = "SystemAssigned, UserAssigned" + // UserAssigned ... + UserAssigned ResourceIdentityType = "UserAssigned" +) + +// PossibleResourceIdentityTypeValues returns an array of possible values for the ResourceIdentityType const type. +func PossibleResourceIdentityTypeValues() []ResourceIdentityType { + return []ResourceIdentityType{None, SystemAssigned, SystemAssignedUserAssigned, UserAssigned} +} + +// Status enumerates the values for status. +type Status string + +const ( + // Failure ... + Failure Status = "Failure" + // InvalidQuotaBelowClusterMinimum ... + InvalidQuotaBelowClusterMinimum Status = "InvalidQuotaBelowClusterMinimum" + // InvalidQuotaExceedsSubscriptionLimit ... + InvalidQuotaExceedsSubscriptionLimit Status = "InvalidQuotaExceedsSubscriptionLimit" + // InvalidVMFamilyName ... + InvalidVMFamilyName Status = "InvalidVMFamilyName" + // OperationNotEnabledForRegion ... + OperationNotEnabledForRegion Status = "OperationNotEnabledForRegion" + // OperationNotSupportedForSku ... + OperationNotSupportedForSku Status = "OperationNotSupportedForSku" + // Success ... + Success Status = "Success" + // Undefined ... + Undefined Status = "Undefined" +) + +// PossibleStatusValues returns an array of possible values for the Status const type. +func PossibleStatusValues() []Status { + return []Status{Failure, InvalidQuotaBelowClusterMinimum, InvalidQuotaExceedsSubscriptionLimit, InvalidVMFamilyName, OperationNotEnabledForRegion, OperationNotSupportedForSku, Success, Undefined} +} + +// Status1 enumerates the values for status 1. +type Status1 string + +const ( + // Status1Disabled ... + Status1Disabled Status1 = "Disabled" + // Status1Enabled ... + Status1Enabled Status1 = "Enabled" +) + +// PossibleStatus1Values returns an array of possible values for the Status1 const type. +func PossibleStatus1Values() []Status1 { + return []Status1{Status1Disabled, Status1Enabled} +} + +// UnderlyingResourceAction enumerates the values for underlying resource action. +type UnderlyingResourceAction string + +const ( + // Delete ... + Delete UnderlyingResourceAction = "Delete" + // Detach ... + Detach UnderlyingResourceAction = "Detach" +) + +// PossibleUnderlyingResourceActionValues returns an array of possible values for the UnderlyingResourceAction const type. +func PossibleUnderlyingResourceActionValues() []UnderlyingResourceAction { + return []UnderlyingResourceAction{Delete, Detach} +} + +// 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} +} + +// VMPriority enumerates the values for vm priority. +type VMPriority string + +const ( + // Dedicated ... + Dedicated VMPriority = "Dedicated" + // LowPriority ... + LowPriority VMPriority = "LowPriority" +) + +// PossibleVMPriorityValues returns an array of possible values for the VMPriority const type. +func PossibleVMPriorityValues() []VMPriority { + return []VMPriority{Dedicated, LowPriority} +} + +// AKS a Machine Learning compute based on AKS. +type AKS struct { + // Properties - AKS properties + Properties *AKSProperties `json:"properties,omitempty"` + // ComputeLocation - Location for the underlying compute + ComputeLocation *string `json:"computeLocation,omitempty"` + // ProvisioningState - READ-ONLY; The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. Possible values include: 'ProvisioningStateUnknown', 'ProvisioningStateUpdating', 'ProvisioningStateCreating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // Description - The description of the Machine Learning compute. + Description *string `json:"description,omitempty"` + // CreatedOn - READ-ONLY; The date and time when the compute was created. + CreatedOn *date.Time `json:"createdOn,omitempty"` + // ModifiedOn - READ-ONLY; The date and time when the compute was last modified. + ModifiedOn *date.Time `json:"modifiedOn,omitempty"` + // ResourceID - ARM resource id of the underlying compute + ResourceID *string `json:"resourceId,omitempty"` + // ProvisioningErrors - READ-ONLY; Errors during provisioning + ProvisioningErrors *[]Error `json:"provisioningErrors,omitempty"` + // IsAttachedCompute - READ-ONLY; Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning service provisioned it if false. + IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"` + // ComputeType - Possible values include: 'ComputeTypeCompute', 'ComputeTypeAKS1', 'ComputeTypeAmlCompute1', 'ComputeTypeVirtualMachine1', 'ComputeTypeHDInsight1', 'ComputeTypeDataFactory1', 'ComputeTypeDatabricks1', 'ComputeTypeDataLakeAnalytics1' + ComputeType ComputeTypeBasicCompute `json:"computeType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AKS. +func (a AKS) MarshalJSON() ([]byte, error) { + a.ComputeType = ComputeTypeAKS1 + objectMap := make(map[string]interface{}) + if a.Properties != nil { + objectMap["properties"] = a.Properties + } + if a.ComputeLocation != nil { + objectMap["computeLocation"] = a.ComputeLocation + } + if a.Description != nil { + objectMap["description"] = a.Description + } + if a.ResourceID != nil { + objectMap["resourceId"] = a.ResourceID + } + if a.ComputeType != "" { + objectMap["computeType"] = a.ComputeType + } + return json.Marshal(objectMap) +} + +// AsAKS is the BasicCompute implementation for AKS. +func (a AKS) AsAKS() (*AKS, bool) { + return &a, true +} + +// AsAmlCompute is the BasicCompute implementation for AKS. +func (a AKS) AsAmlCompute() (*AmlCompute, bool) { + return nil, false +} + +// AsVirtualMachine is the BasicCompute implementation for AKS. +func (a AKS) AsVirtualMachine() (*VirtualMachine, bool) { + return nil, false +} + +// AsHDInsight is the BasicCompute implementation for AKS. +func (a AKS) AsHDInsight() (*HDInsight, bool) { + return nil, false +} + +// AsDataFactory is the BasicCompute implementation for AKS. +func (a AKS) AsDataFactory() (*DataFactory, bool) { + return nil, false +} + +// AsDatabricks is the BasicCompute implementation for AKS. +func (a AKS) AsDatabricks() (*Databricks, bool) { + return nil, false +} + +// AsDataLakeAnalytics is the BasicCompute implementation for AKS. +func (a AKS) AsDataLakeAnalytics() (*DataLakeAnalytics, bool) { + return nil, false +} + +// AsCompute is the BasicCompute implementation for AKS. +func (a AKS) AsCompute() (*Compute, bool) { + return nil, false +} + +// AsBasicCompute is the BasicCompute implementation for AKS. +func (a AKS) AsBasicCompute() (BasicCompute, bool) { + return &a, true +} + +// AksComputeSecrets secrets related to a Machine Learning compute based on AKS. +type AksComputeSecrets struct { + // UserKubeConfig - Content of kubeconfig file that can be used to connect to the Kubernetes cluster. + UserKubeConfig *string `json:"userKubeConfig,omitempty"` + // AdminKubeConfig - Content of kubeconfig file that can be used to connect to the Kubernetes cluster. + AdminKubeConfig *string `json:"adminKubeConfig,omitempty"` + // ImagePullSecretName - Image registry pull secret. + ImagePullSecretName *string `json:"imagePullSecretName,omitempty"` + // ComputeType - Possible values include: 'ComputeTypeBasicComputeSecretsComputeTypeComputeSecrets', 'ComputeTypeBasicComputeSecretsComputeTypeAKS', 'ComputeTypeBasicComputeSecretsComputeTypeVirtualMachine', 'ComputeTypeBasicComputeSecretsComputeTypeDatabricks' + ComputeType ComputeTypeBasicComputeSecrets `json:"computeType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AksComputeSecrets. +func (acs AksComputeSecrets) MarshalJSON() ([]byte, error) { + acs.ComputeType = ComputeTypeBasicComputeSecretsComputeTypeAKS + objectMap := make(map[string]interface{}) + if acs.UserKubeConfig != nil { + objectMap["userKubeConfig"] = acs.UserKubeConfig + } + if acs.AdminKubeConfig != nil { + objectMap["adminKubeConfig"] = acs.AdminKubeConfig + } + if acs.ImagePullSecretName != nil { + objectMap["imagePullSecretName"] = acs.ImagePullSecretName + } + if acs.ComputeType != "" { + objectMap["computeType"] = acs.ComputeType + } + return json.Marshal(objectMap) +} + +// AsAksComputeSecrets is the BasicComputeSecrets implementation for AksComputeSecrets. +func (acs AksComputeSecrets) AsAksComputeSecrets() (*AksComputeSecrets, bool) { + return &acs, true +} + +// AsVirtualMachineSecrets is the BasicComputeSecrets implementation for AksComputeSecrets. +func (acs AksComputeSecrets) AsVirtualMachineSecrets() (*VirtualMachineSecrets, bool) { + return nil, false +} + +// AsDatabricksComputeSecrets is the BasicComputeSecrets implementation for AksComputeSecrets. +func (acs AksComputeSecrets) AsDatabricksComputeSecrets() (*DatabricksComputeSecrets, bool) { + return nil, false +} + +// AsComputeSecrets is the BasicComputeSecrets implementation for AksComputeSecrets. +func (acs AksComputeSecrets) AsComputeSecrets() (*ComputeSecrets, bool) { + return nil, false +} + +// AsBasicComputeSecrets is the BasicComputeSecrets implementation for AksComputeSecrets. +func (acs AksComputeSecrets) AsBasicComputeSecrets() (BasicComputeSecrets, bool) { + return &acs, true +} + +// AksNetworkingConfiguration advance configuration for AKS networking +type AksNetworkingConfiguration struct { + // SubnetID - Virtual network subnet resource ID the compute nodes belong to + SubnetID *string `json:"subnetId,omitempty"` + // ServiceCidr - A CIDR notation IP range from which to assign service cluster IPs. It must not overlap with any Subnet IP ranges. + ServiceCidr *string `json:"serviceCidr,omitempty"` + // DNSServiceIP - An IP address assigned to the Kubernetes DNS service. It must be within the Kubernetes service address range specified in serviceCidr. + DNSServiceIP *string `json:"dnsServiceIP,omitempty"` + // DockerBridgeCidr - A CIDR notation IP range assigned to the Docker bridge network. It must not overlap with any Subnet IP ranges or the Kubernetes service address range. + DockerBridgeCidr *string `json:"dockerBridgeCidr,omitempty"` +} + +// AKSProperties AKS properties +type AKSProperties struct { + // ClusterFqdn - Cluster full qualified domain name + ClusterFqdn *string `json:"clusterFqdn,omitempty"` + // SystemServices - READ-ONLY; System services + SystemServices *[]SystemService `json:"systemServices,omitempty"` + // AgentCount - Number of agents + AgentCount *int32 `json:"agentCount,omitempty"` + // AgentVMSize - Agent virtual machine size + AgentVMSize *string `json:"agentVMSize,omitempty"` + // SslConfiguration - SSL configuration + SslConfiguration *SslConfiguration `json:"sslConfiguration,omitempty"` + // AksNetworkingConfiguration - AKS networking configuration for vnet + AksNetworkingConfiguration *AksNetworkingConfiguration `json:"aksNetworkingConfiguration,omitempty"` +} + +// AmlCompute an Azure Machine Learning compute. +type AmlCompute struct { + // Properties - AML Compute properties + Properties *AmlComputeProperties `json:"properties,omitempty"` + // ComputeLocation - Location for the underlying compute + ComputeLocation *string `json:"computeLocation,omitempty"` + // ProvisioningState - READ-ONLY; The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. Possible values include: 'ProvisioningStateUnknown', 'ProvisioningStateUpdating', 'ProvisioningStateCreating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // Description - The description of the Machine Learning compute. + Description *string `json:"description,omitempty"` + // CreatedOn - READ-ONLY; The date and time when the compute was created. + CreatedOn *date.Time `json:"createdOn,omitempty"` + // ModifiedOn - READ-ONLY; The date and time when the compute was last modified. + ModifiedOn *date.Time `json:"modifiedOn,omitempty"` + // ResourceID - ARM resource id of the underlying compute + ResourceID *string `json:"resourceId,omitempty"` + // ProvisioningErrors - READ-ONLY; Errors during provisioning + ProvisioningErrors *[]Error `json:"provisioningErrors,omitempty"` + // IsAttachedCompute - READ-ONLY; Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning service provisioned it if false. + IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"` + // ComputeType - Possible values include: 'ComputeTypeCompute', 'ComputeTypeAKS1', 'ComputeTypeAmlCompute1', 'ComputeTypeVirtualMachine1', 'ComputeTypeHDInsight1', 'ComputeTypeDataFactory1', 'ComputeTypeDatabricks1', 'ComputeTypeDataLakeAnalytics1' + ComputeType ComputeTypeBasicCompute `json:"computeType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AmlCompute. +func (ac AmlCompute) MarshalJSON() ([]byte, error) { + ac.ComputeType = ComputeTypeAmlCompute1 + objectMap := make(map[string]interface{}) + if ac.Properties != nil { + objectMap["properties"] = ac.Properties + } + if ac.ComputeLocation != nil { + objectMap["computeLocation"] = ac.ComputeLocation + } + if ac.Description != nil { + objectMap["description"] = ac.Description + } + if ac.ResourceID != nil { + objectMap["resourceId"] = ac.ResourceID + } + if ac.ComputeType != "" { + objectMap["computeType"] = ac.ComputeType + } + return json.Marshal(objectMap) +} + +// AsAKS is the BasicCompute implementation for AmlCompute. +func (ac AmlCompute) AsAKS() (*AKS, bool) { + return nil, false +} + +// AsAmlCompute is the BasicCompute implementation for AmlCompute. +func (ac AmlCompute) AsAmlCompute() (*AmlCompute, bool) { + return &ac, true +} + +// AsVirtualMachine is the BasicCompute implementation for AmlCompute. +func (ac AmlCompute) AsVirtualMachine() (*VirtualMachine, bool) { + return nil, false +} + +// AsHDInsight is the BasicCompute implementation for AmlCompute. +func (ac AmlCompute) AsHDInsight() (*HDInsight, bool) { + return nil, false +} + +// AsDataFactory is the BasicCompute implementation for AmlCompute. +func (ac AmlCompute) AsDataFactory() (*DataFactory, bool) { + return nil, false +} + +// AsDatabricks is the BasicCompute implementation for AmlCompute. +func (ac AmlCompute) AsDatabricks() (*Databricks, bool) { + return nil, false +} + +// AsDataLakeAnalytics is the BasicCompute implementation for AmlCompute. +func (ac AmlCompute) AsDataLakeAnalytics() (*DataLakeAnalytics, bool) { + return nil, false +} + +// AsCompute is the BasicCompute implementation for AmlCompute. +func (ac AmlCompute) AsCompute() (*Compute, bool) { + return nil, false +} + +// AsBasicCompute is the BasicCompute implementation for AmlCompute. +func (ac AmlCompute) AsBasicCompute() (BasicCompute, bool) { + return &ac, true +} + +// AmlComputeNodeInformation compute node information related to a AmlCompute. +type AmlComputeNodeInformation struct { + // NodeID - READ-ONLY; ID of the compute node. + NodeID *string `json:"nodeId,omitempty"` + // PrivateIPAddress - READ-ONLY; Private IP address of the compute node. + PrivateIPAddress *string `json:"privateIpAddress,omitempty"` + // PublicIPAddress - READ-ONLY; Public IP address of the compute node. + PublicIPAddress *string `json:"publicIpAddress,omitempty"` + // Port - READ-ONLY; SSH port number of the node. + Port *float64 `json:"port,omitempty"` + // NodeState - READ-ONLY; State of the compute node. Values are idle, running, preparing, unusable, leaving and preempted. Possible values include: 'Idle', 'Running', 'Preparing', 'Unusable', 'Leaving', 'Preempted' + NodeState NodeState `json:"nodeState,omitempty"` + // RunID - READ-ONLY; ID of the Experiment running on the node, if any else null. + RunID *string `json:"runId,omitempty"` +} + +// AmlComputeNodesInformation compute node information related to a AmlCompute. +type AmlComputeNodesInformation struct { + autorest.Response `json:"-"` + // Nodes - READ-ONLY; The collection of returned AmlCompute nodes details. + Nodes *[]AmlComputeNodeInformation `json:"nodes,omitempty"` + // NextLink - READ-ONLY; The continuation token. + NextLink *string `json:"nextLink,omitempty"` + // ComputeType - Possible values include: 'ComputeTypeBasicComputeNodesInformationComputeTypeComputeNodesInformation', 'ComputeTypeBasicComputeNodesInformationComputeTypeAmlCompute' + ComputeType ComputeTypeBasicComputeNodesInformation `json:"computeType,omitempty"` +} + +// MarshalJSON is the custom marshaler for AmlComputeNodesInformation. +func (acni AmlComputeNodesInformation) MarshalJSON() ([]byte, error) { + acni.ComputeType = ComputeTypeBasicComputeNodesInformationComputeTypeAmlCompute + objectMap := make(map[string]interface{}) + if acni.ComputeType != "" { + objectMap["computeType"] = acni.ComputeType + } + return json.Marshal(objectMap) +} + +// AsAmlComputeNodesInformation is the BasicComputeNodesInformation implementation for AmlComputeNodesInformation. +func (acni AmlComputeNodesInformation) AsAmlComputeNodesInformation() (*AmlComputeNodesInformation, bool) { + return &acni, true +} + +// AsComputeNodesInformation is the BasicComputeNodesInformation implementation for AmlComputeNodesInformation. +func (acni AmlComputeNodesInformation) AsComputeNodesInformation() (*ComputeNodesInformation, bool) { + return nil, false +} + +// AsBasicComputeNodesInformation is the BasicComputeNodesInformation implementation for AmlComputeNodesInformation. +func (acni AmlComputeNodesInformation) AsBasicComputeNodesInformation() (BasicComputeNodesInformation, bool) { + return &acni, true +} + +// AmlComputeProperties AML Compute properties +type AmlComputeProperties struct { + // VMSize - Virtual Machine Size + VMSize *string `json:"vmSize,omitempty"` + // VMPriority - Virtual Machine priority. Possible values include: 'Dedicated', 'LowPriority' + VMPriority VMPriority `json:"vmPriority,omitempty"` + // ScaleSettings - Scale settings for AML Compute + ScaleSettings *ScaleSettings `json:"scaleSettings,omitempty"` + // UserAccountCredentials - Credentials for an administrator user account that will be created on each compute node. + UserAccountCredentials *UserAccountCredentials `json:"userAccountCredentials,omitempty"` + // Subnet - Virtual network subnet resource ID the compute nodes belong to. + Subnet *ResourceID `json:"subnet,omitempty"` + // RemoteLoginPortPublicAccess - State of the public SSH port. Possible values are: Disabled - Indicates that the public ssh port is closed on all nodes of the cluster. Enabled - Indicates that the public ssh port is open on all nodes of the cluster. NotSpecified - Indicates that the public ssh port is closed on all nodes of the cluster if VNet is defined, else is open all public nodes. It can be default only during cluster creation time, after creation it will be either enabled or disabled. Possible values include: 'RemoteLoginPortPublicAccessEnabled', 'RemoteLoginPortPublicAccessDisabled', 'RemoteLoginPortPublicAccessNotSpecified' + RemoteLoginPortPublicAccess RemoteLoginPortPublicAccess `json:"remoteLoginPortPublicAccess,omitempty"` + // AllocationState - READ-ONLY; Allocation state of the compute. Possible values are: steady - Indicates that the compute is not resizing. There are no changes to the number of compute nodes in the compute in progress. A compute enters this state when it is created and when no operations are being performed on the compute to change the number of compute nodes. resizing - Indicates that the compute is resizing; that is, compute nodes are being added to or removed from the compute. Possible values include: 'Steady', 'Resizing' + AllocationState AllocationState `json:"allocationState,omitempty"` + // AllocationStateTransitionTime - READ-ONLY; The time at which the compute entered its current allocation state. + AllocationStateTransitionTime *date.Time `json:"allocationStateTransitionTime,omitempty"` + // Errors - READ-ONLY; Collection of errors encountered by various compute nodes during node setup. + Errors *[]Error `json:"errors,omitempty"` + // CurrentNodeCount - READ-ONLY; The number of compute nodes currently assigned to the compute. + CurrentNodeCount *int32 `json:"currentNodeCount,omitempty"` + // TargetNodeCount - READ-ONLY; The target number of compute nodes for the compute. If the allocationState is resizing, this property denotes the target node count for the ongoing resize operation. If the allocationState is steady, this property denotes the target node count for the previous resize operation. + TargetNodeCount *int32 `json:"targetNodeCount,omitempty"` + // NodeStateCounts - READ-ONLY; Counts of various node states on the compute. + NodeStateCounts *NodeStateCounts `json:"nodeStateCounts,omitempty"` +} + +// AmlUserFeature features enabled for a workspace +type AmlUserFeature struct { + // ID - Specifies the feature ID + ID *string `json:"id,omitempty"` + // DisplayName - Specifies the feature name + DisplayName *string `json:"displayName,omitempty"` + // Description - Describes the feature for user experience + Description *string `json:"description,omitempty"` +} + +// ClusterUpdateParameters amlCompute update parameters. +type ClusterUpdateParameters struct { + // ClusterUpdateProperties - The properties of the amlCompute. + *ClusterUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ClusterUpdateParameters. +func (cup ClusterUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cup.ClusterUpdateProperties != nil { + objectMap["properties"] = cup.ClusterUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ClusterUpdateParameters struct. +func (cup *ClusterUpdateParameters) 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 clusterUpdateProperties ClusterUpdateProperties + err = json.Unmarshal(*v, &clusterUpdateProperties) + if err != nil { + return err + } + cup.ClusterUpdateProperties = &clusterUpdateProperties + } + } + } + + return nil +} + +// ClusterUpdateProperties the properties of a amlCompute that need to be updated. +type ClusterUpdateProperties struct { + // ScaleSettings - Desired scale settings for the amlCompute. + ScaleSettings *ScaleSettings `json:"scaleSettings,omitempty"` +} + +// BasicCompute machine Learning compute object. +type BasicCompute interface { + AsAKS() (*AKS, bool) + AsAmlCompute() (*AmlCompute, bool) + AsVirtualMachine() (*VirtualMachine, bool) + AsHDInsight() (*HDInsight, bool) + AsDataFactory() (*DataFactory, bool) + AsDatabricks() (*Databricks, bool) + AsDataLakeAnalytics() (*DataLakeAnalytics, bool) + AsCompute() (*Compute, bool) +} + +// Compute machine Learning compute object. +type Compute struct { + // ComputeLocation - Location for the underlying compute + ComputeLocation *string `json:"computeLocation,omitempty"` + // ProvisioningState - READ-ONLY; The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. Possible values include: 'ProvisioningStateUnknown', 'ProvisioningStateUpdating', 'ProvisioningStateCreating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // Description - The description of the Machine Learning compute. + Description *string `json:"description,omitempty"` + // CreatedOn - READ-ONLY; The date and time when the compute was created. + CreatedOn *date.Time `json:"createdOn,omitempty"` + // ModifiedOn - READ-ONLY; The date and time when the compute was last modified. + ModifiedOn *date.Time `json:"modifiedOn,omitempty"` + // ResourceID - ARM resource id of the underlying compute + ResourceID *string `json:"resourceId,omitempty"` + // ProvisioningErrors - READ-ONLY; Errors during provisioning + ProvisioningErrors *[]Error `json:"provisioningErrors,omitempty"` + // IsAttachedCompute - READ-ONLY; Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning service provisioned it if false. + IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"` + // ComputeType - Possible values include: 'ComputeTypeCompute', 'ComputeTypeAKS1', 'ComputeTypeAmlCompute1', 'ComputeTypeVirtualMachine1', 'ComputeTypeHDInsight1', 'ComputeTypeDataFactory1', 'ComputeTypeDatabricks1', 'ComputeTypeDataLakeAnalytics1' + ComputeType ComputeTypeBasicCompute `json:"computeType,omitempty"` +} + +func unmarshalBasicCompute(body []byte) (BasicCompute, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["computeType"] { + case string(ComputeTypeAKS1): + var a AKS + err := json.Unmarshal(body, &a) + return a, err + case string(ComputeTypeAmlCompute1): + var ac AmlCompute + err := json.Unmarshal(body, &ac) + return ac, err + case string(ComputeTypeVirtualMachine1): + var VM VirtualMachine + err := json.Unmarshal(body, &VM) + return VM, err + case string(ComputeTypeHDInsight1): + var hi HDInsight + err := json.Unmarshal(body, &hi) + return hi, err + case string(ComputeTypeDataFactory1): + var df DataFactory + err := json.Unmarshal(body, &df) + return df, err + case string(ComputeTypeDatabricks1): + var d Databricks + err := json.Unmarshal(body, &d) + return d, err + case string(ComputeTypeDataLakeAnalytics1): + var dla DataLakeAnalytics + err := json.Unmarshal(body, &dla) + return dla, err + default: + var c Compute + err := json.Unmarshal(body, &c) + return c, err + } +} +func unmarshalBasicComputeArray(body []byte) ([]BasicCompute, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + cArray := make([]BasicCompute, len(rawMessages)) + + for index, rawMessage := range rawMessages { + c, err := unmarshalBasicCompute(*rawMessage) + if err != nil { + return nil, err + } + cArray[index] = c + } + return cArray, nil +} + +// MarshalJSON is the custom marshaler for Compute. +func (c Compute) MarshalJSON() ([]byte, error) { + c.ComputeType = ComputeTypeCompute + objectMap := make(map[string]interface{}) + if c.ComputeLocation != nil { + objectMap["computeLocation"] = c.ComputeLocation + } + if c.Description != nil { + objectMap["description"] = c.Description + } + if c.ResourceID != nil { + objectMap["resourceId"] = c.ResourceID + } + if c.ComputeType != "" { + objectMap["computeType"] = c.ComputeType + } + return json.Marshal(objectMap) +} + +// AsAKS is the BasicCompute implementation for Compute. +func (c Compute) AsAKS() (*AKS, bool) { + return nil, false +} + +// AsAmlCompute is the BasicCompute implementation for Compute. +func (c Compute) AsAmlCompute() (*AmlCompute, bool) { + return nil, false +} + +// AsVirtualMachine is the BasicCompute implementation for Compute. +func (c Compute) AsVirtualMachine() (*VirtualMachine, bool) { + return nil, false +} + +// AsHDInsight is the BasicCompute implementation for Compute. +func (c Compute) AsHDInsight() (*HDInsight, bool) { + return nil, false +} + +// AsDataFactory is the BasicCompute implementation for Compute. +func (c Compute) AsDataFactory() (*DataFactory, bool) { + return nil, false +} + +// AsDatabricks is the BasicCompute implementation for Compute. +func (c Compute) AsDatabricks() (*Databricks, bool) { + return nil, false +} + +// AsDataLakeAnalytics is the BasicCompute implementation for Compute. +func (c Compute) AsDataLakeAnalytics() (*DataLakeAnalytics, bool) { + return nil, false +} + +// AsCompute is the BasicCompute implementation for Compute. +func (c Compute) AsCompute() (*Compute, bool) { + return &c, true +} + +// AsBasicCompute is the BasicCompute implementation for Compute. +func (c Compute) AsBasicCompute() (BasicCompute, bool) { + return &c, true +} + +// BasicComputeNodesInformation compute nodes information related to a Machine Learning compute. Might differ for every +// type of compute. +type BasicComputeNodesInformation interface { + AsAmlComputeNodesInformation() (*AmlComputeNodesInformation, bool) + AsComputeNodesInformation() (*ComputeNodesInformation, bool) +} + +// ComputeNodesInformation compute nodes information related to a Machine Learning compute. Might differ for +// every type of compute. +type ComputeNodesInformation struct { + // NextLink - READ-ONLY; The continuation token. + NextLink *string `json:"nextLink,omitempty"` + // ComputeType - Possible values include: 'ComputeTypeBasicComputeNodesInformationComputeTypeComputeNodesInformation', 'ComputeTypeBasicComputeNodesInformationComputeTypeAmlCompute' + ComputeType ComputeTypeBasicComputeNodesInformation `json:"computeType,omitempty"` +} + +func unmarshalBasicComputeNodesInformation(body []byte) (BasicComputeNodesInformation, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["computeType"] { + case string(ComputeTypeBasicComputeNodesInformationComputeTypeAmlCompute): + var acni AmlComputeNodesInformation + err := json.Unmarshal(body, &acni) + return acni, err + default: + var cni ComputeNodesInformation + err := json.Unmarshal(body, &cni) + return cni, err + } +} +func unmarshalBasicComputeNodesInformationArray(body []byte) ([]BasicComputeNodesInformation, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + cniArray := make([]BasicComputeNodesInformation, len(rawMessages)) + + for index, rawMessage := range rawMessages { + cni, err := unmarshalBasicComputeNodesInformation(*rawMessage) + if err != nil { + return nil, err + } + cniArray[index] = cni + } + return cniArray, nil +} + +// MarshalJSON is the custom marshaler for ComputeNodesInformation. +func (cni ComputeNodesInformation) MarshalJSON() ([]byte, error) { + cni.ComputeType = ComputeTypeBasicComputeNodesInformationComputeTypeComputeNodesInformation + objectMap := make(map[string]interface{}) + if cni.ComputeType != "" { + objectMap["computeType"] = cni.ComputeType + } + return json.Marshal(objectMap) +} + +// AsAmlComputeNodesInformation is the BasicComputeNodesInformation implementation for ComputeNodesInformation. +func (cni ComputeNodesInformation) AsAmlComputeNodesInformation() (*AmlComputeNodesInformation, bool) { + return nil, false +} + +// AsComputeNodesInformation is the BasicComputeNodesInformation implementation for ComputeNodesInformation. +func (cni ComputeNodesInformation) AsComputeNodesInformation() (*ComputeNodesInformation, bool) { + return &cni, true +} + +// AsBasicComputeNodesInformation is the BasicComputeNodesInformation implementation for ComputeNodesInformation. +func (cni ComputeNodesInformation) AsBasicComputeNodesInformation() (BasicComputeNodesInformation, bool) { + return &cni, true +} + +// ComputeResource machine Learning compute object wrapped into ARM resource envelope. +type ComputeResource struct { + autorest.Response `json:"-"` + // Properties - Compute properties + Properties BasicCompute `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"` + // Identity - The identity of the resource. + Identity *Identity `json:"identity,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 - The sku of the workspace. + Sku *Sku `json:"sku,omitempty"` +} + +// MarshalJSON is the custom marshaler for ComputeResource. +func (cr ComputeResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["properties"] = cr.Properties + if cr.Identity != nil { + objectMap["identity"] = cr.Identity + } + if cr.Location != nil { + objectMap["location"] = cr.Location + } + if cr.Tags != nil { + objectMap["tags"] = cr.Tags + } + if cr.Sku != nil { + objectMap["sku"] = cr.Sku + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ComputeResource struct. +func (cr *ComputeResource) 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 { + properties, err := unmarshalBasicCompute(*v) + if err != nil { + return err + } + cr.Properties = properties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + cr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + cr.Name = &name + } + case "identity": + if v != nil { + var identity Identity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + cr.Identity = &identity + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + cr.Location = &location + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + cr.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + cr.Tags = tags + } + case "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + cr.Sku = &sku + } + } + } + + return nil +} + +// BasicComputeSecrets secrets related to a Machine Learning compute. Might differ for every type of compute. +type BasicComputeSecrets interface { + AsAksComputeSecrets() (*AksComputeSecrets, bool) + AsVirtualMachineSecrets() (*VirtualMachineSecrets, bool) + AsDatabricksComputeSecrets() (*DatabricksComputeSecrets, bool) + AsComputeSecrets() (*ComputeSecrets, bool) +} + +// ComputeSecrets secrets related to a Machine Learning compute. Might differ for every type of compute. +type ComputeSecrets struct { + autorest.Response `json:"-"` + // ComputeType - Possible values include: 'ComputeTypeBasicComputeSecretsComputeTypeComputeSecrets', 'ComputeTypeBasicComputeSecretsComputeTypeAKS', 'ComputeTypeBasicComputeSecretsComputeTypeVirtualMachine', 'ComputeTypeBasicComputeSecretsComputeTypeDatabricks' + ComputeType ComputeTypeBasicComputeSecrets `json:"computeType,omitempty"` +} + +func unmarshalBasicComputeSecrets(body []byte) (BasicComputeSecrets, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["computeType"] { + case string(ComputeTypeBasicComputeSecretsComputeTypeAKS): + var acs AksComputeSecrets + err := json.Unmarshal(body, &acs) + return acs, err + case string(ComputeTypeBasicComputeSecretsComputeTypeVirtualMachine): + var vms VirtualMachineSecrets + err := json.Unmarshal(body, &vms) + return vms, err + case string(ComputeTypeBasicComputeSecretsComputeTypeDatabricks): + var dcs DatabricksComputeSecrets + err := json.Unmarshal(body, &dcs) + return dcs, err + default: + var cs ComputeSecrets + err := json.Unmarshal(body, &cs) + return cs, err + } +} +func unmarshalBasicComputeSecretsArray(body []byte) ([]BasicComputeSecrets, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + csArray := make([]BasicComputeSecrets, len(rawMessages)) + + for index, rawMessage := range rawMessages { + cs, err := unmarshalBasicComputeSecrets(*rawMessage) + if err != nil { + return nil, err + } + csArray[index] = cs + } + return csArray, nil +} + +// MarshalJSON is the custom marshaler for ComputeSecrets. +func (cs ComputeSecrets) MarshalJSON() ([]byte, error) { + cs.ComputeType = ComputeTypeBasicComputeSecretsComputeTypeComputeSecrets + objectMap := make(map[string]interface{}) + if cs.ComputeType != "" { + objectMap["computeType"] = cs.ComputeType + } + return json.Marshal(objectMap) +} + +// AsAksComputeSecrets is the BasicComputeSecrets implementation for ComputeSecrets. +func (cs ComputeSecrets) AsAksComputeSecrets() (*AksComputeSecrets, bool) { + return nil, false +} + +// AsVirtualMachineSecrets is the BasicComputeSecrets implementation for ComputeSecrets. +func (cs ComputeSecrets) AsVirtualMachineSecrets() (*VirtualMachineSecrets, bool) { + return nil, false +} + +// AsDatabricksComputeSecrets is the BasicComputeSecrets implementation for ComputeSecrets. +func (cs ComputeSecrets) AsDatabricksComputeSecrets() (*DatabricksComputeSecrets, bool) { + return nil, false +} + +// AsComputeSecrets is the BasicComputeSecrets implementation for ComputeSecrets. +func (cs ComputeSecrets) AsComputeSecrets() (*ComputeSecrets, bool) { + return &cs, true +} + +// AsBasicComputeSecrets is the BasicComputeSecrets implementation for ComputeSecrets. +func (cs ComputeSecrets) AsBasicComputeSecrets() (BasicComputeSecrets, bool) { + return &cs, true +} + +// ComputeSecretsModel ... +type ComputeSecretsModel struct { + autorest.Response `json:"-"` + Value BasicComputeSecrets `json:"value,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for ComputeSecretsModel struct. +func (csm *ComputeSecretsModel) UnmarshalJSON(body []byte) error { + cs, err := unmarshalBasicComputeSecrets(body) + if err != nil { + return err + } + csm.Value = cs + + return nil +} + +// Databricks a DataFactory compute. +type Databricks struct { + Properties *DatabricksProperties `json:"properties,omitempty"` + // ComputeLocation - Location for the underlying compute + ComputeLocation *string `json:"computeLocation,omitempty"` + // ProvisioningState - READ-ONLY; The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. Possible values include: 'ProvisioningStateUnknown', 'ProvisioningStateUpdating', 'ProvisioningStateCreating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // Description - The description of the Machine Learning compute. + Description *string `json:"description,omitempty"` + // CreatedOn - READ-ONLY; The date and time when the compute was created. + CreatedOn *date.Time `json:"createdOn,omitempty"` + // ModifiedOn - READ-ONLY; The date and time when the compute was last modified. + ModifiedOn *date.Time `json:"modifiedOn,omitempty"` + // ResourceID - ARM resource id of the underlying compute + ResourceID *string `json:"resourceId,omitempty"` + // ProvisioningErrors - READ-ONLY; Errors during provisioning + ProvisioningErrors *[]Error `json:"provisioningErrors,omitempty"` + // IsAttachedCompute - READ-ONLY; Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning service provisioned it if false. + IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"` + // ComputeType - Possible values include: 'ComputeTypeCompute', 'ComputeTypeAKS1', 'ComputeTypeAmlCompute1', 'ComputeTypeVirtualMachine1', 'ComputeTypeHDInsight1', 'ComputeTypeDataFactory1', 'ComputeTypeDatabricks1', 'ComputeTypeDataLakeAnalytics1' + ComputeType ComputeTypeBasicCompute `json:"computeType,omitempty"` +} + +// MarshalJSON is the custom marshaler for Databricks. +func (d Databricks) MarshalJSON() ([]byte, error) { + d.ComputeType = ComputeTypeDatabricks1 + objectMap := make(map[string]interface{}) + if d.Properties != nil { + objectMap["properties"] = d.Properties + } + if d.ComputeLocation != nil { + objectMap["computeLocation"] = d.ComputeLocation + } + if d.Description != nil { + objectMap["description"] = d.Description + } + if d.ResourceID != nil { + objectMap["resourceId"] = d.ResourceID + } + if d.ComputeType != "" { + objectMap["computeType"] = d.ComputeType + } + return json.Marshal(objectMap) +} + +// AsAKS is the BasicCompute implementation for Databricks. +func (d Databricks) AsAKS() (*AKS, bool) { + return nil, false +} + +// AsAmlCompute is the BasicCompute implementation for Databricks. +func (d Databricks) AsAmlCompute() (*AmlCompute, bool) { + return nil, false +} + +// AsVirtualMachine is the BasicCompute implementation for Databricks. +func (d Databricks) AsVirtualMachine() (*VirtualMachine, bool) { + return nil, false +} + +// AsHDInsight is the BasicCompute implementation for Databricks. +func (d Databricks) AsHDInsight() (*HDInsight, bool) { + return nil, false +} + +// AsDataFactory is the BasicCompute implementation for Databricks. +func (d Databricks) AsDataFactory() (*DataFactory, bool) { + return nil, false +} + +// AsDatabricks is the BasicCompute implementation for Databricks. +func (d Databricks) AsDatabricks() (*Databricks, bool) { + return &d, true +} + +// AsDataLakeAnalytics is the BasicCompute implementation for Databricks. +func (d Databricks) AsDataLakeAnalytics() (*DataLakeAnalytics, bool) { + return nil, false +} + +// AsCompute is the BasicCompute implementation for Databricks. +func (d Databricks) AsCompute() (*Compute, bool) { + return nil, false +} + +// AsBasicCompute is the BasicCompute implementation for Databricks. +func (d Databricks) AsBasicCompute() (BasicCompute, bool) { + return &d, true +} + +// DatabricksComputeSecrets secrets related to a Machine Learning compute based on Databricks. +type DatabricksComputeSecrets struct { + // DatabricksAccessToken - access token for databricks account. + DatabricksAccessToken *string `json:"databricksAccessToken,omitempty"` + // ComputeType - Possible values include: 'ComputeTypeBasicComputeSecretsComputeTypeComputeSecrets', 'ComputeTypeBasicComputeSecretsComputeTypeAKS', 'ComputeTypeBasicComputeSecretsComputeTypeVirtualMachine', 'ComputeTypeBasicComputeSecretsComputeTypeDatabricks' + ComputeType ComputeTypeBasicComputeSecrets `json:"computeType,omitempty"` +} + +// MarshalJSON is the custom marshaler for DatabricksComputeSecrets. +func (dcs DatabricksComputeSecrets) MarshalJSON() ([]byte, error) { + dcs.ComputeType = ComputeTypeBasicComputeSecretsComputeTypeDatabricks + objectMap := make(map[string]interface{}) + if dcs.DatabricksAccessToken != nil { + objectMap["databricksAccessToken"] = dcs.DatabricksAccessToken + } + if dcs.ComputeType != "" { + objectMap["computeType"] = dcs.ComputeType + } + return json.Marshal(objectMap) +} + +// AsAksComputeSecrets is the BasicComputeSecrets implementation for DatabricksComputeSecrets. +func (dcs DatabricksComputeSecrets) AsAksComputeSecrets() (*AksComputeSecrets, bool) { + return nil, false +} + +// AsVirtualMachineSecrets is the BasicComputeSecrets implementation for DatabricksComputeSecrets. +func (dcs DatabricksComputeSecrets) AsVirtualMachineSecrets() (*VirtualMachineSecrets, bool) { + return nil, false +} + +// AsDatabricksComputeSecrets is the BasicComputeSecrets implementation for DatabricksComputeSecrets. +func (dcs DatabricksComputeSecrets) AsDatabricksComputeSecrets() (*DatabricksComputeSecrets, bool) { + return &dcs, true +} + +// AsComputeSecrets is the BasicComputeSecrets implementation for DatabricksComputeSecrets. +func (dcs DatabricksComputeSecrets) AsComputeSecrets() (*ComputeSecrets, bool) { + return nil, false +} + +// AsBasicComputeSecrets is the BasicComputeSecrets implementation for DatabricksComputeSecrets. +func (dcs DatabricksComputeSecrets) AsBasicComputeSecrets() (BasicComputeSecrets, bool) { + return &dcs, true +} + +// DatabricksProperties ... +type DatabricksProperties struct { + // DatabricksAccessToken - Databricks access token + DatabricksAccessToken *string `json:"databricksAccessToken,omitempty"` +} + +// DataFactory a DataFactory compute. +type DataFactory struct { + // ComputeLocation - Location for the underlying compute + ComputeLocation *string `json:"computeLocation,omitempty"` + // ProvisioningState - READ-ONLY; The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. Possible values include: 'ProvisioningStateUnknown', 'ProvisioningStateUpdating', 'ProvisioningStateCreating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // Description - The description of the Machine Learning compute. + Description *string `json:"description,omitempty"` + // CreatedOn - READ-ONLY; The date and time when the compute was created. + CreatedOn *date.Time `json:"createdOn,omitempty"` + // ModifiedOn - READ-ONLY; The date and time when the compute was last modified. + ModifiedOn *date.Time `json:"modifiedOn,omitempty"` + // ResourceID - ARM resource id of the underlying compute + ResourceID *string `json:"resourceId,omitempty"` + // ProvisioningErrors - READ-ONLY; Errors during provisioning + ProvisioningErrors *[]Error `json:"provisioningErrors,omitempty"` + // IsAttachedCompute - READ-ONLY; Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning service provisioned it if false. + IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"` + // ComputeType - Possible values include: 'ComputeTypeCompute', 'ComputeTypeAKS1', 'ComputeTypeAmlCompute1', 'ComputeTypeVirtualMachine1', 'ComputeTypeHDInsight1', 'ComputeTypeDataFactory1', 'ComputeTypeDatabricks1', 'ComputeTypeDataLakeAnalytics1' + ComputeType ComputeTypeBasicCompute `json:"computeType,omitempty"` +} + +// MarshalJSON is the custom marshaler for DataFactory. +func (df DataFactory) MarshalJSON() ([]byte, error) { + df.ComputeType = ComputeTypeDataFactory1 + objectMap := make(map[string]interface{}) + if df.ComputeLocation != nil { + objectMap["computeLocation"] = df.ComputeLocation + } + if df.Description != nil { + objectMap["description"] = df.Description + } + if df.ResourceID != nil { + objectMap["resourceId"] = df.ResourceID + } + if df.ComputeType != "" { + objectMap["computeType"] = df.ComputeType + } + return json.Marshal(objectMap) +} + +// AsAKS is the BasicCompute implementation for DataFactory. +func (df DataFactory) AsAKS() (*AKS, bool) { + return nil, false +} + +// AsAmlCompute is the BasicCompute implementation for DataFactory. +func (df DataFactory) AsAmlCompute() (*AmlCompute, bool) { + return nil, false +} + +// AsVirtualMachine is the BasicCompute implementation for DataFactory. +func (df DataFactory) AsVirtualMachine() (*VirtualMachine, bool) { + return nil, false +} + +// AsHDInsight is the BasicCompute implementation for DataFactory. +func (df DataFactory) AsHDInsight() (*HDInsight, bool) { + return nil, false +} + +// AsDataFactory is the BasicCompute implementation for DataFactory. +func (df DataFactory) AsDataFactory() (*DataFactory, bool) { + return &df, true +} + +// AsDatabricks is the BasicCompute implementation for DataFactory. +func (df DataFactory) AsDatabricks() (*Databricks, bool) { + return nil, false +} + +// AsDataLakeAnalytics is the BasicCompute implementation for DataFactory. +func (df DataFactory) AsDataLakeAnalytics() (*DataLakeAnalytics, bool) { + return nil, false +} + +// AsCompute is the BasicCompute implementation for DataFactory. +func (df DataFactory) AsCompute() (*Compute, bool) { + return nil, false +} + +// AsBasicCompute is the BasicCompute implementation for DataFactory. +func (df DataFactory) AsBasicCompute() (BasicCompute, bool) { + return &df, true +} + +// DataLakeAnalytics a DataLakeAnalytics compute. +type DataLakeAnalytics struct { + Properties *DataLakeAnalyticsProperties `json:"properties,omitempty"` + // ComputeLocation - Location for the underlying compute + ComputeLocation *string `json:"computeLocation,omitempty"` + // ProvisioningState - READ-ONLY; The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. Possible values include: 'ProvisioningStateUnknown', 'ProvisioningStateUpdating', 'ProvisioningStateCreating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // Description - The description of the Machine Learning compute. + Description *string `json:"description,omitempty"` + // CreatedOn - READ-ONLY; The date and time when the compute was created. + CreatedOn *date.Time `json:"createdOn,omitempty"` + // ModifiedOn - READ-ONLY; The date and time when the compute was last modified. + ModifiedOn *date.Time `json:"modifiedOn,omitempty"` + // ResourceID - ARM resource id of the underlying compute + ResourceID *string `json:"resourceId,omitempty"` + // ProvisioningErrors - READ-ONLY; Errors during provisioning + ProvisioningErrors *[]Error `json:"provisioningErrors,omitempty"` + // IsAttachedCompute - READ-ONLY; Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning service provisioned it if false. + IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"` + // ComputeType - Possible values include: 'ComputeTypeCompute', 'ComputeTypeAKS1', 'ComputeTypeAmlCompute1', 'ComputeTypeVirtualMachine1', 'ComputeTypeHDInsight1', 'ComputeTypeDataFactory1', 'ComputeTypeDatabricks1', 'ComputeTypeDataLakeAnalytics1' + ComputeType ComputeTypeBasicCompute `json:"computeType,omitempty"` +} + +// MarshalJSON is the custom marshaler for DataLakeAnalytics. +func (dla DataLakeAnalytics) MarshalJSON() ([]byte, error) { + dla.ComputeType = ComputeTypeDataLakeAnalytics1 + objectMap := make(map[string]interface{}) + if dla.Properties != nil { + objectMap["properties"] = dla.Properties + } + if dla.ComputeLocation != nil { + objectMap["computeLocation"] = dla.ComputeLocation + } + if dla.Description != nil { + objectMap["description"] = dla.Description + } + if dla.ResourceID != nil { + objectMap["resourceId"] = dla.ResourceID + } + if dla.ComputeType != "" { + objectMap["computeType"] = dla.ComputeType + } + return json.Marshal(objectMap) +} + +// AsAKS is the BasicCompute implementation for DataLakeAnalytics. +func (dla DataLakeAnalytics) AsAKS() (*AKS, bool) { + return nil, false +} + +// AsAmlCompute is the BasicCompute implementation for DataLakeAnalytics. +func (dla DataLakeAnalytics) AsAmlCompute() (*AmlCompute, bool) { + return nil, false +} + +// AsVirtualMachine is the BasicCompute implementation for DataLakeAnalytics. +func (dla DataLakeAnalytics) AsVirtualMachine() (*VirtualMachine, bool) { + return nil, false +} + +// AsHDInsight is the BasicCompute implementation for DataLakeAnalytics. +func (dla DataLakeAnalytics) AsHDInsight() (*HDInsight, bool) { + return nil, false +} + +// AsDataFactory is the BasicCompute implementation for DataLakeAnalytics. +func (dla DataLakeAnalytics) AsDataFactory() (*DataFactory, bool) { + return nil, false +} + +// AsDatabricks is the BasicCompute implementation for DataLakeAnalytics. +func (dla DataLakeAnalytics) AsDatabricks() (*Databricks, bool) { + return nil, false +} + +// AsDataLakeAnalytics is the BasicCompute implementation for DataLakeAnalytics. +func (dla DataLakeAnalytics) AsDataLakeAnalytics() (*DataLakeAnalytics, bool) { + return &dla, true +} + +// AsCompute is the BasicCompute implementation for DataLakeAnalytics. +func (dla DataLakeAnalytics) AsCompute() (*Compute, bool) { + return nil, false +} + +// AsBasicCompute is the BasicCompute implementation for DataLakeAnalytics. +func (dla DataLakeAnalytics) AsBasicCompute() (BasicCompute, bool) { + return &dla, true +} + +// DataLakeAnalyticsProperties ... +type DataLakeAnalyticsProperties struct { + // DataLakeStoreAccountName - DataLake Store Account Name + DataLakeStoreAccountName *string `json:"dataLakeStoreAccountName,omitempty"` +} + +// EncryptionProperty ... +type EncryptionProperty struct { + // Status - Indicates whether or not the encryption is enabled for the workspace. Possible values include: 'Enabled', 'Disabled' + Status EncryptionStatus `json:"status,omitempty"` + // KeyVaultProperties - Customer Key vault properties. + KeyVaultProperties *KeyVaultProperties `json:"keyVaultProperties,omitempty"` +} + +// Error wrapper for error response to follow ARM guidelines. +type Error struct { + // Error - READ-ONLY; The error response. + Error *ErrorResponse `json:"error,omitempty"` +} + +// ErrorDetail error detail information. +type ErrorDetail struct { + // Code - Error code. + Code *string `json:"code,omitempty"` + // Message - Error message. + Message *string `json:"message,omitempty"` +} + +// ErrorResponse error response information. +type ErrorResponse struct { + // Code - READ-ONLY; Error code. + Code *string `json:"code,omitempty"` + // Message - READ-ONLY; Error message. + Message *string `json:"message,omitempty"` + // Details - READ-ONLY; An array of error detail objects. + Details *[]ErrorDetail `json:"details,omitempty"` +} + +// HDInsight a HDInsight compute. +type HDInsight struct { + Properties *HDInsightProperties `json:"properties,omitempty"` + // ComputeLocation - Location for the underlying compute + ComputeLocation *string `json:"computeLocation,omitempty"` + // ProvisioningState - READ-ONLY; The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. Possible values include: 'ProvisioningStateUnknown', 'ProvisioningStateUpdating', 'ProvisioningStateCreating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // Description - The description of the Machine Learning compute. + Description *string `json:"description,omitempty"` + // CreatedOn - READ-ONLY; The date and time when the compute was created. + CreatedOn *date.Time `json:"createdOn,omitempty"` + // ModifiedOn - READ-ONLY; The date and time when the compute was last modified. + ModifiedOn *date.Time `json:"modifiedOn,omitempty"` + // ResourceID - ARM resource id of the underlying compute + ResourceID *string `json:"resourceId,omitempty"` + // ProvisioningErrors - READ-ONLY; Errors during provisioning + ProvisioningErrors *[]Error `json:"provisioningErrors,omitempty"` + // IsAttachedCompute - READ-ONLY; Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning service provisioned it if false. + IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"` + // ComputeType - Possible values include: 'ComputeTypeCompute', 'ComputeTypeAKS1', 'ComputeTypeAmlCompute1', 'ComputeTypeVirtualMachine1', 'ComputeTypeHDInsight1', 'ComputeTypeDataFactory1', 'ComputeTypeDatabricks1', 'ComputeTypeDataLakeAnalytics1' + ComputeType ComputeTypeBasicCompute `json:"computeType,omitempty"` +} + +// MarshalJSON is the custom marshaler for HDInsight. +func (hi HDInsight) MarshalJSON() ([]byte, error) { + hi.ComputeType = ComputeTypeHDInsight1 + objectMap := make(map[string]interface{}) + if hi.Properties != nil { + objectMap["properties"] = hi.Properties + } + if hi.ComputeLocation != nil { + objectMap["computeLocation"] = hi.ComputeLocation + } + if hi.Description != nil { + objectMap["description"] = hi.Description + } + if hi.ResourceID != nil { + objectMap["resourceId"] = hi.ResourceID + } + if hi.ComputeType != "" { + objectMap["computeType"] = hi.ComputeType + } + return json.Marshal(objectMap) +} + +// AsAKS is the BasicCompute implementation for HDInsight. +func (hi HDInsight) AsAKS() (*AKS, bool) { + return nil, false +} + +// AsAmlCompute is the BasicCompute implementation for HDInsight. +func (hi HDInsight) AsAmlCompute() (*AmlCompute, bool) { + return nil, false +} + +// AsVirtualMachine is the BasicCompute implementation for HDInsight. +func (hi HDInsight) AsVirtualMachine() (*VirtualMachine, bool) { + return nil, false +} + +// AsHDInsight is the BasicCompute implementation for HDInsight. +func (hi HDInsight) AsHDInsight() (*HDInsight, bool) { + return &hi, true +} + +// AsDataFactory is the BasicCompute implementation for HDInsight. +func (hi HDInsight) AsDataFactory() (*DataFactory, bool) { + return nil, false +} + +// AsDatabricks is the BasicCompute implementation for HDInsight. +func (hi HDInsight) AsDatabricks() (*Databricks, bool) { + return nil, false +} + +// AsDataLakeAnalytics is the BasicCompute implementation for HDInsight. +func (hi HDInsight) AsDataLakeAnalytics() (*DataLakeAnalytics, bool) { + return nil, false +} + +// AsCompute is the BasicCompute implementation for HDInsight. +func (hi HDInsight) AsCompute() (*Compute, bool) { + return nil, false +} + +// AsBasicCompute is the BasicCompute implementation for HDInsight. +func (hi HDInsight) AsBasicCompute() (BasicCompute, bool) { + return &hi, true +} + +// HDInsightProperties ... +type HDInsightProperties struct { + // SSHPort - Port open for ssh connections on the master node of the cluster. + SSHPort *int32 `json:"sshPort,omitempty"` + // Address - Public IP address of the master node of the cluster. + Address *string `json:"address,omitempty"` + // AdministratorAccount - Admin credentials for master node of the cluster + AdministratorAccount *VirtualMachineSSHCredentials `json:"administratorAccount,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: 'SystemAssigned', 'UserAssigned', 'SystemAssignedUserAssigned', 'None' + Type ResourceIdentityType `json:"type,omitempty"` + // UserAssignedIdentities - The list of user identities associated with 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]*IdentityUserAssignedIdentitiesValue `json:"userAssignedIdentities"` +} + +// 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 + } + if i.UserAssignedIdentities != nil { + objectMap["userAssignedIdentities"] = i.UserAssignedIdentities + } + return json.Marshal(objectMap) +} + +// IdentityUserAssignedIdentitiesValue ... +type IdentityUserAssignedIdentitiesValue struct { + // PrincipalID - READ-ONLY; The principal id of user assigned identity. + PrincipalID *string `json:"principalId,omitempty"` + // ClientID - READ-ONLY; The client id of user assigned identity. + ClientID *string `json:"clientId,omitempty"` +} + +// KeyVaultProperties ... +type KeyVaultProperties struct { + // KeyVaultArmID - The ArmId of the keyVault where the customer owned encryption key is present. + KeyVaultArmID *string `json:"keyVaultArmId,omitempty"` + // KeyIdentifier - Key vault uri to access the encryption key. + KeyIdentifier *string `json:"keyIdentifier,omitempty"` + // IdentityClientID - For future use - The client id of the identity which will be used to access key vault. + IdentityClientID *string `json:"identityClientId,omitempty"` +} + +// ListAmlUserFeatureResult the List Aml user feature operation response. +type ListAmlUserFeatureResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of AML user facing features. + Value *[]AmlUserFeature `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page of AML user features information. Call ListNext() with this to fetch the next page of AML user features information. + NextLink *string `json:"nextLink,omitempty"` +} + +// ListAmlUserFeatureResultIterator provides access to a complete listing of AmlUserFeature values. +type ListAmlUserFeatureResultIterator struct { + i int + page ListAmlUserFeatureResultPage +} + +// 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 *ListAmlUserFeatureResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ListAmlUserFeatureResultIterator.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 *ListAmlUserFeatureResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ListAmlUserFeatureResultIterator) 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 ListAmlUserFeatureResultIterator) Response() ListAmlUserFeatureResult { + 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 ListAmlUserFeatureResultIterator) Value() AmlUserFeature { + if !iter.page.NotDone() { + return AmlUserFeature{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ListAmlUserFeatureResultIterator type. +func NewListAmlUserFeatureResultIterator(page ListAmlUserFeatureResultPage) ListAmlUserFeatureResultIterator { + return ListAmlUserFeatureResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (laufr ListAmlUserFeatureResult) IsEmpty() bool { + return laufr.Value == nil || len(*laufr.Value) == 0 +} + +// listAmlUserFeatureResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (laufr ListAmlUserFeatureResult) listAmlUserFeatureResultPreparer(ctx context.Context) (*http.Request, error) { + if laufr.NextLink == nil || len(to.String(laufr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(laufr.NextLink))) +} + +// ListAmlUserFeatureResultPage contains a page of AmlUserFeature values. +type ListAmlUserFeatureResultPage struct { + fn func(context.Context, ListAmlUserFeatureResult) (ListAmlUserFeatureResult, error) + laufr ListAmlUserFeatureResult +} + +// 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 *ListAmlUserFeatureResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ListAmlUserFeatureResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.laufr) + if err != nil { + return err + } + page.laufr = next + 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 *ListAmlUserFeatureResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ListAmlUserFeatureResultPage) NotDone() bool { + return !page.laufr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ListAmlUserFeatureResultPage) Response() ListAmlUserFeatureResult { + return page.laufr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ListAmlUserFeatureResultPage) Values() []AmlUserFeature { + if page.laufr.IsEmpty() { + return nil + } + return *page.laufr.Value +} + +// Creates a new instance of the ListAmlUserFeatureResultPage type. +func NewListAmlUserFeatureResultPage(getNextPage func(context.Context, ListAmlUserFeatureResult) (ListAmlUserFeatureResult, error)) ListAmlUserFeatureResultPage { + return ListAmlUserFeatureResultPage{fn: getNextPage} +} + +// ListUsagesResult the List Usages operation response. +type ListUsagesResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of AML resource usages. + Value *[]Usage `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page of AML resource usage information. Call ListNext() with this to fetch the next page of AML resource usage information. + NextLink *string `json:"nextLink,omitempty"` +} + +// 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 +} + +// 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.NextLink == nil || len(to.String(lur.NextLink)) < 1 { + 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) + }() + } + next, err := page.fn(ctx, page.lur) + if err != nil { + return err + } + page.lur = next + 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(getNextPage func(context.Context, ListUsagesResult) (ListUsagesResult, error)) ListUsagesResultPage { + return ListUsagesResultPage{fn: getNextPage} +} + +// ListWorkspaceKeysResult ... +type ListWorkspaceKeysResult struct { + autorest.Response `json:"-"` + // UserStorageKey - READ-ONLY + UserStorageKey *string `json:"userStorageKey,omitempty"` + // UserStorageResourceID - READ-ONLY + UserStorageResourceID *string `json:"userStorageResourceId,omitempty"` + // AppInsightsInstrumentationKey - READ-ONLY + AppInsightsInstrumentationKey *string `json:"appInsightsInstrumentationKey,omitempty"` + // ContainerRegistryCredentials - READ-ONLY + ContainerRegistryCredentials *RegistryListCredentialsResult `json:"containerRegistryCredentials,omitempty"` +} + +// ListWorkspaceQuotas the List WorkspaceQuotasByVMFamily operation response. +type ListWorkspaceQuotas struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of Workspace Quotas by VM Family + Value *[]ResourceQuota `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page of workspace quota information by VM Family. Call ListNext() with this to fetch the next page of Workspace Quota information. + NextLink *string `json:"nextLink,omitempty"` +} + +// ListWorkspaceQuotasIterator provides access to a complete listing of ResourceQuota values. +type ListWorkspaceQuotasIterator struct { + i int + page ListWorkspaceQuotasPage +} + +// 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 *ListWorkspaceQuotasIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ListWorkspaceQuotasIterator.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 *ListWorkspaceQuotasIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ListWorkspaceQuotasIterator) 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 ListWorkspaceQuotasIterator) Response() ListWorkspaceQuotas { + 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 ListWorkspaceQuotasIterator) Value() ResourceQuota { + if !iter.page.NotDone() { + return ResourceQuota{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ListWorkspaceQuotasIterator type. +func NewListWorkspaceQuotasIterator(page ListWorkspaceQuotasPage) ListWorkspaceQuotasIterator { + return ListWorkspaceQuotasIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (lwq ListWorkspaceQuotas) IsEmpty() bool { + return lwq.Value == nil || len(*lwq.Value) == 0 +} + +// listWorkspaceQuotasPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (lwq ListWorkspaceQuotas) listWorkspaceQuotasPreparer(ctx context.Context) (*http.Request, error) { + if lwq.NextLink == nil || len(to.String(lwq.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(lwq.NextLink))) +} + +// ListWorkspaceQuotasPage contains a page of ResourceQuota values. +type ListWorkspaceQuotasPage struct { + fn func(context.Context, ListWorkspaceQuotas) (ListWorkspaceQuotas, error) + lwq ListWorkspaceQuotas +} + +// 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 *ListWorkspaceQuotasPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ListWorkspaceQuotasPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.lwq) + if err != nil { + return err + } + page.lwq = next + 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 *ListWorkspaceQuotasPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ListWorkspaceQuotasPage) NotDone() bool { + return !page.lwq.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ListWorkspaceQuotasPage) Response() ListWorkspaceQuotas { + return page.lwq +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ListWorkspaceQuotasPage) Values() []ResourceQuota { + if page.lwq.IsEmpty() { + return nil + } + return *page.lwq.Value +} + +// Creates a new instance of the ListWorkspaceQuotasPage type. +func NewListWorkspaceQuotasPage(getNextPage func(context.Context, ListWorkspaceQuotas) (ListWorkspaceQuotas, error)) ListWorkspaceQuotasPage { + return ListWorkspaceQuotasPage{fn: getNextPage} +} + +// MachineLearningComputeCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type MachineLearningComputeCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *MachineLearningComputeCreateOrUpdateFuture) Result(client MachineLearningComputeClient) (cr ComputeResource, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("machinelearningservices.MachineLearningComputeCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if cr.Response.Response, err = future.GetResult(sender); err == nil && cr.Response.Response.StatusCode != http.StatusNoContent { + cr, err = client.CreateOrUpdateResponder(cr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeCreateOrUpdateFuture", "Result", cr.Response.Response, "Failure responding to request") + } + } + return +} + +// MachineLearningComputeDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type MachineLearningComputeDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *MachineLearningComputeDeleteFuture) Result(client MachineLearningComputeClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("machinelearningservices.MachineLearningComputeDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// MachineLearningComputeUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type MachineLearningComputeUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *MachineLearningComputeUpdateFuture) Result(client MachineLearningComputeClient) (cr ComputeResource, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("machinelearningservices.MachineLearningComputeUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if cr.Response.Response, err = future.GetResult(sender); err == nil && cr.Response.Response.StatusCode != http.StatusNoContent { + cr, err = client.UpdateResponder(cr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.MachineLearningComputeUpdateFuture", "Result", cr.Response.Response, "Failure responding to request") + } + } + return +} + +// NodeStateCounts counts of various compute node states on the amlCompute. +type NodeStateCounts struct { + // IdleNodeCount - READ-ONLY; Number of compute nodes in idle state. + IdleNodeCount *int32 `json:"idleNodeCount,omitempty"` + // RunningNodeCount - READ-ONLY; Number of compute nodes which are running jobs. + RunningNodeCount *int32 `json:"runningNodeCount,omitempty"` + // PreparingNodeCount - READ-ONLY; Number of compute nodes which are being prepared. + PreparingNodeCount *int32 `json:"preparingNodeCount,omitempty"` + // UnusableNodeCount - READ-ONLY; Number of compute nodes which are in unusable state. + UnusableNodeCount *int32 `json:"unusableNodeCount,omitempty"` + // LeavingNodeCount - READ-ONLY; Number of compute nodes which are leaving the amlCompute. + LeavingNodeCount *int32 `json:"leavingNodeCount,omitempty"` + // PreemptedNodeCount - READ-ONLY; Number of compute nodes which are in preempted state. + PreemptedNodeCount *int32 `json:"preemptedNodeCount,omitempty"` +} + +// Operation azure Machine Learning workspace REST API operation +type Operation struct { + // Name - Operation name: {provider}/{resource}/{operation} + Name *string `json:"name,omitempty"` + // Display - Display name of operation + Display *OperationDisplay `json:"display,omitempty"` +} + +// OperationDisplay display name of operation +type OperationDisplay struct { + // Provider - The resource provider name: Microsoft.MachineLearningExperimentation + 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 an array of operations supported by the resource provider. +type OperationListResult struct { + autorest.Response `json:"-"` + // Value - List of AML workspace operations supported by the AML workspace resource provider. + Value *[]Operation `json:"value,omitempty"` +} + +// PaginatedComputeResourcesList paginated list of Machine Learning compute objects wrapped in ARM resource +// envelope. +type PaginatedComputeResourcesList struct { + autorest.Response `json:"-"` + // Value - An array of Machine Learning compute objects wrapped in ARM resource envelope. + Value *[]ComputeResource `json:"value,omitempty"` + // NextLink - A continuation link (absolute URI) to the next page of results in the list. + NextLink *string `json:"nextLink,omitempty"` +} + +// PaginatedComputeResourcesListIterator provides access to a complete listing of ComputeResource values. +type PaginatedComputeResourcesListIterator struct { + i int + page PaginatedComputeResourcesListPage +} + +// 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 *PaginatedComputeResourcesListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PaginatedComputeResourcesListIterator.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 *PaginatedComputeResourcesListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter PaginatedComputeResourcesListIterator) 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 PaginatedComputeResourcesListIterator) Response() PaginatedComputeResourcesList { + 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 PaginatedComputeResourcesListIterator) Value() ComputeResource { + if !iter.page.NotDone() { + return ComputeResource{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the PaginatedComputeResourcesListIterator type. +func NewPaginatedComputeResourcesListIterator(page PaginatedComputeResourcesListPage) PaginatedComputeResourcesListIterator { + return PaginatedComputeResourcesListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pcrl PaginatedComputeResourcesList) IsEmpty() bool { + return pcrl.Value == nil || len(*pcrl.Value) == 0 +} + +// paginatedComputeResourcesListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pcrl PaginatedComputeResourcesList) paginatedComputeResourcesListPreparer(ctx context.Context) (*http.Request, error) { + if pcrl.NextLink == nil || len(to.String(pcrl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pcrl.NextLink))) +} + +// PaginatedComputeResourcesListPage contains a page of ComputeResource values. +type PaginatedComputeResourcesListPage struct { + fn func(context.Context, PaginatedComputeResourcesList) (PaginatedComputeResourcesList, error) + pcrl PaginatedComputeResourcesList +} + +// 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 *PaginatedComputeResourcesListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PaginatedComputeResourcesListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.pcrl) + if err != nil { + return err + } + page.pcrl = next + 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 *PaginatedComputeResourcesListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page PaginatedComputeResourcesListPage) NotDone() bool { + return !page.pcrl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page PaginatedComputeResourcesListPage) Response() PaginatedComputeResourcesList { + return page.pcrl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page PaginatedComputeResourcesListPage) Values() []ComputeResource { + if page.pcrl.IsEmpty() { + return nil + } + return *page.pcrl.Value +} + +// Creates a new instance of the PaginatedComputeResourcesListPage type. +func NewPaginatedComputeResourcesListPage(getNextPage func(context.Context, PaginatedComputeResourcesList) (PaginatedComputeResourcesList, error)) PaginatedComputeResourcesListPage { + return PaginatedComputeResourcesListPage{fn: getNextPage} +} + +// Password ... +type Password struct { + // Name - READ-ONLY + Name *string `json:"name,omitempty"` + // Value - READ-ONLY + Value *string `json:"value,omitempty"` +} + +// PrivateEndpoint the Private Endpoint resource. +type PrivateEndpoint struct { + // ID - READ-ONLY; The ARM identifier for Private Endpoint + ID *string `json:"id,omitempty"` +} + +// PrivateEndpointConnection the Private Endpoint Connection resource. +type PrivateEndpointConnection struct { + autorest.Response `json:"-"` + // PrivateEndpointConnectionProperties - Resource properties. + *PrivateEndpointConnectionProperties `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"` + // Identity - The identity of the resource. + Identity *Identity `json:"identity,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 - The sku of the workspace. + Sku *Sku `json:"sku,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 + } + if pec.Identity != nil { + objectMap["identity"] = pec.Identity + } + if pec.Location != nil { + objectMap["location"] = pec.Location + } + if pec.Tags != nil { + objectMap["tags"] = pec.Tags + } + if pec.Sku != nil { + objectMap["sku"] = pec.Sku + } + 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 "identity": + if v != nil { + var identity Identity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + pec.Identity = &identity + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + pec.Location = &location + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pec.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + pec.Tags = tags + } + case "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + pec.Sku = &sku + } + } + } + + return nil +} + +// PrivateEndpointConnectionProperties properties of the PrivateEndpointConnectProperties. +type PrivateEndpointConnectionProperties struct { + // PrivateEndpoint - The resource of private end point. + 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 - The provisioning state of the private endpoint connection resource. Possible values include: 'Succeeded', 'Creating', 'Deleting', 'Failed' + ProvisioningState PrivateEndpointConnectionProvisioningState `json:"provisioningState,omitempty"` +} + +// PrivateLinkResource a private link resource +type PrivateLinkResource struct { + // PrivateLinkResourceProperties - Resource properties. + *PrivateLinkResourceProperties `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"` + // Identity - The identity of the resource. + Identity *Identity `json:"identity,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 - The sku of the workspace. + Sku *Sku `json:"sku,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateLinkResource. +func (plr PrivateLinkResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if plr.PrivateLinkResourceProperties != nil { + objectMap["properties"] = plr.PrivateLinkResourceProperties + } + if plr.Identity != nil { + objectMap["identity"] = plr.Identity + } + if plr.Location != nil { + objectMap["location"] = plr.Location + } + if plr.Tags != nil { + objectMap["tags"] = plr.Tags + } + if plr.Sku != nil { + objectMap["sku"] = plr.Sku + } + 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 "properties": + if v != nil { + var privateLinkResourceProperties PrivateLinkResourceProperties + err = json.Unmarshal(*v, &privateLinkResourceProperties) + if err != nil { + return err + } + plr.PrivateLinkResourceProperties = &privateLinkResourceProperties + } + 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 "identity": + if v != nil { + var identity Identity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + plr.Identity = &identity + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + plr.Location = &location + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + plr.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + plr.Tags = tags + } + case "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + plr.Sku = &sku + } + } + } + + return nil +} + +// PrivateLinkResourceListResult a list of private link resources +type PrivateLinkResourceListResult struct { + autorest.Response `json:"-"` + // Value - Array of private link resources + Value *[]PrivateLinkResource `json:"value,omitempty"` +} + +// PrivateLinkResourceProperties properties of a private link resource. +type PrivateLinkResourceProperties struct { + // GroupID - READ-ONLY; The private link resource group id. + GroupID *string `json:"groupId,omitempty"` + // RequiredMembers - READ-ONLY; 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 a collection of information about the state of the connection between +// service consumer and provider. +type PrivateLinkServiceConnectionState struct { + // Status - Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. Possible values include: 'Pending', 'Approved', 'Rejected', 'Disconnected', 'Timeout' + Status PrivateEndpointServiceConnectionStatus `json:"status,omitempty"` + // Description - The reason for approval/rejection of the connection. + Description *string `json:"description,omitempty"` + // ActionsRequired - A message indicating if changes on the service provider require any updates on the consumer. + ActionsRequired *string `json:"actionsRequired,omitempty"` +} + +// QuotaBaseProperties the properties for Quota update or retrieval. +type QuotaBaseProperties struct { + // ID - Specifies the resource ID. + ID *string `json:"id,omitempty"` + // Type - Specifies the resource type. + Type *string `json:"type,omitempty"` + // Limit - The maximum permitted quota of the resource. + Limit *int64 `json:"limit,omitempty"` + // Unit - An enum describing the unit of quota measurement. Possible values include: 'Count' + Unit QuotaUnit `json:"unit,omitempty"` +} + +// QuotaUpdateParameters quota update parameters. +type QuotaUpdateParameters struct { + // Value - The list for update quota. + Value *[]QuotaBaseProperties `json:"value,omitempty"` +} + +// RegistryListCredentialsResult ... +type RegistryListCredentialsResult struct { + // Location - READ-ONLY + Location *string `json:"location,omitempty"` + // Username - READ-ONLY + Username *string `json:"username,omitempty"` + Passwords *[]Password `json:"passwords,omitempty"` +} + +// Resource azure Resource Manager resource envelope. +type Resource struct { + // 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"` + // Identity - The identity of the resource. + Identity *Identity `json:"identity,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 - The sku of the workspace. + Sku *Sku `json:"sku,omitempty"` +} + +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.Identity != nil { + objectMap["identity"] = r.Identity + } + if r.Location != nil { + objectMap["location"] = r.Location + } + if r.Tags != nil { + objectMap["tags"] = r.Tags + } + if r.Sku != nil { + objectMap["sku"] = r.Sku + } + return json.Marshal(objectMap) +} + +// ResourceID represents a resource ID. For example, for a subnet, it is the resource URL for the subnet. +type ResourceID struct { + // ID - The ID of the resource + ID *string `json:"id,omitempty"` +} + +// ResourceName the Resource Name. +type ResourceName struct { + // Value - READ-ONLY; The name of the resource. + Value *string `json:"value,omitempty"` + // LocalizedValue - READ-ONLY; The localized name of the resource. + LocalizedValue *string `json:"localizedValue,omitempty"` +} + +// ResourceQuota the quota assigned to a resource. +type ResourceQuota struct { + // ID - READ-ONLY; Specifies the resource ID. + ID *string `json:"id,omitempty"` + // Type - READ-ONLY; Specifies the resource type. + Type *string `json:"type,omitempty"` + // Name - READ-ONLY; Name of the resource. + Name *ResourceName `json:"name,omitempty"` + // Limit - READ-ONLY; The maximum permitted quota of the resource. + Limit *int64 `json:"limit,omitempty"` + // Unit - READ-ONLY; An enum describing the unit of quota measurement. Possible values include: 'Count' + Unit QuotaUnit `json:"unit,omitempty"` +} + +// ResourceSkuLocationInfo ... +type ResourceSkuLocationInfo struct { + // Location - READ-ONLY; Location of the SKU + Location *string `json:"location,omitempty"` + // Zones - READ-ONLY; List of availability zones where the SKU is supported. + Zones *[]string `json:"zones,omitempty"` + // ZoneDetails - READ-ONLY; Details of capabilities available to a SKU in specific zones. + ZoneDetails *[]ResourceSkuZoneDetails `json:"zoneDetails,omitempty"` +} + +// ResourceSkuZoneDetails describes The zonal capabilities of a SKU. +type ResourceSkuZoneDetails struct { + // Name - READ-ONLY; The set of zones that the SKU is available in with the specified capabilities. + Name *[]string `json:"name,omitempty"` + // Capabilities - READ-ONLY; A list of capabilities that are available for the SKU in the specified list of zones. + Capabilities *[]SKUCapability `json:"capabilities,omitempty"` +} + +// Restriction the restriction because of which SKU cannot be used. +type Restriction struct { + // Type - READ-ONLY; The type of restrictions. As of now only possible value for this is location. + Type *string `json:"type,omitempty"` + // Values - READ-ONLY; The value of restrictions. If the restriction type is set to location. This would be different locations where the SKU is restricted. + Values *[]string `json:"values,omitempty"` + // ReasonCode - The reason for the restriction. Possible values include: 'NotSpecified', 'NotAvailableForRegion', 'NotAvailableForSubscription' + ReasonCode ReasonCode `json:"reasonCode,omitempty"` +} + +// ScaleSettings scale settings for AML Compute +type ScaleSettings struct { + // MaxNodeCount - Max number of nodes to use + MaxNodeCount *int32 `json:"maxNodeCount,omitempty"` + // MinNodeCount - Min number of nodes to use + MinNodeCount *int32 `json:"minNodeCount,omitempty"` + // NodeIdleTimeBeforeScaleDown - Node Idle Time before scaling down amlCompute + NodeIdleTimeBeforeScaleDown *string `json:"nodeIdleTimeBeforeScaleDown,omitempty"` +} + +// ServicePrincipalCredentials service principal credentials. +type ServicePrincipalCredentials struct { + // ClientID - Client Id + ClientID *string `json:"clientId,omitempty"` + // ClientSecret - Client secret + ClientSecret *string `json:"clientSecret,omitempty"` +} + +// SharedPrivateLinkResource ... +type SharedPrivateLinkResource struct { + // Name - Unique name of the private link. + Name *string `json:"name,omitempty"` + // SharedPrivateLinkResourceProperty - Resource properties. + *SharedPrivateLinkResourceProperty `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for SharedPrivateLinkResource. +func (splr SharedPrivateLinkResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if splr.Name != nil { + objectMap["name"] = splr.Name + } + if splr.SharedPrivateLinkResourceProperty != nil { + objectMap["properties"] = splr.SharedPrivateLinkResourceProperty + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SharedPrivateLinkResource struct. +func (splr *SharedPrivateLinkResource) 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 + } + splr.Name = &name + } + case "properties": + if v != nil { + var sharedPrivateLinkResourceProperty SharedPrivateLinkResourceProperty + err = json.Unmarshal(*v, &sharedPrivateLinkResourceProperty) + if err != nil { + return err + } + splr.SharedPrivateLinkResourceProperty = &sharedPrivateLinkResourceProperty + } + } + } + + return nil +} + +// SharedPrivateLinkResourceProperty properties of a shared private link resource. +type SharedPrivateLinkResourceProperty struct { + // PrivateLinkResourceID - The resource id that private link links to. + PrivateLinkResourceID *string `json:"privateLinkResourceId,omitempty"` + // GroupID - The private link resource group id. + GroupID *string `json:"groupId,omitempty"` + // RequestMessage - Request message. + RequestMessage *string `json:"requestMessage,omitempty"` + // Status - Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. Possible values include: 'Pending', 'Approved', 'Rejected', 'Disconnected', 'Timeout' + Status PrivateEndpointServiceConnectionStatus `json:"status,omitempty"` +} + +// Sku sku of the resource +type Sku struct { + // Name - Name of the sku + Name *string `json:"name,omitempty"` + // Tier - Tier of the sku like Basic or Enterprise + Tier *string `json:"tier,omitempty"` +} + +// SKUCapability features/user capabilities associated with the sku +type SKUCapability struct { + // Name - Capability/Feature ID + Name *string `json:"name,omitempty"` + // Value - Details about the feature/capability + Value *string `json:"value,omitempty"` +} + +// SkuListResult list of skus with features +type SkuListResult struct { + autorest.Response `json:"-"` + Value *[]WorkspaceSku `json:"value,omitempty"` + // NextLink - The URI to fetch the next page of Workspace Skus. Call ListNext() with this URI to fetch the next page of Workspace Skus + NextLink *string `json:"nextLink,omitempty"` +} + +// SkuListResultIterator provides access to a complete listing of WorkspaceSku values. +type SkuListResultIterator struct { + i int + page SkuListResultPage +} + +// 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 *SkuListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SkuListResultIterator.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 *SkuListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SkuListResultIterator) 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 SkuListResultIterator) Response() SkuListResult { + 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 SkuListResultIterator) Value() WorkspaceSku { + if !iter.page.NotDone() { + return WorkspaceSku{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the SkuListResultIterator type. +func NewSkuListResultIterator(page SkuListResultPage) SkuListResultIterator { + return SkuListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (slr SkuListResult) IsEmpty() bool { + return slr.Value == nil || len(*slr.Value) == 0 +} + +// skuListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (slr SkuListResult) skuListResultPreparer(ctx context.Context) (*http.Request, error) { + if slr.NextLink == nil || len(to.String(slr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(slr.NextLink))) +} + +// SkuListResultPage contains a page of WorkspaceSku values. +type SkuListResultPage struct { + fn func(context.Context, SkuListResult) (SkuListResult, error) + slr SkuListResult +} + +// 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 *SkuListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SkuListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.slr) + if err != nil { + return err + } + page.slr = next + 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 *SkuListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SkuListResultPage) NotDone() bool { + return !page.slr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SkuListResultPage) Response() SkuListResult { + return page.slr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SkuListResultPage) Values() []WorkspaceSku { + if page.slr.IsEmpty() { + return nil + } + return *page.slr.Value +} + +// Creates a new instance of the SkuListResultPage type. +func NewSkuListResultPage(getNextPage func(context.Context, SkuListResult) (SkuListResult, error)) SkuListResultPage { + return SkuListResultPage{fn: getNextPage} +} + +// SslConfiguration the ssl configuration for scoring +type SslConfiguration struct { + // Status - Enable or disable ssl for scoring. Possible values include: 'Status1Disabled', 'Status1Enabled' + Status Status1 `json:"status,omitempty"` + // Cert - Cert data + Cert *string `json:"cert,omitempty"` + // Key - Key data + Key *string `json:"key,omitempty"` + // Cname - CNAME of the cert + Cname *string `json:"cname,omitempty"` +} + +// SystemService a system service running on a compute. +type SystemService struct { + // SystemServiceType - READ-ONLY; The type of this system service. + SystemServiceType *string `json:"systemServiceType,omitempty"` + // PublicIPAddress - READ-ONLY; Public IP address + PublicIPAddress *string `json:"publicIpAddress,omitempty"` + // Version - READ-ONLY; The version for this type. + Version *string `json:"version,omitempty"` +} + +// UpdateWorkspaceQuotas the properties for update Quota response. +type UpdateWorkspaceQuotas struct { + // ID - READ-ONLY; Specifies the resource ID. + ID *string `json:"id,omitempty"` + // Type - READ-ONLY; Specifies the resource type. + Type *string `json:"type,omitempty"` + // Limit - The maximum permitted quota of the resource. + Limit *int64 `json:"limit,omitempty"` + // Unit - READ-ONLY; An enum describing the unit of quota measurement. Possible values include: 'Count' + Unit QuotaUnit `json:"unit,omitempty"` + // Status - Status of update workspace quota. Possible values include: 'Undefined', 'Success', 'Failure', 'InvalidQuotaBelowClusterMinimum', 'InvalidQuotaExceedsSubscriptionLimit', 'InvalidVMFamilyName', 'OperationNotSupportedForSku', 'OperationNotEnabledForRegion' + Status Status `json:"status,omitempty"` +} + +// UpdateWorkspaceQuotasResult the result of update workspace quota. +type UpdateWorkspaceQuotasResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of workspace quota update result. + Value *[]UpdateWorkspaceQuotas `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page of workspace quota update result. Call ListNext() with this to fetch the next page of Workspace Quota update result. + NextLink *string `json:"nextLink,omitempty"` +} + +// Usage describes AML Resource Usage. +type Usage struct { + // ID - READ-ONLY; Specifies the resource ID. + ID *string `json:"id,omitempty"` + // Type - READ-ONLY; Specifies the resource type. + Type *string `json:"type,omitempty"` + // Unit - READ-ONLY; An enum describing the unit of usage measurement. Possible values include: 'UsageUnitCount' + Unit UsageUnit `json:"unit,omitempty"` + // CurrentValue - READ-ONLY; The current usage of the resource. + CurrentValue *int64 `json:"currentValue,omitempty"` + // Limit - READ-ONLY; The maximum permitted usage of the resource. + Limit *int64 `json:"limit,omitempty"` + // Name - READ-ONLY; The name of the type of usage. + Name *UsageName `json:"name,omitempty"` +} + +// UsageName the Usage Names. +type UsageName struct { + // Value - READ-ONLY; The name of the resource. + Value *string `json:"value,omitempty"` + // LocalizedValue - READ-ONLY; The localized name of the resource. + LocalizedValue *string `json:"localizedValue,omitempty"` +} + +// UserAccountCredentials settings for user account that gets created on each on the nodes of a compute. +type UserAccountCredentials struct { + // AdminUserName - Name of the administrator user account which can be used to SSH to nodes. + AdminUserName *string `json:"adminUserName,omitempty"` + // AdminUserSSHPublicKey - SSH public key of the administrator user account. + AdminUserSSHPublicKey *string `json:"adminUserSshPublicKey,omitempty"` + // AdminUserPassword - Password of the administrator user account. + AdminUserPassword *string `json:"adminUserPassword,omitempty"` +} + +// VirtualMachine a Machine Learning compute based on Azure Virtual Machines. +type VirtualMachine struct { + Properties *VirtualMachineProperties `json:"properties,omitempty"` + // ComputeLocation - Location for the underlying compute + ComputeLocation *string `json:"computeLocation,omitempty"` + // ProvisioningState - READ-ONLY; The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed. Possible values include: 'ProvisioningStateUnknown', 'ProvisioningStateUpdating', 'ProvisioningStateCreating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // Description - The description of the Machine Learning compute. + Description *string `json:"description,omitempty"` + // CreatedOn - READ-ONLY; The date and time when the compute was created. + CreatedOn *date.Time `json:"createdOn,omitempty"` + // ModifiedOn - READ-ONLY; The date and time when the compute was last modified. + ModifiedOn *date.Time `json:"modifiedOn,omitempty"` + // ResourceID - ARM resource id of the underlying compute + ResourceID *string `json:"resourceId,omitempty"` + // ProvisioningErrors - READ-ONLY; Errors during provisioning + ProvisioningErrors *[]Error `json:"provisioningErrors,omitempty"` + // IsAttachedCompute - READ-ONLY; Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning service provisioned it if false. + IsAttachedCompute *bool `json:"isAttachedCompute,omitempty"` + // ComputeType - Possible values include: 'ComputeTypeCompute', 'ComputeTypeAKS1', 'ComputeTypeAmlCompute1', 'ComputeTypeVirtualMachine1', 'ComputeTypeHDInsight1', 'ComputeTypeDataFactory1', 'ComputeTypeDatabricks1', 'ComputeTypeDataLakeAnalytics1' + ComputeType ComputeTypeBasicCompute `json:"computeType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualMachine. +func (VM VirtualMachine) MarshalJSON() ([]byte, error) { + VM.ComputeType = ComputeTypeVirtualMachine1 + objectMap := make(map[string]interface{}) + if VM.Properties != nil { + objectMap["properties"] = VM.Properties + } + if VM.ComputeLocation != nil { + objectMap["computeLocation"] = VM.ComputeLocation + } + if VM.Description != nil { + objectMap["description"] = VM.Description + } + if VM.ResourceID != nil { + objectMap["resourceId"] = VM.ResourceID + } + if VM.ComputeType != "" { + objectMap["computeType"] = VM.ComputeType + } + return json.Marshal(objectMap) +} + +// AsAKS is the BasicCompute implementation for VirtualMachine. +func (VM VirtualMachine) AsAKS() (*AKS, bool) { + return nil, false +} + +// AsAmlCompute is the BasicCompute implementation for VirtualMachine. +func (VM VirtualMachine) AsAmlCompute() (*AmlCompute, bool) { + return nil, false +} + +// AsVirtualMachine is the BasicCompute implementation for VirtualMachine. +func (VM VirtualMachine) AsVirtualMachine() (*VirtualMachine, bool) { + return &VM, true +} + +// AsHDInsight is the BasicCompute implementation for VirtualMachine. +func (VM VirtualMachine) AsHDInsight() (*HDInsight, bool) { + return nil, false +} + +// AsDataFactory is the BasicCompute implementation for VirtualMachine. +func (VM VirtualMachine) AsDataFactory() (*DataFactory, bool) { + return nil, false +} + +// AsDatabricks is the BasicCompute implementation for VirtualMachine. +func (VM VirtualMachine) AsDatabricks() (*Databricks, bool) { + return nil, false +} + +// AsDataLakeAnalytics is the BasicCompute implementation for VirtualMachine. +func (VM VirtualMachine) AsDataLakeAnalytics() (*DataLakeAnalytics, bool) { + return nil, false +} + +// AsCompute is the BasicCompute implementation for VirtualMachine. +func (VM VirtualMachine) AsCompute() (*Compute, bool) { + return nil, false +} + +// AsBasicCompute is the BasicCompute implementation for VirtualMachine. +func (VM VirtualMachine) AsBasicCompute() (BasicCompute, bool) { + return &VM, true +} + +// VirtualMachineProperties ... +type VirtualMachineProperties struct { + // VirtualMachineSize - Virtual Machine size + VirtualMachineSize *string `json:"virtualMachineSize,omitempty"` + // SSHPort - Port open for ssh connections. + SSHPort *int32 `json:"sshPort,omitempty"` + // Address - Public IP address of the virtual machine. + Address *string `json:"address,omitempty"` + // AdministratorAccount - Admin credentials for virtual machine + AdministratorAccount *VirtualMachineSSHCredentials `json:"administratorAccount,omitempty"` +} + +// VirtualMachineSecrets secrets related to a Machine Learning compute based on AKS. +type VirtualMachineSecrets struct { + // AdministratorAccount - Admin credentials for virtual machine. + AdministratorAccount *VirtualMachineSSHCredentials `json:"administratorAccount,omitempty"` + // ComputeType - Possible values include: 'ComputeTypeBasicComputeSecretsComputeTypeComputeSecrets', 'ComputeTypeBasicComputeSecretsComputeTypeAKS', 'ComputeTypeBasicComputeSecretsComputeTypeVirtualMachine', 'ComputeTypeBasicComputeSecretsComputeTypeDatabricks' + ComputeType ComputeTypeBasicComputeSecrets `json:"computeType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineSecrets. +func (vms VirtualMachineSecrets) MarshalJSON() ([]byte, error) { + vms.ComputeType = ComputeTypeBasicComputeSecretsComputeTypeVirtualMachine + objectMap := make(map[string]interface{}) + if vms.AdministratorAccount != nil { + objectMap["administratorAccount"] = vms.AdministratorAccount + } + if vms.ComputeType != "" { + objectMap["computeType"] = vms.ComputeType + } + return json.Marshal(objectMap) +} + +// AsAksComputeSecrets is the BasicComputeSecrets implementation for VirtualMachineSecrets. +func (vms VirtualMachineSecrets) AsAksComputeSecrets() (*AksComputeSecrets, bool) { + return nil, false +} + +// AsVirtualMachineSecrets is the BasicComputeSecrets implementation for VirtualMachineSecrets. +func (vms VirtualMachineSecrets) AsVirtualMachineSecrets() (*VirtualMachineSecrets, bool) { + return &vms, true +} + +// AsDatabricksComputeSecrets is the BasicComputeSecrets implementation for VirtualMachineSecrets. +func (vms VirtualMachineSecrets) AsDatabricksComputeSecrets() (*DatabricksComputeSecrets, bool) { + return nil, false +} + +// AsComputeSecrets is the BasicComputeSecrets implementation for VirtualMachineSecrets. +func (vms VirtualMachineSecrets) AsComputeSecrets() (*ComputeSecrets, bool) { + return nil, false +} + +// AsBasicComputeSecrets is the BasicComputeSecrets implementation for VirtualMachineSecrets. +func (vms VirtualMachineSecrets) AsBasicComputeSecrets() (BasicComputeSecrets, bool) { + return &vms, true +} + +// VirtualMachineSize describes the properties of a VM size. +type VirtualMachineSize struct { + // Name - READ-ONLY; The name of the virtual machine size. + Name *string `json:"name,omitempty"` + // Family - READ-ONLY; The family name of the virtual machine size. + Family *string `json:"family,omitempty"` + // VCPUs - READ-ONLY; The number of vCPUs supported by the virtual machine size. + VCPUs *int32 `json:"vCPUs,omitempty"` + // Gpus - READ-ONLY; The number of gPUs supported by the virtual machine size. + Gpus *int32 `json:"gpus,omitempty"` + // OsVhdSizeMB - READ-ONLY; The OS VHD disk size, in MB, allowed by the virtual machine size. + OsVhdSizeMB *int32 `json:"osVhdSizeMB,omitempty"` + // MaxResourceVolumeMB - READ-ONLY; The resource volume size, in MB, allowed by the virtual machine size. + MaxResourceVolumeMB *int32 `json:"maxResourceVolumeMB,omitempty"` + // MemoryGB - READ-ONLY; The amount of memory, in GB, supported by the virtual machine size. + MemoryGB *float64 `json:"memoryGB,omitempty"` + // LowPriorityCapable - READ-ONLY; Specifies if the virtual machine size supports low priority VMs. + LowPriorityCapable *bool `json:"lowPriorityCapable,omitempty"` + // PremiumIO - READ-ONLY; Specifies if the virtual machine size supports premium IO. + PremiumIO *bool `json:"premiumIO,omitempty"` +} + +// VirtualMachineSizeListResult the List Virtual Machine size operation response. +type VirtualMachineSizeListResult struct { + autorest.Response `json:"-"` + // AmlCompute - The list of virtual machine sizes supported by AmlCompute. + AmlCompute *[]VirtualMachineSize `json:"amlCompute,omitempty"` +} + +// VirtualMachineSSHCredentials admin credentials for virtual machine +type VirtualMachineSSHCredentials struct { + // Username - Username of admin account + Username *string `json:"username,omitempty"` + // Password - Password of admin account + Password *string `json:"password,omitempty"` + // PublicKeyData - Public key data + PublicKeyData *string `json:"publicKeyData,omitempty"` + // PrivateKeyData - Private key data + PrivateKeyData *string `json:"privateKeyData,omitempty"` +} + +// Workspace an object that represents a machine learning workspace. +type Workspace struct { + autorest.Response `json:"-"` + // WorkspaceProperties - The properties of the machine learning workspace. + *WorkspaceProperties `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"` + // Identity - The identity of the resource. + Identity *Identity `json:"identity,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 - The sku of the workspace. + Sku *Sku `json:"sku,omitempty"` +} + +// MarshalJSON is the custom marshaler for Workspace. +func (w Workspace) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if w.WorkspaceProperties != nil { + objectMap["properties"] = w.WorkspaceProperties + } + if w.Identity != nil { + objectMap["identity"] = w.Identity + } + if w.Location != nil { + objectMap["location"] = w.Location + } + if w.Tags != nil { + objectMap["tags"] = w.Tags + } + if w.Sku != nil { + objectMap["sku"] = w.Sku + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Workspace struct. +func (w *Workspace) 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 workspaceProperties WorkspaceProperties + err = json.Unmarshal(*v, &workspaceProperties) + if err != nil { + return err + } + w.WorkspaceProperties = &workspaceProperties + } + 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 "identity": + if v != nil { + var identity Identity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + w.Identity = &identity + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + w.Location = &location + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + w.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + w.Tags = tags + } + case "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + w.Sku = &sku + } + } + } + + return nil +} + +// WorkspaceListResult the result of a request to list machine learning workspaces. +type WorkspaceListResult struct { + autorest.Response `json:"-"` + // Value - The list of machine learning workspaces. Since this list may be incomplete, the nextLink field should be used to request the next list of machine learning workspaces. + Value *[]Workspace `json:"value,omitempty"` + // NextLink - The URI that can be used to request the next list of machine learning workspaces. + NextLink *string `json:"nextLink,omitempty"` +} + +// WorkspaceListResultIterator provides access to a complete listing of Workspace values. +type WorkspaceListResultIterator struct { + i int + page WorkspaceListResultPage +} + +// 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 *WorkspaceListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceListResultIterator.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 *WorkspaceListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter WorkspaceListResultIterator) 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 WorkspaceListResultIterator) Response() WorkspaceListResult { + 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 WorkspaceListResultIterator) Value() Workspace { + if !iter.page.NotDone() { + return Workspace{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the WorkspaceListResultIterator type. +func NewWorkspaceListResultIterator(page WorkspaceListResultPage) WorkspaceListResultIterator { + return WorkspaceListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (wlr WorkspaceListResult) IsEmpty() bool { + return wlr.Value == nil || len(*wlr.Value) == 0 +} + +// workspaceListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (wlr WorkspaceListResult) workspaceListResultPreparer(ctx context.Context) (*http.Request, error) { + if wlr.NextLink == nil || len(to.String(wlr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(wlr.NextLink))) +} + +// WorkspaceListResultPage contains a page of Workspace values. +type WorkspaceListResultPage struct { + fn func(context.Context, WorkspaceListResult) (WorkspaceListResult, error) + wlr WorkspaceListResult +} + +// 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 *WorkspaceListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.wlr) + if err != nil { + return err + } + page.wlr = next + 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 *WorkspaceListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page WorkspaceListResultPage) NotDone() bool { + return !page.wlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page WorkspaceListResultPage) Response() WorkspaceListResult { + return page.wlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page WorkspaceListResultPage) Values() []Workspace { + if page.wlr.IsEmpty() { + return nil + } + return *page.wlr.Value +} + +// Creates a new instance of the WorkspaceListResultPage type. +func NewWorkspaceListResultPage(getNextPage func(context.Context, WorkspaceListResult) (WorkspaceListResult, error)) WorkspaceListResultPage { + return WorkspaceListResultPage{fn: getNextPage} +} + +// WorkspaceProperties the properties of a machine learning workspace. +type WorkspaceProperties struct { + // WorkspaceID - READ-ONLY; The immutable id associated with this workspace. + WorkspaceID *string `json:"workspaceId,omitempty"` + // Description - The description of this workspace. + Description *string `json:"description,omitempty"` + // FriendlyName - The friendly name for this workspace. This name in mutable + FriendlyName *string `json:"friendlyName,omitempty"` + // CreationTime - READ-ONLY; The creation time of the machine learning workspace in ISO8601 format. + CreationTime *date.Time `json:"creationTime,omitempty"` + // KeyVault - ARM id of the key vault associated with this workspace. This cannot be changed once the workspace has been created + KeyVault *string `json:"keyVault,omitempty"` + // ApplicationInsights - ARM id of the application insights associated with this workspace. This cannot be changed once the workspace has been created + ApplicationInsights *string `json:"applicationInsights,omitempty"` + // ContainerRegistry - ARM id of the container registry associated with this workspace. This cannot be changed once the workspace has been created + ContainerRegistry *string `json:"containerRegistry,omitempty"` + // StorageAccount - ARM id of the storage account associated with this workspace. This cannot be changed once the workspace has been created + StorageAccount *string `json:"storageAccount,omitempty"` + // DiscoveryURL - Url for the discovery service to identify regional endpoints for machine learning experimentation services + DiscoveryURL *string `json:"discoveryUrl,omitempty"` + // ProvisioningState - READ-ONLY; The current deployment state of workspace resource. The provisioningState is to indicate states for resource provisioning. Possible values include: 'ProvisioningStateUnknown', 'ProvisioningStateUpdating', 'ProvisioningStateCreating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // Encryption - The encryption settings of Azure ML workspace. + Encryption *EncryptionProperty `json:"encryption,omitempty"` + // HbiWorkspace - The flag to signal HBI data in the workspace and reduce diagnostic data collected by the service + HbiWorkspace *bool `json:"hbiWorkspace,omitempty"` + // ServiceProvisionedResourceGroup - READ-ONLY; The name of the managed resource group created by workspace RP in customer subscription if the workspace is CMK workspace + ServiceProvisionedResourceGroup *string `json:"serviceProvisionedResourceGroup,omitempty"` + // PrivateLinkCount - READ-ONLY; Count of private connections in the workspace + PrivateLinkCount *int32 `json:"privateLinkCount,omitempty"` + // ImageBuildCompute - The compute name for image build + ImageBuildCompute *string `json:"imageBuildCompute,omitempty"` + // AllowPublicAccessWhenBehindVnet - The flag to indicate whether to allow public access when behind VNet. + AllowPublicAccessWhenBehindVnet *bool `json:"allowPublicAccessWhenBehindVnet,omitempty"` + // PrivateEndpointConnections - READ-ONLY; The list of private endpoint connections in the workspace. + PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` + // SharedPrivateLinkResources - The list of shared private link resources in this workspace. + SharedPrivateLinkResources *[]SharedPrivateLinkResource `json:"sharedPrivateLinkResources,omitempty"` +} + +// WorkspacePropertiesUpdateParameters the parameters for updating the properties of a machine learning +// workspace. +type WorkspacePropertiesUpdateParameters struct { + // Description - The description of this workspace. + Description *string `json:"description,omitempty"` + // FriendlyName - The friendly name for this workspace. + FriendlyName *string `json:"friendlyName,omitempty"` +} + +// WorkspacesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type WorkspacesCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *WorkspacesCreateOrUpdateFuture) Result(client WorkspacesClient) (w Workspace, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("machinelearningservices.WorkspacesCreateOrUpdateFuture") + 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.CreateOrUpdateResponder(w.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesCreateOrUpdateFuture", "Result", w.Response.Response, "Failure responding to request") + } + } + return +} + +// WorkspaceSku describes Workspace Sku details and features +type WorkspaceSku struct { + // Locations - READ-ONLY; The set of locations that the SKU is available. This will be supported and registered Azure Geo Regions (e.g. West US, East US, Southeast Asia, etc.). + Locations *[]string `json:"locations,omitempty"` + // LocationInfo - READ-ONLY; A list of locations and availability zones in those locations where the SKU is available. + LocationInfo *[]ResourceSkuLocationInfo `json:"locationInfo,omitempty"` + // Tier - READ-ONLY; Sku Tier like Basic or Enterprise + Tier *string `json:"tier,omitempty"` + // ResourceType - READ-ONLY + ResourceType *string `json:"resourceType,omitempty"` + // Name - READ-ONLY + Name *string `json:"name,omitempty"` + // Capabilities - READ-ONLY; List of features/user capabilities associated with the sku + Capabilities *[]SKUCapability `json:"capabilities,omitempty"` + // Restrictions - The restrictions because of which SKU cannot be used. This is empty if there are no restrictions. + Restrictions *[]Restriction `json:"restrictions,omitempty"` +} + +// WorkspaceUpdateParameters the parameters for updating a machine learning workspace. +type WorkspaceUpdateParameters struct { + // Tags - The resource tags for the machine learning workspace. + Tags map[string]*string `json:"tags"` + // Sku - The sku of the workspace. + Sku *Sku `json:"sku,omitempty"` + // WorkspacePropertiesUpdateParameters - The properties that the machine learning workspace will be updated with. + *WorkspacePropertiesUpdateParameters `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for WorkspaceUpdateParameters. +func (wup WorkspaceUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wup.Tags != nil { + objectMap["tags"] = wup.Tags + } + if wup.Sku != nil { + objectMap["sku"] = wup.Sku + } + if wup.WorkspacePropertiesUpdateParameters != nil { + objectMap["properties"] = wup.WorkspacePropertiesUpdateParameters + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for WorkspaceUpdateParameters struct. +func (wup *WorkspaceUpdateParameters) 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 "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + wup.Sku = &sku + } + case "properties": + if v != nil { + var workspacePropertiesUpdateParameters WorkspacePropertiesUpdateParameters + err = json.Unmarshal(*v, &workspacePropertiesUpdateParameters) + if err != nil { + return err + } + wup.WorkspacePropertiesUpdateParameters = &workspacePropertiesUpdateParameters + } + } + } + + return nil +} diff --git a/services/machinelearningservices/mgmt/2020-04-01/machinelearningservices/operations.go b/services/machinelearningservices/mgmt/2020-04-01/machinelearningservices/operations.go new file mode 100644 index 000000000000..9bcf28dea169 --- /dev/null +++ b/services/machinelearningservices/mgmt/2020-04-01/machinelearningservices/operations.go @@ -0,0 +1,109 @@ +package machinelearningservices + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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 these APIs allow end users to operate on Azure Machine Learning Workspace resources. +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 Machine Learning Workspaces REST API operations. +func (client OperationsClient) List(ctx context.Context) (result OperationListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.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) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.OperationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "machinelearningservices.OperationsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.OperationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2020-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.MachineLearningServices/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, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/machinelearningservices/mgmt/2020-04-01/machinelearningservices/privateendpointconnections.go b/services/machinelearningservices/mgmt/2020-04-01/machinelearningservices/privateendpointconnections.go new file mode 100644 index 000000000000..e256a06bd351 --- /dev/null +++ b/services/machinelearningservices/mgmt/2020-04-01/machinelearningservices/privateendpointconnections.go @@ -0,0 +1,288 @@ +package machinelearningservices + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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 these APIs allow end users to operate on Azure Machine Learning Workspace +// resources. +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 deletes the specified private endpoint connection associated with the workspace. +// Parameters: +// resourceGroupName - name of the resource group in which workspace is located. +// workspaceName - name of Azure Machine Learning workspace. +// privateEndpointConnectionName - the name of the private endpoint connection associated with the workspace +func (client PrivateEndpointConnectionsClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, workspaceName, privateEndpointConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.PrivateEndpointConnectionsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "machinelearningservices.PrivateEndpointConnectionsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.PrivateEndpointConnectionsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client PrivateEndpointConnectionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-04-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.MachineLearningServices/workspaces/{workspaceName}/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) (*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 PrivateEndpointConnectionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the specified private endpoint connection associated with the workspace. +// Parameters: +// resourceGroupName - name of the resource group in which workspace is located. +// workspaceName - name of Azure Machine Learning workspace. +// privateEndpointConnectionName - the name of the private endpoint connection associated with the workspace +func (client PrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, workspaceName 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, workspaceName, privateEndpointConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.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, "machinelearningservices.PrivateEndpointConnectionsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.PrivateEndpointConnectionsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client PrivateEndpointConnectionsClient) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/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, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Put update the state of specified private endpoint connection associated with the workspace. +// Parameters: +// resourceGroupName - name of the resource group in which workspace is located. +// workspaceName - name of Azure Machine Learning workspace. +// privateEndpointConnectionName - the name of the private endpoint connection associated with the workspace +// properties - the private endpoint connection properties. +func (client PrivateEndpointConnectionsClient) Put(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string, properties PrivateEndpointConnection) (result PrivateEndpointConnection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.Put") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: properties, + Constraints: []validation.Constraint{{Target: "properties.PrivateEndpointConnectionProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "properties.PrivateEndpointConnectionProperties.PrivateLinkServiceConnectionState", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("machinelearningservices.PrivateEndpointConnectionsClient", "Put", err.Error()) + } + + req, err := client.PutPreparer(ctx, resourceGroupName, workspaceName, privateEndpointConnectionName, properties) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.PrivateEndpointConnectionsClient", "Put", nil, "Failure preparing request") + return + } + + resp, err := client.PutSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "machinelearningservices.PrivateEndpointConnectionsClient", "Put", resp, "Failure sending request") + return + } + + result, err = client.PutResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.PrivateEndpointConnectionsClient", "Put", resp, "Failure responding to request") + } + + return +} + +// PutPreparer prepares the Put request. +func (client PrivateEndpointConnectionsClient) PutPreparer(ctx context.Context, resourceGroupName string, workspaceName string, privateEndpointConnectionName string, properties PrivateEndpointConnection) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-04-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.MachineLearningServices/workspaces/{workspaceName}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), + autorest.WithJSON(properties), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PutSender sends the Put request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateEndpointConnectionsClient) PutSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// PutResponder handles the response to the Put request. The method always +// closes the http.Response Body. +func (client PrivateEndpointConnectionsClient) PutResponder(resp *http.Response) (result PrivateEndpointConnection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/machinelearningservices/mgmt/2020-04-01/machinelearningservices/privatelinkresources.go b/services/machinelearningservices/mgmt/2020-04-01/machinelearningservices/privatelinkresources.go new file mode 100644 index 000000000000..88a911041196 --- /dev/null +++ b/services/machinelearningservices/mgmt/2020-04-01/machinelearningservices/privatelinkresources.go @@ -0,0 +1,120 @@ +package machinelearningservices + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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 these APIs allow end users to operate on Azure Machine Learning Workspace +// resources. +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)} +} + +// ListByWorkspace gets the private link resources that need to be created for a workspace. +// Parameters: +// resourceGroupName - name of the resource group in which workspace is located. +// workspaceName - name of Azure Machine Learning workspace. +func (client PrivateLinkResourcesClient) ListByWorkspace(ctx context.Context, resourceGroupName string, workspaceName string) (result PrivateLinkResourceListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourcesClient.ListByWorkspace") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListByWorkspacePreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.PrivateLinkResourcesClient", "ListByWorkspace", nil, "Failure preparing request") + return + } + + resp, err := client.ListByWorkspaceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "machinelearningservices.PrivateLinkResourcesClient", "ListByWorkspace", resp, "Failure sending request") + return + } + + result, err = client.ListByWorkspaceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.PrivateLinkResourcesClient", "ListByWorkspace", resp, "Failure responding to request") + } + + return +} + +// ListByWorkspacePreparer prepares the ListByWorkspace request. +func (client PrivateLinkResourcesClient) ListByWorkspacePreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/privateLinkResources", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByWorkspaceSender sends the ListByWorkspace request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateLinkResourcesClient) ListByWorkspaceSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByWorkspaceResponder handles the response to the ListByWorkspace request. The method always +// closes the http.Response Body. +func (client PrivateLinkResourcesClient) ListByWorkspaceResponder(resp *http.Response) (result PrivateLinkResourceListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/machinelearningservices/mgmt/2020-04-01/machinelearningservices/quotas.go b/services/machinelearningservices/mgmt/2020-04-01/machinelearningservices/quotas.go new file mode 100644 index 000000000000..b00afa57dd53 --- /dev/null +++ b/services/machinelearningservices/mgmt/2020-04-01/machinelearningservices/quotas.go @@ -0,0 +1,244 @@ +package machinelearningservices + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// QuotasClient is the these APIs allow end users to operate on Azure Machine Learning Workspace resources. +type QuotasClient struct { + BaseClient +} + +// NewQuotasClient creates an instance of the QuotasClient client. +func NewQuotasClient(subscriptionID string) QuotasClient { + return NewQuotasClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewQuotasClientWithBaseURI creates an instance of the QuotasClient 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 NewQuotasClientWithBaseURI(baseURI string, subscriptionID string) QuotasClient { + return QuotasClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List gets the currently assigned Workspace Quotas based on VMFamily. +// Parameters: +// location - the location for which resource usage is queried. +func (client QuotasClient) List(ctx context.Context, location string) (result ListWorkspaceQuotasPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/QuotasClient.List") + defer func() { + sc := -1 + if result.lwq.Response.Response != nil { + sc = result.lwq.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: location, + Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("machinelearningservices.QuotasClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, location) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.QuotasClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.lwq.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "machinelearningservices.QuotasClient", "List", resp, "Failure sending request") + return + } + + result.lwq, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.QuotasClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client QuotasClient) ListPreparer(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 = "2020-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/Quotas", 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 QuotasClient) 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 QuotasClient) ListResponder(resp *http.Response) (result ListWorkspaceQuotas, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 QuotasClient) listNextResults(ctx context.Context, lastResults ListWorkspaceQuotas) (result ListWorkspaceQuotas, err error) { + req, err := lastResults.listWorkspaceQuotasPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "machinelearningservices.QuotasClient", "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, "machinelearningservices.QuotasClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.QuotasClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client QuotasClient) ListComplete(ctx context.Context, location string) (result ListWorkspaceQuotasIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/QuotasClient.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, location) + return +} + +// Update update quota for each VM family in workspace. +// Parameters: +// location - the location for update quota is queried. +// parameters - quota update parameters. +func (client QuotasClient) Update(ctx context.Context, location string, parameters QuotaUpdateParameters) (result UpdateWorkspaceQuotasResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/QuotasClient.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: location, + Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("machinelearningservices.QuotasClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, location, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.QuotasClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "machinelearningservices.QuotasClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.QuotasClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client QuotasClient) UpdatePreparer(ctx context.Context, location string, parameters QuotaUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-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.MachineLearningServices/locations/{location}/updateQuotas", pathParameters), + autorest.WithJSON(parameters), + 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 QuotasClient) 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 QuotasClient) UpdateResponder(resp *http.Response) (result UpdateWorkspaceQuotasResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/machinelearningservices/mgmt/2020-04-01/machinelearningservices/usages.go b/services/machinelearningservices/mgmt/2020-04-01/machinelearningservices/usages.go new file mode 100644 index 000000000000..8a894467a90e --- /dev/null +++ b/services/machinelearningservices/mgmt/2020-04-01/machinelearningservices/usages.go @@ -0,0 +1,161 @@ +package machinelearningservices + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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 these APIs allow end users to operate on Azure Machine Learning Workspace resources. +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)} +} + +// List gets the current usage information as well as limits for AML resources for given subscription and location. +// Parameters: +// location - the location for which resource usage is queried. +func (client UsagesClient) List(ctx context.Context, location string) (result ListUsagesResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UsagesClient.List") + 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: location, + Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("machinelearningservices.UsagesClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, location) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.UsagesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.lur.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "machinelearningservices.UsagesClient", "List", resp, "Failure sending request") + return + } + + result.lur, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.UsagesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client UsagesClient) ListPreparer(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 = "2020-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/usages", 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 UsagesClient) 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 UsagesClient) ListResponder(resp *http.Response) (result ListUsagesResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 UsagesClient) listNextResults(ctx context.Context, lastResults ListUsagesResult) (result ListUsagesResult, err error) { + req, err := lastResults.listUsagesResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "machinelearningservices.UsagesClient", "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, "machinelearningservices.UsagesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.UsagesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client UsagesClient) ListComplete(ctx context.Context, location string) (result ListUsagesResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UsagesClient.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, location) + return +} diff --git a/services/machinelearningservices/mgmt/2020-04-01/machinelearningservices/version.go b/services/machinelearningservices/mgmt/2020-04-01/machinelearningservices/version.go new file mode 100644 index 000000000000..208d95c55f3b --- /dev/null +++ b/services/machinelearningservices/mgmt/2020-04-01/machinelearningservices/version.go @@ -0,0 +1,30 @@ +package machinelearningservices + +import "github.com/Azure/azure-sdk-for-go/version" + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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() + " machinelearningservices/2020-04-01" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/services/machinelearningservices/mgmt/2020-04-01/machinelearningservices/virtualmachinesizes.go b/services/machinelearningservices/mgmt/2020-04-01/machinelearningservices/virtualmachinesizes.go new file mode 100644 index 000000000000..b64c7204b151 --- /dev/null +++ b/services/machinelearningservices/mgmt/2020-04-01/machinelearningservices/virtualmachinesizes.go @@ -0,0 +1,125 @@ +package machinelearningservices + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// VirtualMachineSizesClient is the these APIs allow end users to operate on Azure Machine Learning Workspace +// resources. +type VirtualMachineSizesClient struct { + BaseClient +} + +// NewVirtualMachineSizesClient creates an instance of the VirtualMachineSizesClient client. +func NewVirtualMachineSizesClient(subscriptionID string) VirtualMachineSizesClient { + return NewVirtualMachineSizesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewVirtualMachineSizesClientWithBaseURI creates an instance of the VirtualMachineSizesClient 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 NewVirtualMachineSizesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachineSizesClient { + return VirtualMachineSizesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List returns supported VM Sizes in a location +// Parameters: +// location - the location upon which virtual-machine-sizes is queried. +func (client VirtualMachineSizesClient) List(ctx context.Context, location string) (result VirtualMachineSizeListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachineSizesClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: location, + Constraints: []validation.Constraint{{Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("machinelearningservices.VirtualMachineSizesClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx, location) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.VirtualMachineSizesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "machinelearningservices.VirtualMachineSizesClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.VirtualMachineSizesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client VirtualMachineSizesClient) ListPreparer(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 = "2020-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/locations/{location}/vmSizes", 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 VirtualMachineSizesClient) 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 VirtualMachineSizesClient) ListResponder(resp *http.Response) (result VirtualMachineSizeListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/machinelearningservices/mgmt/2020-04-01/machinelearningservices/workspacefeatures.go b/services/machinelearningservices/mgmt/2020-04-01/machinelearningservices/workspacefeatures.go new file mode 100644 index 000000000000..14e2a68faec1 --- /dev/null +++ b/services/machinelearningservices/mgmt/2020-04-01/machinelearningservices/workspacefeatures.go @@ -0,0 +1,157 @@ +package machinelearningservices + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// WorkspaceFeaturesClient is the these APIs allow end users to operate on Azure Machine Learning Workspace resources. +type WorkspaceFeaturesClient struct { + BaseClient +} + +// NewWorkspaceFeaturesClient creates an instance of the WorkspaceFeaturesClient client. +func NewWorkspaceFeaturesClient(subscriptionID string) WorkspaceFeaturesClient { + return NewWorkspaceFeaturesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWorkspaceFeaturesClientWithBaseURI creates an instance of the WorkspaceFeaturesClient 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 NewWorkspaceFeaturesClientWithBaseURI(baseURI string, subscriptionID string) WorkspaceFeaturesClient { + return WorkspaceFeaturesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List lists all enabled features for a workspace +// Parameters: +// resourceGroupName - name of the resource group in which workspace is located. +// workspaceName - name of Azure Machine Learning workspace. +func (client WorkspaceFeaturesClient) List(ctx context.Context, resourceGroupName string, workspaceName string) (result ListAmlUserFeatureResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceFeaturesClient.List") + defer func() { + sc := -1 + if result.laufr.Response.Response != nil { + sc = result.laufr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspaceFeaturesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.laufr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspaceFeaturesClient", "List", resp, "Failure sending request") + return + } + + result.laufr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspaceFeaturesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client WorkspaceFeaturesClient) ListPreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}/features", 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 WorkspaceFeaturesClient) 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 WorkspaceFeaturesClient) ListResponder(resp *http.Response) (result ListAmlUserFeatureResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 WorkspaceFeaturesClient) listNextResults(ctx context.Context, lastResults ListAmlUserFeatureResult) (result ListAmlUserFeatureResult, err error) { + req, err := lastResults.listAmlUserFeatureResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "machinelearningservices.WorkspaceFeaturesClient", "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, "machinelearningservices.WorkspaceFeaturesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspaceFeaturesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client WorkspaceFeaturesClient) ListComplete(ctx context.Context, resourceGroupName string, workspaceName string) (result ListAmlUserFeatureResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceFeaturesClient.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, workspaceName) + return +} diff --git a/services/machinelearningservices/mgmt/2020-04-01/machinelearningservices/workspaces.go b/services/machinelearningservices/mgmt/2020-04-01/machinelearningservices/workspaces.go new file mode 100644 index 000000000000..23f8b51d115a --- /dev/null +++ b/services/machinelearningservices/mgmt/2020-04-01/machinelearningservices/workspaces.go @@ -0,0 +1,748 @@ +package machinelearningservices + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// WorkspacesClient is the these APIs allow end users to operate on Azure Machine Learning Workspace resources. +type WorkspacesClient struct { + BaseClient +} + +// NewWorkspacesClient creates an instance of the WorkspacesClient client. +func NewWorkspacesClient(subscriptionID string) WorkspacesClient { + return NewWorkspacesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWorkspacesClientWithBaseURI creates an instance of the WorkspacesClient 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 NewWorkspacesClientWithBaseURI(baseURI string, subscriptionID string) WorkspacesClient { + return WorkspacesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a workspace with the specified parameters. +// Parameters: +// resourceGroupName - name of the resource group in which workspace is located. +// workspaceName - name of Azure Machine Learning workspace. +// parameters - the parameters for creating or updating a machine learning workspace. +func (client WorkspacesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, parameters Workspace) (result WorkspacesCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.WorkspaceProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.WorkspaceProperties.Encryption", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.WorkspaceProperties.Encryption.KeyVaultProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.WorkspaceProperties.Encryption.KeyVaultProperties.KeyVaultArmID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.WorkspaceProperties.Encryption.KeyVaultProperties.KeyIdentifier", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}, + }}}}}); err != nil { + return result, validation.NewError("machinelearningservices.WorkspacesClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, workspaceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client WorkspacesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, workspaceName string, parameters Workspace) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-04-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.MachineLearningServices/workspaces/{workspaceName}", pathParameters), + autorest.WithJSON(parameters), + 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 WorkspacesClient) CreateOrUpdateSender(req *http.Request) (future WorkspacesCreateOrUpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client WorkspacesClient) CreateOrUpdateResponder(resp *http.Response) (result Workspace, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a machine learning workspace. +// Parameters: +// resourceGroupName - name of the resource group in which workspace is located. +// workspaceName - name of Azure Machine Learning workspace. +func (client WorkspacesClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client WorkspacesClient) DeletePreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-04-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.MachineLearningServices/workspaces/{workspaceName}", 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 WorkspacesClient) 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 WorkspacesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the properties of the specified machine learning workspace. +// Parameters: +// resourceGroupName - name of the resource group in which workspace is located. +// workspaceName - name of Azure Machine Learning workspace. +func (client WorkspacesClient) Get(ctx context.Context, resourceGroupName string, workspaceName string) (result Workspace, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.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, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client WorkspacesClient) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces/{workspaceName}", 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 WorkspacesClient) 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 WorkspacesClient) GetResponder(resp *http.Response) (result Workspace, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByResourceGroup lists all the available machine learning workspaces under the specified resource group. +// Parameters: +// resourceGroupName - name of the resource group in which workspace is located. +// skiptoken - continuation token for pagination. +func (client WorkspacesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, skiptoken string) (result WorkspaceListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.wlr.Response.Response != nil { + sc = result.wlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, skiptoken) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.wlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.wlr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client WorkspacesClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string, skiptoken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skiptoken) > 0 { + queryParameters["$skiptoken"] = autorest.Encode("query", skiptoken) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MachineLearningServices/workspaces", 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 WorkspacesClient) 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 WorkspacesClient) ListByResourceGroupResponder(resp *http.Response) (result WorkspaceListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 WorkspacesClient) listByResourceGroupNextResults(ctx context.Context, lastResults WorkspaceListResult) (result WorkspaceListResult, err error) { + req, err := lastResults.workspaceListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "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, "machinelearningservices.WorkspacesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client WorkspacesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, skiptoken string) (result WorkspaceListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.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, skiptoken) + return +} + +// ListBySubscription lists all the available machine learning workspaces under the specified subscription. +// Parameters: +// skiptoken - continuation token for pagination. +func (client WorkspacesClient) ListBySubscription(ctx context.Context, skiptoken string) (result WorkspaceListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.ListBySubscription") + defer func() { + sc := -1 + if result.wlr.Response.Response != nil { + sc = result.wlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listBySubscriptionNextResults + req, err := client.ListBySubscriptionPreparer(ctx, skiptoken) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.wlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result.wlr, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "ListBySubscription", resp, "Failure responding to request") + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client WorkspacesClient) ListBySubscriptionPreparer(ctx context.Context, skiptoken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skiptoken) > 0 { + queryParameters["$skiptoken"] = autorest.Encode("query", skiptoken) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.MachineLearningServices/workspaces", 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 WorkspacesClient) 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 WorkspacesClient) ListBySubscriptionResponder(resp *http.Response) (result WorkspaceListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 WorkspacesClient) listBySubscriptionNextResults(ctx context.Context, lastResults WorkspaceListResult) (result WorkspaceListResult, err error) { + req, err := lastResults.workspaceListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "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, "machinelearningservices.WorkspacesClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client WorkspacesClient) ListBySubscriptionComplete(ctx context.Context, skiptoken string) (result WorkspaceListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.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, skiptoken) + return +} + +// ListKeys lists all the keys associated with this workspace. This includes keys for the storage account, app insights +// and password for container registry +// Parameters: +// resourceGroupName - name of the resource group in which workspace is located. +// workspaceName - name of Azure Machine Learning workspace. +func (client WorkspacesClient) ListKeys(ctx context.Context, resourceGroupName string, workspaceName string) (result ListWorkspaceKeysResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.ListKeys") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListKeysPreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "ListKeys", nil, "Failure preparing request") + return + } + + resp, err := client.ListKeysSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "ListKeys", resp, "Failure sending request") + return + } + + result, err = client.ListKeysResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "ListKeys", resp, "Failure responding to request") + } + + return +} + +// ListKeysPreparer prepares the ListKeys request. +func (client WorkspacesClient) ListKeysPreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-04-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.MachineLearningServices/workspaces/{workspaceName}/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 WorkspacesClient) 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 WorkspacesClient) ListKeysResponder(resp *http.Response) (result ListWorkspaceKeysResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ResyncKeys resync all the keys associated with this workspace. This includes keys for the storage account, app +// insights and password for container registry +// Parameters: +// resourceGroupName - name of the resource group in which workspace is located. +// workspaceName - name of Azure Machine Learning workspace. +func (client WorkspacesClient) ResyncKeys(ctx context.Context, resourceGroupName string, workspaceName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.ResyncKeys") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ResyncKeysPreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "ResyncKeys", nil, "Failure preparing request") + return + } + + resp, err := client.ResyncKeysSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "ResyncKeys", resp, "Failure sending request") + return + } + + result, err = client.ResyncKeysResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "ResyncKeys", resp, "Failure responding to request") + } + + return +} + +// ResyncKeysPreparer prepares the ResyncKeys request. +func (client WorkspacesClient) ResyncKeysPreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-04-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.MachineLearningServices/workspaces/{workspaceName}/resyncKeys", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResyncKeysSender sends the ResyncKeys request. The method will close the +// http.Response Body if it receives an error. +func (client WorkspacesClient) ResyncKeysSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ResyncKeysResponder handles the response to the ResyncKeys request. The method always +// closes the http.Response Body. +func (client WorkspacesClient) ResyncKeysResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Update updates a machine learning workspace with the specified parameters. +// Parameters: +// resourceGroupName - name of the resource group in which workspace is located. +// workspaceName - name of Azure Machine Learning workspace. +// parameters - the parameters for updating a machine learning workspace. +func (client WorkspacesClient) Update(ctx context.Context, resourceGroupName string, workspaceName string, parameters WorkspaceUpdateParameters) (result Workspace, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, workspaceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "machinelearningservices.WorkspacesClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client WorkspacesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, workspaceName string, parameters WorkspaceUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-04-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.MachineLearningServices/workspaces/{workspaceName}", pathParameters), + autorest.WithJSON(parameters), + 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 WorkspacesClient) 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 WorkspacesClient) UpdateResponder(resp *http.Response) (result Workspace, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/mediaservices/mgmt/2018-07-01/media/mediaapi/interfaces.go b/services/mediaservices/mgmt/2018-07-01/media/mediaapi/interfaces.go index 736f2218bb42..f28edc40d21c 100644 --- a/services/mediaservices/mgmt/2018-07-01/media/mediaapi/interfaces.go +++ b/services/mediaservices/mgmt/2018-07-01/media/mediaapi/interfaces.go @@ -53,6 +53,7 @@ type MediaservicesClientAPI interface { ListComplete(ctx context.Context, resourceGroupName string) (result media.ServiceCollectionIterator, err error) ListBySubscription(ctx context.Context) (result media.SubscriptionMediaServiceCollectionPage, err error) ListBySubscriptionComplete(ctx context.Context) (result media.SubscriptionMediaServiceCollectionIterator, err error) + ListEdgePolicies(ctx context.Context, resourceGroupName string, accountName string, parameters media.ListEdgePoliciesInput) (result media.EdgePolicies, err error) SyncStorageKeys(ctx context.Context, resourceGroupName string, accountName string, parameters media.SyncStorageKeysInput) (result autorest.Response, err error) Update(ctx context.Context, resourceGroupName string, accountName string, parameters media.Service) (result media.Service, err error) } diff --git a/services/mediaservices/mgmt/2018-07-01/media/mediaservices.go b/services/mediaservices/mgmt/2018-07-01/media/mediaservices.go index 851bc9314877..44785c1d8c95 100644 --- a/services/mediaservices/mgmt/2018-07-01/media/mediaservices.go +++ b/services/mediaservices/mgmt/2018-07-01/media/mediaservices.go @@ -566,6 +566,85 @@ func (client MediaservicesClient) ListBySubscriptionComplete(ctx context.Context return } +// ListEdgePolicies list the media edge policies associated with the Media Services account. +// Parameters: +// resourceGroupName - the name of the resource group within the Azure subscription. +// accountName - the Media Services account name. +// parameters - the request parameters +func (client MediaservicesClient) ListEdgePolicies(ctx context.Context, resourceGroupName string, accountName string, parameters ListEdgePoliciesInput) (result EdgePolicies, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MediaservicesClient.ListEdgePolicies") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListEdgePoliciesPreparer(ctx, resourceGroupName, accountName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "media.MediaservicesClient", "ListEdgePolicies", nil, "Failure preparing request") + return + } + + resp, err := client.ListEdgePoliciesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "media.MediaservicesClient", "ListEdgePolicies", resp, "Failure sending request") + return + } + + result, err = client.ListEdgePoliciesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "media.MediaservicesClient", "ListEdgePolicies", resp, "Failure responding to request") + } + + return +} + +// ListEdgePoliciesPreparer prepares the ListEdgePolicies request. +func (client MediaservicesClient) ListEdgePoliciesPreparer(ctx context.Context, resourceGroupName string, accountName string, parameters ListEdgePoliciesInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-07-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.Media/mediaservices/{accountName}/listEdgePolicies", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListEdgePoliciesSender sends the ListEdgePolicies request. The method will close the +// http.Response Body if it receives an error. +func (client MediaservicesClient) ListEdgePoliciesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListEdgePoliciesResponder handles the response to the ListEdgePolicies request. The method always +// closes the http.Response Body. +func (client MediaservicesClient) ListEdgePoliciesResponder(resp *http.Response) (result EdgePolicies, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // SyncStorageKeys synchronizes storage account keys for a storage account associated with the Media Service account. // Parameters: // resourceGroupName - the name of the resource group within the Azure subscription. diff --git a/services/mediaservices/mgmt/2018-07-01/media/models.go b/services/mediaservices/mgmt/2018-07-01/media/models.go index cd29ffc08fa5..3000538b8799 100644 --- a/services/mediaservices/mgmt/2018-07-01/media/models.go +++ b/services/mediaservices/mgmt/2018-07-01/media/models.go @@ -4493,6 +4493,34 @@ type Deinterlace struct { Mode DeinterlaceMode `json:"mode,omitempty"` } +// EdgePolicies ... +type EdgePolicies struct { + autorest.Response `json:"-"` + UsageDataCollectionPolicy *EdgeUsageDataCollectionPolicy `json:"usageDataCollectionPolicy,omitempty"` +} + +// EdgeUsageDataCollectionPolicy ... +type EdgeUsageDataCollectionPolicy struct { + // DataCollectionFrequency - Usage data collection frequency in ISO 8601 duration format e.g. PT10M , PT5H. + DataCollectionFrequency *string `json:"dataCollectionFrequency,omitempty"` + // DataReportingFrequency - Usage data reporting frequency in ISO 8601 duration format e.g. PT10M , PT5H. + DataReportingFrequency *string `json:"dataReportingFrequency,omitempty"` + // MaxAllowedUnreportedUsageDuration - Maximum time for which the functionality of the device will not be hampered for not reporting the usage data. + MaxAllowedUnreportedUsageDuration *string `json:"maxAllowedUnreportedUsageDuration,omitempty"` + // EventHubDetails - Details of Event Hub where the usage will be reported. + EventHubDetails *EdgeUsageDataEventHub `json:"eventHubDetails,omitempty"` +} + +// EdgeUsageDataEventHub ... +type EdgeUsageDataEventHub struct { + // Name - Name of the Event Hub where usage will be reported. + Name *string `json:"name,omitempty"` + // Namespace - Namespace of the Event Hub where usage will be reported. + Namespace *string `json:"namespace,omitempty"` + // Token - SAS token needed to interact with Event Hub. + Token *string `json:"token,omitempty"` +} + // EnabledProtocols class to specify which protocols are enabled type EnabledProtocols struct { // Download - Enable Download protocol or not @@ -6959,6 +6987,12 @@ type ListContentKeysResponse struct { ContentKeys *[]StreamingLocatorContentKey `json:"contentKeys,omitempty"` } +// ListEdgePoliciesInput ... +type ListEdgePoliciesInput struct { + // DeviceID - Unique identifier of the edge device. + DeviceID *string `json:"deviceId,omitempty"` +} + // ListPathsResponse class of response for listPaths action type ListPathsResponse struct { autorest.Response `json:"-"` diff --git a/services/netapp/mgmt/2019-11-01/netapp/models.go b/services/netapp/mgmt/2019-11-01/netapp/models.go index 3e1d5e266660..1bb4adea7f85 100644 --- a/services/netapp/mgmt/2019-11-01/netapp/models.go +++ b/services/netapp/mgmt/2019-11-01/netapp/models.go @@ -1518,7 +1518,7 @@ type VolumeProperties struct { // SubnetID - The Azure Resource URI for a delegated subnet. Must have the delegation Microsoft.NetApp/volumes SubnetID *string `json:"subnetId,omitempty"` // MountTargets - List of mount targets - MountTargets *[]MountTarget `json:"mountTargets,omitempty"` + MountTargets *[]MountTargetProperties `json:"mountTargets,omitempty"` // VolumeType - What type of volume is this VolumeType *string `json:"volumeType,omitempty"` // DataProtection - DataProtection type volumes include an object containing details of the replication diff --git a/services/network/mgmt/2019-07-01/network/connectionmonitors.go b/services/network/mgmt/2019-07-01/network/connectionmonitors.go index 86b7360f7005..a51fbe48f160 100644 --- a/services/network/mgmt/2019-07-01/network/connectionmonitors.go +++ b/services/network/mgmt/2019-07-01/network/connectionmonitors.go @@ -94,7 +94,7 @@ func (client ConnectionMonitorsClient) CreateOrUpdatePreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-06-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -174,7 +174,7 @@ func (client ConnectionMonitorsClient) DeletePreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-06-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -257,7 +257,7 @@ func (client ConnectionMonitorsClient) GetPreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-06-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -333,7 +333,7 @@ func (client ConnectionMonitorsClient) ListPreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-06-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -405,7 +405,7 @@ func (client ConnectionMonitorsClient) QueryPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-06-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -483,7 +483,7 @@ func (client ConnectionMonitorsClient) StartPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-06-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -560,7 +560,7 @@ func (client ConnectionMonitorsClient) StopPreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-06-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -644,7 +644,7 @@ func (client ConnectionMonitorsClient) UpdateTagsPreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-06-01" + const APIVersion = "2019-07-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/network/mgmt/2019-08-01/network/connectionmonitors.go b/services/network/mgmt/2019-08-01/network/connectionmonitors.go index 86b7360f7005..9b0990edcf50 100644 --- a/services/network/mgmt/2019-08-01/network/connectionmonitors.go +++ b/services/network/mgmt/2019-08-01/network/connectionmonitors.go @@ -94,7 +94,7 @@ func (client ConnectionMonitorsClient) CreateOrUpdatePreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-06-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -174,7 +174,7 @@ func (client ConnectionMonitorsClient) DeletePreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-06-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -257,7 +257,7 @@ func (client ConnectionMonitorsClient) GetPreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-06-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -333,7 +333,7 @@ func (client ConnectionMonitorsClient) ListPreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-06-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -405,7 +405,7 @@ func (client ConnectionMonitorsClient) QueryPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-06-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -483,7 +483,7 @@ func (client ConnectionMonitorsClient) StartPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-06-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -560,7 +560,7 @@ func (client ConnectionMonitorsClient) StopPreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-06-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -644,7 +644,7 @@ func (client ConnectionMonitorsClient) UpdateTagsPreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-06-01" + const APIVersion = "2019-08-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/network/mgmt/2019-09-01/network/connectionmonitors.go b/services/network/mgmt/2019-09-01/network/connectionmonitors.go index 86b7360f7005..ade8f2fb4e4c 100644 --- a/services/network/mgmt/2019-09-01/network/connectionmonitors.go +++ b/services/network/mgmt/2019-09-01/network/connectionmonitors.go @@ -94,7 +94,7 @@ func (client ConnectionMonitorsClient) CreateOrUpdatePreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-06-01" + const APIVersion = "2019-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -174,7 +174,7 @@ func (client ConnectionMonitorsClient) DeletePreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-06-01" + const APIVersion = "2019-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -257,7 +257,7 @@ func (client ConnectionMonitorsClient) GetPreparer(ctx context.Context, resource "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-06-01" + const APIVersion = "2019-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -333,7 +333,7 @@ func (client ConnectionMonitorsClient) ListPreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-06-01" + const APIVersion = "2019-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -405,7 +405,7 @@ func (client ConnectionMonitorsClient) QueryPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-06-01" + const APIVersion = "2019-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -483,7 +483,7 @@ func (client ConnectionMonitorsClient) StartPreparer(ctx context.Context, resour "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-06-01" + const APIVersion = "2019-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -560,7 +560,7 @@ func (client ConnectionMonitorsClient) StopPreparer(ctx context.Context, resourc "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-06-01" + const APIVersion = "2019-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -644,7 +644,7 @@ func (client ConnectionMonitorsClient) UpdateTagsPreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-06-01" + const APIVersion = "2019-09-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/operationalinsights/v1/operationalinsights/get.go b/services/operationalinsights/v1/operationalinsights/get.go deleted file mode 100644 index 47925a166488..000000000000 --- a/services/operationalinsights/v1/operationalinsights/get.go +++ /dev/null @@ -1,110 +0,0 @@ -package operationalinsights - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// 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" -) - -// GetClient is the log Analytics Data Plane Client -type GetClient struct { - BaseClient -} - -// NewGetClient creates an instance of the GetClient client. -func NewGetClient() GetClient { - return NewGetClientWithBaseURI(DefaultBaseURI) -} - -// NewGetClientWithBaseURI creates an instance of the GetClient 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 NewGetClientWithBaseURI(baseURI string) GetClient { - return GetClient{NewWithBaseURI(baseURI)} -} - -// Metadata retrieve the metadata information for the workspace, including its schema, functions, workspace info, -// categories etc. -// Parameters: -// workspaceID - ID of the workspace. This is Workspace ID from the Properties blade in the Azure portal. -func (client GetClient) Metadata(ctx context.Context, workspaceID string) (result MetadataResults, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GetClient.Metadata") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.MetadataPreparer(ctx, workspaceID) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.GetClient", "Metadata", nil, "Failure preparing request") - return - } - - resp, err := client.MetadataSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "operationalinsights.GetClient", "Metadata", resp, "Failure sending request") - return - } - - result, err = client.MetadataResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.GetClient", "Metadata", resp, "Failure responding to request") - } - - return -} - -// MetadataPreparer prepares the Metadata request. -func (client GetClient) MetadataPreparer(ctx context.Context, workspaceID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "workspaceId": autorest.Encode("path", workspaceID), - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/workspaces/{workspaceId}/metadata", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// MetadataSender sends the Metadata request. The method will close the -// http.Response Body if it receives an error. -func (client GetClient) MetadataSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// MetadataResponder handles the response to the Metadata request. The method always -// closes the http.Response Body. -func (client GetClient) MetadataResponder(resp *http.Response) (result MetadataResults, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/services/operationalinsights/v1/operationalinsights/metadata.go b/services/operationalinsights/v1/operationalinsights/metadata.go new file mode 100644 index 000000000000..fdb778eeb5d9 --- /dev/null +++ b/services/operationalinsights/v1/operationalinsights/metadata.go @@ -0,0 +1,178 @@ +package operationalinsights + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// MetadataClient is the log Analytics Data Plane Client +type MetadataClient struct { + BaseClient +} + +// NewMetadataClient creates an instance of the MetadataClient client. +func NewMetadataClient() MetadataClient { + return NewMetadataClientWithBaseURI(DefaultBaseURI) +} + +// NewMetadataClientWithBaseURI creates an instance of the MetadataClient 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 NewMetadataClientWithBaseURI(baseURI string) MetadataClient { + return MetadataClient{NewWithBaseURI(baseURI)} +} + +// Get retrieve the metadata information for the workspace, including its schema, functions, workspace info, categories +// etc. +// Parameters: +// workspaceID - ID of the workspace. This is Workspace ID from the Properties blade in the Azure portal. +func (client MetadataClient) Get(ctx context.Context, workspaceID string) (result MetadataResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MetadataClient.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, workspaceID) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.MetadataClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "operationalinsights.MetadataClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.MetadataClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client MetadataClient) GetPreparer(ctx context.Context, workspaceID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "workspaceId": autorest.Encode("path", workspaceID), + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/workspaces/{workspaceId}/metadata", pathParameters)) + 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 MetadataClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client MetadataClient) GetResponder(resp *http.Response) (result MetadataResults, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Post retrieve the metadata information for the workspace, including its schema, functions, workspace info, +// categories etc. +// Parameters: +// workspaceID - ID of the workspace. This is Workspace ID from the Properties blade in the Azure portal. +func (client MetadataClient) Post(ctx context.Context, workspaceID string) (result MetadataResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MetadataClient.Post") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PostPreparer(ctx, workspaceID) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.MetadataClient", "Post", nil, "Failure preparing request") + return + } + + resp, err := client.PostSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "operationalinsights.MetadataClient", "Post", resp, "Failure sending request") + return + } + + result, err = client.PostResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.MetadataClient", "Post", resp, "Failure responding to request") + } + + return +} + +// PostPreparer prepares the Post request. +func (client MetadataClient) PostPreparer(ctx context.Context, workspaceID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "workspaceId": autorest.Encode("path", workspaceID), + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/workspaces/{workspaceId}/metadata", pathParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PostSender sends the Post request. The method will close the +// http.Response Body if it receives an error. +func (client MetadataClient) PostSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// PostResponder handles the response to the Post request. The method always +// closes the http.Response Body. +func (client MetadataClient) PostResponder(resp *http.Response) (result MetadataResults, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/operationalinsights/v1/operationalinsights/operationalinsightsapi/interfaces.go b/services/operationalinsights/v1/operationalinsights/operationalinsightsapi/interfaces.go index fd3e63ae80d2..d6691b178015 100644 --- a/services/operationalinsights/v1/operationalinsights/operationalinsightsapi/interfaces.go +++ b/services/operationalinsights/v1/operationalinsights/operationalinsightsapi/interfaces.go @@ -29,16 +29,10 @@ type QueryClientAPI interface { var _ QueryClientAPI = (*operationalinsights.QueryClient)(nil) -// GetClientAPI contains the set of methods on the GetClient type. -type GetClientAPI interface { - Metadata(ctx context.Context, workspaceID string) (result operationalinsights.MetadataResults, err error) +// MetadataClientAPI contains the set of methods on the MetadataClient type. +type MetadataClientAPI interface { + Get(ctx context.Context, workspaceID string) (result operationalinsights.MetadataResults, err error) + Post(ctx context.Context, workspaceID string) (result operationalinsights.MetadataResults, err error) } -var _ GetClientAPI = (*operationalinsights.GetClient)(nil) - -// PostClientAPI contains the set of methods on the PostClient type. -type PostClientAPI interface { - Metadata(ctx context.Context, workspaceID string) (result operationalinsights.MetadataResults, err error) -} - -var _ PostClientAPI = (*operationalinsights.PostClient)(nil) +var _ MetadataClientAPI = (*operationalinsights.MetadataClient)(nil) diff --git a/services/operationalinsights/v1/operationalinsights/post.go b/services/operationalinsights/v1/operationalinsights/post.go deleted file mode 100644 index eebbaec32b6a..000000000000 --- a/services/operationalinsights/v1/operationalinsights/post.go +++ /dev/null @@ -1,110 +0,0 @@ -package operationalinsights - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// 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" -) - -// PostClient is the log Analytics Data Plane Client -type PostClient struct { - BaseClient -} - -// NewPostClient creates an instance of the PostClient client. -func NewPostClient() PostClient { - return NewPostClientWithBaseURI(DefaultBaseURI) -} - -// NewPostClientWithBaseURI creates an instance of the PostClient 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 NewPostClientWithBaseURI(baseURI string) PostClient { - return PostClient{NewWithBaseURI(baseURI)} -} - -// Metadata retrieve the metadata information for the workspace, including its schema, functions, workspace info, -// categories etc. -// Parameters: -// workspaceID - ID of the workspace. This is Workspace ID from the Properties blade in the Azure portal. -func (client PostClient) Metadata(ctx context.Context, workspaceID string) (result MetadataResults, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PostClient.Metadata") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.MetadataPreparer(ctx, workspaceID) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.PostClient", "Metadata", nil, "Failure preparing request") - return - } - - resp, err := client.MetadataSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "operationalinsights.PostClient", "Metadata", resp, "Failure sending request") - return - } - - result, err = client.MetadataResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "operationalinsights.PostClient", "Metadata", resp, "Failure responding to request") - } - - return -} - -// MetadataPreparer prepares the Metadata request. -func (client PostClient) MetadataPreparer(ctx context.Context, workspaceID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "workspaceId": autorest.Encode("path", workspaceID), - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/workspaces/{workspaceId}/metadata", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// MetadataSender sends the Metadata request. The method will close the -// http.Response Body if it receives an error. -func (client PostClient) MetadataSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// MetadataResponder handles the response to the Metadata request. The method always -// closes the http.Response Body. -func (client PostClient) MetadataResponder(resp *http.Response) (result MetadataResults, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/services/peering/mgmt/2020-04-01/peering/client.go b/services/peering/mgmt/2020-04-01/peering/client.go new file mode 100644 index 000000000000..8e28ba927816 --- /dev/null +++ b/services/peering/mgmt/2020-04-01/peering/client.go @@ -0,0 +1,133 @@ +// Package peering implements the Azure ARM Peering service API version 2020-04-01. +// +// Peering Client +package peering + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +const ( + // DefaultBaseURI is the default URI used for the service Peering + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Peering. +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, + } +} + +// CheckServiceProviderAvailability checks if the peering service provider is present within 1000 miles of customer's +// location +// Parameters: +// checkServiceProviderAvailabilityInput - the CheckServiceProviderAvailabilityInput indicating customer +// location and service provider. +func (client BaseClient) CheckServiceProviderAvailability(ctx context.Context, checkServiceProviderAvailabilityInput CheckServiceProviderAvailabilityInput) (result String, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CheckServiceProviderAvailability") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CheckServiceProviderAvailabilityPreparer(ctx, checkServiceProviderAvailabilityInput) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.BaseClient", "CheckServiceProviderAvailability", nil, "Failure preparing request") + return + } + + resp, err := client.CheckServiceProviderAvailabilitySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "peering.BaseClient", "CheckServiceProviderAvailability", resp, "Failure sending request") + return + } + + result, err = client.CheckServiceProviderAvailabilityResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.BaseClient", "CheckServiceProviderAvailability", resp, "Failure responding to request") + } + + return +} + +// CheckServiceProviderAvailabilityPreparer prepares the CheckServiceProviderAvailability request. +func (client BaseClient) CheckServiceProviderAvailabilityPreparer(ctx context.Context, checkServiceProviderAvailabilityInput CheckServiceProviderAvailabilityInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-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.Peering/CheckServiceProviderAvailability", pathParameters), + autorest.WithJSON(checkServiceProviderAvailabilityInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CheckServiceProviderAvailabilitySender sends the CheckServiceProviderAvailability request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) CheckServiceProviderAvailabilitySender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CheckServiceProviderAvailabilityResponder handles the response to the CheckServiceProviderAvailability request. The method always +// closes the http.Response Body. +func (client BaseClient) CheckServiceProviderAvailabilityResponder(resp *http.Response) (result String, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/peering/mgmt/2020-04-01/peering/legacypeerings.go b/services/peering/mgmt/2020-04-01/peering/legacypeerings.go new file mode 100644 index 000000000000..16698a8c83c1 --- /dev/null +++ b/services/peering/mgmt/2020-04-01/peering/legacypeerings.go @@ -0,0 +1,160 @@ +package peering + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// LegacyPeeringsClient is the peering Client +type LegacyPeeringsClient struct { + BaseClient +} + +// NewLegacyPeeringsClient creates an instance of the LegacyPeeringsClient client. +func NewLegacyPeeringsClient(subscriptionID string) LegacyPeeringsClient { + return NewLegacyPeeringsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewLegacyPeeringsClientWithBaseURI creates an instance of the LegacyPeeringsClient 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 NewLegacyPeeringsClientWithBaseURI(baseURI string, subscriptionID string) LegacyPeeringsClient { + return LegacyPeeringsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List lists all of the legacy peerings under the given subscription matching the specified kind and location. +// Parameters: +// peeringLocation - the location of the peering. +// kind - the kind of the peering. +// asn - the ASN number associated with a legacy peering. +func (client LegacyPeeringsClient) List(ctx context.Context, peeringLocation string, kind string, asn *int32) (result ListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LegacyPeeringsClient.List") + defer func() { + sc := -1 + if result.lr.Response.Response != nil { + sc = result.lr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, peeringLocation, kind, asn) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.LegacyPeeringsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.lr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "peering.LegacyPeeringsClient", "List", resp, "Failure sending request") + return + } + + result.lr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.LegacyPeeringsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client LegacyPeeringsClient) ListPreparer(ctx context.Context, peeringLocation string, kind string, asn *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + "kind": autorest.Encode("query", kind), + "peeringLocation": autorest.Encode("query", peeringLocation), + } + if asn != nil { + queryParameters["asn"] = autorest.Encode("query", *asn) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Peering/legacyPeerings", 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 LegacyPeeringsClient) 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 LegacyPeeringsClient) ListResponder(resp *http.Response) (result ListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 LegacyPeeringsClient) listNextResults(ctx context.Context, lastResults ListResult) (result ListResult, err error) { + req, err := lastResults.listResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "peering.LegacyPeeringsClient", "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, "peering.LegacyPeeringsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.LegacyPeeringsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client LegacyPeeringsClient) ListComplete(ctx context.Context, peeringLocation string, kind string, asn *int32) (result ListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LegacyPeeringsClient.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, peeringLocation, kind, asn) + return +} diff --git a/services/peering/mgmt/2020-04-01/peering/locations.go b/services/peering/mgmt/2020-04-01/peering/locations.go new file mode 100644 index 000000000000..0afcef5cbeaf --- /dev/null +++ b/services/peering/mgmt/2020-04-01/peering/locations.go @@ -0,0 +1,158 @@ +package peering + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// LocationsClient is the peering Client +type LocationsClient struct { + BaseClient +} + +// NewLocationsClient creates an instance of the LocationsClient client. +func NewLocationsClient(subscriptionID string) LocationsClient { + return NewLocationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewLocationsClientWithBaseURI creates an instance of the LocationsClient 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 NewLocationsClientWithBaseURI(baseURI string, subscriptionID string) LocationsClient { + return LocationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List lists all of the available peering locations for the specified kind of peering. +// Parameters: +// kind - the kind of the peering. +// directPeeringType - the type of direct peering. +func (client LocationsClient) List(ctx context.Context, kind string, directPeeringType string) (result LocationListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LocationsClient.List") + defer func() { + sc := -1 + if result.llr.Response.Response != nil { + sc = result.llr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, kind, directPeeringType) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.LocationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.llr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "peering.LocationsClient", "List", resp, "Failure sending request") + return + } + + result.llr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.LocationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client LocationsClient) ListPreparer(ctx context.Context, kind string, directPeeringType string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + "kind": autorest.Encode("query", kind), + } + if len(string(directPeeringType)) > 0 { + queryParameters["directPeeringType"] = autorest.Encode("query", directPeeringType) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Peering/peeringLocations", 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 LocationsClient) 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 LocationsClient) ListResponder(resp *http.Response) (result LocationListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 LocationsClient) listNextResults(ctx context.Context, lastResults LocationListResult) (result LocationListResult, err error) { + req, err := lastResults.locationListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "peering.LocationsClient", "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, "peering.LocationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.LocationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client LocationsClient) ListComplete(ctx context.Context, kind string, directPeeringType string) (result LocationListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LocationsClient.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, kind, directPeeringType) + return +} diff --git a/services/peering/mgmt/2020-04-01/peering/models.go b/services/peering/mgmt/2020-04-01/peering/models.go new file mode 100644 index 000000000000..e105dc147c64 --- /dev/null +++ b/services/peering/mgmt/2020-04-01/peering/models.go @@ -0,0 +1,3242 @@ +package peering + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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/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/peering/mgmt/2020-04-01/peering" + +// ConnectionState enumerates the values for connection state. +type ConnectionState string + +const ( + // Active ... + Active ConnectionState = "Active" + // Approved ... + Approved ConnectionState = "Approved" + // None ... + None ConnectionState = "None" + // PendingApproval ... + PendingApproval ConnectionState = "PendingApproval" + // ProvisioningCompleted ... + ProvisioningCompleted ConnectionState = "ProvisioningCompleted" + // ProvisioningFailed ... + ProvisioningFailed ConnectionState = "ProvisioningFailed" + // ProvisioningStarted ... + ProvisioningStarted ConnectionState = "ProvisioningStarted" + // Validating ... + Validating ConnectionState = "Validating" +) + +// PossibleConnectionStateValues returns an array of possible values for the ConnectionState const type. +func PossibleConnectionStateValues() []ConnectionState { + return []ConnectionState{Active, Approved, None, PendingApproval, ProvisioningCompleted, ProvisioningFailed, ProvisioningStarted, Validating} +} + +// DirectPeeringType enumerates the values for direct peering type. +type DirectPeeringType string + +const ( + // Cdn ... + Cdn DirectPeeringType = "Cdn" + // Edge ... + Edge DirectPeeringType = "Edge" + // Internal ... + Internal DirectPeeringType = "Internal" + // Ix ... + Ix DirectPeeringType = "Ix" + // IxRs ... + IxRs DirectPeeringType = "IxRs" + // Transit ... + Transit DirectPeeringType = "Transit" +) + +// PossibleDirectPeeringTypeValues returns an array of possible values for the DirectPeeringType const type. +func PossibleDirectPeeringTypeValues() []DirectPeeringType { + return []DirectPeeringType{Cdn, Edge, Internal, Ix, IxRs, Transit} +} + +// Family enumerates the values for family. +type Family string + +const ( + // Direct ... + Direct Family = "Direct" + // Exchange ... + Exchange Family = "Exchange" +) + +// PossibleFamilyValues returns an array of possible values for the Family const type. +func PossibleFamilyValues() []Family { + return []Family{Direct, Exchange} +} + +// Kind enumerates the values for kind. +type Kind string + +const ( + // KindDirect ... + KindDirect Kind = "Direct" + // KindExchange ... + KindExchange Kind = "Exchange" +) + +// PossibleKindValues returns an array of possible values for the Kind const type. +func PossibleKindValues() []Kind { + return []Kind{KindDirect, KindExchange} +} + +// LearnedType enumerates the values for learned type. +type LearnedType string + +const ( + // LearnedTypeNone ... + LearnedTypeNone LearnedType = "None" + // LearnedTypeViaServiceProvider ... + LearnedTypeViaServiceProvider LearnedType = "ViaServiceProvider" + // LearnedTypeViaSession ... + LearnedTypeViaSession LearnedType = "ViaSession" +) + +// PossibleLearnedTypeValues returns an array of possible values for the LearnedType const type. +func PossibleLearnedTypeValues() []LearnedType { + return []LearnedType{LearnedTypeNone, LearnedTypeViaServiceProvider, LearnedTypeViaSession} +} + +// PrefixValidationState enumerates the values for prefix validation state. +type PrefixValidationState string + +const ( + // PrefixValidationStateFailed ... + PrefixValidationStateFailed PrefixValidationState = "Failed" + // PrefixValidationStateInvalid ... + PrefixValidationStateInvalid PrefixValidationState = "Invalid" + // PrefixValidationStateNone ... + PrefixValidationStateNone PrefixValidationState = "None" + // PrefixValidationStatePending ... + PrefixValidationStatePending PrefixValidationState = "Pending" + // PrefixValidationStateUnknown ... + PrefixValidationStateUnknown PrefixValidationState = "Unknown" + // PrefixValidationStateVerified ... + PrefixValidationStateVerified PrefixValidationState = "Verified" + // PrefixValidationStateWarning ... + PrefixValidationStateWarning PrefixValidationState = "Warning" +) + +// PossiblePrefixValidationStateValues returns an array of possible values for the PrefixValidationState const type. +func PossiblePrefixValidationStateValues() []PrefixValidationState { + return []PrefixValidationState{PrefixValidationStateFailed, PrefixValidationStateInvalid, PrefixValidationStateNone, PrefixValidationStatePending, PrefixValidationStateUnknown, PrefixValidationStateVerified, PrefixValidationStateWarning} +} + +// ProvisioningState enumerates the values for provisioning state. +type ProvisioningState string + +const ( + // Deleting ... + Deleting ProvisioningState = "Deleting" + // Failed ... + Failed ProvisioningState = "Failed" + // Succeeded ... + Succeeded ProvisioningState = "Succeeded" + // Updating ... + Updating ProvisioningState = "Updating" +) + +// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. +func PossibleProvisioningStateValues() []ProvisioningState { + return []ProvisioningState{Deleting, Failed, Succeeded, Updating} +} + +// Role enumerates the values for role. +type Role string + +const ( + // RoleEscalation ... + RoleEscalation Role = "Escalation" + // RoleNoc ... + RoleNoc Role = "Noc" + // RoleOther ... + RoleOther Role = "Other" + // RolePolicy ... + RolePolicy Role = "Policy" + // RoleService ... + RoleService Role = "Service" + // RoleTechnical ... + RoleTechnical Role = "Technical" +) + +// PossibleRoleValues returns an array of possible values for the Role const type. +func PossibleRoleValues() []Role { + return []Role{RoleEscalation, RoleNoc, RoleOther, RolePolicy, RoleService, RoleTechnical} +} + +// SessionAddressProvider enumerates the values for session address provider. +type SessionAddressProvider string + +const ( + // Microsoft ... + Microsoft SessionAddressProvider = "Microsoft" + // Peer ... + Peer SessionAddressProvider = "Peer" +) + +// PossibleSessionAddressProviderValues returns an array of possible values for the SessionAddressProvider const type. +func PossibleSessionAddressProviderValues() []SessionAddressProvider { + return []SessionAddressProvider{Microsoft, Peer} +} + +// SessionStateV4 enumerates the values for session state v4. +type SessionStateV4 string + +const ( + // SessionStateV4Active ... + SessionStateV4Active SessionStateV4 = "Active" + // SessionStateV4Connect ... + SessionStateV4Connect SessionStateV4 = "Connect" + // SessionStateV4Established ... + SessionStateV4Established SessionStateV4 = "Established" + // SessionStateV4Idle ... + SessionStateV4Idle SessionStateV4 = "Idle" + // SessionStateV4None ... + SessionStateV4None SessionStateV4 = "None" + // SessionStateV4OpenConfirm ... + SessionStateV4OpenConfirm SessionStateV4 = "OpenConfirm" + // SessionStateV4OpenReceived ... + SessionStateV4OpenReceived SessionStateV4 = "OpenReceived" + // SessionStateV4OpenSent ... + SessionStateV4OpenSent SessionStateV4 = "OpenSent" + // SessionStateV4PendingAdd ... + SessionStateV4PendingAdd SessionStateV4 = "PendingAdd" + // SessionStateV4PendingRemove ... + SessionStateV4PendingRemove SessionStateV4 = "PendingRemove" + // SessionStateV4PendingUpdate ... + SessionStateV4PendingUpdate SessionStateV4 = "PendingUpdate" +) + +// PossibleSessionStateV4Values returns an array of possible values for the SessionStateV4 const type. +func PossibleSessionStateV4Values() []SessionStateV4 { + return []SessionStateV4{SessionStateV4Active, SessionStateV4Connect, SessionStateV4Established, SessionStateV4Idle, SessionStateV4None, SessionStateV4OpenConfirm, SessionStateV4OpenReceived, SessionStateV4OpenSent, SessionStateV4PendingAdd, SessionStateV4PendingRemove, SessionStateV4PendingUpdate} +} + +// SessionStateV6 enumerates the values for session state v6. +type SessionStateV6 string + +const ( + // SessionStateV6Active ... + SessionStateV6Active SessionStateV6 = "Active" + // SessionStateV6Connect ... + SessionStateV6Connect SessionStateV6 = "Connect" + // SessionStateV6Established ... + SessionStateV6Established SessionStateV6 = "Established" + // SessionStateV6Idle ... + SessionStateV6Idle SessionStateV6 = "Idle" + // SessionStateV6None ... + SessionStateV6None SessionStateV6 = "None" + // SessionStateV6OpenConfirm ... + SessionStateV6OpenConfirm SessionStateV6 = "OpenConfirm" + // SessionStateV6OpenReceived ... + SessionStateV6OpenReceived SessionStateV6 = "OpenReceived" + // SessionStateV6OpenSent ... + SessionStateV6OpenSent SessionStateV6 = "OpenSent" + // SessionStateV6PendingAdd ... + SessionStateV6PendingAdd SessionStateV6 = "PendingAdd" + // SessionStateV6PendingRemove ... + SessionStateV6PendingRemove SessionStateV6 = "PendingRemove" + // SessionStateV6PendingUpdate ... + SessionStateV6PendingUpdate SessionStateV6 = "PendingUpdate" +) + +// PossibleSessionStateV6Values returns an array of possible values for the SessionStateV6 const type. +func PossibleSessionStateV6Values() []SessionStateV6 { + return []SessionStateV6{SessionStateV6Active, SessionStateV6Connect, SessionStateV6Established, SessionStateV6Idle, SessionStateV6None, SessionStateV6OpenConfirm, SessionStateV6OpenReceived, SessionStateV6OpenSent, SessionStateV6PendingAdd, SessionStateV6PendingRemove, SessionStateV6PendingUpdate} +} + +// Size enumerates the values for size. +type Size string + +const ( + // Free ... + Free Size = "Free" + // Metered ... + Metered Size = "Metered" + // Unlimited ... + Unlimited Size = "Unlimited" +) + +// PossibleSizeValues returns an array of possible values for the Size const type. +func PossibleSizeValues() []Size { + return []Size{Free, Metered, Unlimited} +} + +// Tier enumerates the values for tier. +type Tier string + +const ( + // Basic ... + Basic Tier = "Basic" + // Premium ... + Premium Tier = "Premium" +) + +// PossibleTierValues returns an array of possible values for the Tier const type. +func PossibleTierValues() []Tier { + return []Tier{Basic, Premium} +} + +// ValidationState enumerates the values for validation state. +type ValidationState string + +const ( + // ValidationStateApproved ... + ValidationStateApproved ValidationState = "Approved" + // ValidationStateFailed ... + ValidationStateFailed ValidationState = "Failed" + // ValidationStateNone ... + ValidationStateNone ValidationState = "None" + // ValidationStatePending ... + ValidationStatePending ValidationState = "Pending" +) + +// PossibleValidationStateValues returns an array of possible values for the ValidationState const type. +func PossibleValidationStateValues() []ValidationState { + return []ValidationState{ValidationStateApproved, ValidationStateFailed, ValidationStateNone, ValidationStatePending} +} + +// BandwidthOffer the properties that define a peering bandwidth offer. +type BandwidthOffer struct { + // OfferName - The name of the bandwidth offer. + OfferName *string `json:"offerName,omitempty"` + // ValueInMbps - The value of the bandwidth offer in Mbps. + ValueInMbps *int32 `json:"valueInMbps,omitempty"` +} + +// BgpSession the properties that define a BGP session. +type BgpSession struct { + // SessionPrefixV4 - The IPv4 prefix that contains both ends' IPv4 addresses. + SessionPrefixV4 *string `json:"sessionPrefixV4,omitempty"` + // SessionPrefixV6 - The IPv6 prefix that contains both ends' IPv6 addresses. + SessionPrefixV6 *string `json:"sessionPrefixV6,omitempty"` + // MicrosoftSessionIPv4Address - The IPv4 session address on Microsoft's end. + MicrosoftSessionIPv4Address *string `json:"microsoftSessionIPv4Address,omitempty"` + // MicrosoftSessionIPv6Address - The IPv6 session address on Microsoft's end. + MicrosoftSessionIPv6Address *string `json:"microsoftSessionIPv6Address,omitempty"` + // PeerSessionIPv4Address - The IPv4 session address on peer's end. + PeerSessionIPv4Address *string `json:"peerSessionIPv4Address,omitempty"` + // PeerSessionIPv6Address - The IPv6 session address on peer's end. + PeerSessionIPv6Address *string `json:"peerSessionIPv6Address,omitempty"` + // SessionStateV4 - READ-ONLY; The state of the IPv4 session. Possible values include: 'SessionStateV4None', 'SessionStateV4Idle', 'SessionStateV4Connect', 'SessionStateV4Active', 'SessionStateV4OpenSent', 'SessionStateV4OpenConfirm', 'SessionStateV4OpenReceived', 'SessionStateV4Established', 'SessionStateV4PendingAdd', 'SessionStateV4PendingUpdate', 'SessionStateV4PendingRemove' + SessionStateV4 SessionStateV4 `json:"sessionStateV4,omitempty"` + // SessionStateV6 - READ-ONLY; The state of the IPv6 session. Possible values include: 'SessionStateV6None', 'SessionStateV6Idle', 'SessionStateV6Connect', 'SessionStateV6Active', 'SessionStateV6OpenSent', 'SessionStateV6OpenConfirm', 'SessionStateV6OpenReceived', 'SessionStateV6Established', 'SessionStateV6PendingAdd', 'SessionStateV6PendingUpdate', 'SessionStateV6PendingRemove' + SessionStateV6 SessionStateV6 `json:"sessionStateV6,omitempty"` + // MaxPrefixesAdvertisedV4 - The maximum number of prefixes advertised over the IPv4 session. + MaxPrefixesAdvertisedV4 *int32 `json:"maxPrefixesAdvertisedV4,omitempty"` + // MaxPrefixesAdvertisedV6 - The maximum number of prefixes advertised over the IPv6 session. + MaxPrefixesAdvertisedV6 *int32 `json:"maxPrefixesAdvertisedV6,omitempty"` + // Md5AuthenticationKey - The MD5 authentication key of the session. + Md5AuthenticationKey *string `json:"md5AuthenticationKey,omitempty"` +} + +// CheckServiceProviderAvailabilityInput class for CheckServiceProviderAvailabilityInput +type CheckServiceProviderAvailabilityInput struct { + // PeeringServiceLocation - Gets or sets the peering service location. + PeeringServiceLocation *string `json:"peeringServiceLocation,omitempty"` + // PeeringServiceProvider - Gets or sets the peering service provider. + PeeringServiceProvider *string `json:"peeringServiceProvider,omitempty"` +} + +// ContactDetail the contact detail class. +type ContactDetail struct { + // Role - The role of the contact. Possible values include: 'RoleNoc', 'RolePolicy', 'RoleTechnical', 'RoleService', 'RoleEscalation', 'RoleOther' + Role Role `json:"role,omitempty"` + // Email - The e-mail address of the contact. + Email *string `json:"email,omitempty"` + // Phone - The phone number of the contact. + Phone *string `json:"phone,omitempty"` +} + +// DirectConnection the properties that define a direct connection. +type DirectConnection struct { + // BandwidthInMbps - The bandwidth of the connection. + BandwidthInMbps *int32 `json:"bandwidthInMbps,omitempty"` + // ProvisionedBandwidthInMbps - READ-ONLY; The bandwidth that is actually provisioned. + ProvisionedBandwidthInMbps *int32 `json:"provisionedBandwidthInMbps,omitempty"` + // SessionAddressProvider - The field indicating if Microsoft provides session ip addresses. Possible values include: 'Microsoft', 'Peer' + SessionAddressProvider SessionAddressProvider `json:"sessionAddressProvider,omitempty"` + // UseForPeeringService - The flag that indicates whether or not the connection is used for peering service. + UseForPeeringService *bool `json:"useForPeeringService,omitempty"` + // PeeringDBFacilityID - The PeeringDB.com ID of the facility at which the connection has to be set up. + PeeringDBFacilityID *int32 `json:"peeringDBFacilityId,omitempty"` + // ConnectionState - READ-ONLY; The state of the connection. Possible values include: 'None', 'PendingApproval', 'Approved', 'ProvisioningStarted', 'ProvisioningFailed', 'ProvisioningCompleted', 'Validating', 'Active' + ConnectionState ConnectionState `json:"connectionState,omitempty"` + // BgpSession - The BGP session associated with the connection. + BgpSession *BgpSession `json:"bgpSession,omitempty"` + // ConnectionIdentifier - The unique identifier (GUID) for the connection. + ConnectionIdentifier *string `json:"connectionIdentifier,omitempty"` + // ErrorMessage - READ-ONLY; The error message related to the connection state, if any. + ErrorMessage *string `json:"errorMessage,omitempty"` +} + +// DirectPeeringFacility the properties that define a direct peering facility. +type DirectPeeringFacility struct { + // Address - The address of the direct peering facility. + Address *string `json:"address,omitempty"` + // DirectPeeringType - The type of the direct peering. Possible values include: 'Edge', 'Transit', 'Cdn', 'Internal', 'Ix', 'IxRs' + DirectPeeringType DirectPeeringType `json:"directPeeringType,omitempty"` + // PeeringDBFacilityID - The PeeringDB.com ID of the facility. + PeeringDBFacilityID *int32 `json:"peeringDBFacilityId,omitempty"` + // PeeringDBFacilityLink - The PeeringDB.com URL of the facility. + PeeringDBFacilityLink *string `json:"peeringDBFacilityLink,omitempty"` +} + +// ErrorDetail the error detail that describes why an operation has failed. +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"` +} + +// ErrorResponse the error response that indicates why an operation has failed. +type ErrorResponse struct { + // Error - The error detail that describes why an operation has failed. + Error *ErrorDetail `json:"error,omitempty"` +} + +// ExchangeConnection the properties that define an exchange connection. +type ExchangeConnection struct { + // PeeringDBFacilityID - The PeeringDB.com ID of the facility at which the connection has to be set up. + PeeringDBFacilityID *int32 `json:"peeringDBFacilityId,omitempty"` + // ConnectionState - READ-ONLY; The state of the connection. Possible values include: 'None', 'PendingApproval', 'Approved', 'ProvisioningStarted', 'ProvisioningFailed', 'ProvisioningCompleted', 'Validating', 'Active' + ConnectionState ConnectionState `json:"connectionState,omitempty"` + // BgpSession - The BGP session associated with the connection. + BgpSession *BgpSession `json:"bgpSession,omitempty"` + // ConnectionIdentifier - The unique identifier (GUID) for the connection. + ConnectionIdentifier *string `json:"connectionIdentifier,omitempty"` + // ErrorMessage - READ-ONLY; The error message related to the connection state, if any. + ErrorMessage *string `json:"errorMessage,omitempty"` +} + +// ExchangePeeringFacility the properties that define an exchange peering facility. +type ExchangePeeringFacility struct { + // ExchangeName - The name of the exchange peering facility. + ExchangeName *string `json:"exchangeName,omitempty"` + // BandwidthInMbps - The bandwidth of the connection between Microsoft and the exchange peering facility. + BandwidthInMbps *int32 `json:"bandwidthInMbps,omitempty"` + // MicrosoftIPv4Address - The IPv4 address of Microsoft at the exchange peering facility. + MicrosoftIPv4Address *string `json:"microsoftIPv4Address,omitempty"` + // MicrosoftIPv6Address - The IPv6 address of Microsoft at the exchange peering facility. + MicrosoftIPv6Address *string `json:"microsoftIPv6Address,omitempty"` + // FacilityIPv4Prefix - The IPv4 prefixes associated with the exchange peering facility. + FacilityIPv4Prefix *string `json:"facilityIPv4Prefix,omitempty"` + // FacilityIPv6Prefix - The IPv6 prefixes associated with the exchange peering facility. + FacilityIPv6Prefix *string `json:"facilityIPv6Prefix,omitempty"` + // PeeringDBFacilityID - The PeeringDB.com ID of the facility. + PeeringDBFacilityID *int32 `json:"peeringDBFacilityId,omitempty"` + // PeeringDBFacilityLink - The PeeringDB.com URL of the facility. + PeeringDBFacilityLink *string `json:"peeringDBFacilityLink,omitempty"` +} + +// ListResult the paginated list of peerings. +type ListResult struct { + autorest.Response `json:"-"` + // Value - The list of peerings. + Value *[]Model `json:"value,omitempty"` + // NextLink - The link to fetch the next page of peerings. + NextLink *string `json:"nextLink,omitempty"` +} + +// ListResultIterator provides access to a complete listing of Model values. +type ListResultIterator struct { + i int + page ListResultPage +} + +// 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 *ListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ListResultIterator.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 *ListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ListResultIterator) 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 ListResultIterator) Response() ListResult { + 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 ListResultIterator) Value() Model { + if !iter.page.NotDone() { + return Model{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ListResultIterator type. +func NewListResultIterator(page ListResultPage) ListResultIterator { + return ListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (lr ListResult) IsEmpty() bool { + return lr.Value == nil || len(*lr.Value) == 0 +} + +// listResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (lr ListResult) listResultPreparer(ctx context.Context) (*http.Request, error) { + if lr.NextLink == nil || len(to.String(lr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(lr.NextLink))) +} + +// ListResultPage contains a page of Model values. +type ListResultPage struct { + fn func(context.Context, ListResult) (ListResult, error) + lr ListResult +} + +// 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 *ListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.lr) + if err != nil { + return err + } + page.lr = next + 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 *ListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ListResultPage) NotDone() bool { + return !page.lr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ListResultPage) Response() ListResult { + return page.lr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ListResultPage) Values() []Model { + if page.lr.IsEmpty() { + return nil + } + return *page.lr.Value +} + +// Creates a new instance of the ListResultPage type. +func NewListResultPage(getNextPage func(context.Context, ListResult) (ListResult, error)) ListResultPage { + return ListResultPage{fn: getNextPage} +} + +// Location peering location is where connectivity could be established to the Microsoft Cloud Edge. +type Location struct { + // Kind - The kind of peering that the peering location supports. Possible values include: 'KindDirect', 'KindExchange' + Kind Kind `json:"kind,omitempty"` + // LocationProperties - The properties that define a peering location. + *LocationProperties `json:"properties,omitempty"` + // Name - READ-ONLY; The name of the resource. + Name *string `json:"name,omitempty"` + // ID - READ-ONLY; The ID of the resource. + ID *string `json:"id,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Location. +func (l Location) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if l.Kind != "" { + objectMap["kind"] = l.Kind + } + if l.LocationProperties != nil { + objectMap["properties"] = l.LocationProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Location struct. +func (l *Location) 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 "kind": + if v != nil { + var kind Kind + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + l.Kind = kind + } + case "properties": + if v != nil { + var locationProperties LocationProperties + err = json.Unmarshal(*v, &locationProperties) + if err != nil { + return err + } + l.LocationProperties = &locationProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + l.Name = &name + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + l.ID = &ID + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + l.Type = &typeVar + } + } + } + + return nil +} + +// LocationListResult the paginated list of peering locations. +type LocationListResult struct { + autorest.Response `json:"-"` + // Value - The list of peering locations. + Value *[]Location `json:"value,omitempty"` + // NextLink - The link to fetch the next page of peering locations. + NextLink *string `json:"nextLink,omitempty"` +} + +// LocationListResultIterator provides access to a complete listing of Location values. +type LocationListResultIterator struct { + i int + page LocationListResultPage +} + +// 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 *LocationListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LocationListResultIterator.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 *LocationListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter LocationListResultIterator) 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 LocationListResultIterator) Response() LocationListResult { + 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 LocationListResultIterator) Value() Location { + if !iter.page.NotDone() { + return Location{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the LocationListResultIterator type. +func NewLocationListResultIterator(page LocationListResultPage) LocationListResultIterator { + return LocationListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (llr LocationListResult) IsEmpty() bool { + return llr.Value == nil || len(*llr.Value) == 0 +} + +// locationListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (llr LocationListResult) locationListResultPreparer(ctx context.Context) (*http.Request, error) { + if llr.NextLink == nil || len(to.String(llr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(llr.NextLink))) +} + +// LocationListResultPage contains a page of Location values. +type LocationListResultPage struct { + fn func(context.Context, LocationListResult) (LocationListResult, error) + llr LocationListResult +} + +// 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 *LocationListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LocationListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.llr) + if err != nil { + return err + } + page.llr = next + 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 *LocationListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page LocationListResultPage) NotDone() bool { + return !page.llr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page LocationListResultPage) Response() LocationListResult { + return page.llr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page LocationListResultPage) Values() []Location { + if page.llr.IsEmpty() { + return nil + } + return *page.llr.Value +} + +// Creates a new instance of the LocationListResultPage type. +func NewLocationListResultPage(getNextPage func(context.Context, LocationListResult) (LocationListResult, error)) LocationListResultPage { + return LocationListResultPage{fn: getNextPage} +} + +// LocationProperties the properties that define a peering location. +type LocationProperties struct { + // Direct - The properties that define a direct peering location. + Direct *LocationPropertiesDirect `json:"direct,omitempty"` + // Exchange - The properties that define an exchange peering location. + Exchange *LocationPropertiesExchange `json:"exchange,omitempty"` + // PeeringLocation - The name of the peering location. + PeeringLocation *string `json:"peeringLocation,omitempty"` + // Country - The country in which the peering location exists. + Country *string `json:"country,omitempty"` + // AzureRegion - The Azure region associated with the peering location. + AzureRegion *string `json:"azureRegion,omitempty"` +} + +// LocationPropertiesDirect the properties that define a direct peering location. +type LocationPropertiesDirect struct { + // PeeringFacilities - The list of direct peering facilities at the peering location. + PeeringFacilities *[]DirectPeeringFacility `json:"peeringFacilities,omitempty"` + // BandwidthOffers - The list of bandwidth offers available at the peering location. + BandwidthOffers *[]BandwidthOffer `json:"bandwidthOffers,omitempty"` +} + +// LocationPropertiesExchange the properties that define an exchange peering location. +type LocationPropertiesExchange struct { + // PeeringFacilities - The list of exchange peering facilities at the peering location. + PeeringFacilities *[]ExchangePeeringFacility `json:"peeringFacilities,omitempty"` +} + +// Model peering is a logical representation of a set of connections to the Microsoft Cloud Edge at a +// location. +type Model struct { + autorest.Response `json:"-"` + // Sku - The SKU that defines the tier and kind of the peering. + Sku *Sku `json:"sku,omitempty"` + // Kind - The kind of the peering. Possible values include: 'KindDirect', 'KindExchange' + Kind Kind `json:"kind,omitempty"` + // Properties - The properties that define a peering. + *Properties `json:"properties,omitempty"` + // Location - The location of the resource. + Location *string `json:"location,omitempty"` + // Tags - The resource tags. + Tags map[string]*string `json:"tags"` + // Name - READ-ONLY; The name of the resource. + Name *string `json:"name,omitempty"` + // ID - READ-ONLY; The ID of the resource. + ID *string `json:"id,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Model. +func (mVar Model) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mVar.Sku != nil { + objectMap["sku"] = mVar.Sku + } + if mVar.Kind != "" { + objectMap["kind"] = mVar.Kind + } + if mVar.Properties != nil { + objectMap["properties"] = mVar.Properties + } + if mVar.Location != nil { + objectMap["location"] = mVar.Location + } + if mVar.Tags != nil { + objectMap["tags"] = mVar.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Model struct. +func (mVar *Model) 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 + } + mVar.Sku = &sku + } + case "kind": + if v != nil { + var kind Kind + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + mVar.Kind = kind + } + case "properties": + if v != nil { + var properties Properties + err = json.Unmarshal(*v, &properties) + if err != nil { + return err + } + mVar.Properties = &properties + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + mVar.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + mVar.Tags = tags + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mVar.Name = &name + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + mVar.ID = &ID + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mVar.Type = &typeVar + } + } + } + + return nil +} + +// Operation the peering API operation. +type Operation struct { + // Name - READ-ONLY; The name of the operation. + Name *string `json:"name,omitempty"` + // Display - READ-ONLY; The information related to the operation. + Display *OperationDisplayInfo `json:"display,omitempty"` + // IsDataAction - READ-ONLY; The flag that indicates whether the operation applies to data plane. + IsDataAction *bool `json:"isDataAction,omitempty"` +} + +// OperationDisplayInfo the information related to the operation. +type OperationDisplayInfo struct { + // Provider - READ-ONLY; The name of the resource provider. + Provider *string `json:"provider,omitempty"` + // Resource - READ-ONLY; The type of the resource. + Resource *string `json:"resource,omitempty"` + // Operation - READ-ONLY; The name of the operation. + Operation *string `json:"operation,omitempty"` + // Description - READ-ONLY; The description of the operation. + Description *string `json:"description,omitempty"` +} + +// OperationListResult the paginated list of peering API operations. +type OperationListResult struct { + autorest.Response `json:"-"` + // Value - The list of peering API operations. + Value *[]Operation `json:"value,omitempty"` + // NextLink - The link to fetch the next page of peering API operations. + NextLink *string `json:"nextLink,omitempty"` +} + +// 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 +} + +// 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.NextLink == nil || len(to.String(olr.NextLink)) < 1 { + 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) + }() + } + next, err := page.fn(ctx, page.olr) + if err != nil { + return err + } + page.olr = next + 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(getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { + return OperationListResultPage{fn: getNextPage} +} + +// PeerAsn the essential information related to the peer's ASN. +type PeerAsn struct { + autorest.Response `json:"-"` + // PeerAsnProperties - The properties that define a peer's ASN. + *PeerAsnProperties `json:"properties,omitempty"` + // Name - READ-ONLY; The name of the resource. + Name *string `json:"name,omitempty"` + // ID - READ-ONLY; The ID of the resource. + ID *string `json:"id,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for PeerAsn. +func (pa PeerAsn) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pa.PeerAsnProperties != nil { + objectMap["properties"] = pa.PeerAsnProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PeerAsn struct. +func (pa *PeerAsn) 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 peerAsnProperties PeerAsnProperties + err = json.Unmarshal(*v, &peerAsnProperties) + if err != nil { + return err + } + pa.PeerAsnProperties = &peerAsnProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + pa.Name = &name + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + pa.ID = &ID + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pa.Type = &typeVar + } + } + } + + return nil +} + +// PeerAsnListResult the paginated list of peer ASNs. +type PeerAsnListResult struct { + autorest.Response `json:"-"` + // Value - The list of peer ASNs. + Value *[]PeerAsn `json:"value,omitempty"` + // NextLink - The link to fetch the next page of peer ASNs. + NextLink *string `json:"nextLink,omitempty"` +} + +// PeerAsnListResultIterator provides access to a complete listing of PeerAsn values. +type PeerAsnListResultIterator struct { + i int + page PeerAsnListResultPage +} + +// 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 *PeerAsnListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PeerAsnListResultIterator.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 *PeerAsnListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter PeerAsnListResultIterator) 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 PeerAsnListResultIterator) Response() PeerAsnListResult { + 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 PeerAsnListResultIterator) Value() PeerAsn { + if !iter.page.NotDone() { + return PeerAsn{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the PeerAsnListResultIterator type. +func NewPeerAsnListResultIterator(page PeerAsnListResultPage) PeerAsnListResultIterator { + return PeerAsnListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (palr PeerAsnListResult) IsEmpty() bool { + return palr.Value == nil || len(*palr.Value) == 0 +} + +// peerAsnListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (palr PeerAsnListResult) peerAsnListResultPreparer(ctx context.Context) (*http.Request, error) { + if palr.NextLink == nil || len(to.String(palr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(palr.NextLink))) +} + +// PeerAsnListResultPage contains a page of PeerAsn values. +type PeerAsnListResultPage struct { + fn func(context.Context, PeerAsnListResult) (PeerAsnListResult, error) + palr PeerAsnListResult +} + +// 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 *PeerAsnListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PeerAsnListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.palr) + if err != nil { + return err + } + page.palr = next + 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 *PeerAsnListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page PeerAsnListResultPage) NotDone() bool { + return !page.palr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page PeerAsnListResultPage) Response() PeerAsnListResult { + return page.palr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page PeerAsnListResultPage) Values() []PeerAsn { + if page.palr.IsEmpty() { + return nil + } + return *page.palr.Value +} + +// Creates a new instance of the PeerAsnListResultPage type. +func NewPeerAsnListResultPage(getNextPage func(context.Context, PeerAsnListResult) (PeerAsnListResult, error)) PeerAsnListResultPage { + return PeerAsnListResultPage{fn: getNextPage} +} + +// PeerAsnProperties the properties that define a peer's ASN. +type PeerAsnProperties struct { + // PeerAsn - The Autonomous System Number (ASN) of the peer. + PeerAsn *int32 `json:"peerAsn,omitempty"` + // PeerContactDetail - The contact details of the peer. + PeerContactDetail *[]ContactDetail `json:"peerContactDetail,omitempty"` + // PeerName - The name of the peer. + PeerName *string `json:"peerName,omitempty"` + // ValidationState - The validation state of the ASN associated with the peer. Possible values include: 'ValidationStateNone', 'ValidationStatePending', 'ValidationStateApproved', 'ValidationStateFailed' + ValidationState ValidationState `json:"validationState,omitempty"` + // ErrorMessage - READ-ONLY; The error message for the validation state + ErrorMessage *string `json:"errorMessage,omitempty"` +} + +// Properties the properties that define connectivity to the Microsoft Cloud Edge. +type Properties struct { + // Direct - The properties that define a direct peering. + Direct *PropertiesDirect `json:"direct,omitempty"` + // Exchange - The properties that define an exchange peering. + Exchange *PropertiesExchange `json:"exchange,omitempty"` + // PeeringLocation - The location of the peering. + PeeringLocation *string `json:"peeringLocation,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// PropertiesDirect the properties that define a direct peering. +type PropertiesDirect struct { + // Connections - The set of connections that constitute a direct peering. + Connections *[]DirectConnection `json:"connections,omitempty"` + // UseForPeeringService - READ-ONLY; The flag that indicates whether or not the peering is used for peering service. + UseForPeeringService *bool `json:"useForPeeringService,omitempty"` + // PeerAsn - The reference of the peer ASN. + PeerAsn *SubResource `json:"peerAsn,omitempty"` + // DirectPeeringType - The type of direct peering. Possible values include: 'Edge', 'Transit', 'Cdn', 'Internal', 'Ix', 'IxRs' + DirectPeeringType DirectPeeringType `json:"directPeeringType,omitempty"` +} + +// PropertiesExchange the properties that define an exchange peering. +type PropertiesExchange struct { + // Connections - The set of connections that constitute an exchange peering. + Connections *[]ExchangeConnection `json:"connections,omitempty"` + // PeerAsn - The reference of the peer ASN. + PeerAsn *SubResource `json:"peerAsn,omitempty"` +} + +// ReceivedRoute the properties that define a received route. +type ReceivedRoute struct { + // Prefix - READ-ONLY; The prefix. + Prefix *string `json:"prefix,omitempty"` + // NextHop - READ-ONLY; The next hop for the prefix. + NextHop *string `json:"nextHop,omitempty"` + // AsPath - READ-ONLY; The AS path for the prefix. + AsPath *string `json:"asPath,omitempty"` + // OriginAsValidationState - READ-ONLY; The origin AS change information for the prefix. + OriginAsValidationState *string `json:"originAsValidationState,omitempty"` + // RpkiValidationState - READ-ONLY; The RPKI validation state for the prefix and origin AS that's listed in the AS path. + RpkiValidationState *string `json:"rpkiValidationState,omitempty"` + // TrustAnchor - READ-ONLY; The authority which holds the Route Origin Authorization record for the prefix, if any. + TrustAnchor *string `json:"trustAnchor,omitempty"` + // ReceivedTimestamp - READ-ONLY; The received timestamp associated with the prefix. + ReceivedTimestamp *string `json:"receivedTimestamp,omitempty"` +} + +// ReceivedRouteListResult the paginated list of received routes for the peering. +type ReceivedRouteListResult struct { + autorest.Response `json:"-"` + // Value - The list of received routes for the peering. + Value *[]ReceivedRoute `json:"value,omitempty"` + // NextLink - The link to fetch the next page of received routes for the peering. + NextLink *string `json:"nextLink,omitempty"` +} + +// ReceivedRouteListResultIterator provides access to a complete listing of ReceivedRoute values. +type ReceivedRouteListResultIterator struct { + i int + page ReceivedRouteListResultPage +} + +// 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 *ReceivedRouteListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReceivedRouteListResultIterator.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 *ReceivedRouteListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ReceivedRouteListResultIterator) 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 ReceivedRouteListResultIterator) Response() ReceivedRouteListResult { + 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 ReceivedRouteListResultIterator) Value() ReceivedRoute { + if !iter.page.NotDone() { + return ReceivedRoute{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ReceivedRouteListResultIterator type. +func NewReceivedRouteListResultIterator(page ReceivedRouteListResultPage) ReceivedRouteListResultIterator { + return ReceivedRouteListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rrlr ReceivedRouteListResult) IsEmpty() bool { + return rrlr.Value == nil || len(*rrlr.Value) == 0 +} + +// receivedRouteListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rrlr ReceivedRouteListResult) receivedRouteListResultPreparer(ctx context.Context) (*http.Request, error) { + if rrlr.NextLink == nil || len(to.String(rrlr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rrlr.NextLink))) +} + +// ReceivedRouteListResultPage contains a page of ReceivedRoute values. +type ReceivedRouteListResultPage struct { + fn func(context.Context, ReceivedRouteListResult) (ReceivedRouteListResult, error) + rrlr ReceivedRouteListResult +} + +// 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 *ReceivedRouteListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReceivedRouteListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.rrlr) + if err != nil { + return err + } + page.rrlr = next + 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 *ReceivedRouteListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ReceivedRouteListResultPage) NotDone() bool { + return !page.rrlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ReceivedRouteListResultPage) Response() ReceivedRouteListResult { + return page.rrlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ReceivedRouteListResultPage) Values() []ReceivedRoute { + if page.rrlr.IsEmpty() { + return nil + } + return *page.rrlr.Value +} + +// Creates a new instance of the ReceivedRouteListResultPage type. +func NewReceivedRouteListResultPage(getNextPage func(context.Context, ReceivedRouteListResult) (ReceivedRouteListResult, error)) ReceivedRouteListResultPage { + return ReceivedRouteListResultPage{fn: getNextPage} +} + +// RegisteredAsn the customer's ASN that is registered by the peering service provider. +type RegisteredAsn struct { + autorest.Response `json:"-"` + // RegisteredAsnProperties - The properties that define a registered ASN. + *RegisteredAsnProperties `json:"properties,omitempty"` + // Name - READ-ONLY; The name of the resource. + Name *string `json:"name,omitempty"` + // ID - READ-ONLY; The ID of the resource. + ID *string `json:"id,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for RegisteredAsn. +func (ra RegisteredAsn) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ra.RegisteredAsnProperties != nil { + objectMap["properties"] = ra.RegisteredAsnProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for RegisteredAsn struct. +func (ra *RegisteredAsn) 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 registeredAsnProperties RegisteredAsnProperties + err = json.Unmarshal(*v, ®isteredAsnProperties) + if err != nil { + return err + } + ra.RegisteredAsnProperties = ®isteredAsnProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ra.Name = &name + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ra.ID = &ID + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ra.Type = &typeVar + } + } + } + + return nil +} + +// RegisteredAsnListResult the paginated list of peering registered ASNs. +type RegisteredAsnListResult struct { + autorest.Response `json:"-"` + // Value - The list of peering registered ASNs. + Value *[]RegisteredAsn `json:"value,omitempty"` + // NextLink - The link to fetch the next page of peering registered ASNs. + NextLink *string `json:"nextLink,omitempty"` +} + +// RegisteredAsnListResultIterator provides access to a complete listing of RegisteredAsn values. +type RegisteredAsnListResultIterator struct { + i int + page RegisteredAsnListResultPage +} + +// 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 *RegisteredAsnListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RegisteredAsnListResultIterator.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 *RegisteredAsnListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter RegisteredAsnListResultIterator) 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 RegisteredAsnListResultIterator) Response() RegisteredAsnListResult { + 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 RegisteredAsnListResultIterator) Value() RegisteredAsn { + if !iter.page.NotDone() { + return RegisteredAsn{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the RegisteredAsnListResultIterator type. +func NewRegisteredAsnListResultIterator(page RegisteredAsnListResultPage) RegisteredAsnListResultIterator { + return RegisteredAsnListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ralr RegisteredAsnListResult) IsEmpty() bool { + return ralr.Value == nil || len(*ralr.Value) == 0 +} + +// registeredAsnListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ralr RegisteredAsnListResult) registeredAsnListResultPreparer(ctx context.Context) (*http.Request, error) { + if ralr.NextLink == nil || len(to.String(ralr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ralr.NextLink))) +} + +// RegisteredAsnListResultPage contains a page of RegisteredAsn values. +type RegisteredAsnListResultPage struct { + fn func(context.Context, RegisteredAsnListResult) (RegisteredAsnListResult, error) + ralr RegisteredAsnListResult +} + +// 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 *RegisteredAsnListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RegisteredAsnListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.ralr) + if err != nil { + return err + } + page.ralr = next + 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 *RegisteredAsnListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page RegisteredAsnListResultPage) NotDone() bool { + return !page.ralr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page RegisteredAsnListResultPage) Response() RegisteredAsnListResult { + return page.ralr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page RegisteredAsnListResultPage) Values() []RegisteredAsn { + if page.ralr.IsEmpty() { + return nil + } + return *page.ralr.Value +} + +// Creates a new instance of the RegisteredAsnListResultPage type. +func NewRegisteredAsnListResultPage(getNextPage func(context.Context, RegisteredAsnListResult) (RegisteredAsnListResult, error)) RegisteredAsnListResultPage { + return RegisteredAsnListResultPage{fn: getNextPage} +} + +// RegisteredAsnProperties the properties that define a registered ASN. +type RegisteredAsnProperties struct { + // Asn - The customer's ASN from which traffic originates. + Asn *int32 `json:"asn,omitempty"` + // PeeringServicePrefixKey - READ-ONLY; The peering service prefix key that is to be shared with the customer. + PeeringServicePrefixKey *string `json:"peeringServicePrefixKey,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// RegisteredPrefix the customer's prefix that is registered by the peering service provider. +type RegisteredPrefix struct { + autorest.Response `json:"-"` + // RegisteredPrefixProperties - The properties that define a registered prefix. + *RegisteredPrefixProperties `json:"properties,omitempty"` + // Name - READ-ONLY; The name of the resource. + Name *string `json:"name,omitempty"` + // ID - READ-ONLY; The ID of the resource. + ID *string `json:"id,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for RegisteredPrefix. +func (rp RegisteredPrefix) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rp.RegisteredPrefixProperties != nil { + objectMap["properties"] = rp.RegisteredPrefixProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for RegisteredPrefix struct. +func (rp *RegisteredPrefix) 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 registeredPrefixProperties RegisteredPrefixProperties + err = json.Unmarshal(*v, ®isteredPrefixProperties) + if err != nil { + return err + } + rp.RegisteredPrefixProperties = ®isteredPrefixProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rp.Name = &name + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rp.ID = &ID + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rp.Type = &typeVar + } + } + } + + return nil +} + +// RegisteredPrefixListResult the paginated list of peering registered prefixes. +type RegisteredPrefixListResult struct { + autorest.Response `json:"-"` + // Value - The list of peering registered prefixes. + Value *[]RegisteredPrefix `json:"value,omitempty"` + // NextLink - The link to fetch the next page of peering registered prefixes. + NextLink *string `json:"nextLink,omitempty"` +} + +// RegisteredPrefixListResultIterator provides access to a complete listing of RegisteredPrefix values. +type RegisteredPrefixListResultIterator struct { + i int + page RegisteredPrefixListResultPage +} + +// 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 *RegisteredPrefixListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RegisteredPrefixListResultIterator.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 *RegisteredPrefixListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter RegisteredPrefixListResultIterator) 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 RegisteredPrefixListResultIterator) Response() RegisteredPrefixListResult { + 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 RegisteredPrefixListResultIterator) Value() RegisteredPrefix { + if !iter.page.NotDone() { + return RegisteredPrefix{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the RegisteredPrefixListResultIterator type. +func NewRegisteredPrefixListResultIterator(page RegisteredPrefixListResultPage) RegisteredPrefixListResultIterator { + return RegisteredPrefixListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rplr RegisteredPrefixListResult) IsEmpty() bool { + return rplr.Value == nil || len(*rplr.Value) == 0 +} + +// registeredPrefixListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rplr RegisteredPrefixListResult) registeredPrefixListResultPreparer(ctx context.Context) (*http.Request, error) { + if rplr.NextLink == nil || len(to.String(rplr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rplr.NextLink))) +} + +// RegisteredPrefixListResultPage contains a page of RegisteredPrefix values. +type RegisteredPrefixListResultPage struct { + fn func(context.Context, RegisteredPrefixListResult) (RegisteredPrefixListResult, error) + rplr RegisteredPrefixListResult +} + +// 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 *RegisteredPrefixListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RegisteredPrefixListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.rplr) + if err != nil { + return err + } + page.rplr = next + 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 *RegisteredPrefixListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page RegisteredPrefixListResultPage) NotDone() bool { + return !page.rplr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page RegisteredPrefixListResultPage) Response() RegisteredPrefixListResult { + return page.rplr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page RegisteredPrefixListResultPage) Values() []RegisteredPrefix { + if page.rplr.IsEmpty() { + return nil + } + return *page.rplr.Value +} + +// Creates a new instance of the RegisteredPrefixListResultPage type. +func NewRegisteredPrefixListResultPage(getNextPage func(context.Context, RegisteredPrefixListResult) (RegisteredPrefixListResult, error)) RegisteredPrefixListResultPage { + return RegisteredPrefixListResultPage{fn: getNextPage} +} + +// RegisteredPrefixProperties the properties that define a registered prefix. +type RegisteredPrefixProperties struct { + // Prefix - The customer's prefix from which traffic originates. + Prefix *string `json:"prefix,omitempty"` + // PrefixValidationState - READ-ONLY; The prefix validation state. Possible values include: 'PrefixValidationStateNone', 'PrefixValidationStateInvalid', 'PrefixValidationStateVerified', 'PrefixValidationStateFailed', 'PrefixValidationStatePending', 'PrefixValidationStateWarning', 'PrefixValidationStateUnknown' + PrefixValidationState PrefixValidationState `json:"prefixValidationState,omitempty"` + // PeeringServicePrefixKey - READ-ONLY; The peering service prefix key that is to be shared with the customer. + PeeringServicePrefixKey *string `json:"peeringServicePrefixKey,omitempty"` + // ErrorMessage - READ-ONLY; The error message associated with the validation state, if any. + ErrorMessage *string `json:"errorMessage,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// Resource the ARM resource class. +type Resource struct { + // Name - READ-ONLY; The name of the resource. + Name *string `json:"name,omitempty"` + // ID - READ-ONLY; The ID of the resource. + ID *string `json:"id,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` +} + +// ResourceTags the resource tags. +type ResourceTags struct { + // Tags - Gets or sets the tags, a dictionary of descriptors arm object + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for ResourceTags. +func (rt ResourceTags) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rt.Tags != nil { + objectMap["tags"] = rt.Tags + } + return json.Marshal(objectMap) +} + +// Service peering Service +type Service struct { + autorest.Response `json:"-"` + // Sku - The SKU that defines the type of the peering service. + Sku *ServiceSku `json:"sku,omitempty"` + // ServiceProperties - The properties that define a peering service. + *ServiceProperties `json:"properties,omitempty"` + // Location - The location of the resource. + Location *string `json:"location,omitempty"` + // Tags - The resource tags. + Tags map[string]*string `json:"tags"` + // Name - READ-ONLY; The name of the resource. + Name *string `json:"name,omitempty"` + // ID - READ-ONLY; The ID of the resource. + ID *string `json:"id,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Service. +func (s Service) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if s.Sku != nil { + objectMap["sku"] = s.Sku + } + if s.ServiceProperties != nil { + objectMap["properties"] = s.ServiceProperties + } + 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 Service struct. +func (s *Service) 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 ServiceSku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + s.Sku = &sku + } + case "properties": + if v != nil { + var serviceProperties ServiceProperties + err = json.Unmarshal(*v, &serviceProperties) + if err != nil { + return err + } + s.ServiceProperties = &serviceProperties + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + s.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + s.Tags = tags + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + s.Name = &name + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + s.ID = &ID + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + s.Type = &typeVar + } + } + } + + return nil +} + +// ServiceCountry the peering service country. +type ServiceCountry struct { + // Name - READ-ONLY; The name of the resource. + Name *string `json:"name,omitempty"` + // ID - READ-ONLY; The ID of the resource. + ID *string `json:"id,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` +} + +// ServiceCountryListResult the paginated list of peering service countries. +type ServiceCountryListResult struct { + autorest.Response `json:"-"` + // Value - The list of peering service countries. + Value *[]ServiceCountry `json:"value,omitempty"` + // NextLink - The link to fetch the next page of peering service countries. + NextLink *string `json:"nextLink,omitempty"` +} + +// ServiceCountryListResultIterator provides access to a complete listing of ServiceCountry values. +type ServiceCountryListResultIterator struct { + i int + page ServiceCountryListResultPage +} + +// 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 *ServiceCountryListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServiceCountryListResultIterator.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 *ServiceCountryListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ServiceCountryListResultIterator) 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 ServiceCountryListResultIterator) Response() ServiceCountryListResult { + 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 ServiceCountryListResultIterator) Value() ServiceCountry { + if !iter.page.NotDone() { + return ServiceCountry{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ServiceCountryListResultIterator type. +func NewServiceCountryListResultIterator(page ServiceCountryListResultPage) ServiceCountryListResultIterator { + return ServiceCountryListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (sclr ServiceCountryListResult) IsEmpty() bool { + return sclr.Value == nil || len(*sclr.Value) == 0 +} + +// serviceCountryListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (sclr ServiceCountryListResult) serviceCountryListResultPreparer(ctx context.Context) (*http.Request, error) { + if sclr.NextLink == nil || len(to.String(sclr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(sclr.NextLink))) +} + +// ServiceCountryListResultPage contains a page of ServiceCountry values. +type ServiceCountryListResultPage struct { + fn func(context.Context, ServiceCountryListResult) (ServiceCountryListResult, error) + sclr ServiceCountryListResult +} + +// 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 *ServiceCountryListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServiceCountryListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.sclr) + if err != nil { + return err + } + page.sclr = next + 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 *ServiceCountryListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ServiceCountryListResultPage) NotDone() bool { + return !page.sclr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ServiceCountryListResultPage) Response() ServiceCountryListResult { + return page.sclr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ServiceCountryListResultPage) Values() []ServiceCountry { + if page.sclr.IsEmpty() { + return nil + } + return *page.sclr.Value +} + +// Creates a new instance of the ServiceCountryListResultPage type. +func NewServiceCountryListResultPage(getNextPage func(context.Context, ServiceCountryListResult) (ServiceCountryListResult, error)) ServiceCountryListResultPage { + return ServiceCountryListResultPage{fn: getNextPage} +} + +// ServiceListResult the paginated list of peering services. +type ServiceListResult struct { + autorest.Response `json:"-"` + // Value - The list of peering services. + Value *[]Service `json:"value,omitempty"` + // NextLink - The link to fetch the next page of peering services. + NextLink *string `json:"nextLink,omitempty"` +} + +// ServiceListResultIterator provides access to a complete listing of Service values. +type ServiceListResultIterator struct { + i int + page ServiceListResultPage +} + +// 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 *ServiceListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServiceListResultIterator.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 *ServiceListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ServiceListResultIterator) 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 ServiceListResultIterator) Response() ServiceListResult { + 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 ServiceListResultIterator) Value() Service { + if !iter.page.NotDone() { + return Service{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ServiceListResultIterator type. +func NewServiceListResultIterator(page ServiceListResultPage) ServiceListResultIterator { + return ServiceListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (slr ServiceListResult) IsEmpty() bool { + return slr.Value == nil || len(*slr.Value) == 0 +} + +// serviceListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (slr ServiceListResult) serviceListResultPreparer(ctx context.Context) (*http.Request, error) { + if slr.NextLink == nil || len(to.String(slr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(slr.NextLink))) +} + +// ServiceListResultPage contains a page of Service values. +type ServiceListResultPage struct { + fn func(context.Context, ServiceListResult) (ServiceListResult, error) + slr ServiceListResult +} + +// 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 *ServiceListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServiceListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.slr) + if err != nil { + return err + } + page.slr = next + 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 *ServiceListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ServiceListResultPage) NotDone() bool { + return !page.slr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ServiceListResultPage) Response() ServiceListResult { + return page.slr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ServiceListResultPage) Values() []Service { + if page.slr.IsEmpty() { + return nil + } + return *page.slr.Value +} + +// Creates a new instance of the ServiceListResultPage type. +func NewServiceListResultPage(getNextPage func(context.Context, ServiceListResult) (ServiceListResult, error)) ServiceListResultPage { + return ServiceListResultPage{fn: getNextPage} +} + +// ServiceLocation the peering service location. +type ServiceLocation struct { + // ServiceLocationProperties - The properties that define a peering service location. + *ServiceLocationProperties `json:"properties,omitempty"` + // Name - READ-ONLY; The name of the resource. + Name *string `json:"name,omitempty"` + // ID - READ-ONLY; The ID of the resource. + ID *string `json:"id,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ServiceLocation. +func (sl ServiceLocation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sl.ServiceLocationProperties != nil { + objectMap["properties"] = sl.ServiceLocationProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ServiceLocation struct. +func (sl *ServiceLocation) 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 serviceLocationProperties ServiceLocationProperties + err = json.Unmarshal(*v, &serviceLocationProperties) + if err != nil { + return err + } + sl.ServiceLocationProperties = &serviceLocationProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sl.Name = &name + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sl.ID = &ID + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sl.Type = &typeVar + } + } + } + + return nil +} + +// ServiceLocationListResult the paginated list of peering service locations. +type ServiceLocationListResult struct { + autorest.Response `json:"-"` + // Value - The list of peering service locations. + Value *[]ServiceLocation `json:"value,omitempty"` + // NextLink - The link to fetch the next page of peering service locations. + NextLink *string `json:"nextLink,omitempty"` +} + +// ServiceLocationListResultIterator provides access to a complete listing of ServiceLocation values. +type ServiceLocationListResultIterator struct { + i int + page ServiceLocationListResultPage +} + +// 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 *ServiceLocationListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServiceLocationListResultIterator.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 *ServiceLocationListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ServiceLocationListResultIterator) 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 ServiceLocationListResultIterator) Response() ServiceLocationListResult { + 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 ServiceLocationListResultIterator) Value() ServiceLocation { + if !iter.page.NotDone() { + return ServiceLocation{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ServiceLocationListResultIterator type. +func NewServiceLocationListResultIterator(page ServiceLocationListResultPage) ServiceLocationListResultIterator { + return ServiceLocationListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (sllr ServiceLocationListResult) IsEmpty() bool { + return sllr.Value == nil || len(*sllr.Value) == 0 +} + +// serviceLocationListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (sllr ServiceLocationListResult) serviceLocationListResultPreparer(ctx context.Context) (*http.Request, error) { + if sllr.NextLink == nil || len(to.String(sllr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(sllr.NextLink))) +} + +// ServiceLocationListResultPage contains a page of ServiceLocation values. +type ServiceLocationListResultPage struct { + fn func(context.Context, ServiceLocationListResult) (ServiceLocationListResult, error) + sllr ServiceLocationListResult +} + +// 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 *ServiceLocationListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServiceLocationListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.sllr) + if err != nil { + return err + } + page.sllr = next + 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 *ServiceLocationListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ServiceLocationListResultPage) NotDone() bool { + return !page.sllr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ServiceLocationListResultPage) Response() ServiceLocationListResult { + return page.sllr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ServiceLocationListResultPage) Values() []ServiceLocation { + if page.sllr.IsEmpty() { + return nil + } + return *page.sllr.Value +} + +// Creates a new instance of the ServiceLocationListResultPage type. +func NewServiceLocationListResultPage(getNextPage func(context.Context, ServiceLocationListResult) (ServiceLocationListResult, error)) ServiceLocationListResultPage { + return ServiceLocationListResultPage{fn: getNextPage} +} + +// ServiceLocationProperties the properties that define connectivity to the Peering Service Location. +type ServiceLocationProperties struct { + // Country - Country of the customer + Country *string `json:"country,omitempty"` + // State - State of the customer + State *string `json:"state,omitempty"` + // AzureRegion - Azure region for the location + AzureRegion *string `json:"azureRegion,omitempty"` +} + +// ServicePrefix the peering service prefix class. +type ServicePrefix struct { + autorest.Response `json:"-"` + // ServicePrefixProperties - Gets or sets the peering prefix properties. + *ServicePrefixProperties `json:"properties,omitempty"` + // Name - READ-ONLY; The name of the resource. + Name *string `json:"name,omitempty"` + // ID - READ-ONLY; The ID of the resource. + ID *string `json:"id,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ServicePrefix. +func (sp ServicePrefix) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sp.ServicePrefixProperties != nil { + objectMap["properties"] = sp.ServicePrefixProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ServicePrefix struct. +func (sp *ServicePrefix) 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 servicePrefixProperties ServicePrefixProperties + err = json.Unmarshal(*v, &servicePrefixProperties) + if err != nil { + return err + } + sp.ServicePrefixProperties = &servicePrefixProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sp.Name = &name + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sp.ID = &ID + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sp.Type = &typeVar + } + } + } + + return nil +} + +// ServicePrefixEvent the details of the event associated with a prefix. +type ServicePrefixEvent struct { + // EventTimestamp - READ-ONLY; The timestamp of the event associated with a prefix. + EventTimestamp *date.Time `json:"eventTimestamp,omitempty"` + // EventType - READ-ONLY; The type of the event associated with a prefix. + EventType *string `json:"eventType,omitempty"` + // EventSummary - READ-ONLY; The summary of the event associated with a prefix. + EventSummary *string `json:"eventSummary,omitempty"` + // EventLevel - READ-ONLY; The level of the event associated with a prefix. + EventLevel *string `json:"eventLevel,omitempty"` + // EventDescription - READ-ONLY; The description of the event associated with a prefix. + EventDescription *string `json:"eventDescription,omitempty"` +} + +// ServicePrefixListResult the paginated list of peering service prefixes. +type ServicePrefixListResult struct { + autorest.Response `json:"-"` + // Value - The list of peering service prefixes. + Value *[]ServicePrefix `json:"value,omitempty"` + // NextLink - The link to fetch the next page of peering service prefixes. + NextLink *string `json:"nextLink,omitempty"` +} + +// ServicePrefixListResultIterator provides access to a complete listing of ServicePrefix values. +type ServicePrefixListResultIterator struct { + i int + page ServicePrefixListResultPage +} + +// 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 *ServicePrefixListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicePrefixListResultIterator.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 *ServicePrefixListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ServicePrefixListResultIterator) 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 ServicePrefixListResultIterator) Response() ServicePrefixListResult { + 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 ServicePrefixListResultIterator) Value() ServicePrefix { + if !iter.page.NotDone() { + return ServicePrefix{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ServicePrefixListResultIterator type. +func NewServicePrefixListResultIterator(page ServicePrefixListResultPage) ServicePrefixListResultIterator { + return ServicePrefixListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (splr ServicePrefixListResult) IsEmpty() bool { + return splr.Value == nil || len(*splr.Value) == 0 +} + +// servicePrefixListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (splr ServicePrefixListResult) servicePrefixListResultPreparer(ctx context.Context) (*http.Request, error) { + if splr.NextLink == nil || len(to.String(splr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(splr.NextLink))) +} + +// ServicePrefixListResultPage contains a page of ServicePrefix values. +type ServicePrefixListResultPage struct { + fn func(context.Context, ServicePrefixListResult) (ServicePrefixListResult, error) + splr ServicePrefixListResult +} + +// 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 *ServicePrefixListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicePrefixListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.splr) + if err != nil { + return err + } + page.splr = next + 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 *ServicePrefixListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ServicePrefixListResultPage) NotDone() bool { + return !page.splr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ServicePrefixListResultPage) Response() ServicePrefixListResult { + return page.splr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ServicePrefixListResultPage) Values() []ServicePrefix { + if page.splr.IsEmpty() { + return nil + } + return *page.splr.Value +} + +// Creates a new instance of the ServicePrefixListResultPage type. +func NewServicePrefixListResultPage(getNextPage func(context.Context, ServicePrefixListResult) (ServicePrefixListResult, error)) ServicePrefixListResultPage { + return ServicePrefixListResultPage{fn: getNextPage} +} + +// ServicePrefixProperties the peering service prefix properties class. +type ServicePrefixProperties struct { + // Prefix - The prefix from which your traffic originates. + Prefix *string `json:"prefix,omitempty"` + // PrefixValidationState - READ-ONLY; The prefix validation state. Possible values include: 'PrefixValidationStateNone', 'PrefixValidationStateInvalid', 'PrefixValidationStateVerified', 'PrefixValidationStateFailed', 'PrefixValidationStatePending', 'PrefixValidationStateWarning', 'PrefixValidationStateUnknown' + PrefixValidationState PrefixValidationState `json:"prefixValidationState,omitempty"` + // LearnedType - READ-ONLY; The prefix learned type. Possible values include: 'LearnedTypeNone', 'LearnedTypeViaServiceProvider', 'LearnedTypeViaSession' + LearnedType LearnedType `json:"learnedType,omitempty"` + // ErrorMessage - READ-ONLY; The error message for validation state + ErrorMessage *string `json:"errorMessage,omitempty"` + // Events - READ-ONLY; The list of events for peering service prefix + Events *[]ServicePrefixEvent `json:"events,omitempty"` + // PeeringServicePrefixKey - The peering service prefix key + PeeringServicePrefixKey *string `json:"peeringServicePrefixKey,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// ServiceProperties the properties that define connectivity to the Peering Service. +type ServiceProperties struct { + // PeeringServiceLocation - The PeeringServiceLocation of the Customer. + PeeringServiceLocation *string `json:"peeringServiceLocation,omitempty"` + // PeeringServiceProvider - The MAPS Provider Name. + PeeringServiceProvider *string `json:"peeringServiceProvider,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state of the resource. Possible values include: 'Succeeded', 'Updating', 'Deleting', 'Failed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// ServiceProvider peeringService provider +type ServiceProvider struct { + // ServiceProviderProperties - The properties that define a peering service provider. + *ServiceProviderProperties `json:"properties,omitempty"` + // Name - READ-ONLY; The name of the resource. + Name *string `json:"name,omitempty"` + // ID - READ-ONLY; The ID of the resource. + ID *string `json:"id,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ServiceProvider. +func (sp ServiceProvider) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sp.ServiceProviderProperties != nil { + objectMap["properties"] = sp.ServiceProviderProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ServiceProvider struct. +func (sp *ServiceProvider) 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 serviceProviderProperties ServiceProviderProperties + err = json.Unmarshal(*v, &serviceProviderProperties) + if err != nil { + return err + } + sp.ServiceProviderProperties = &serviceProviderProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sp.Name = &name + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sp.ID = &ID + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sp.Type = &typeVar + } + } + } + + return nil +} + +// ServiceProviderListResult the paginated list of peering service providers. +type ServiceProviderListResult struct { + autorest.Response `json:"-"` + // Value - The list of peering service providers. + Value *[]ServiceProvider `json:"value,omitempty"` + // NextLink - The link to fetch the next page of peering service providers. + NextLink *string `json:"nextLink,omitempty"` +} + +// ServiceProviderListResultIterator provides access to a complete listing of ServiceProvider values. +type ServiceProviderListResultIterator struct { + i int + page ServiceProviderListResultPage +} + +// 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 *ServiceProviderListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServiceProviderListResultIterator.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 *ServiceProviderListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ServiceProviderListResultIterator) 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 ServiceProviderListResultIterator) Response() ServiceProviderListResult { + 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 ServiceProviderListResultIterator) Value() ServiceProvider { + if !iter.page.NotDone() { + return ServiceProvider{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ServiceProviderListResultIterator type. +func NewServiceProviderListResultIterator(page ServiceProviderListResultPage) ServiceProviderListResultIterator { + return ServiceProviderListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (splr ServiceProviderListResult) IsEmpty() bool { + return splr.Value == nil || len(*splr.Value) == 0 +} + +// serviceProviderListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (splr ServiceProviderListResult) serviceProviderListResultPreparer(ctx context.Context) (*http.Request, error) { + if splr.NextLink == nil || len(to.String(splr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(splr.NextLink))) +} + +// ServiceProviderListResultPage contains a page of ServiceProvider values. +type ServiceProviderListResultPage struct { + fn func(context.Context, ServiceProviderListResult) (ServiceProviderListResult, error) + splr ServiceProviderListResult +} + +// 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 *ServiceProviderListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServiceProviderListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.splr) + if err != nil { + return err + } + page.splr = next + 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 *ServiceProviderListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ServiceProviderListResultPage) NotDone() bool { + return !page.splr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ServiceProviderListResultPage) Response() ServiceProviderListResult { + return page.splr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ServiceProviderListResultPage) Values() []ServiceProvider { + if page.splr.IsEmpty() { + return nil + } + return *page.splr.Value +} + +// Creates a new instance of the ServiceProviderListResultPage type. +func NewServiceProviderListResultPage(getNextPage func(context.Context, ServiceProviderListResult) (ServiceProviderListResult, error)) ServiceProviderListResultPage { + return ServiceProviderListResultPage{fn: getNextPage} +} + +// ServiceProviderProperties the properties that define connectivity to the Peering Service Provider. +type ServiceProviderProperties struct { + // ServiceProviderName - The name of the service provider. + ServiceProviderName *string `json:"serviceProviderName,omitempty"` +} + +// ServiceSku the SKU that defines the type of the peering service. +type ServiceSku struct { + // Name - The name of the peering service SKU. + Name *string `json:"name,omitempty"` +} + +// Sku the SKU that defines the tier and kind of the peering. +type Sku struct { + // Name - The name of the peering SKU. + Name *string `json:"name,omitempty"` + // Tier - The tier of the peering SKU. Possible values include: 'Basic', 'Premium' + Tier Tier `json:"tier,omitempty"` + // Family - The family of the peering SKU. Possible values include: 'Direct', 'Exchange' + Family Family `json:"family,omitempty"` + // Size - The size of the peering SKU. Possible values include: 'Free', 'Metered', 'Unlimited' + Size Size `json:"size,omitempty"` +} + +// String ... +type String struct { + autorest.Response `json:"-"` + // Value - Possible values include: 'Available', 'Unavailable' + Value *string `json:"value,omitempty"` +} + +// SubResource the sub resource. +type SubResource struct { + // ID - The identifier of the referenced resource. + ID *string `json:"id,omitempty"` +} diff --git a/services/peering/mgmt/2020-04-01/peering/operations.go b/services/peering/mgmt/2020-04-01/peering/operations.go new file mode 100644 index 000000000000..b0f5d4a290e0 --- /dev/null +++ b/services/peering/mgmt/2020-04-01/peering/operations.go @@ -0,0 +1,147 @@ +package peering + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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 peering Client +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 API operations for peering resources. +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, "peering.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, "peering.OperationsClient", "List", resp, "Failure sending request") + return + } + + result.olr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.OperationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2020-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.Peering/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, + client.ByInspecting(), + 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, "peering.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, "peering.OperationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.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/peering/mgmt/2020-04-01/peering/peerasns.go b/services/peering/mgmt/2020-04-01/peering/peerasns.go new file mode 100644 index 000000000000..e92985c6087c --- /dev/null +++ b/services/peering/mgmt/2020-04-01/peering/peerasns.go @@ -0,0 +1,376 @@ +package peering + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// PeerAsnsClient is the peering Client +type PeerAsnsClient struct { + BaseClient +} + +// NewPeerAsnsClient creates an instance of the PeerAsnsClient client. +func NewPeerAsnsClient(subscriptionID string) PeerAsnsClient { + return NewPeerAsnsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPeerAsnsClientWithBaseURI creates an instance of the PeerAsnsClient 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 NewPeerAsnsClientWithBaseURI(baseURI string, subscriptionID string) PeerAsnsClient { + return PeerAsnsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates a new peer ASN or updates an existing peer ASN with the specified name under the given +// subscription. +// Parameters: +// peerAsnName - the peer ASN name. +// peerAsn - the peer ASN. +func (client PeerAsnsClient) CreateOrUpdate(ctx context.Context, peerAsnName string, peerAsn PeerAsn) (result PeerAsn, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PeerAsnsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateOrUpdatePreparer(ctx, peerAsnName, peerAsn) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.PeerAsnsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "peering.PeerAsnsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.PeerAsnsClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client PeerAsnsClient) CreateOrUpdatePreparer(ctx context.Context, peerAsnName string, peerAsn PeerAsn) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "peerAsnName": autorest.Encode("path", peerAsnName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-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}/providers/Microsoft.Peering/peerAsns/{peerAsnName}", pathParameters), + autorest.WithJSON(peerAsn), + 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 PeerAsnsClient) 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 PeerAsnsClient) CreateOrUpdateResponder(resp *http.Response) (result PeerAsn, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes an existing peer ASN with the specified name under the given subscription. +// Parameters: +// peerAsnName - the peer ASN name. +func (client PeerAsnsClient) Delete(ctx context.Context, peerAsnName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PeerAsnsClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, peerAsnName) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.PeerAsnsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "peering.PeerAsnsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.PeerAsnsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client PeerAsnsClient) DeletePreparer(ctx context.Context, peerAsnName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "peerAsnName": autorest.Encode("path", peerAsnName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Peering/peerAsns/{peerAsnName}", 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 PeerAsnsClient) 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 PeerAsnsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the peer ASN with the specified name under the given subscription. +// Parameters: +// peerAsnName - the peer ASN name. +func (client PeerAsnsClient) Get(ctx context.Context, peerAsnName string) (result PeerAsn, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PeerAsnsClient.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, peerAsnName) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.PeerAsnsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "peering.PeerAsnsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.PeerAsnsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client PeerAsnsClient) GetPreparer(ctx context.Context, peerAsnName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "peerAsnName": autorest.Encode("path", peerAsnName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Peering/peerAsns/{peerAsnName}", 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 PeerAsnsClient) 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 PeerAsnsClient) GetResponder(resp *http.Response) (result PeerAsn, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListBySubscription lists all of the peer ASNs under the given subscription. +func (client PeerAsnsClient) ListBySubscription(ctx context.Context) (result PeerAsnListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PeerAsnsClient.ListBySubscription") + defer func() { + sc := -1 + if result.palr.Response.Response != nil { + sc = result.palr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listBySubscriptionNextResults + req, err := client.ListBySubscriptionPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.PeerAsnsClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.palr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "peering.PeerAsnsClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result.palr, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.PeerAsnsClient", "ListBySubscription", resp, "Failure responding to request") + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client PeerAsnsClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Peering/peerAsns", 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 PeerAsnsClient) 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 PeerAsnsClient) ListBySubscriptionResponder(resp *http.Response) (result PeerAsnListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 PeerAsnsClient) listBySubscriptionNextResults(ctx context.Context, lastResults PeerAsnListResult) (result PeerAsnListResult, err error) { + req, err := lastResults.peerAsnListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "peering.PeerAsnsClient", "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, "peering.PeerAsnsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.PeerAsnsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client PeerAsnsClient) ListBySubscriptionComplete(ctx context.Context) (result PeerAsnListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PeerAsnsClient.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 +} diff --git a/services/peering/mgmt/2020-04-01/peering/peeringapi/interfaces.go b/services/peering/mgmt/2020-04-01/peering/peeringapi/interfaces.go new file mode 100644 index 000000000000..33b888d405da --- /dev/null +++ b/services/peering/mgmt/2020-04-01/peering/peeringapi/interfaces.go @@ -0,0 +1,159 @@ +package peeringapi + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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/peering/mgmt/2020-04-01/peering" + "github.com/Azure/go-autorest/autorest" +) + +// BaseClientAPI contains the set of methods on the BaseClient type. +type BaseClientAPI interface { + CheckServiceProviderAvailability(ctx context.Context, checkServiceProviderAvailabilityInput peering.CheckServiceProviderAvailabilityInput) (result peering.String, err error) +} + +var _ BaseClientAPI = (*peering.BaseClient)(nil) + +// LegacyPeeringsClientAPI contains the set of methods on the LegacyPeeringsClient type. +type LegacyPeeringsClientAPI interface { + List(ctx context.Context, peeringLocation string, kind string, asn *int32) (result peering.ListResultPage, err error) + ListComplete(ctx context.Context, peeringLocation string, kind string, asn *int32) (result peering.ListResultIterator, err error) +} + +var _ LegacyPeeringsClientAPI = (*peering.LegacyPeeringsClient)(nil) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result peering.OperationListResultPage, err error) + ListComplete(ctx context.Context) (result peering.OperationListResultIterator, err error) +} + +var _ OperationsClientAPI = (*peering.OperationsClient)(nil) + +// PeerAsnsClientAPI contains the set of methods on the PeerAsnsClient type. +type PeerAsnsClientAPI interface { + CreateOrUpdate(ctx context.Context, peerAsnName string, peerAsn peering.PeerAsn) (result peering.PeerAsn, err error) + Delete(ctx context.Context, peerAsnName string) (result autorest.Response, err error) + Get(ctx context.Context, peerAsnName string) (result peering.PeerAsn, err error) + ListBySubscription(ctx context.Context) (result peering.PeerAsnListResultPage, err error) + ListBySubscriptionComplete(ctx context.Context) (result peering.PeerAsnListResultIterator, err error) +} + +var _ PeerAsnsClientAPI = (*peering.PeerAsnsClient)(nil) + +// LocationsClientAPI contains the set of methods on the LocationsClient type. +type LocationsClientAPI interface { + List(ctx context.Context, kind string, directPeeringType string) (result peering.LocationListResultPage, err error) + ListComplete(ctx context.Context, kind string, directPeeringType string) (result peering.LocationListResultIterator, err error) +} + +var _ LocationsClientAPI = (*peering.LocationsClient)(nil) + +// RegisteredAsnsClientAPI contains the set of methods on the RegisteredAsnsClient type. +type RegisteredAsnsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, peeringName string, registeredAsnName string, registeredAsn peering.RegisteredAsn) (result peering.RegisteredAsn, err error) + Delete(ctx context.Context, resourceGroupName string, peeringName string, registeredAsnName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, peeringName string, registeredAsnName string) (result peering.RegisteredAsn, err error) + ListByPeering(ctx context.Context, resourceGroupName string, peeringName string) (result peering.RegisteredAsnListResultPage, err error) + ListByPeeringComplete(ctx context.Context, resourceGroupName string, peeringName string) (result peering.RegisteredAsnListResultIterator, err error) +} + +var _ RegisteredAsnsClientAPI = (*peering.RegisteredAsnsClient)(nil) + +// RegisteredPrefixesClientAPI contains the set of methods on the RegisteredPrefixesClient type. +type RegisteredPrefixesClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, peeringName string, registeredPrefixName string, registeredPrefix peering.RegisteredPrefix) (result peering.RegisteredPrefix, err error) + Delete(ctx context.Context, resourceGroupName string, peeringName string, registeredPrefixName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, peeringName string, registeredPrefixName string) (result peering.RegisteredPrefix, err error) + ListByPeering(ctx context.Context, resourceGroupName string, peeringName string) (result peering.RegisteredPrefixListResultPage, err error) + ListByPeeringComplete(ctx context.Context, resourceGroupName string, peeringName string) (result peering.RegisteredPrefixListResultIterator, err error) +} + +var _ RegisteredPrefixesClientAPI = (*peering.RegisteredPrefixesClient)(nil) + +// PeeringsClientAPI contains the set of methods on the PeeringsClient type. +type PeeringsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, peeringName string, peering peering.Model) (result peering.Model, err error) + Delete(ctx context.Context, resourceGroupName string, peeringName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, peeringName string) (result peering.Model, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result peering.ListResultPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result peering.ListResultIterator, err error) + ListBySubscription(ctx context.Context) (result peering.ListResultPage, err error) + ListBySubscriptionComplete(ctx context.Context) (result peering.ListResultIterator, err error) + Update(ctx context.Context, resourceGroupName string, peeringName string, tags peering.ResourceTags) (result peering.Model, err error) +} + +var _ PeeringsClientAPI = (*peering.PeeringsClient)(nil) + +// ReceivedRoutesClientAPI contains the set of methods on the ReceivedRoutesClient type. +type ReceivedRoutesClientAPI interface { + ListByPeering(ctx context.Context, resourceGroupName string, peeringName string, prefix string, asPath string, originAsValidationState string, rpkiValidationState string, skipToken string) (result peering.ReceivedRouteListResultPage, err error) + ListByPeeringComplete(ctx context.Context, resourceGroupName string, peeringName string, prefix string, asPath string, originAsValidationState string, rpkiValidationState string, skipToken string) (result peering.ReceivedRouteListResultIterator, err error) +} + +var _ ReceivedRoutesClientAPI = (*peering.ReceivedRoutesClient)(nil) + +// ServiceCountriesClientAPI contains the set of methods on the ServiceCountriesClient type. +type ServiceCountriesClientAPI interface { + List(ctx context.Context) (result peering.ServiceCountryListResultPage, err error) + ListComplete(ctx context.Context) (result peering.ServiceCountryListResultIterator, err error) +} + +var _ ServiceCountriesClientAPI = (*peering.ServiceCountriesClient)(nil) + +// ServiceLocationsClientAPI contains the set of methods on the ServiceLocationsClient type. +type ServiceLocationsClientAPI interface { + List(ctx context.Context, country string) (result peering.ServiceLocationListResultPage, err error) + ListComplete(ctx context.Context, country string) (result peering.ServiceLocationListResultIterator, err error) +} + +var _ ServiceLocationsClientAPI = (*peering.ServiceLocationsClient)(nil) + +// PrefixesClientAPI contains the set of methods on the PrefixesClient type. +type PrefixesClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, peeringServiceName string, prefixName string, peeringServicePrefix peering.ServicePrefix) (result peering.ServicePrefix, err error) + Delete(ctx context.Context, resourceGroupName string, peeringServiceName string, prefixName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, peeringServiceName string, prefixName string, expand string) (result peering.ServicePrefix, err error) + ListByPeeringService(ctx context.Context, resourceGroupName string, peeringServiceName string, expand string) (result peering.ServicePrefixListResultPage, err error) + ListByPeeringServiceComplete(ctx context.Context, resourceGroupName string, peeringServiceName string, expand string) (result peering.ServicePrefixListResultIterator, err error) +} + +var _ PrefixesClientAPI = (*peering.PrefixesClient)(nil) + +// ServiceProvidersClientAPI contains the set of methods on the ServiceProvidersClient type. +type ServiceProvidersClientAPI interface { + List(ctx context.Context) (result peering.ServiceProviderListResultPage, err error) + ListComplete(ctx context.Context) (result peering.ServiceProviderListResultIterator, err error) +} + +var _ ServiceProvidersClientAPI = (*peering.ServiceProvidersClient)(nil) + +// ServicesClientAPI contains the set of methods on the ServicesClient type. +type ServicesClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, peeringServiceName string, peeringService peering.Service) (result peering.Service, err error) + Delete(ctx context.Context, resourceGroupName string, peeringServiceName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, peeringServiceName string) (result peering.Service, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result peering.ServiceListResultPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result peering.ServiceListResultIterator, err error) + ListBySubscription(ctx context.Context) (result peering.ServiceListResultPage, err error) + ListBySubscriptionComplete(ctx context.Context) (result peering.ServiceListResultIterator, err error) + Update(ctx context.Context, resourceGroupName string, peeringServiceName string, tags peering.ResourceTags) (result peering.Service, err error) +} + +var _ ServicesClientAPI = (*peering.ServicesClient)(nil) diff --git a/services/peering/mgmt/2020-04-01/peering/peerings.go b/services/peering/mgmt/2020-04-01/peering/peerings.go new file mode 100644 index 000000000000..95cc74482259 --- /dev/null +++ b/services/peering/mgmt/2020-04-01/peering/peerings.go @@ -0,0 +1,581 @@ +package peering + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// PeeringsClient is the peering Client +type PeeringsClient struct { + BaseClient +} + +// NewPeeringsClient creates an instance of the PeeringsClient client. +func NewPeeringsClient(subscriptionID string) PeeringsClient { + return NewPeeringsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPeeringsClientWithBaseURI creates an instance of the PeeringsClient 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 NewPeeringsClientWithBaseURI(baseURI string, subscriptionID string) PeeringsClient { + return PeeringsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates a new peering or updates an existing peering with the specified name under the given +// subscription and resource group. +// Parameters: +// resourceGroupName - the name of the resource group. +// peeringName - the name of the peering. +// peering - the properties needed to create or update a peering. +func (client PeeringsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, peeringName string, peering Model) (result Model, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PeeringsClient.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: peering, + Constraints: []validation.Constraint{{Target: "peering.Sku", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "peering.Location", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("peering.PeeringsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, peeringName, peering) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.PeeringsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "peering.PeeringsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.PeeringsClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client PeeringsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, peeringName string, peering Model) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "peeringName": autorest.Encode("path", peeringName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-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.Peering/peerings/{peeringName}", pathParameters), + autorest.WithJSON(peering), + 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 PeeringsClient) 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 PeeringsClient) CreateOrUpdateResponder(resp *http.Response) (result Model, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes an existing peering with the specified name under the given subscription and resource group. +// Parameters: +// resourceGroupName - the name of the resource group. +// peeringName - the name of the peering. +func (client PeeringsClient) Delete(ctx context.Context, resourceGroupName string, peeringName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PeeringsClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, peeringName) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.PeeringsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "peering.PeeringsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.PeeringsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client PeeringsClient) DeletePreparer(ctx context.Context, resourceGroupName string, peeringName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "peeringName": autorest.Encode("path", peeringName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-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.Peering/peerings/{peeringName}", 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 PeeringsClient) 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 PeeringsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets an existing peering with the specified name under the given subscription and resource group. +// Parameters: +// resourceGroupName - the name of the resource group. +// peeringName - the name of the peering. +func (client PeeringsClient) Get(ctx context.Context, resourceGroupName string, peeringName string) (result Model, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PeeringsClient.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, peeringName) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.PeeringsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "peering.PeeringsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.PeeringsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client PeeringsClient) GetPreparer(ctx context.Context, resourceGroupName string, peeringName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "peeringName": autorest.Encode("path", peeringName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peerings/{peeringName}", 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 PeeringsClient) 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 PeeringsClient) GetResponder(resp *http.Response) (result Model, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByResourceGroup lists all of the peerings under the given subscription and resource group. +// Parameters: +// resourceGroupName - the name of the resource group. +func (client PeeringsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PeeringsClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.lr.Response.Response != nil { + sc = result.lr.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, "peering.PeeringsClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.lr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "peering.PeeringsClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.lr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.PeeringsClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client PeeringsClient) 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 = "2020-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peerings", 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 PeeringsClient) 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 PeeringsClient) ListByResourceGroupResponder(resp *http.Response) (result ListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 PeeringsClient) listByResourceGroupNextResults(ctx context.Context, lastResults ListResult) (result ListResult, err error) { + req, err := lastResults.listResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "peering.PeeringsClient", "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, "peering.PeeringsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.PeeringsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client PeeringsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PeeringsClient.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 lists all of the peerings under the given subscription. +func (client PeeringsClient) ListBySubscription(ctx context.Context) (result ListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PeeringsClient.ListBySubscription") + defer func() { + sc := -1 + if result.lr.Response.Response != nil { + sc = result.lr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listBySubscriptionNextResults + req, err := client.ListBySubscriptionPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.PeeringsClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.lr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "peering.PeeringsClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result.lr, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.PeeringsClient", "ListBySubscription", resp, "Failure responding to request") + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client PeeringsClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Peering/peerings", 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 PeeringsClient) 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 PeeringsClient) ListBySubscriptionResponder(resp *http.Response) (result ListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 PeeringsClient) listBySubscriptionNextResults(ctx context.Context, lastResults ListResult) (result ListResult, err error) { + req, err := lastResults.listResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "peering.PeeringsClient", "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, "peering.PeeringsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.PeeringsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client PeeringsClient) ListBySubscriptionComplete(ctx context.Context) (result ListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PeeringsClient.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 updates tags for a peering with the specified name under the given subscription and resource group. +// Parameters: +// resourceGroupName - the name of the resource group. +// peeringName - the name of the peering. +// tags - the resource tags. +func (client PeeringsClient) Update(ctx context.Context, resourceGroupName string, peeringName string, tags ResourceTags) (result Model, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PeeringsClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, peeringName, tags) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.PeeringsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "peering.PeeringsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.PeeringsClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client PeeringsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, peeringName string, tags ResourceTags) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "peeringName": autorest.Encode("path", peeringName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-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.Peering/peerings/{peeringName}", pathParameters), + autorest.WithJSON(tags), + 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 PeeringsClient) 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 PeeringsClient) UpdateResponder(resp *http.Response) (result Model, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/peering/mgmt/2020-04-01/peering/prefixes.go b/services/peering/mgmt/2020-04-01/peering/prefixes.go new file mode 100644 index 000000000000..965444d47755 --- /dev/null +++ b/services/peering/mgmt/2020-04-01/peering/prefixes.go @@ -0,0 +1,403 @@ +package peering + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// PrefixesClient is the peering Client +type PrefixesClient struct { + BaseClient +} + +// NewPrefixesClient creates an instance of the PrefixesClient client. +func NewPrefixesClient(subscriptionID string) PrefixesClient { + return NewPrefixesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPrefixesClientWithBaseURI creates an instance of the PrefixesClient 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 NewPrefixesClientWithBaseURI(baseURI string, subscriptionID string) PrefixesClient { + return PrefixesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates a new prefix with the specified name under the given subscription, resource group and peering +// service. +// Parameters: +// resourceGroupName - the name of the resource group. +// peeringServiceName - the name of the peering service. +// prefixName - the name of the prefix. +// peeringServicePrefix - the properties needed to create a prefix. +func (client PrefixesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, peeringServiceName string, prefixName string, peeringServicePrefix ServicePrefix) (result ServicePrefix, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrefixesClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, peeringServiceName, prefixName, peeringServicePrefix) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.PrefixesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "peering.PrefixesClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.PrefixesClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client PrefixesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, peeringServiceName string, prefixName string, peeringServicePrefix ServicePrefix) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "peeringServiceName": autorest.Encode("path", peeringServiceName), + "prefixName": autorest.Encode("path", prefixName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-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.Peering/peeringServices/{peeringServiceName}/prefixes/{prefixName}", pathParameters), + autorest.WithJSON(peeringServicePrefix), + 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 PrefixesClient) 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 PrefixesClient) CreateOrUpdateResponder(resp *http.Response) (result ServicePrefix, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes an existing prefix with the specified name under the given subscription, resource group and peering +// service. +// Parameters: +// resourceGroupName - the name of the resource group. +// peeringServiceName - the name of the peering service. +// prefixName - the name of the prefix. +func (client PrefixesClient) Delete(ctx context.Context, resourceGroupName string, peeringServiceName string, prefixName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrefixesClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, peeringServiceName, prefixName) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.PrefixesClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "peering.PrefixesClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.PrefixesClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client PrefixesClient) DeletePreparer(ctx context.Context, resourceGroupName string, peeringServiceName string, prefixName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "peeringServiceName": autorest.Encode("path", peeringServiceName), + "prefixName": autorest.Encode("path", prefixName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-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.Peering/peeringServices/{peeringServiceName}/prefixes/{prefixName}", 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 PrefixesClient) 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 PrefixesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets an existing prefix with the specified name under the given subscription, resource group and peering +// service. +// Parameters: +// resourceGroupName - the name of the resource group. +// peeringServiceName - the name of the peering service. +// prefixName - the name of the prefix. +// expand - the properties to be expanded. +func (client PrefixesClient) Get(ctx context.Context, resourceGroupName string, peeringServiceName string, prefixName string, expand string) (result ServicePrefix, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrefixesClient.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, peeringServiceName, prefixName, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.PrefixesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "peering.PrefixesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.PrefixesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client PrefixesClient) GetPreparer(ctx context.Context, resourceGroupName string, peeringServiceName string, prefixName string, expand string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "peeringServiceName": autorest.Encode("path", peeringServiceName), + "prefixName": autorest.Encode("path", prefixName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peeringServices/{peeringServiceName}/prefixes/{prefixName}", 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 PrefixesClient) 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 PrefixesClient) GetResponder(resp *http.Response) (result ServicePrefix, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByPeeringService lists all prefixes under the given subscription, resource group and peering service. +// Parameters: +// resourceGroupName - the name of the resource group. +// peeringServiceName - the name of the peering service. +// expand - the properties to be expanded. +func (client PrefixesClient) ListByPeeringService(ctx context.Context, resourceGroupName string, peeringServiceName string, expand string) (result ServicePrefixListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrefixesClient.ListByPeeringService") + defer func() { + sc := -1 + if result.splr.Response.Response != nil { + sc = result.splr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByPeeringServiceNextResults + req, err := client.ListByPeeringServicePreparer(ctx, resourceGroupName, peeringServiceName, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.PrefixesClient", "ListByPeeringService", nil, "Failure preparing request") + return + } + + resp, err := client.ListByPeeringServiceSender(req) + if err != nil { + result.splr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "peering.PrefixesClient", "ListByPeeringService", resp, "Failure sending request") + return + } + + result.splr, err = client.ListByPeeringServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.PrefixesClient", "ListByPeeringService", resp, "Failure responding to request") + } + + return +} + +// ListByPeeringServicePreparer prepares the ListByPeeringService request. +func (client PrefixesClient) ListByPeeringServicePreparer(ctx context.Context, resourceGroupName string, peeringServiceName string, expand string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "peeringServiceName": autorest.Encode("path", peeringServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peeringServices/{peeringServiceName}/prefixes", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByPeeringServiceSender sends the ListByPeeringService request. The method will close the +// http.Response Body if it receives an error. +func (client PrefixesClient) ListByPeeringServiceSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByPeeringServiceResponder handles the response to the ListByPeeringService request. The method always +// closes the http.Response Body. +func (client PrefixesClient) ListByPeeringServiceResponder(resp *http.Response) (result ServicePrefixListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByPeeringServiceNextResults retrieves the next set of results, if any. +func (client PrefixesClient) listByPeeringServiceNextResults(ctx context.Context, lastResults ServicePrefixListResult) (result ServicePrefixListResult, err error) { + req, err := lastResults.servicePrefixListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "peering.PrefixesClient", "listByPeeringServiceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByPeeringServiceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "peering.PrefixesClient", "listByPeeringServiceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByPeeringServiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.PrefixesClient", "listByPeeringServiceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByPeeringServiceComplete enumerates all values, automatically crossing page boundaries as required. +func (client PrefixesClient) ListByPeeringServiceComplete(ctx context.Context, resourceGroupName string, peeringServiceName string, expand string) (result ServicePrefixListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrefixesClient.ListByPeeringService") + 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.ListByPeeringService(ctx, resourceGroupName, peeringServiceName, expand) + return +} diff --git a/services/peering/mgmt/2020-04-01/peering/receivedroutes.go b/services/peering/mgmt/2020-04-01/peering/receivedroutes.go new file mode 100644 index 000000000000..2a81ead67fe3 --- /dev/null +++ b/services/peering/mgmt/2020-04-01/peering/receivedroutes.go @@ -0,0 +1,177 @@ +package peering + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// ReceivedRoutesClient is the peering Client +type ReceivedRoutesClient struct { + BaseClient +} + +// NewReceivedRoutesClient creates an instance of the ReceivedRoutesClient client. +func NewReceivedRoutesClient(subscriptionID string) ReceivedRoutesClient { + return NewReceivedRoutesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewReceivedRoutesClientWithBaseURI creates an instance of the ReceivedRoutesClient 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 NewReceivedRoutesClientWithBaseURI(baseURI string, subscriptionID string) ReceivedRoutesClient { + return ReceivedRoutesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListByPeering lists the prefixes received over the specified peering under the given subscription and resource +// group. +// Parameters: +// resourceGroupName - the name of the resource group. +// peeringName - the name of the peering. +// prefix - the optional prefix that can be used to filter the routes. +// asPath - the optional AS path that can be used to filter the routes. +// originAsValidationState - the optional origin AS validation state that can be used to filter the routes. +// rpkiValidationState - the optional RPKI validation state that can be used to filter the routes. +// skipToken - the optional page continuation token that is used in the event of paginated result. +func (client ReceivedRoutesClient) ListByPeering(ctx context.Context, resourceGroupName string, peeringName string, prefix string, asPath string, originAsValidationState string, rpkiValidationState string, skipToken string) (result ReceivedRouteListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReceivedRoutesClient.ListByPeering") + defer func() { + sc := -1 + if result.rrlr.Response.Response != nil { + sc = result.rrlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByPeeringNextResults + req, err := client.ListByPeeringPreparer(ctx, resourceGroupName, peeringName, prefix, asPath, originAsValidationState, rpkiValidationState, skipToken) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.ReceivedRoutesClient", "ListByPeering", nil, "Failure preparing request") + return + } + + resp, err := client.ListByPeeringSender(req) + if err != nil { + result.rrlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "peering.ReceivedRoutesClient", "ListByPeering", resp, "Failure sending request") + return + } + + result.rrlr, err = client.ListByPeeringResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.ReceivedRoutesClient", "ListByPeering", resp, "Failure responding to request") + } + + return +} + +// ListByPeeringPreparer prepares the ListByPeering request. +func (client ReceivedRoutesClient) ListByPeeringPreparer(ctx context.Context, resourceGroupName string, peeringName string, prefix string, asPath string, originAsValidationState string, rpkiValidationState string, skipToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "peeringName": autorest.Encode("path", peeringName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(prefix) > 0 { + queryParameters["prefix"] = autorest.Encode("query", prefix) + } + if len(asPath) > 0 { + queryParameters["asPath"] = autorest.Encode("query", asPath) + } + if len(originAsValidationState) > 0 { + queryParameters["originAsValidationState"] = autorest.Encode("query", originAsValidationState) + } + if len(rpkiValidationState) > 0 { + queryParameters["rpkiValidationState"] = autorest.Encode("query", rpkiValidationState) + } + if len(skipToken) > 0 { + queryParameters["$skipToken"] = autorest.Encode("query", skipToken) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peerings/{peeringName}/receivedRoutes", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByPeeringSender sends the ListByPeering request. The method will close the +// http.Response Body if it receives an error. +func (client ReceivedRoutesClient) ListByPeeringSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByPeeringResponder handles the response to the ListByPeering request. The method always +// closes the http.Response Body. +func (client ReceivedRoutesClient) ListByPeeringResponder(resp *http.Response) (result ReceivedRouteListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByPeeringNextResults retrieves the next set of results, if any. +func (client ReceivedRoutesClient) listByPeeringNextResults(ctx context.Context, lastResults ReceivedRouteListResult) (result ReceivedRouteListResult, err error) { + req, err := lastResults.receivedRouteListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "peering.ReceivedRoutesClient", "listByPeeringNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByPeeringSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "peering.ReceivedRoutesClient", "listByPeeringNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByPeeringResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.ReceivedRoutesClient", "listByPeeringNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByPeeringComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReceivedRoutesClient) ListByPeeringComplete(ctx context.Context, resourceGroupName string, peeringName string, prefix string, asPath string, originAsValidationState string, rpkiValidationState string, skipToken string) (result ReceivedRouteListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReceivedRoutesClient.ListByPeering") + 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.ListByPeering(ctx, resourceGroupName, peeringName, prefix, asPath, originAsValidationState, rpkiValidationState, skipToken) + return +} diff --git a/services/peering/mgmt/2020-04-01/peering/registeredasns.go b/services/peering/mgmt/2020-04-01/peering/registeredasns.go new file mode 100644 index 000000000000..f36dcc5cb1f6 --- /dev/null +++ b/services/peering/mgmt/2020-04-01/peering/registeredasns.go @@ -0,0 +1,395 @@ +package peering + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// RegisteredAsnsClient is the peering Client +type RegisteredAsnsClient struct { + BaseClient +} + +// NewRegisteredAsnsClient creates an instance of the RegisteredAsnsClient client. +func NewRegisteredAsnsClient(subscriptionID string) RegisteredAsnsClient { + return NewRegisteredAsnsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewRegisteredAsnsClientWithBaseURI creates an instance of the RegisteredAsnsClient 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 NewRegisteredAsnsClientWithBaseURI(baseURI string, subscriptionID string) RegisteredAsnsClient { + return RegisteredAsnsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates a new registered ASN with the specified name under the given subscription, resource group and +// peering. +// Parameters: +// resourceGroupName - the name of the resource group. +// peeringName - the name of the peering. +// registeredAsnName - the name of the ASN. +// registeredAsn - the properties needed to create a registered ASN. +func (client RegisteredAsnsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, peeringName string, registeredAsnName string, registeredAsn RegisteredAsn) (result RegisteredAsn, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RegisteredAsnsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, peeringName, registeredAsnName, registeredAsn) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.RegisteredAsnsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "peering.RegisteredAsnsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.RegisteredAsnsClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client RegisteredAsnsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, peeringName string, registeredAsnName string, registeredAsn RegisteredAsn) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "peeringName": autorest.Encode("path", peeringName), + "registeredAsnName": autorest.Encode("path", registeredAsnName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-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.Peering/peerings/{peeringName}/registeredAsns/{registeredAsnName}", pathParameters), + autorest.WithJSON(registeredAsn), + 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 RegisteredAsnsClient) 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 RegisteredAsnsClient) CreateOrUpdateResponder(resp *http.Response) (result RegisteredAsn, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes an existing registered ASN with the specified name under the given subscription, resource group and +// peering. +// Parameters: +// resourceGroupName - the name of the resource group. +// peeringName - the name of the peering. +// registeredAsnName - the name of the registered ASN. +func (client RegisteredAsnsClient) Delete(ctx context.Context, resourceGroupName string, peeringName string, registeredAsnName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RegisteredAsnsClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, peeringName, registeredAsnName) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.RegisteredAsnsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "peering.RegisteredAsnsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.RegisteredAsnsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client RegisteredAsnsClient) DeletePreparer(ctx context.Context, resourceGroupName string, peeringName string, registeredAsnName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "peeringName": autorest.Encode("path", peeringName), + "registeredAsnName": autorest.Encode("path", registeredAsnName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-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.Peering/peerings/{peeringName}/registeredAsns/{registeredAsnName}", 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 RegisteredAsnsClient) 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 RegisteredAsnsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets an existing registered ASN with the specified name under the given subscription, resource group and +// peering. +// Parameters: +// resourceGroupName - the name of the resource group. +// peeringName - the name of the peering. +// registeredAsnName - the name of the registered ASN. +func (client RegisteredAsnsClient) Get(ctx context.Context, resourceGroupName string, peeringName string, registeredAsnName string) (result RegisteredAsn, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RegisteredAsnsClient.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, peeringName, registeredAsnName) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.RegisteredAsnsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "peering.RegisteredAsnsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.RegisteredAsnsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client RegisteredAsnsClient) GetPreparer(ctx context.Context, resourceGroupName string, peeringName string, registeredAsnName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "peeringName": autorest.Encode("path", peeringName), + "registeredAsnName": autorest.Encode("path", registeredAsnName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peerings/{peeringName}/registeredAsns/{registeredAsnName}", 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 RegisteredAsnsClient) 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 RegisteredAsnsClient) GetResponder(resp *http.Response) (result RegisteredAsn, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByPeering lists all registered ASNs under the given subscription, resource group and peering. +// Parameters: +// resourceGroupName - the name of the resource group. +// peeringName - the name of the peering. +func (client RegisteredAsnsClient) ListByPeering(ctx context.Context, resourceGroupName string, peeringName string) (result RegisteredAsnListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RegisteredAsnsClient.ListByPeering") + defer func() { + sc := -1 + if result.ralr.Response.Response != nil { + sc = result.ralr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByPeeringNextResults + req, err := client.ListByPeeringPreparer(ctx, resourceGroupName, peeringName) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.RegisteredAsnsClient", "ListByPeering", nil, "Failure preparing request") + return + } + + resp, err := client.ListByPeeringSender(req) + if err != nil { + result.ralr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "peering.RegisteredAsnsClient", "ListByPeering", resp, "Failure sending request") + return + } + + result.ralr, err = client.ListByPeeringResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.RegisteredAsnsClient", "ListByPeering", resp, "Failure responding to request") + } + + return +} + +// ListByPeeringPreparer prepares the ListByPeering request. +func (client RegisteredAsnsClient) ListByPeeringPreparer(ctx context.Context, resourceGroupName string, peeringName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "peeringName": autorest.Encode("path", peeringName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peerings/{peeringName}/registeredAsns", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByPeeringSender sends the ListByPeering request. The method will close the +// http.Response Body if it receives an error. +func (client RegisteredAsnsClient) ListByPeeringSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByPeeringResponder handles the response to the ListByPeering request. The method always +// closes the http.Response Body. +func (client RegisteredAsnsClient) ListByPeeringResponder(resp *http.Response) (result RegisteredAsnListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByPeeringNextResults retrieves the next set of results, if any. +func (client RegisteredAsnsClient) listByPeeringNextResults(ctx context.Context, lastResults RegisteredAsnListResult) (result RegisteredAsnListResult, err error) { + req, err := lastResults.registeredAsnListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "peering.RegisteredAsnsClient", "listByPeeringNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByPeeringSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "peering.RegisteredAsnsClient", "listByPeeringNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByPeeringResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.RegisteredAsnsClient", "listByPeeringNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByPeeringComplete enumerates all values, automatically crossing page boundaries as required. +func (client RegisteredAsnsClient) ListByPeeringComplete(ctx context.Context, resourceGroupName string, peeringName string) (result RegisteredAsnListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RegisteredAsnsClient.ListByPeering") + 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.ListByPeering(ctx, resourceGroupName, peeringName) + return +} diff --git a/services/peering/mgmt/2020-04-01/peering/registeredprefixes.go b/services/peering/mgmt/2020-04-01/peering/registeredprefixes.go new file mode 100644 index 000000000000..fe500f8c14d1 --- /dev/null +++ b/services/peering/mgmt/2020-04-01/peering/registeredprefixes.go @@ -0,0 +1,396 @@ +package peering + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// RegisteredPrefixesClient is the peering Client +type RegisteredPrefixesClient struct { + BaseClient +} + +// NewRegisteredPrefixesClient creates an instance of the RegisteredPrefixesClient client. +func NewRegisteredPrefixesClient(subscriptionID string) RegisteredPrefixesClient { + return NewRegisteredPrefixesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewRegisteredPrefixesClientWithBaseURI creates an instance of the RegisteredPrefixesClient 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 NewRegisteredPrefixesClientWithBaseURI(baseURI string, subscriptionID string) RegisteredPrefixesClient { + return RegisteredPrefixesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates a new registered prefix with the specified name under the given subscription, resource group +// and peering. +// Parameters: +// resourceGroupName - the name of the resource group. +// peeringName - the name of the peering. +// registeredPrefixName - the name of the registered prefix. +// registeredPrefix - the properties needed to create a registered prefix. +func (client RegisteredPrefixesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, peeringName string, registeredPrefixName string, registeredPrefix RegisteredPrefix) (result RegisteredPrefix, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RegisteredPrefixesClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, peeringName, registeredPrefixName, registeredPrefix) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.RegisteredPrefixesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "peering.RegisteredPrefixesClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.RegisteredPrefixesClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client RegisteredPrefixesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, peeringName string, registeredPrefixName string, registeredPrefix RegisteredPrefix) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "peeringName": autorest.Encode("path", peeringName), + "registeredPrefixName": autorest.Encode("path", registeredPrefixName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-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.Peering/peerings/{peeringName}/registeredPrefixes/{registeredPrefixName}", pathParameters), + autorest.WithJSON(registeredPrefix), + 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 RegisteredPrefixesClient) 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 RegisteredPrefixesClient) CreateOrUpdateResponder(resp *http.Response) (result RegisteredPrefix, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes an existing registered prefix with the specified name under the given subscription, resource group +// and peering. +// Parameters: +// resourceGroupName - the name of the resource group. +// peeringName - the name of the peering. +// registeredPrefixName - the name of the registered prefix. +func (client RegisteredPrefixesClient) Delete(ctx context.Context, resourceGroupName string, peeringName string, registeredPrefixName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RegisteredPrefixesClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, peeringName, registeredPrefixName) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.RegisteredPrefixesClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "peering.RegisteredPrefixesClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.RegisteredPrefixesClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client RegisteredPrefixesClient) DeletePreparer(ctx context.Context, resourceGroupName string, peeringName string, registeredPrefixName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "peeringName": autorest.Encode("path", peeringName), + "registeredPrefixName": autorest.Encode("path", registeredPrefixName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-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.Peering/peerings/{peeringName}/registeredPrefixes/{registeredPrefixName}", 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 RegisteredPrefixesClient) 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 RegisteredPrefixesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets an existing registered prefix with the specified name under the given subscription, resource group and +// peering. +// Parameters: +// resourceGroupName - the name of the resource group. +// peeringName - the name of the peering. +// registeredPrefixName - the name of the registered prefix. +func (client RegisteredPrefixesClient) Get(ctx context.Context, resourceGroupName string, peeringName string, registeredPrefixName string) (result RegisteredPrefix, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RegisteredPrefixesClient.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, peeringName, registeredPrefixName) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.RegisteredPrefixesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "peering.RegisteredPrefixesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.RegisteredPrefixesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client RegisteredPrefixesClient) GetPreparer(ctx context.Context, resourceGroupName string, peeringName string, registeredPrefixName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "peeringName": autorest.Encode("path", peeringName), + "registeredPrefixName": autorest.Encode("path", registeredPrefixName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peerings/{peeringName}/registeredPrefixes/{registeredPrefixName}", 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 RegisteredPrefixesClient) 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 RegisteredPrefixesClient) GetResponder(resp *http.Response) (result RegisteredPrefix, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByPeering lists all registered prefixes under the given subscription, resource group and peering. +// Parameters: +// resourceGroupName - the name of the resource group. +// peeringName - the name of the peering. +func (client RegisteredPrefixesClient) ListByPeering(ctx context.Context, resourceGroupName string, peeringName string) (result RegisteredPrefixListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RegisteredPrefixesClient.ListByPeering") + defer func() { + sc := -1 + if result.rplr.Response.Response != nil { + sc = result.rplr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByPeeringNextResults + req, err := client.ListByPeeringPreparer(ctx, resourceGroupName, peeringName) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.RegisteredPrefixesClient", "ListByPeering", nil, "Failure preparing request") + return + } + + resp, err := client.ListByPeeringSender(req) + if err != nil { + result.rplr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "peering.RegisteredPrefixesClient", "ListByPeering", resp, "Failure sending request") + return + } + + result.rplr, err = client.ListByPeeringResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.RegisteredPrefixesClient", "ListByPeering", resp, "Failure responding to request") + } + + return +} + +// ListByPeeringPreparer prepares the ListByPeering request. +func (client RegisteredPrefixesClient) ListByPeeringPreparer(ctx context.Context, resourceGroupName string, peeringName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "peeringName": autorest.Encode("path", peeringName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peerings/{peeringName}/registeredPrefixes", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByPeeringSender sends the ListByPeering request. The method will close the +// http.Response Body if it receives an error. +func (client RegisteredPrefixesClient) ListByPeeringSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByPeeringResponder handles the response to the ListByPeering request. The method always +// closes the http.Response Body. +func (client RegisteredPrefixesClient) ListByPeeringResponder(resp *http.Response) (result RegisteredPrefixListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByPeeringNextResults retrieves the next set of results, if any. +func (client RegisteredPrefixesClient) listByPeeringNextResults(ctx context.Context, lastResults RegisteredPrefixListResult) (result RegisteredPrefixListResult, err error) { + req, err := lastResults.registeredPrefixListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "peering.RegisteredPrefixesClient", "listByPeeringNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByPeeringSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "peering.RegisteredPrefixesClient", "listByPeeringNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByPeeringResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.RegisteredPrefixesClient", "listByPeeringNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByPeeringComplete enumerates all values, automatically crossing page boundaries as required. +func (client RegisteredPrefixesClient) ListByPeeringComplete(ctx context.Context, resourceGroupName string, peeringName string) (result RegisteredPrefixListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RegisteredPrefixesClient.ListByPeering") + 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.ListByPeering(ctx, resourceGroupName, peeringName) + return +} diff --git a/services/peering/mgmt/2020-04-01/peering/servicecountries.go b/services/peering/mgmt/2020-04-01/peering/servicecountries.go new file mode 100644 index 000000000000..b8f8dd219c30 --- /dev/null +++ b/services/peering/mgmt/2020-04-01/peering/servicecountries.go @@ -0,0 +1,152 @@ +package peering + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// ServiceCountriesClient is the peering Client +type ServiceCountriesClient struct { + BaseClient +} + +// NewServiceCountriesClient creates an instance of the ServiceCountriesClient client. +func NewServiceCountriesClient(subscriptionID string) ServiceCountriesClient { + return NewServiceCountriesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewServiceCountriesClientWithBaseURI creates an instance of the ServiceCountriesClient 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 NewServiceCountriesClientWithBaseURI(baseURI string, subscriptionID string) ServiceCountriesClient { + return ServiceCountriesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List lists all of the available countries for peering service. +func (client ServiceCountriesClient) List(ctx context.Context) (result ServiceCountryListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServiceCountriesClient.List") + defer func() { + sc := -1 + if result.sclr.Response.Response != nil { + sc = result.sclr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.ServiceCountriesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.sclr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "peering.ServiceCountriesClient", "List", resp, "Failure sending request") + return + } + + result.sclr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.ServiceCountriesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client ServiceCountriesClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Peering/peeringServiceCountries", 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 ServiceCountriesClient) 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 ServiceCountriesClient) ListResponder(resp *http.Response) (result ServiceCountryListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 ServiceCountriesClient) listNextResults(ctx context.Context, lastResults ServiceCountryListResult) (result ServiceCountryListResult, err error) { + req, err := lastResults.serviceCountryListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "peering.ServiceCountriesClient", "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, "peering.ServiceCountriesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.ServiceCountriesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ServiceCountriesClient) ListComplete(ctx context.Context) (result ServiceCountryListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServiceCountriesClient.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/peering/mgmt/2020-04-01/peering/servicelocations.go b/services/peering/mgmt/2020-04-01/peering/servicelocations.go new file mode 100644 index 000000000000..c36193898a8d --- /dev/null +++ b/services/peering/mgmt/2020-04-01/peering/servicelocations.go @@ -0,0 +1,157 @@ +package peering + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// ServiceLocationsClient is the peering Client +type ServiceLocationsClient struct { + BaseClient +} + +// NewServiceLocationsClient creates an instance of the ServiceLocationsClient client. +func NewServiceLocationsClient(subscriptionID string) ServiceLocationsClient { + return NewServiceLocationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewServiceLocationsClientWithBaseURI creates an instance of the ServiceLocationsClient 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 NewServiceLocationsClientWithBaseURI(baseURI string, subscriptionID string) ServiceLocationsClient { + return ServiceLocationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List lists all of the available locations for peering service. +// Parameters: +// country - the country of interest, in which the locations are to be present. +func (client ServiceLocationsClient) List(ctx context.Context, country string) (result ServiceLocationListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServiceLocationsClient.List") + defer func() { + sc := -1 + if result.sllr.Response.Response != nil { + sc = result.sllr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, country) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.ServiceLocationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.sllr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "peering.ServiceLocationsClient", "List", resp, "Failure sending request") + return + } + + result.sllr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.ServiceLocationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client ServiceLocationsClient) ListPreparer(ctx context.Context, country string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(country) > 0 { + queryParameters["country"] = autorest.Encode("query", country) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Peering/peeringServiceLocations", 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 ServiceLocationsClient) 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 ServiceLocationsClient) ListResponder(resp *http.Response) (result ServiceLocationListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 ServiceLocationsClient) listNextResults(ctx context.Context, lastResults ServiceLocationListResult) (result ServiceLocationListResult, err error) { + req, err := lastResults.serviceLocationListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "peering.ServiceLocationsClient", "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, "peering.ServiceLocationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.ServiceLocationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ServiceLocationsClient) ListComplete(ctx context.Context, country string) (result ServiceLocationListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServiceLocationsClient.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, country) + return +} diff --git a/services/peering/mgmt/2020-04-01/peering/serviceproviders.go b/services/peering/mgmt/2020-04-01/peering/serviceproviders.go new file mode 100644 index 000000000000..e265b39a127b --- /dev/null +++ b/services/peering/mgmt/2020-04-01/peering/serviceproviders.go @@ -0,0 +1,152 @@ +package peering + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// ServiceProvidersClient is the peering Client +type ServiceProvidersClient struct { + BaseClient +} + +// NewServiceProvidersClient creates an instance of the ServiceProvidersClient client. +func NewServiceProvidersClient(subscriptionID string) ServiceProvidersClient { + return NewServiceProvidersClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewServiceProvidersClientWithBaseURI creates an instance of the ServiceProvidersClient 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 NewServiceProvidersClientWithBaseURI(baseURI string, subscriptionID string) ServiceProvidersClient { + return ServiceProvidersClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List lists all of the available peering service locations for the specified kind of peering. +func (client ServiceProvidersClient) List(ctx context.Context) (result ServiceProviderListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServiceProvidersClient.List") + defer func() { + sc := -1 + if result.splr.Response.Response != nil { + sc = result.splr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.ServiceProvidersClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.splr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "peering.ServiceProvidersClient", "List", resp, "Failure sending request") + return + } + + result.splr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.ServiceProvidersClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client ServiceProvidersClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Peering/peeringServiceProviders", 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 ServiceProvidersClient) 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 ServiceProvidersClient) ListResponder(resp *http.Response) (result ServiceProviderListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 ServiceProvidersClient) listNextResults(ctx context.Context, lastResults ServiceProviderListResult) (result ServiceProviderListResult, err error) { + req, err := lastResults.serviceProviderListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "peering.ServiceProvidersClient", "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, "peering.ServiceProvidersClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.ServiceProvidersClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ServiceProvidersClient) ListComplete(ctx context.Context) (result ServiceProviderListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServiceProvidersClient.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/peering/mgmt/2020-04-01/peering/services.go b/services/peering/mgmt/2020-04-01/peering/services.go new file mode 100644 index 000000000000..5c0cd18e79f7 --- /dev/null +++ b/services/peering/mgmt/2020-04-01/peering/services.go @@ -0,0 +1,580 @@ +package peering + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// ServicesClient is the peering Client +type ServicesClient struct { + BaseClient +} + +// NewServicesClient creates an instance of the ServicesClient client. +func NewServicesClient(subscriptionID string) ServicesClient { + return NewServicesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewServicesClientWithBaseURI creates an instance of the ServicesClient 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 NewServicesClientWithBaseURI(baseURI string, subscriptionID string) ServicesClient { + return ServicesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates a new peering service or updates an existing peering with the specified name under the given +// subscription and resource group. +// Parameters: +// resourceGroupName - the name of the resource group. +// peeringServiceName - the name of the peering service. +// peeringService - the properties needed to create or update a peering service. +func (client ServicesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, peeringServiceName string, peeringService Service) (result Service, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.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: peeringService, + Constraints: []validation.Constraint{{Target: "peeringService.Location", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("peering.ServicesClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, peeringServiceName, peeringService) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.ServicesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "peering.ServicesClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.ServicesClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ServicesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, peeringServiceName string, peeringService Service) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "peeringServiceName": autorest.Encode("path", peeringServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-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.Peering/peeringServices/{peeringServiceName}", pathParameters), + autorest.WithJSON(peeringService), + 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 ServicesClient) 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 ServicesClient) CreateOrUpdateResponder(resp *http.Response) (result Service, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes an existing peering service with the specified name under the given subscription and resource group. +// Parameters: +// resourceGroupName - the name of the resource group. +// peeringServiceName - the name of the peering service. +func (client ServicesClient) Delete(ctx context.Context, resourceGroupName string, peeringServiceName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, peeringServiceName) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.ServicesClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "peering.ServicesClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.ServicesClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ServicesClient) DeletePreparer(ctx context.Context, resourceGroupName string, peeringServiceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "peeringServiceName": autorest.Encode("path", peeringServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-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.Peering/peeringServices/{peeringServiceName}", 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 ServicesClient) 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 ServicesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets an existing peering service with the specified name under the given subscription and resource group. +// Parameters: +// resourceGroupName - the name of the resource group. +// peeringServiceName - the name of the peering. +func (client ServicesClient) Get(ctx context.Context, resourceGroupName string, peeringServiceName string) (result Service, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.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, peeringServiceName) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.ServicesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "peering.ServicesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.ServicesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ServicesClient) GetPreparer(ctx context.Context, resourceGroupName string, peeringServiceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "peeringServiceName": autorest.Encode("path", peeringServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peeringServices/{peeringServiceName}", 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 ServicesClient) 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 ServicesClient) GetResponder(resp *http.Response) (result Service, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByResourceGroup lists all of the peering services under the given subscription and resource group. +// Parameters: +// resourceGroupName - the name of the resource group. +func (client ServicesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ServiceListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.slr.Response.Response != nil { + sc = result.slr.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, "peering.ServicesClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.slr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "peering.ServicesClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.slr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.ServicesClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client ServicesClient) 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 = "2020-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Peering/peeringServices", 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 ServicesClient) 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 ServicesClient) ListByResourceGroupResponder(resp *http.Response) (result ServiceListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 ServicesClient) listByResourceGroupNextResults(ctx context.Context, lastResults ServiceListResult) (result ServiceListResult, err error) { + req, err := lastResults.serviceListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "peering.ServicesClient", "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, "peering.ServicesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.ServicesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client ServicesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ServiceListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.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 lists all of the peerings under the given subscription. +func (client ServicesClient) ListBySubscription(ctx context.Context) (result ServiceListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.ListBySubscription") + defer func() { + sc := -1 + if result.slr.Response.Response != nil { + sc = result.slr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listBySubscriptionNextResults + req, err := client.ListBySubscriptionPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.ServicesClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.slr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "peering.ServicesClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result.slr, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.ServicesClient", "ListBySubscription", resp, "Failure responding to request") + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client ServicesClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Peering/peeringServices", 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 ServicesClient) 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 ServicesClient) ListBySubscriptionResponder(resp *http.Response) (result ServiceListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 ServicesClient) listBySubscriptionNextResults(ctx context.Context, lastResults ServiceListResult) (result ServiceListResult, err error) { + req, err := lastResults.serviceListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "peering.ServicesClient", "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, "peering.ServicesClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.ServicesClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client ServicesClient) ListBySubscriptionComplete(ctx context.Context) (result ServiceListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.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 updates tags for a peering service with the specified name under the given subscription and resource group. +// Parameters: +// resourceGroupName - the name of the resource group. +// peeringServiceName - the name of the peering service. +// tags - the resource tags. +func (client ServicesClient) Update(ctx context.Context, resourceGroupName string, peeringServiceName string, tags ResourceTags) (result Service, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ServicesClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, peeringServiceName, tags) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.ServicesClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "peering.ServicesClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "peering.ServicesClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ServicesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, peeringServiceName string, tags ResourceTags) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "peeringServiceName": autorest.Encode("path", peeringServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-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.Peering/peeringServices/{peeringServiceName}", pathParameters), + autorest.WithJSON(tags), + 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 ServicesClient) 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 ServicesClient) UpdateResponder(resp *http.Response) (result Service, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/peering/mgmt/2020-04-01/peering/version.go b/services/peering/mgmt/2020-04-01/peering/version.go new file mode 100644 index 000000000000..0f3e06a9c8fd --- /dev/null +++ b/services/peering/mgmt/2020-04-01/peering/version.go @@ -0,0 +1,30 @@ +package peering + +import "github.com/Azure/azure-sdk-for-go/version" + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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() + " peering/2020-04-01" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/services/policyinsights/mgmt/2019-10-01/policyinsights/models.go b/services/policyinsights/mgmt/2019-10-01/policyinsights/models.go index 7085a361adac..b7e124803bbe 100644 --- a/services/policyinsights/mgmt/2019-10-01/policyinsights/models.go +++ b/services/policyinsights/mgmt/2019-10-01/policyinsights/models.go @@ -930,10 +930,149 @@ type PolicyEventsQueryResults struct { OdataContext *string `json:"@odata.context,omitempty"` // OdataCount - OData entity count; represents the number of policy event records returned. OdataCount *int32 `json:"@odata.count,omitempty"` + // OdataNextLink - Odata next link; URL to get the next set of results. + OdataNextLink *string `json:"@odata.nextLink,omitempty"` // Value - Query results. Value *[]PolicyEvent `json:"value,omitempty"` } +// PolicyEventsQueryResultsIterator provides access to a complete listing of PolicyEvent values. +type PolicyEventsQueryResultsIterator struct { + i int + page PolicyEventsQueryResultsPage +} + +// 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 *PolicyEventsQueryResultsIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyEventsQueryResultsIterator.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 *PolicyEventsQueryResultsIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter PolicyEventsQueryResultsIterator) 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 PolicyEventsQueryResultsIterator) Response() PolicyEventsQueryResults { + 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 PolicyEventsQueryResultsIterator) Value() PolicyEvent { + if !iter.page.NotDone() { + return PolicyEvent{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the PolicyEventsQueryResultsIterator type. +func NewPolicyEventsQueryResultsIterator(page PolicyEventsQueryResultsPage) PolicyEventsQueryResultsIterator { + return PolicyEventsQueryResultsIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (peqr PolicyEventsQueryResults) IsEmpty() bool { + return peqr.Value == nil || len(*peqr.Value) == 0 +} + +// policyEventsQueryResultsPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (peqr PolicyEventsQueryResults) policyEventsQueryResultsPreparer(ctx context.Context) (*http.Request, error) { + if peqr.OdataNextLink == nil || len(to.String(peqr.OdataNextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(peqr.OdataNextLink))) +} + +// PolicyEventsQueryResultsPage contains a page of PolicyEvent values. +type PolicyEventsQueryResultsPage struct { + fn func(context.Context, PolicyEventsQueryResults) (PolicyEventsQueryResults, error) + peqr PolicyEventsQueryResults +} + +// 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 *PolicyEventsQueryResultsPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyEventsQueryResultsPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.peqr) + if err != nil { + return err + } + page.peqr = next + 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 *PolicyEventsQueryResultsPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page PolicyEventsQueryResultsPage) NotDone() bool { + return !page.peqr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page PolicyEventsQueryResultsPage) Response() PolicyEventsQueryResults { + return page.peqr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page PolicyEventsQueryResultsPage) Values() []PolicyEvent { + if page.peqr.IsEmpty() { + return nil + } + return *page.peqr.Value +} + +// Creates a new instance of the PolicyEventsQueryResultsPage type. +func NewPolicyEventsQueryResultsPage(getNextPage func(context.Context, PolicyEventsQueryResults) (PolicyEventsQueryResults, error)) PolicyEventsQueryResultsPage { + return PolicyEventsQueryResultsPage{fn: getNextPage} +} + // PolicyGroupSummary policy definition group summary. type PolicyGroupSummary struct { // PolicyGroupName - Policy group name. @@ -1714,10 +1853,149 @@ type PolicyStatesQueryResults struct { OdataContext *string `json:"@odata.context,omitempty"` // OdataCount - OData entity count; represents the number of policy state records returned. OdataCount *int32 `json:"@odata.count,omitempty"` + // OdataNextLink - Odata next link; URL to get the next set of results. + OdataNextLink *string `json:"@odata.nextLink,omitempty"` // Value - Query results. Value *[]PolicyState `json:"value,omitempty"` } +// PolicyStatesQueryResultsIterator provides access to a complete listing of PolicyState values. +type PolicyStatesQueryResultsIterator struct { + i int + page PolicyStatesQueryResultsPage +} + +// 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 *PolicyStatesQueryResultsIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyStatesQueryResultsIterator.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 *PolicyStatesQueryResultsIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter PolicyStatesQueryResultsIterator) 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 PolicyStatesQueryResultsIterator) Response() PolicyStatesQueryResults { + 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 PolicyStatesQueryResultsIterator) Value() PolicyState { + if !iter.page.NotDone() { + return PolicyState{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the PolicyStatesQueryResultsIterator type. +func NewPolicyStatesQueryResultsIterator(page PolicyStatesQueryResultsPage) PolicyStatesQueryResultsIterator { + return PolicyStatesQueryResultsIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (psqr PolicyStatesQueryResults) IsEmpty() bool { + return psqr.Value == nil || len(*psqr.Value) == 0 +} + +// policyStatesQueryResultsPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (psqr PolicyStatesQueryResults) policyStatesQueryResultsPreparer(ctx context.Context) (*http.Request, error) { + if psqr.OdataNextLink == nil || len(to.String(psqr.OdataNextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(psqr.OdataNextLink))) +} + +// PolicyStatesQueryResultsPage contains a page of PolicyState values. +type PolicyStatesQueryResultsPage struct { + fn func(context.Context, PolicyStatesQueryResults) (PolicyStatesQueryResults, error) + psqr PolicyStatesQueryResults +} + +// 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 *PolicyStatesQueryResultsPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyStatesQueryResultsPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.psqr) + if err != nil { + return err + } + page.psqr = next + 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 *PolicyStatesQueryResultsPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page PolicyStatesQueryResultsPage) NotDone() bool { + return !page.psqr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page PolicyStatesQueryResultsPage) Response() PolicyStatesQueryResults { + return page.psqr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page PolicyStatesQueryResultsPage) Values() []PolicyState { + if page.psqr.IsEmpty() { + return nil + } + return *page.psqr.Value +} + +// Creates a new instance of the PolicyStatesQueryResultsPage type. +func NewPolicyStatesQueryResultsPage(getNextPage func(context.Context, PolicyStatesQueryResults) (PolicyStatesQueryResults, error)) PolicyStatesQueryResultsPage { + return PolicyStatesQueryResultsPage{fn: getNextPage} +} + // PolicyStatesTriggerResourceGroupEvaluationFuture an abstraction for monitoring and retrieving the // results of a long-running operation. type PolicyStatesTriggerResourceGroupEvaluationFuture struct { @@ -2433,12 +2711,6 @@ func (spm *SlimPolicyMetadata) UnmarshalJSON(body []byte) error { return nil } -// String ... -type String struct { - autorest.Response `json:"-"` - Value *string `json:"value,omitempty"` -} - // SummarizeResults summarize action results. type SummarizeResults struct { autorest.Response `json:"-"` diff --git a/services/policyinsights/mgmt/2019-10-01/policyinsights/policyevents.go b/services/policyinsights/mgmt/2019-10-01/policyinsights/policyevents.go index 0c77e0e35813..514796bbaf79 100644 --- a/services/policyinsights/mgmt/2019-10-01/policyinsights/policyevents.go +++ b/services/policyinsights/mgmt/2019-10-01/policyinsights/policyevents.go @@ -43,80 +43,6 @@ func NewPolicyEventsClientWithBaseURI(baseURI string) PolicyEventsClient { return PolicyEventsClient{NewWithBaseURI(baseURI)} } -// GetMetadata gets OData metadata XML document. -// Parameters: -// scope - a valid scope, i.e. management group, subscription, resource group, or resource ID. Scope used has -// no effect on metadata returned. -func (client PolicyEventsClient) GetMetadata(ctx context.Context, scope string) (result String, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PolicyEventsClient.GetMetadata") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetMetadataPreparer(ctx, scope) - if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "GetMetadata", nil, "Failure preparing request") - return - } - - resp, err := client.GetMetadataSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "GetMetadata", resp, "Failure sending request") - return - } - - result, err = client.GetMetadataResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "GetMetadata", resp, "Failure responding to request") - } - - return -} - -// GetMetadataPreparer prepares the GetMetadata request. -func (client PolicyEventsClient) GetMetadataPreparer(ctx context.Context, scope string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "scope": scope, - } - - const APIVersion = "2019-10-01" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/{scope}/providers/Microsoft.PolicyInsights/policyEvents/$metadata", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetMetadataSender sends the GetMetadata request. The method will close the -// http.Response Body if it receives an error. -func (client PolicyEventsClient) GetMetadataSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetMetadataResponder handles the response to the GetMetadata request. The method always -// closes the http.Response Body. -func (client PolicyEventsClient) GetMetadataResponder(resp *http.Response) (result String, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - // ListQueryResultsForManagementGroup queries policy events for the resources under the management group. // Parameters: // managementGroupName - management group name. @@ -131,13 +57,15 @@ func (client PolicyEventsClient) GetMetadataResponder(resp *http.Response) (resu // specified, the service uses request time. // filter - oData filter expression. // apply - oData apply expression for aggregations. -func (client PolicyEventsClient) ListQueryResultsForManagementGroup(ctx context.Context, managementGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result PolicyEventsQueryResults, err error) { +// skipToken - skiptoken is only provided if a previous response returned a partial result as a part of +// nextLink element. +func (client PolicyEventsClient) ListQueryResultsForManagementGroup(ctx context.Context, managementGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result PolicyEventsQueryResultsPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PolicyEventsClient.ListQueryResultsForManagementGroup") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.peqr.Response.Response != nil { + sc = result.peqr.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -149,7 +77,8 @@ func (client PolicyEventsClient) ListQueryResultsForManagementGroup(ctx context. return result, validation.NewError("policyinsights.PolicyEventsClient", "ListQueryResultsForManagementGroup", err.Error()) } - req, err := client.ListQueryResultsForManagementGroupPreparer(ctx, managementGroupName, top, orderBy, selectParameter, from, toParameter, filter, apply) + result.fn = client.listQueryResultsForManagementGroupNextResults + req, err := client.ListQueryResultsForManagementGroupPreparer(ctx, managementGroupName, top, orderBy, selectParameter, from, toParameter, filter, apply, skipToken) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForManagementGroup", nil, "Failure preparing request") return @@ -157,12 +86,12 @@ func (client PolicyEventsClient) ListQueryResultsForManagementGroup(ctx context. resp, err := client.ListQueryResultsForManagementGroupSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} + result.peqr.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForManagementGroup", resp, "Failure sending request") return } - result, err = client.ListQueryResultsForManagementGroupResponder(resp) + result.peqr, err = client.ListQueryResultsForManagementGroupResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForManagementGroup", resp, "Failure responding to request") } @@ -171,7 +100,7 @@ func (client PolicyEventsClient) ListQueryResultsForManagementGroup(ctx context. } // ListQueryResultsForManagementGroupPreparer prepares the ListQueryResultsForManagementGroup request. -func (client PolicyEventsClient) ListQueryResultsForManagementGroupPreparer(ctx context.Context, managementGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (*http.Request, error) { +func (client PolicyEventsClient) ListQueryResultsForManagementGroupPreparer(ctx context.Context, managementGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (*http.Request, error) { pathParameters := map[string]interface{}{ "managementGroupName": autorest.Encode("path", managementGroupName), "managementGroupsNamespace": autorest.Encode("path", "Microsoft.Management"), @@ -203,6 +132,9 @@ func (client PolicyEventsClient) ListQueryResultsForManagementGroupPreparer(ctx if len(apply) > 0 { queryParameters["$apply"] = autorest.Encode("query", apply) } + if len(skipToken) > 0 { + queryParameters["$skiptoken"] = autorest.Encode("query", skipToken) + } preparer := autorest.CreatePreparer( autorest.AsPost(), @@ -231,6 +163,43 @@ func (client PolicyEventsClient) ListQueryResultsForManagementGroupResponder(res return } +// listQueryResultsForManagementGroupNextResults retrieves the next set of results, if any. +func (client PolicyEventsClient) listQueryResultsForManagementGroupNextResults(ctx context.Context, lastResults PolicyEventsQueryResults) (result PolicyEventsQueryResults, err error) { + req, err := lastResults.policyEventsQueryResultsPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "listQueryResultsForManagementGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListQueryResultsForManagementGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "listQueryResultsForManagementGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListQueryResultsForManagementGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "listQueryResultsForManagementGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListQueryResultsForManagementGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client PolicyEventsClient) ListQueryResultsForManagementGroupComplete(ctx context.Context, managementGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result PolicyEventsQueryResultsIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyEventsClient.ListQueryResultsForManagementGroup") + 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.ListQueryResultsForManagementGroup(ctx, managementGroupName, top, orderBy, selectParameter, from, toParameter, filter, apply, skipToken) + return +} + // ListQueryResultsForPolicyDefinition queries policy events for the subscription level policy definition. // Parameters: // subscriptionID - microsoft Azure subscription ID. @@ -246,13 +215,15 @@ func (client PolicyEventsClient) ListQueryResultsForManagementGroupResponder(res // specified, the service uses request time. // filter - oData filter expression. // apply - oData apply expression for aggregations. -func (client PolicyEventsClient) ListQueryResultsForPolicyDefinition(ctx context.Context, subscriptionID string, policyDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result PolicyEventsQueryResults, err error) { +// skipToken - skiptoken is only provided if a previous response returned a partial result as a part of +// nextLink element. +func (client PolicyEventsClient) ListQueryResultsForPolicyDefinition(ctx context.Context, subscriptionID string, policyDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result PolicyEventsQueryResultsPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PolicyEventsClient.ListQueryResultsForPolicyDefinition") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.peqr.Response.Response != nil { + sc = result.peqr.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -264,7 +235,8 @@ func (client PolicyEventsClient) ListQueryResultsForPolicyDefinition(ctx context return result, validation.NewError("policyinsights.PolicyEventsClient", "ListQueryResultsForPolicyDefinition", err.Error()) } - req, err := client.ListQueryResultsForPolicyDefinitionPreparer(ctx, subscriptionID, policyDefinitionName, top, orderBy, selectParameter, from, toParameter, filter, apply) + result.fn = client.listQueryResultsForPolicyDefinitionNextResults + req, err := client.ListQueryResultsForPolicyDefinitionPreparer(ctx, subscriptionID, policyDefinitionName, top, orderBy, selectParameter, from, toParameter, filter, apply, skipToken) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForPolicyDefinition", nil, "Failure preparing request") return @@ -272,12 +244,12 @@ func (client PolicyEventsClient) ListQueryResultsForPolicyDefinition(ctx context resp, err := client.ListQueryResultsForPolicyDefinitionSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} + result.peqr.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForPolicyDefinition", resp, "Failure sending request") return } - result, err = client.ListQueryResultsForPolicyDefinitionResponder(resp) + result.peqr, err = client.ListQueryResultsForPolicyDefinitionResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForPolicyDefinition", resp, "Failure responding to request") } @@ -286,7 +258,7 @@ func (client PolicyEventsClient) ListQueryResultsForPolicyDefinition(ctx context } // ListQueryResultsForPolicyDefinitionPreparer prepares the ListQueryResultsForPolicyDefinition request. -func (client PolicyEventsClient) ListQueryResultsForPolicyDefinitionPreparer(ctx context.Context, subscriptionID string, policyDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (*http.Request, error) { +func (client PolicyEventsClient) ListQueryResultsForPolicyDefinitionPreparer(ctx context.Context, subscriptionID string, policyDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (*http.Request, error) { pathParameters := map[string]interface{}{ "authorizationNamespace": autorest.Encode("path", "Microsoft.Authorization"), "policyDefinitionName": autorest.Encode("path", policyDefinitionName), @@ -319,6 +291,9 @@ func (client PolicyEventsClient) ListQueryResultsForPolicyDefinitionPreparer(ctx if len(apply) > 0 { queryParameters["$apply"] = autorest.Encode("query", apply) } + if len(skipToken) > 0 { + queryParameters["$skiptoken"] = autorest.Encode("query", skipToken) + } preparer := autorest.CreatePreparer( autorest.AsPost(), @@ -347,6 +322,43 @@ func (client PolicyEventsClient) ListQueryResultsForPolicyDefinitionResponder(re return } +// listQueryResultsForPolicyDefinitionNextResults retrieves the next set of results, if any. +func (client PolicyEventsClient) listQueryResultsForPolicyDefinitionNextResults(ctx context.Context, lastResults PolicyEventsQueryResults) (result PolicyEventsQueryResults, err error) { + req, err := lastResults.policyEventsQueryResultsPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "listQueryResultsForPolicyDefinitionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListQueryResultsForPolicyDefinitionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "listQueryResultsForPolicyDefinitionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListQueryResultsForPolicyDefinitionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "listQueryResultsForPolicyDefinitionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListQueryResultsForPolicyDefinitionComplete enumerates all values, automatically crossing page boundaries as required. +func (client PolicyEventsClient) ListQueryResultsForPolicyDefinitionComplete(ctx context.Context, subscriptionID string, policyDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result PolicyEventsQueryResultsIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyEventsClient.ListQueryResultsForPolicyDefinition") + 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.ListQueryResultsForPolicyDefinition(ctx, subscriptionID, policyDefinitionName, top, orderBy, selectParameter, from, toParameter, filter, apply, skipToken) + return +} + // ListQueryResultsForPolicySetDefinition queries policy events for the subscription level policy set definition. // Parameters: // subscriptionID - microsoft Azure subscription ID. @@ -362,13 +374,15 @@ func (client PolicyEventsClient) ListQueryResultsForPolicyDefinitionResponder(re // specified, the service uses request time. // filter - oData filter expression. // apply - oData apply expression for aggregations. -func (client PolicyEventsClient) ListQueryResultsForPolicySetDefinition(ctx context.Context, subscriptionID string, policySetDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result PolicyEventsQueryResults, err error) { +// skipToken - skiptoken is only provided if a previous response returned a partial result as a part of +// nextLink element. +func (client PolicyEventsClient) ListQueryResultsForPolicySetDefinition(ctx context.Context, subscriptionID string, policySetDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result PolicyEventsQueryResultsPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PolicyEventsClient.ListQueryResultsForPolicySetDefinition") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.peqr.Response.Response != nil { + sc = result.peqr.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -380,7 +394,8 @@ func (client PolicyEventsClient) ListQueryResultsForPolicySetDefinition(ctx cont return result, validation.NewError("policyinsights.PolicyEventsClient", "ListQueryResultsForPolicySetDefinition", err.Error()) } - req, err := client.ListQueryResultsForPolicySetDefinitionPreparer(ctx, subscriptionID, policySetDefinitionName, top, orderBy, selectParameter, from, toParameter, filter, apply) + result.fn = client.listQueryResultsForPolicySetDefinitionNextResults + req, err := client.ListQueryResultsForPolicySetDefinitionPreparer(ctx, subscriptionID, policySetDefinitionName, top, orderBy, selectParameter, from, toParameter, filter, apply, skipToken) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForPolicySetDefinition", nil, "Failure preparing request") return @@ -388,12 +403,12 @@ func (client PolicyEventsClient) ListQueryResultsForPolicySetDefinition(ctx cont resp, err := client.ListQueryResultsForPolicySetDefinitionSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} + result.peqr.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForPolicySetDefinition", resp, "Failure sending request") return } - result, err = client.ListQueryResultsForPolicySetDefinitionResponder(resp) + result.peqr, err = client.ListQueryResultsForPolicySetDefinitionResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForPolicySetDefinition", resp, "Failure responding to request") } @@ -402,7 +417,7 @@ func (client PolicyEventsClient) ListQueryResultsForPolicySetDefinition(ctx cont } // ListQueryResultsForPolicySetDefinitionPreparer prepares the ListQueryResultsForPolicySetDefinition request. -func (client PolicyEventsClient) ListQueryResultsForPolicySetDefinitionPreparer(ctx context.Context, subscriptionID string, policySetDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (*http.Request, error) { +func (client PolicyEventsClient) ListQueryResultsForPolicySetDefinitionPreparer(ctx context.Context, subscriptionID string, policySetDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (*http.Request, error) { pathParameters := map[string]interface{}{ "authorizationNamespace": autorest.Encode("path", "Microsoft.Authorization"), "policyEventsResource": autorest.Encode("path", "default"), @@ -435,6 +450,9 @@ func (client PolicyEventsClient) ListQueryResultsForPolicySetDefinitionPreparer( if len(apply) > 0 { queryParameters["$apply"] = autorest.Encode("query", apply) } + if len(skipToken) > 0 { + queryParameters["$skiptoken"] = autorest.Encode("query", skipToken) + } preparer := autorest.CreatePreparer( autorest.AsPost(), @@ -463,6 +481,43 @@ func (client PolicyEventsClient) ListQueryResultsForPolicySetDefinitionResponder return } +// listQueryResultsForPolicySetDefinitionNextResults retrieves the next set of results, if any. +func (client PolicyEventsClient) listQueryResultsForPolicySetDefinitionNextResults(ctx context.Context, lastResults PolicyEventsQueryResults) (result PolicyEventsQueryResults, err error) { + req, err := lastResults.policyEventsQueryResultsPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "listQueryResultsForPolicySetDefinitionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListQueryResultsForPolicySetDefinitionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "listQueryResultsForPolicySetDefinitionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListQueryResultsForPolicySetDefinitionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "listQueryResultsForPolicySetDefinitionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListQueryResultsForPolicySetDefinitionComplete enumerates all values, automatically crossing page boundaries as required. +func (client PolicyEventsClient) ListQueryResultsForPolicySetDefinitionComplete(ctx context.Context, subscriptionID string, policySetDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result PolicyEventsQueryResultsIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyEventsClient.ListQueryResultsForPolicySetDefinition") + 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.ListQueryResultsForPolicySetDefinition(ctx, subscriptionID, policySetDefinitionName, top, orderBy, selectParameter, from, toParameter, filter, apply, skipToken) + return +} + // ListQueryResultsForResource queries policy events for the resource. // Parameters: // resourceID - resource ID. @@ -478,13 +533,15 @@ func (client PolicyEventsClient) ListQueryResultsForPolicySetDefinitionResponder // filter - oData filter expression. // apply - oData apply expression for aggregations. // expand - the $expand query parameter. For example, to expand components use $expand=components -func (client PolicyEventsClient) ListQueryResultsForResource(ctx context.Context, resourceID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, expand string) (result PolicyEventsQueryResults, err error) { +// skipToken - skiptoken is only provided if a previous response returned a partial result as a part of +// nextLink element. +func (client PolicyEventsClient) ListQueryResultsForResource(ctx context.Context, resourceID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, expand string, skipToken string) (result PolicyEventsQueryResultsPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PolicyEventsClient.ListQueryResultsForResource") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.peqr.Response.Response != nil { + sc = result.peqr.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -496,7 +553,8 @@ func (client PolicyEventsClient) ListQueryResultsForResource(ctx context.Context return result, validation.NewError("policyinsights.PolicyEventsClient", "ListQueryResultsForResource", err.Error()) } - req, err := client.ListQueryResultsForResourcePreparer(ctx, resourceID, top, orderBy, selectParameter, from, toParameter, filter, apply, expand) + result.fn = client.listQueryResultsForResourceNextResults + req, err := client.ListQueryResultsForResourcePreparer(ctx, resourceID, top, orderBy, selectParameter, from, toParameter, filter, apply, expand, skipToken) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForResource", nil, "Failure preparing request") return @@ -504,12 +562,12 @@ func (client PolicyEventsClient) ListQueryResultsForResource(ctx context.Context resp, err := client.ListQueryResultsForResourceSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} + result.peqr.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForResource", resp, "Failure sending request") return } - result, err = client.ListQueryResultsForResourceResponder(resp) + result.peqr, err = client.ListQueryResultsForResourceResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForResource", resp, "Failure responding to request") } @@ -518,7 +576,7 @@ func (client PolicyEventsClient) ListQueryResultsForResource(ctx context.Context } // ListQueryResultsForResourcePreparer prepares the ListQueryResultsForResource request. -func (client PolicyEventsClient) ListQueryResultsForResourcePreparer(ctx context.Context, resourceID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, expand string) (*http.Request, error) { +func (client PolicyEventsClient) ListQueryResultsForResourcePreparer(ctx context.Context, resourceID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, expand string, skipToken string) (*http.Request, error) { pathParameters := map[string]interface{}{ "policyEventsResource": autorest.Encode("path", "default"), "resourceId": resourceID, @@ -552,6 +610,9 @@ func (client PolicyEventsClient) ListQueryResultsForResourcePreparer(ctx context if len(expand) > 0 { queryParameters["$expand"] = autorest.Encode("query", expand) } + if len(skipToken) > 0 { + queryParameters["$skiptoken"] = autorest.Encode("query", skipToken) + } preparer := autorest.CreatePreparer( autorest.AsPost(), @@ -580,6 +641,43 @@ func (client PolicyEventsClient) ListQueryResultsForResourceResponder(resp *http return } +// listQueryResultsForResourceNextResults retrieves the next set of results, if any. +func (client PolicyEventsClient) listQueryResultsForResourceNextResults(ctx context.Context, lastResults PolicyEventsQueryResults) (result PolicyEventsQueryResults, err error) { + req, err := lastResults.policyEventsQueryResultsPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "listQueryResultsForResourceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListQueryResultsForResourceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "listQueryResultsForResourceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListQueryResultsForResourceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "listQueryResultsForResourceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListQueryResultsForResourceComplete enumerates all values, automatically crossing page boundaries as required. +func (client PolicyEventsClient) ListQueryResultsForResourceComplete(ctx context.Context, resourceID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, expand string, skipToken string) (result PolicyEventsQueryResultsIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyEventsClient.ListQueryResultsForResource") + 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.ListQueryResultsForResource(ctx, resourceID, top, orderBy, selectParameter, from, toParameter, filter, apply, expand, skipToken) + return +} + // ListQueryResultsForResourceGroup queries policy events for the resources under the resource group. // Parameters: // subscriptionID - microsoft Azure subscription ID. @@ -595,13 +693,15 @@ func (client PolicyEventsClient) ListQueryResultsForResourceResponder(resp *http // specified, the service uses request time. // filter - oData filter expression. // apply - oData apply expression for aggregations. -func (client PolicyEventsClient) ListQueryResultsForResourceGroup(ctx context.Context, subscriptionID string, resourceGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result PolicyEventsQueryResults, err error) { +// skipToken - skiptoken is only provided if a previous response returned a partial result as a part of +// nextLink element. +func (client PolicyEventsClient) ListQueryResultsForResourceGroup(ctx context.Context, subscriptionID string, resourceGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result PolicyEventsQueryResultsPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PolicyEventsClient.ListQueryResultsForResourceGroup") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.peqr.Response.Response != nil { + sc = result.peqr.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -613,7 +713,8 @@ func (client PolicyEventsClient) ListQueryResultsForResourceGroup(ctx context.Co return result, validation.NewError("policyinsights.PolicyEventsClient", "ListQueryResultsForResourceGroup", err.Error()) } - req, err := client.ListQueryResultsForResourceGroupPreparer(ctx, subscriptionID, resourceGroupName, top, orderBy, selectParameter, from, toParameter, filter, apply) + result.fn = client.listQueryResultsForResourceGroupNextResults + req, err := client.ListQueryResultsForResourceGroupPreparer(ctx, subscriptionID, resourceGroupName, top, orderBy, selectParameter, from, toParameter, filter, apply, skipToken) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForResourceGroup", nil, "Failure preparing request") return @@ -621,12 +722,12 @@ func (client PolicyEventsClient) ListQueryResultsForResourceGroup(ctx context.Co resp, err := client.ListQueryResultsForResourceGroupSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} + result.peqr.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForResourceGroup", resp, "Failure sending request") return } - result, err = client.ListQueryResultsForResourceGroupResponder(resp) + result.peqr, err = client.ListQueryResultsForResourceGroupResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForResourceGroup", resp, "Failure responding to request") } @@ -635,7 +736,7 @@ func (client PolicyEventsClient) ListQueryResultsForResourceGroup(ctx context.Co } // ListQueryResultsForResourceGroupPreparer prepares the ListQueryResultsForResourceGroup request. -func (client PolicyEventsClient) ListQueryResultsForResourceGroupPreparer(ctx context.Context, subscriptionID string, resourceGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (*http.Request, error) { +func (client PolicyEventsClient) ListQueryResultsForResourceGroupPreparer(ctx context.Context, subscriptionID string, resourceGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (*http.Request, error) { pathParameters := map[string]interface{}{ "policyEventsResource": autorest.Encode("path", "default"), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -667,6 +768,9 @@ func (client PolicyEventsClient) ListQueryResultsForResourceGroupPreparer(ctx co if len(apply) > 0 { queryParameters["$apply"] = autorest.Encode("query", apply) } + if len(skipToken) > 0 { + queryParameters["$skiptoken"] = autorest.Encode("query", skipToken) + } preparer := autorest.CreatePreparer( autorest.AsPost(), @@ -695,6 +799,43 @@ func (client PolicyEventsClient) ListQueryResultsForResourceGroupResponder(resp return } +// listQueryResultsForResourceGroupNextResults retrieves the next set of results, if any. +func (client PolicyEventsClient) listQueryResultsForResourceGroupNextResults(ctx context.Context, lastResults PolicyEventsQueryResults) (result PolicyEventsQueryResults, err error) { + req, err := lastResults.policyEventsQueryResultsPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "listQueryResultsForResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListQueryResultsForResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "listQueryResultsForResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListQueryResultsForResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "listQueryResultsForResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListQueryResultsForResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client PolicyEventsClient) ListQueryResultsForResourceGroupComplete(ctx context.Context, subscriptionID string, resourceGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result PolicyEventsQueryResultsIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyEventsClient.ListQueryResultsForResourceGroup") + 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.ListQueryResultsForResourceGroup(ctx, subscriptionID, resourceGroupName, top, orderBy, selectParameter, from, toParameter, filter, apply, skipToken) + return +} + // ListQueryResultsForResourceGroupLevelPolicyAssignment queries policy events for the resource group level policy // assignment. // Parameters: @@ -712,13 +853,15 @@ func (client PolicyEventsClient) ListQueryResultsForResourceGroupResponder(resp // specified, the service uses request time. // filter - oData filter expression. // apply - oData apply expression for aggregations. -func (client PolicyEventsClient) ListQueryResultsForResourceGroupLevelPolicyAssignment(ctx context.Context, subscriptionID string, resourceGroupName string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result PolicyEventsQueryResults, err error) { +// skipToken - skiptoken is only provided if a previous response returned a partial result as a part of +// nextLink element. +func (client PolicyEventsClient) ListQueryResultsForResourceGroupLevelPolicyAssignment(ctx context.Context, subscriptionID string, resourceGroupName string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result PolicyEventsQueryResultsPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PolicyEventsClient.ListQueryResultsForResourceGroupLevelPolicyAssignment") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.peqr.Response.Response != nil { + sc = result.peqr.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -730,7 +873,8 @@ func (client PolicyEventsClient) ListQueryResultsForResourceGroupLevelPolicyAssi return result, validation.NewError("policyinsights.PolicyEventsClient", "ListQueryResultsForResourceGroupLevelPolicyAssignment", err.Error()) } - req, err := client.ListQueryResultsForResourceGroupLevelPolicyAssignmentPreparer(ctx, subscriptionID, resourceGroupName, policyAssignmentName, top, orderBy, selectParameter, from, toParameter, filter, apply) + result.fn = client.listQueryResultsForResourceGroupLevelPolicyAssignmentNextResults + req, err := client.ListQueryResultsForResourceGroupLevelPolicyAssignmentPreparer(ctx, subscriptionID, resourceGroupName, policyAssignmentName, top, orderBy, selectParameter, from, toParameter, filter, apply, skipToken) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForResourceGroupLevelPolicyAssignment", nil, "Failure preparing request") return @@ -738,12 +882,12 @@ func (client PolicyEventsClient) ListQueryResultsForResourceGroupLevelPolicyAssi resp, err := client.ListQueryResultsForResourceGroupLevelPolicyAssignmentSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} + result.peqr.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForResourceGroupLevelPolicyAssignment", resp, "Failure sending request") return } - result, err = client.ListQueryResultsForResourceGroupLevelPolicyAssignmentResponder(resp) + result.peqr, err = client.ListQueryResultsForResourceGroupLevelPolicyAssignmentResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForResourceGroupLevelPolicyAssignment", resp, "Failure responding to request") } @@ -752,7 +896,7 @@ func (client PolicyEventsClient) ListQueryResultsForResourceGroupLevelPolicyAssi } // ListQueryResultsForResourceGroupLevelPolicyAssignmentPreparer prepares the ListQueryResultsForResourceGroupLevelPolicyAssignment request. -func (client PolicyEventsClient) ListQueryResultsForResourceGroupLevelPolicyAssignmentPreparer(ctx context.Context, subscriptionID string, resourceGroupName string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (*http.Request, error) { +func (client PolicyEventsClient) ListQueryResultsForResourceGroupLevelPolicyAssignmentPreparer(ctx context.Context, subscriptionID string, resourceGroupName string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (*http.Request, error) { pathParameters := map[string]interface{}{ "authorizationNamespace": autorest.Encode("path", "Microsoft.Authorization"), "policyAssignmentName": autorest.Encode("path", policyAssignmentName), @@ -786,6 +930,9 @@ func (client PolicyEventsClient) ListQueryResultsForResourceGroupLevelPolicyAssi if len(apply) > 0 { queryParameters["$apply"] = autorest.Encode("query", apply) } + if len(skipToken) > 0 { + queryParameters["$skiptoken"] = autorest.Encode("query", skipToken) + } preparer := autorest.CreatePreparer( autorest.AsPost(), @@ -814,6 +961,43 @@ func (client PolicyEventsClient) ListQueryResultsForResourceGroupLevelPolicyAssi return } +// listQueryResultsForResourceGroupLevelPolicyAssignmentNextResults retrieves the next set of results, if any. +func (client PolicyEventsClient) listQueryResultsForResourceGroupLevelPolicyAssignmentNextResults(ctx context.Context, lastResults PolicyEventsQueryResults) (result PolicyEventsQueryResults, err error) { + req, err := lastResults.policyEventsQueryResultsPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "listQueryResultsForResourceGroupLevelPolicyAssignmentNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListQueryResultsForResourceGroupLevelPolicyAssignmentSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "listQueryResultsForResourceGroupLevelPolicyAssignmentNextResults", resp, "Failure sending next results request") + } + result, err = client.ListQueryResultsForResourceGroupLevelPolicyAssignmentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "listQueryResultsForResourceGroupLevelPolicyAssignmentNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListQueryResultsForResourceGroupLevelPolicyAssignmentComplete enumerates all values, automatically crossing page boundaries as required. +func (client PolicyEventsClient) ListQueryResultsForResourceGroupLevelPolicyAssignmentComplete(ctx context.Context, subscriptionID string, resourceGroupName string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result PolicyEventsQueryResultsIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyEventsClient.ListQueryResultsForResourceGroupLevelPolicyAssignment") + 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.ListQueryResultsForResourceGroupLevelPolicyAssignment(ctx, subscriptionID, resourceGroupName, policyAssignmentName, top, orderBy, selectParameter, from, toParameter, filter, apply, skipToken) + return +} + // ListQueryResultsForSubscription queries policy events for the resources under the subscription. // Parameters: // subscriptionID - microsoft Azure subscription ID. @@ -828,13 +1012,15 @@ func (client PolicyEventsClient) ListQueryResultsForResourceGroupLevelPolicyAssi // specified, the service uses request time. // filter - oData filter expression. // apply - oData apply expression for aggregations. -func (client PolicyEventsClient) ListQueryResultsForSubscription(ctx context.Context, subscriptionID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result PolicyEventsQueryResults, err error) { +// skipToken - skiptoken is only provided if a previous response returned a partial result as a part of +// nextLink element. +func (client PolicyEventsClient) ListQueryResultsForSubscription(ctx context.Context, subscriptionID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result PolicyEventsQueryResultsPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PolicyEventsClient.ListQueryResultsForSubscription") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.peqr.Response.Response != nil { + sc = result.peqr.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -846,7 +1032,8 @@ func (client PolicyEventsClient) ListQueryResultsForSubscription(ctx context.Con return result, validation.NewError("policyinsights.PolicyEventsClient", "ListQueryResultsForSubscription", err.Error()) } - req, err := client.ListQueryResultsForSubscriptionPreparer(ctx, subscriptionID, top, orderBy, selectParameter, from, toParameter, filter, apply) + result.fn = client.listQueryResultsForSubscriptionNextResults + req, err := client.ListQueryResultsForSubscriptionPreparer(ctx, subscriptionID, top, orderBy, selectParameter, from, toParameter, filter, apply, skipToken) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForSubscription", nil, "Failure preparing request") return @@ -854,12 +1041,12 @@ func (client PolicyEventsClient) ListQueryResultsForSubscription(ctx context.Con resp, err := client.ListQueryResultsForSubscriptionSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} + result.peqr.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForSubscription", resp, "Failure sending request") return } - result, err = client.ListQueryResultsForSubscriptionResponder(resp) + result.peqr, err = client.ListQueryResultsForSubscriptionResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForSubscription", resp, "Failure responding to request") } @@ -868,7 +1055,7 @@ func (client PolicyEventsClient) ListQueryResultsForSubscription(ctx context.Con } // ListQueryResultsForSubscriptionPreparer prepares the ListQueryResultsForSubscription request. -func (client PolicyEventsClient) ListQueryResultsForSubscriptionPreparer(ctx context.Context, subscriptionID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (*http.Request, error) { +func (client PolicyEventsClient) ListQueryResultsForSubscriptionPreparer(ctx context.Context, subscriptionID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (*http.Request, error) { pathParameters := map[string]interface{}{ "policyEventsResource": autorest.Encode("path", "default"), "subscriptionId": autorest.Encode("path", subscriptionID), @@ -899,6 +1086,9 @@ func (client PolicyEventsClient) ListQueryResultsForSubscriptionPreparer(ctx con if len(apply) > 0 { queryParameters["$apply"] = autorest.Encode("query", apply) } + if len(skipToken) > 0 { + queryParameters["$skiptoken"] = autorest.Encode("query", skipToken) + } preparer := autorest.CreatePreparer( autorest.AsPost(), @@ -927,6 +1117,43 @@ func (client PolicyEventsClient) ListQueryResultsForSubscriptionResponder(resp * return } +// listQueryResultsForSubscriptionNextResults retrieves the next set of results, if any. +func (client PolicyEventsClient) listQueryResultsForSubscriptionNextResults(ctx context.Context, lastResults PolicyEventsQueryResults) (result PolicyEventsQueryResults, err error) { + req, err := lastResults.policyEventsQueryResultsPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "listQueryResultsForSubscriptionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListQueryResultsForSubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "listQueryResultsForSubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListQueryResultsForSubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "listQueryResultsForSubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListQueryResultsForSubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client PolicyEventsClient) ListQueryResultsForSubscriptionComplete(ctx context.Context, subscriptionID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result PolicyEventsQueryResultsIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyEventsClient.ListQueryResultsForSubscription") + 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.ListQueryResultsForSubscription(ctx, subscriptionID, top, orderBy, selectParameter, from, toParameter, filter, apply, skipToken) + return +} + // ListQueryResultsForSubscriptionLevelPolicyAssignment queries policy events for the subscription level policy // assignment. // Parameters: @@ -943,13 +1170,15 @@ func (client PolicyEventsClient) ListQueryResultsForSubscriptionResponder(resp * // specified, the service uses request time. // filter - oData filter expression. // apply - oData apply expression for aggregations. -func (client PolicyEventsClient) ListQueryResultsForSubscriptionLevelPolicyAssignment(ctx context.Context, subscriptionID string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result PolicyEventsQueryResults, err error) { +// skipToken - skiptoken is only provided if a previous response returned a partial result as a part of +// nextLink element. +func (client PolicyEventsClient) ListQueryResultsForSubscriptionLevelPolicyAssignment(ctx context.Context, subscriptionID string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result PolicyEventsQueryResultsPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PolicyEventsClient.ListQueryResultsForSubscriptionLevelPolicyAssignment") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.peqr.Response.Response != nil { + sc = result.peqr.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -961,7 +1190,8 @@ func (client PolicyEventsClient) ListQueryResultsForSubscriptionLevelPolicyAssig return result, validation.NewError("policyinsights.PolicyEventsClient", "ListQueryResultsForSubscriptionLevelPolicyAssignment", err.Error()) } - req, err := client.ListQueryResultsForSubscriptionLevelPolicyAssignmentPreparer(ctx, subscriptionID, policyAssignmentName, top, orderBy, selectParameter, from, toParameter, filter, apply) + result.fn = client.listQueryResultsForSubscriptionLevelPolicyAssignmentNextResults + req, err := client.ListQueryResultsForSubscriptionLevelPolicyAssignmentPreparer(ctx, subscriptionID, policyAssignmentName, top, orderBy, selectParameter, from, toParameter, filter, apply, skipToken) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForSubscriptionLevelPolicyAssignment", nil, "Failure preparing request") return @@ -969,12 +1199,12 @@ func (client PolicyEventsClient) ListQueryResultsForSubscriptionLevelPolicyAssig resp, err := client.ListQueryResultsForSubscriptionLevelPolicyAssignmentSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} + result.peqr.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForSubscriptionLevelPolicyAssignment", resp, "Failure sending request") return } - result, err = client.ListQueryResultsForSubscriptionLevelPolicyAssignmentResponder(resp) + result.peqr, err = client.ListQueryResultsForSubscriptionLevelPolicyAssignmentResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForSubscriptionLevelPolicyAssignment", resp, "Failure responding to request") } @@ -983,7 +1213,7 @@ func (client PolicyEventsClient) ListQueryResultsForSubscriptionLevelPolicyAssig } // ListQueryResultsForSubscriptionLevelPolicyAssignmentPreparer prepares the ListQueryResultsForSubscriptionLevelPolicyAssignment request. -func (client PolicyEventsClient) ListQueryResultsForSubscriptionLevelPolicyAssignmentPreparer(ctx context.Context, subscriptionID string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (*http.Request, error) { +func (client PolicyEventsClient) ListQueryResultsForSubscriptionLevelPolicyAssignmentPreparer(ctx context.Context, subscriptionID string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (*http.Request, error) { pathParameters := map[string]interface{}{ "authorizationNamespace": autorest.Encode("path", "Microsoft.Authorization"), "policyAssignmentName": autorest.Encode("path", policyAssignmentName), @@ -1016,6 +1246,9 @@ func (client PolicyEventsClient) ListQueryResultsForSubscriptionLevelPolicyAssig if len(apply) > 0 { queryParameters["$apply"] = autorest.Encode("query", apply) } + if len(skipToken) > 0 { + queryParameters["$skiptoken"] = autorest.Encode("query", skipToken) + } preparer := autorest.CreatePreparer( autorest.AsPost(), @@ -1043,3 +1276,40 @@ func (client PolicyEventsClient) ListQueryResultsForSubscriptionLevelPolicyAssig result.Response = autorest.Response{Response: resp} return } + +// listQueryResultsForSubscriptionLevelPolicyAssignmentNextResults retrieves the next set of results, if any. +func (client PolicyEventsClient) listQueryResultsForSubscriptionLevelPolicyAssignmentNextResults(ctx context.Context, lastResults PolicyEventsQueryResults) (result PolicyEventsQueryResults, err error) { + req, err := lastResults.policyEventsQueryResultsPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "listQueryResultsForSubscriptionLevelPolicyAssignmentNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListQueryResultsForSubscriptionLevelPolicyAssignmentSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "listQueryResultsForSubscriptionLevelPolicyAssignmentNextResults", resp, "Failure sending next results request") + } + result, err = client.ListQueryResultsForSubscriptionLevelPolicyAssignmentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "listQueryResultsForSubscriptionLevelPolicyAssignmentNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListQueryResultsForSubscriptionLevelPolicyAssignmentComplete enumerates all values, automatically crossing page boundaries as required. +func (client PolicyEventsClient) ListQueryResultsForSubscriptionLevelPolicyAssignmentComplete(ctx context.Context, subscriptionID string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result PolicyEventsQueryResultsIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyEventsClient.ListQueryResultsForSubscriptionLevelPolicyAssignment") + 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.ListQueryResultsForSubscriptionLevelPolicyAssignment(ctx, subscriptionID, policyAssignmentName, top, orderBy, selectParameter, from, toParameter, filter, apply, skipToken) + return +} diff --git a/services/policyinsights/mgmt/2019-10-01/policyinsights/policyinsightsapi/interfaces.go b/services/policyinsights/mgmt/2019-10-01/policyinsights/policyinsightsapi/interfaces.go index 5b39931a3beb..d7d7f40524a3 100644 --- a/services/policyinsights/mgmt/2019-10-01/policyinsights/policyinsightsapi/interfaces.go +++ b/services/policyinsights/mgmt/2019-10-01/policyinsights/policyinsightsapi/interfaces.go @@ -77,29 +77,44 @@ var _ RemediationsClientAPI = (*policyinsights.RemediationsClient)(nil) // PolicyEventsClientAPI contains the set of methods on the PolicyEventsClient type. type PolicyEventsClientAPI interface { - GetMetadata(ctx context.Context, scope string) (result policyinsights.String, err error) - ListQueryResultsForManagementGroup(ctx context.Context, managementGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result policyinsights.PolicyEventsQueryResults, err error) - ListQueryResultsForPolicyDefinition(ctx context.Context, subscriptionID string, policyDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result policyinsights.PolicyEventsQueryResults, err error) - ListQueryResultsForPolicySetDefinition(ctx context.Context, subscriptionID string, policySetDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result policyinsights.PolicyEventsQueryResults, err error) - ListQueryResultsForResource(ctx context.Context, resourceID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, expand string) (result policyinsights.PolicyEventsQueryResults, err error) - ListQueryResultsForResourceGroup(ctx context.Context, subscriptionID string, resourceGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result policyinsights.PolicyEventsQueryResults, err error) - ListQueryResultsForResourceGroupLevelPolicyAssignment(ctx context.Context, subscriptionID string, resourceGroupName string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result policyinsights.PolicyEventsQueryResults, err error) - ListQueryResultsForSubscription(ctx context.Context, subscriptionID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result policyinsights.PolicyEventsQueryResults, err error) - ListQueryResultsForSubscriptionLevelPolicyAssignment(ctx context.Context, subscriptionID string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result policyinsights.PolicyEventsQueryResults, err error) + ListQueryResultsForManagementGroup(ctx context.Context, managementGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result policyinsights.PolicyEventsQueryResultsPage, err error) + ListQueryResultsForManagementGroupComplete(ctx context.Context, managementGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result policyinsights.PolicyEventsQueryResultsIterator, err error) + ListQueryResultsForPolicyDefinition(ctx context.Context, subscriptionID string, policyDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result policyinsights.PolicyEventsQueryResultsPage, err error) + ListQueryResultsForPolicyDefinitionComplete(ctx context.Context, subscriptionID string, policyDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result policyinsights.PolicyEventsQueryResultsIterator, err error) + ListQueryResultsForPolicySetDefinition(ctx context.Context, subscriptionID string, policySetDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result policyinsights.PolicyEventsQueryResultsPage, err error) + ListQueryResultsForPolicySetDefinitionComplete(ctx context.Context, subscriptionID string, policySetDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result policyinsights.PolicyEventsQueryResultsIterator, err error) + ListQueryResultsForResource(ctx context.Context, resourceID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, expand string, skipToken string) (result policyinsights.PolicyEventsQueryResultsPage, err error) + ListQueryResultsForResourceComplete(ctx context.Context, resourceID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, expand string, skipToken string) (result policyinsights.PolicyEventsQueryResultsIterator, err error) + ListQueryResultsForResourceGroup(ctx context.Context, subscriptionID string, resourceGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result policyinsights.PolicyEventsQueryResultsPage, err error) + ListQueryResultsForResourceGroupComplete(ctx context.Context, subscriptionID string, resourceGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result policyinsights.PolicyEventsQueryResultsIterator, err error) + ListQueryResultsForResourceGroupLevelPolicyAssignment(ctx context.Context, subscriptionID string, resourceGroupName string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result policyinsights.PolicyEventsQueryResultsPage, err error) + ListQueryResultsForResourceGroupLevelPolicyAssignmentComplete(ctx context.Context, subscriptionID string, resourceGroupName string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result policyinsights.PolicyEventsQueryResultsIterator, err error) + ListQueryResultsForSubscription(ctx context.Context, subscriptionID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result policyinsights.PolicyEventsQueryResultsPage, err error) + ListQueryResultsForSubscriptionComplete(ctx context.Context, subscriptionID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result policyinsights.PolicyEventsQueryResultsIterator, err error) + ListQueryResultsForSubscriptionLevelPolicyAssignment(ctx context.Context, subscriptionID string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result policyinsights.PolicyEventsQueryResultsPage, err error) + ListQueryResultsForSubscriptionLevelPolicyAssignmentComplete(ctx context.Context, subscriptionID string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result policyinsights.PolicyEventsQueryResultsIterator, err error) } var _ PolicyEventsClientAPI = (*policyinsights.PolicyEventsClient)(nil) // PolicyStatesClientAPI contains the set of methods on the PolicyStatesClient type. type PolicyStatesClientAPI interface { - ListQueryResultsForManagementGroup(ctx context.Context, policyStatesResource policyinsights.PolicyStatesResource, managementGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result policyinsights.PolicyStatesQueryResults, err error) - ListQueryResultsForPolicyDefinition(ctx context.Context, policyStatesResource policyinsights.PolicyStatesResource, subscriptionID string, policyDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result policyinsights.PolicyStatesQueryResults, err error) - ListQueryResultsForPolicySetDefinition(ctx context.Context, policyStatesResource policyinsights.PolicyStatesResource, subscriptionID string, policySetDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result policyinsights.PolicyStatesQueryResults, err error) - ListQueryResultsForResource(ctx context.Context, policyStatesResource policyinsights.PolicyStatesResource, resourceID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, expand string) (result policyinsights.PolicyStatesQueryResults, err error) - ListQueryResultsForResourceGroup(ctx context.Context, policyStatesResource policyinsights.PolicyStatesResource, subscriptionID string, resourceGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result policyinsights.PolicyStatesQueryResults, err error) - ListQueryResultsForResourceGroupLevelPolicyAssignment(ctx context.Context, policyStatesResource policyinsights.PolicyStatesResource, subscriptionID string, resourceGroupName string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result policyinsights.PolicyStatesQueryResults, err error) - ListQueryResultsForSubscription(ctx context.Context, policyStatesResource policyinsights.PolicyStatesResource, subscriptionID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result policyinsights.PolicyStatesQueryResults, err error) - ListQueryResultsForSubscriptionLevelPolicyAssignment(ctx context.Context, policyStatesResource policyinsights.PolicyStatesResource, subscriptionID string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result policyinsights.PolicyStatesQueryResults, err error) + ListQueryResultsForManagementGroup(ctx context.Context, policyStatesResource policyinsights.PolicyStatesResource, managementGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result policyinsights.PolicyStatesQueryResultsPage, err error) + ListQueryResultsForManagementGroupComplete(ctx context.Context, policyStatesResource policyinsights.PolicyStatesResource, managementGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result policyinsights.PolicyStatesQueryResultsIterator, err error) + ListQueryResultsForPolicyDefinition(ctx context.Context, policyStatesResource policyinsights.PolicyStatesResource, subscriptionID string, policyDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result policyinsights.PolicyStatesQueryResultsPage, err error) + ListQueryResultsForPolicyDefinitionComplete(ctx context.Context, policyStatesResource policyinsights.PolicyStatesResource, subscriptionID string, policyDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result policyinsights.PolicyStatesQueryResultsIterator, err error) + ListQueryResultsForPolicySetDefinition(ctx context.Context, policyStatesResource policyinsights.PolicyStatesResource, subscriptionID string, policySetDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result policyinsights.PolicyStatesQueryResultsPage, err error) + ListQueryResultsForPolicySetDefinitionComplete(ctx context.Context, policyStatesResource policyinsights.PolicyStatesResource, subscriptionID string, policySetDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result policyinsights.PolicyStatesQueryResultsIterator, err error) + ListQueryResultsForResource(ctx context.Context, policyStatesResource policyinsights.PolicyStatesResource, resourceID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, expand string, skipToken string) (result policyinsights.PolicyStatesQueryResultsPage, err error) + ListQueryResultsForResourceComplete(ctx context.Context, policyStatesResource policyinsights.PolicyStatesResource, resourceID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, expand string, skipToken string) (result policyinsights.PolicyStatesQueryResultsIterator, err error) + ListQueryResultsForResourceGroup(ctx context.Context, policyStatesResource policyinsights.PolicyStatesResource, subscriptionID string, resourceGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result policyinsights.PolicyStatesQueryResultsPage, err error) + ListQueryResultsForResourceGroupComplete(ctx context.Context, policyStatesResource policyinsights.PolicyStatesResource, subscriptionID string, resourceGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result policyinsights.PolicyStatesQueryResultsIterator, err error) + ListQueryResultsForResourceGroupLevelPolicyAssignment(ctx context.Context, policyStatesResource policyinsights.PolicyStatesResource, subscriptionID string, resourceGroupName string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result policyinsights.PolicyStatesQueryResultsPage, err error) + ListQueryResultsForResourceGroupLevelPolicyAssignmentComplete(ctx context.Context, policyStatesResource policyinsights.PolicyStatesResource, subscriptionID string, resourceGroupName string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result policyinsights.PolicyStatesQueryResultsIterator, err error) + ListQueryResultsForSubscription(ctx context.Context, policyStatesResource policyinsights.PolicyStatesResource, subscriptionID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result policyinsights.PolicyStatesQueryResultsPage, err error) + ListQueryResultsForSubscriptionComplete(ctx context.Context, policyStatesResource policyinsights.PolicyStatesResource, subscriptionID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result policyinsights.PolicyStatesQueryResultsIterator, err error) + ListQueryResultsForSubscriptionLevelPolicyAssignment(ctx context.Context, policyStatesResource policyinsights.PolicyStatesResource, subscriptionID string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result policyinsights.PolicyStatesQueryResultsPage, err error) + ListQueryResultsForSubscriptionLevelPolicyAssignmentComplete(ctx context.Context, policyStatesResource policyinsights.PolicyStatesResource, subscriptionID string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result policyinsights.PolicyStatesQueryResultsIterator, err error) SummarizeForManagementGroup(ctx context.Context, managementGroupName string, top *int32, from *date.Time, toParameter *date.Time, filter string) (result policyinsights.SummarizeResults, err error) SummarizeForPolicyDefinition(ctx context.Context, subscriptionID string, policyDefinitionName string, top *int32, from *date.Time, toParameter *date.Time, filter string) (result policyinsights.SummarizeResults, err error) SummarizeForPolicySetDefinition(ctx context.Context, subscriptionID string, policySetDefinitionName string, top *int32, from *date.Time, toParameter *date.Time, filter string) (result policyinsights.SummarizeResults, err error) diff --git a/services/policyinsights/mgmt/2019-10-01/policyinsights/policystates.go b/services/policyinsights/mgmt/2019-10-01/policyinsights/policystates.go index 56d5414355ac..bc924f6470ba 100644 --- a/services/policyinsights/mgmt/2019-10-01/policyinsights/policystates.go +++ b/services/policyinsights/mgmt/2019-10-01/policyinsights/policystates.go @@ -59,13 +59,15 @@ func NewPolicyStatesClientWithBaseURI(baseURI string) PolicyStatesClient { // specified, the service uses request time. // filter - oData filter expression. // apply - oData apply expression for aggregations. -func (client PolicyStatesClient) ListQueryResultsForManagementGroup(ctx context.Context, policyStatesResource PolicyStatesResource, managementGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result PolicyStatesQueryResults, err error) { +// skipToken - skiptoken is only provided if a previous response returned a partial result as a part of +// nextLink element. +func (client PolicyStatesClient) ListQueryResultsForManagementGroup(ctx context.Context, policyStatesResource PolicyStatesResource, managementGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result PolicyStatesQueryResultsPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PolicyStatesClient.ListQueryResultsForManagementGroup") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.psqr.Response.Response != nil { + sc = result.psqr.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -77,7 +79,8 @@ func (client PolicyStatesClient) ListQueryResultsForManagementGroup(ctx context. return result, validation.NewError("policyinsights.PolicyStatesClient", "ListQueryResultsForManagementGroup", err.Error()) } - req, err := client.ListQueryResultsForManagementGroupPreparer(ctx, policyStatesResource, managementGroupName, top, orderBy, selectParameter, from, toParameter, filter, apply) + result.fn = client.listQueryResultsForManagementGroupNextResults + req, err := client.ListQueryResultsForManagementGroupPreparer(ctx, policyStatesResource, managementGroupName, top, orderBy, selectParameter, from, toParameter, filter, apply, skipToken) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForManagementGroup", nil, "Failure preparing request") return @@ -85,12 +88,12 @@ func (client PolicyStatesClient) ListQueryResultsForManagementGroup(ctx context. resp, err := client.ListQueryResultsForManagementGroupSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} + result.psqr.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForManagementGroup", resp, "Failure sending request") return } - result, err = client.ListQueryResultsForManagementGroupResponder(resp) + result.psqr, err = client.ListQueryResultsForManagementGroupResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForManagementGroup", resp, "Failure responding to request") } @@ -99,7 +102,7 @@ func (client PolicyStatesClient) ListQueryResultsForManagementGroup(ctx context. } // ListQueryResultsForManagementGroupPreparer prepares the ListQueryResultsForManagementGroup request. -func (client PolicyStatesClient) ListQueryResultsForManagementGroupPreparer(ctx context.Context, policyStatesResource PolicyStatesResource, managementGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (*http.Request, error) { +func (client PolicyStatesClient) ListQueryResultsForManagementGroupPreparer(ctx context.Context, policyStatesResource PolicyStatesResource, managementGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (*http.Request, error) { pathParameters := map[string]interface{}{ "managementGroupName": autorest.Encode("path", managementGroupName), "managementGroupsNamespace": autorest.Encode("path", "Microsoft.Management"), @@ -131,6 +134,9 @@ func (client PolicyStatesClient) ListQueryResultsForManagementGroupPreparer(ctx if len(apply) > 0 { queryParameters["$apply"] = autorest.Encode("query", apply) } + if len(skipToken) > 0 { + queryParameters["$skiptoken"] = autorest.Encode("query", skipToken) + } preparer := autorest.CreatePreparer( autorest.AsPost(), @@ -159,6 +165,43 @@ func (client PolicyStatesClient) ListQueryResultsForManagementGroupResponder(res return } +// listQueryResultsForManagementGroupNextResults retrieves the next set of results, if any. +func (client PolicyStatesClient) listQueryResultsForManagementGroupNextResults(ctx context.Context, lastResults PolicyStatesQueryResults) (result PolicyStatesQueryResults, err error) { + req, err := lastResults.policyStatesQueryResultsPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "listQueryResultsForManagementGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListQueryResultsForManagementGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "listQueryResultsForManagementGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListQueryResultsForManagementGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "listQueryResultsForManagementGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListQueryResultsForManagementGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client PolicyStatesClient) ListQueryResultsForManagementGroupComplete(ctx context.Context, policyStatesResource PolicyStatesResource, managementGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result PolicyStatesQueryResultsIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyStatesClient.ListQueryResultsForManagementGroup") + 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.ListQueryResultsForManagementGroup(ctx, policyStatesResource, managementGroupName, top, orderBy, selectParameter, from, toParameter, filter, apply, skipToken) + return +} + // ListQueryResultsForPolicyDefinition queries policy states for the subscription level policy definition. // Parameters: // policyStatesResource - the virtual resource under PolicyStates resource type. In a given time range, @@ -176,13 +219,15 @@ func (client PolicyStatesClient) ListQueryResultsForManagementGroupResponder(res // specified, the service uses request time. // filter - oData filter expression. // apply - oData apply expression for aggregations. -func (client PolicyStatesClient) ListQueryResultsForPolicyDefinition(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, policyDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result PolicyStatesQueryResults, err error) { +// skipToken - skiptoken is only provided if a previous response returned a partial result as a part of +// nextLink element. +func (client PolicyStatesClient) ListQueryResultsForPolicyDefinition(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, policyDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result PolicyStatesQueryResultsPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PolicyStatesClient.ListQueryResultsForPolicyDefinition") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.psqr.Response.Response != nil { + sc = result.psqr.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -194,7 +239,8 @@ func (client PolicyStatesClient) ListQueryResultsForPolicyDefinition(ctx context return result, validation.NewError("policyinsights.PolicyStatesClient", "ListQueryResultsForPolicyDefinition", err.Error()) } - req, err := client.ListQueryResultsForPolicyDefinitionPreparer(ctx, policyStatesResource, subscriptionID, policyDefinitionName, top, orderBy, selectParameter, from, toParameter, filter, apply) + result.fn = client.listQueryResultsForPolicyDefinitionNextResults + req, err := client.ListQueryResultsForPolicyDefinitionPreparer(ctx, policyStatesResource, subscriptionID, policyDefinitionName, top, orderBy, selectParameter, from, toParameter, filter, apply, skipToken) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForPolicyDefinition", nil, "Failure preparing request") return @@ -202,12 +248,12 @@ func (client PolicyStatesClient) ListQueryResultsForPolicyDefinition(ctx context resp, err := client.ListQueryResultsForPolicyDefinitionSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} + result.psqr.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForPolicyDefinition", resp, "Failure sending request") return } - result, err = client.ListQueryResultsForPolicyDefinitionResponder(resp) + result.psqr, err = client.ListQueryResultsForPolicyDefinitionResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForPolicyDefinition", resp, "Failure responding to request") } @@ -216,7 +262,7 @@ func (client PolicyStatesClient) ListQueryResultsForPolicyDefinition(ctx context } // ListQueryResultsForPolicyDefinitionPreparer prepares the ListQueryResultsForPolicyDefinition request. -func (client PolicyStatesClient) ListQueryResultsForPolicyDefinitionPreparer(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, policyDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (*http.Request, error) { +func (client PolicyStatesClient) ListQueryResultsForPolicyDefinitionPreparer(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, policyDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (*http.Request, error) { pathParameters := map[string]interface{}{ "authorizationNamespace": autorest.Encode("path", "Microsoft.Authorization"), "policyDefinitionName": autorest.Encode("path", policyDefinitionName), @@ -249,6 +295,9 @@ func (client PolicyStatesClient) ListQueryResultsForPolicyDefinitionPreparer(ctx if len(apply) > 0 { queryParameters["$apply"] = autorest.Encode("query", apply) } + if len(skipToken) > 0 { + queryParameters["$skiptoken"] = autorest.Encode("query", skipToken) + } preparer := autorest.CreatePreparer( autorest.AsPost(), @@ -277,6 +326,43 @@ func (client PolicyStatesClient) ListQueryResultsForPolicyDefinitionResponder(re return } +// listQueryResultsForPolicyDefinitionNextResults retrieves the next set of results, if any. +func (client PolicyStatesClient) listQueryResultsForPolicyDefinitionNextResults(ctx context.Context, lastResults PolicyStatesQueryResults) (result PolicyStatesQueryResults, err error) { + req, err := lastResults.policyStatesQueryResultsPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "listQueryResultsForPolicyDefinitionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListQueryResultsForPolicyDefinitionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "listQueryResultsForPolicyDefinitionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListQueryResultsForPolicyDefinitionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "listQueryResultsForPolicyDefinitionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListQueryResultsForPolicyDefinitionComplete enumerates all values, automatically crossing page boundaries as required. +func (client PolicyStatesClient) ListQueryResultsForPolicyDefinitionComplete(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, policyDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result PolicyStatesQueryResultsIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyStatesClient.ListQueryResultsForPolicyDefinition") + 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.ListQueryResultsForPolicyDefinition(ctx, policyStatesResource, subscriptionID, policyDefinitionName, top, orderBy, selectParameter, from, toParameter, filter, apply, skipToken) + return +} + // ListQueryResultsForPolicySetDefinition queries policy states for the subscription level policy set definition. // Parameters: // policyStatesResource - the virtual resource under PolicyStates resource type. In a given time range, @@ -294,13 +380,15 @@ func (client PolicyStatesClient) ListQueryResultsForPolicyDefinitionResponder(re // specified, the service uses request time. // filter - oData filter expression. // apply - oData apply expression for aggregations. -func (client PolicyStatesClient) ListQueryResultsForPolicySetDefinition(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, policySetDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result PolicyStatesQueryResults, err error) { +// skipToken - skiptoken is only provided if a previous response returned a partial result as a part of +// nextLink element. +func (client PolicyStatesClient) ListQueryResultsForPolicySetDefinition(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, policySetDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result PolicyStatesQueryResultsPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PolicyStatesClient.ListQueryResultsForPolicySetDefinition") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.psqr.Response.Response != nil { + sc = result.psqr.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -312,7 +400,8 @@ func (client PolicyStatesClient) ListQueryResultsForPolicySetDefinition(ctx cont return result, validation.NewError("policyinsights.PolicyStatesClient", "ListQueryResultsForPolicySetDefinition", err.Error()) } - req, err := client.ListQueryResultsForPolicySetDefinitionPreparer(ctx, policyStatesResource, subscriptionID, policySetDefinitionName, top, orderBy, selectParameter, from, toParameter, filter, apply) + result.fn = client.listQueryResultsForPolicySetDefinitionNextResults + req, err := client.ListQueryResultsForPolicySetDefinitionPreparer(ctx, policyStatesResource, subscriptionID, policySetDefinitionName, top, orderBy, selectParameter, from, toParameter, filter, apply, skipToken) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForPolicySetDefinition", nil, "Failure preparing request") return @@ -320,12 +409,12 @@ func (client PolicyStatesClient) ListQueryResultsForPolicySetDefinition(ctx cont resp, err := client.ListQueryResultsForPolicySetDefinitionSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} + result.psqr.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForPolicySetDefinition", resp, "Failure sending request") return } - result, err = client.ListQueryResultsForPolicySetDefinitionResponder(resp) + result.psqr, err = client.ListQueryResultsForPolicySetDefinitionResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForPolicySetDefinition", resp, "Failure responding to request") } @@ -334,7 +423,7 @@ func (client PolicyStatesClient) ListQueryResultsForPolicySetDefinition(ctx cont } // ListQueryResultsForPolicySetDefinitionPreparer prepares the ListQueryResultsForPolicySetDefinition request. -func (client PolicyStatesClient) ListQueryResultsForPolicySetDefinitionPreparer(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, policySetDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (*http.Request, error) { +func (client PolicyStatesClient) ListQueryResultsForPolicySetDefinitionPreparer(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, policySetDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (*http.Request, error) { pathParameters := map[string]interface{}{ "authorizationNamespace": autorest.Encode("path", "Microsoft.Authorization"), "policySetDefinitionName": autorest.Encode("path", policySetDefinitionName), @@ -367,6 +456,9 @@ func (client PolicyStatesClient) ListQueryResultsForPolicySetDefinitionPreparer( if len(apply) > 0 { queryParameters["$apply"] = autorest.Encode("query", apply) } + if len(skipToken) > 0 { + queryParameters["$skiptoken"] = autorest.Encode("query", skipToken) + } preparer := autorest.CreatePreparer( autorest.AsPost(), @@ -395,6 +487,43 @@ func (client PolicyStatesClient) ListQueryResultsForPolicySetDefinitionResponder return } +// listQueryResultsForPolicySetDefinitionNextResults retrieves the next set of results, if any. +func (client PolicyStatesClient) listQueryResultsForPolicySetDefinitionNextResults(ctx context.Context, lastResults PolicyStatesQueryResults) (result PolicyStatesQueryResults, err error) { + req, err := lastResults.policyStatesQueryResultsPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "listQueryResultsForPolicySetDefinitionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListQueryResultsForPolicySetDefinitionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "listQueryResultsForPolicySetDefinitionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListQueryResultsForPolicySetDefinitionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "listQueryResultsForPolicySetDefinitionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListQueryResultsForPolicySetDefinitionComplete enumerates all values, automatically crossing page boundaries as required. +func (client PolicyStatesClient) ListQueryResultsForPolicySetDefinitionComplete(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, policySetDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result PolicyStatesQueryResultsIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyStatesClient.ListQueryResultsForPolicySetDefinition") + 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.ListQueryResultsForPolicySetDefinition(ctx, policyStatesResource, subscriptionID, policySetDefinitionName, top, orderBy, selectParameter, from, toParameter, filter, apply, skipToken) + return +} + // ListQueryResultsForResource queries policy states for the resource. // Parameters: // policyStatesResource - the virtual resource under PolicyStates resource type. In a given time range, @@ -412,13 +541,15 @@ func (client PolicyStatesClient) ListQueryResultsForPolicySetDefinitionResponder // filter - oData filter expression. // apply - oData apply expression for aggregations. // expand - the $expand query parameter. For example, to expand components use $expand=components -func (client PolicyStatesClient) ListQueryResultsForResource(ctx context.Context, policyStatesResource PolicyStatesResource, resourceID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, expand string) (result PolicyStatesQueryResults, err error) { +// skipToken - skiptoken is only provided if a previous response returned a partial result as a part of +// nextLink element. +func (client PolicyStatesClient) ListQueryResultsForResource(ctx context.Context, policyStatesResource PolicyStatesResource, resourceID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, expand string, skipToken string) (result PolicyStatesQueryResultsPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PolicyStatesClient.ListQueryResultsForResource") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.psqr.Response.Response != nil { + sc = result.psqr.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -430,7 +561,8 @@ func (client PolicyStatesClient) ListQueryResultsForResource(ctx context.Context return result, validation.NewError("policyinsights.PolicyStatesClient", "ListQueryResultsForResource", err.Error()) } - req, err := client.ListQueryResultsForResourcePreparer(ctx, policyStatesResource, resourceID, top, orderBy, selectParameter, from, toParameter, filter, apply, expand) + result.fn = client.listQueryResultsForResourceNextResults + req, err := client.ListQueryResultsForResourcePreparer(ctx, policyStatesResource, resourceID, top, orderBy, selectParameter, from, toParameter, filter, apply, expand, skipToken) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForResource", nil, "Failure preparing request") return @@ -438,12 +570,12 @@ func (client PolicyStatesClient) ListQueryResultsForResource(ctx context.Context resp, err := client.ListQueryResultsForResourceSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} + result.psqr.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForResource", resp, "Failure sending request") return } - result, err = client.ListQueryResultsForResourceResponder(resp) + result.psqr, err = client.ListQueryResultsForResourceResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForResource", resp, "Failure responding to request") } @@ -452,7 +584,7 @@ func (client PolicyStatesClient) ListQueryResultsForResource(ctx context.Context } // ListQueryResultsForResourcePreparer prepares the ListQueryResultsForResource request. -func (client PolicyStatesClient) ListQueryResultsForResourcePreparer(ctx context.Context, policyStatesResource PolicyStatesResource, resourceID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, expand string) (*http.Request, error) { +func (client PolicyStatesClient) ListQueryResultsForResourcePreparer(ctx context.Context, policyStatesResource PolicyStatesResource, resourceID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, expand string, skipToken string) (*http.Request, error) { pathParameters := map[string]interface{}{ "policyStatesResource": autorest.Encode("path", policyStatesResource), "resourceId": resourceID, @@ -486,6 +618,9 @@ func (client PolicyStatesClient) ListQueryResultsForResourcePreparer(ctx context if len(expand) > 0 { queryParameters["$expand"] = autorest.Encode("query", expand) } + if len(skipToken) > 0 { + queryParameters["$skiptoken"] = autorest.Encode("query", skipToken) + } preparer := autorest.CreatePreparer( autorest.AsPost(), @@ -514,6 +649,43 @@ func (client PolicyStatesClient) ListQueryResultsForResourceResponder(resp *http return } +// listQueryResultsForResourceNextResults retrieves the next set of results, if any. +func (client PolicyStatesClient) listQueryResultsForResourceNextResults(ctx context.Context, lastResults PolicyStatesQueryResults) (result PolicyStatesQueryResults, err error) { + req, err := lastResults.policyStatesQueryResultsPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "listQueryResultsForResourceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListQueryResultsForResourceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "listQueryResultsForResourceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListQueryResultsForResourceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "listQueryResultsForResourceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListQueryResultsForResourceComplete enumerates all values, automatically crossing page boundaries as required. +func (client PolicyStatesClient) ListQueryResultsForResourceComplete(ctx context.Context, policyStatesResource PolicyStatesResource, resourceID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, expand string, skipToken string) (result PolicyStatesQueryResultsIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyStatesClient.ListQueryResultsForResource") + 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.ListQueryResultsForResource(ctx, policyStatesResource, resourceID, top, orderBy, selectParameter, from, toParameter, filter, apply, expand, skipToken) + return +} + // ListQueryResultsForResourceGroup queries policy states for the resources under the resource group. // Parameters: // policyStatesResource - the virtual resource under PolicyStates resource type. In a given time range, @@ -531,13 +703,15 @@ func (client PolicyStatesClient) ListQueryResultsForResourceResponder(resp *http // specified, the service uses request time. // filter - oData filter expression. // apply - oData apply expression for aggregations. -func (client PolicyStatesClient) ListQueryResultsForResourceGroup(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, resourceGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result PolicyStatesQueryResults, err error) { +// skipToken - skiptoken is only provided if a previous response returned a partial result as a part of +// nextLink element. +func (client PolicyStatesClient) ListQueryResultsForResourceGroup(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, resourceGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result PolicyStatesQueryResultsPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PolicyStatesClient.ListQueryResultsForResourceGroup") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.psqr.Response.Response != nil { + sc = result.psqr.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -549,7 +723,8 @@ func (client PolicyStatesClient) ListQueryResultsForResourceGroup(ctx context.Co return result, validation.NewError("policyinsights.PolicyStatesClient", "ListQueryResultsForResourceGroup", err.Error()) } - req, err := client.ListQueryResultsForResourceGroupPreparer(ctx, policyStatesResource, subscriptionID, resourceGroupName, top, orderBy, selectParameter, from, toParameter, filter, apply) + result.fn = client.listQueryResultsForResourceGroupNextResults + req, err := client.ListQueryResultsForResourceGroupPreparer(ctx, policyStatesResource, subscriptionID, resourceGroupName, top, orderBy, selectParameter, from, toParameter, filter, apply, skipToken) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForResourceGroup", nil, "Failure preparing request") return @@ -557,12 +732,12 @@ func (client PolicyStatesClient) ListQueryResultsForResourceGroup(ctx context.Co resp, err := client.ListQueryResultsForResourceGroupSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} + result.psqr.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForResourceGroup", resp, "Failure sending request") return } - result, err = client.ListQueryResultsForResourceGroupResponder(resp) + result.psqr, err = client.ListQueryResultsForResourceGroupResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForResourceGroup", resp, "Failure responding to request") } @@ -571,7 +746,7 @@ func (client PolicyStatesClient) ListQueryResultsForResourceGroup(ctx context.Co } // ListQueryResultsForResourceGroupPreparer prepares the ListQueryResultsForResourceGroup request. -func (client PolicyStatesClient) ListQueryResultsForResourceGroupPreparer(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, resourceGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (*http.Request, error) { +func (client PolicyStatesClient) ListQueryResultsForResourceGroupPreparer(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, resourceGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (*http.Request, error) { pathParameters := map[string]interface{}{ "policyStatesResource": autorest.Encode("path", policyStatesResource), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -603,6 +778,9 @@ func (client PolicyStatesClient) ListQueryResultsForResourceGroupPreparer(ctx co if len(apply) > 0 { queryParameters["$apply"] = autorest.Encode("query", apply) } + if len(skipToken) > 0 { + queryParameters["$skiptoken"] = autorest.Encode("query", skipToken) + } preparer := autorest.CreatePreparer( autorest.AsPost(), @@ -631,6 +809,43 @@ func (client PolicyStatesClient) ListQueryResultsForResourceGroupResponder(resp return } +// listQueryResultsForResourceGroupNextResults retrieves the next set of results, if any. +func (client PolicyStatesClient) listQueryResultsForResourceGroupNextResults(ctx context.Context, lastResults PolicyStatesQueryResults) (result PolicyStatesQueryResults, err error) { + req, err := lastResults.policyStatesQueryResultsPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "listQueryResultsForResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListQueryResultsForResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "listQueryResultsForResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListQueryResultsForResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "listQueryResultsForResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListQueryResultsForResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client PolicyStatesClient) ListQueryResultsForResourceGroupComplete(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, resourceGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result PolicyStatesQueryResultsIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyStatesClient.ListQueryResultsForResourceGroup") + 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.ListQueryResultsForResourceGroup(ctx, policyStatesResource, subscriptionID, resourceGroupName, top, orderBy, selectParameter, from, toParameter, filter, apply, skipToken) + return +} + // ListQueryResultsForResourceGroupLevelPolicyAssignment queries policy states for the resource group level policy // assignment. // Parameters: @@ -650,13 +865,15 @@ func (client PolicyStatesClient) ListQueryResultsForResourceGroupResponder(resp // specified, the service uses request time. // filter - oData filter expression. // apply - oData apply expression for aggregations. -func (client PolicyStatesClient) ListQueryResultsForResourceGroupLevelPolicyAssignment(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, resourceGroupName string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result PolicyStatesQueryResults, err error) { +// skipToken - skiptoken is only provided if a previous response returned a partial result as a part of +// nextLink element. +func (client PolicyStatesClient) ListQueryResultsForResourceGroupLevelPolicyAssignment(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, resourceGroupName string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result PolicyStatesQueryResultsPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PolicyStatesClient.ListQueryResultsForResourceGroupLevelPolicyAssignment") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.psqr.Response.Response != nil { + sc = result.psqr.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -668,7 +885,8 @@ func (client PolicyStatesClient) ListQueryResultsForResourceGroupLevelPolicyAssi return result, validation.NewError("policyinsights.PolicyStatesClient", "ListQueryResultsForResourceGroupLevelPolicyAssignment", err.Error()) } - req, err := client.ListQueryResultsForResourceGroupLevelPolicyAssignmentPreparer(ctx, policyStatesResource, subscriptionID, resourceGroupName, policyAssignmentName, top, orderBy, selectParameter, from, toParameter, filter, apply) + result.fn = client.listQueryResultsForResourceGroupLevelPolicyAssignmentNextResults + req, err := client.ListQueryResultsForResourceGroupLevelPolicyAssignmentPreparer(ctx, policyStatesResource, subscriptionID, resourceGroupName, policyAssignmentName, top, orderBy, selectParameter, from, toParameter, filter, apply, skipToken) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForResourceGroupLevelPolicyAssignment", nil, "Failure preparing request") return @@ -676,12 +894,12 @@ func (client PolicyStatesClient) ListQueryResultsForResourceGroupLevelPolicyAssi resp, err := client.ListQueryResultsForResourceGroupLevelPolicyAssignmentSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} + result.psqr.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForResourceGroupLevelPolicyAssignment", resp, "Failure sending request") return } - result, err = client.ListQueryResultsForResourceGroupLevelPolicyAssignmentResponder(resp) + result.psqr, err = client.ListQueryResultsForResourceGroupLevelPolicyAssignmentResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForResourceGroupLevelPolicyAssignment", resp, "Failure responding to request") } @@ -690,7 +908,7 @@ func (client PolicyStatesClient) ListQueryResultsForResourceGroupLevelPolicyAssi } // ListQueryResultsForResourceGroupLevelPolicyAssignmentPreparer prepares the ListQueryResultsForResourceGroupLevelPolicyAssignment request. -func (client PolicyStatesClient) ListQueryResultsForResourceGroupLevelPolicyAssignmentPreparer(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, resourceGroupName string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (*http.Request, error) { +func (client PolicyStatesClient) ListQueryResultsForResourceGroupLevelPolicyAssignmentPreparer(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, resourceGroupName string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (*http.Request, error) { pathParameters := map[string]interface{}{ "authorizationNamespace": autorest.Encode("path", "Microsoft.Authorization"), "policyAssignmentName": autorest.Encode("path", policyAssignmentName), @@ -724,6 +942,9 @@ func (client PolicyStatesClient) ListQueryResultsForResourceGroupLevelPolicyAssi if len(apply) > 0 { queryParameters["$apply"] = autorest.Encode("query", apply) } + if len(skipToken) > 0 { + queryParameters["$skiptoken"] = autorest.Encode("query", skipToken) + } preparer := autorest.CreatePreparer( autorest.AsPost(), @@ -752,6 +973,43 @@ func (client PolicyStatesClient) ListQueryResultsForResourceGroupLevelPolicyAssi return } +// listQueryResultsForResourceGroupLevelPolicyAssignmentNextResults retrieves the next set of results, if any. +func (client PolicyStatesClient) listQueryResultsForResourceGroupLevelPolicyAssignmentNextResults(ctx context.Context, lastResults PolicyStatesQueryResults) (result PolicyStatesQueryResults, err error) { + req, err := lastResults.policyStatesQueryResultsPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "listQueryResultsForResourceGroupLevelPolicyAssignmentNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListQueryResultsForResourceGroupLevelPolicyAssignmentSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "listQueryResultsForResourceGroupLevelPolicyAssignmentNextResults", resp, "Failure sending next results request") + } + result, err = client.ListQueryResultsForResourceGroupLevelPolicyAssignmentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "listQueryResultsForResourceGroupLevelPolicyAssignmentNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListQueryResultsForResourceGroupLevelPolicyAssignmentComplete enumerates all values, automatically crossing page boundaries as required. +func (client PolicyStatesClient) ListQueryResultsForResourceGroupLevelPolicyAssignmentComplete(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, resourceGroupName string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result PolicyStatesQueryResultsIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyStatesClient.ListQueryResultsForResourceGroupLevelPolicyAssignment") + 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.ListQueryResultsForResourceGroupLevelPolicyAssignment(ctx, policyStatesResource, subscriptionID, resourceGroupName, policyAssignmentName, top, orderBy, selectParameter, from, toParameter, filter, apply, skipToken) + return +} + // ListQueryResultsForSubscription queries policy states for the resources under the subscription. // Parameters: // policyStatesResource - the virtual resource under PolicyStates resource type. In a given time range, @@ -768,13 +1026,15 @@ func (client PolicyStatesClient) ListQueryResultsForResourceGroupLevelPolicyAssi // specified, the service uses request time. // filter - oData filter expression. // apply - oData apply expression for aggregations. -func (client PolicyStatesClient) ListQueryResultsForSubscription(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result PolicyStatesQueryResults, err error) { +// skipToken - skiptoken is only provided if a previous response returned a partial result as a part of +// nextLink element. +func (client PolicyStatesClient) ListQueryResultsForSubscription(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result PolicyStatesQueryResultsPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PolicyStatesClient.ListQueryResultsForSubscription") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.psqr.Response.Response != nil { + sc = result.psqr.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -786,7 +1046,8 @@ func (client PolicyStatesClient) ListQueryResultsForSubscription(ctx context.Con return result, validation.NewError("policyinsights.PolicyStatesClient", "ListQueryResultsForSubscription", err.Error()) } - req, err := client.ListQueryResultsForSubscriptionPreparer(ctx, policyStatesResource, subscriptionID, top, orderBy, selectParameter, from, toParameter, filter, apply) + result.fn = client.listQueryResultsForSubscriptionNextResults + req, err := client.ListQueryResultsForSubscriptionPreparer(ctx, policyStatesResource, subscriptionID, top, orderBy, selectParameter, from, toParameter, filter, apply, skipToken) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForSubscription", nil, "Failure preparing request") return @@ -794,12 +1055,12 @@ func (client PolicyStatesClient) ListQueryResultsForSubscription(ctx context.Con resp, err := client.ListQueryResultsForSubscriptionSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} + result.psqr.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForSubscription", resp, "Failure sending request") return } - result, err = client.ListQueryResultsForSubscriptionResponder(resp) + result.psqr, err = client.ListQueryResultsForSubscriptionResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForSubscription", resp, "Failure responding to request") } @@ -808,7 +1069,7 @@ func (client PolicyStatesClient) ListQueryResultsForSubscription(ctx context.Con } // ListQueryResultsForSubscriptionPreparer prepares the ListQueryResultsForSubscription request. -func (client PolicyStatesClient) ListQueryResultsForSubscriptionPreparer(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (*http.Request, error) { +func (client PolicyStatesClient) ListQueryResultsForSubscriptionPreparer(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (*http.Request, error) { pathParameters := map[string]interface{}{ "policyStatesResource": autorest.Encode("path", policyStatesResource), "subscriptionId": autorest.Encode("path", subscriptionID), @@ -839,6 +1100,9 @@ func (client PolicyStatesClient) ListQueryResultsForSubscriptionPreparer(ctx con if len(apply) > 0 { queryParameters["$apply"] = autorest.Encode("query", apply) } + if len(skipToken) > 0 { + queryParameters["$skiptoken"] = autorest.Encode("query", skipToken) + } preparer := autorest.CreatePreparer( autorest.AsPost(), @@ -867,6 +1131,43 @@ func (client PolicyStatesClient) ListQueryResultsForSubscriptionResponder(resp * return } +// listQueryResultsForSubscriptionNextResults retrieves the next set of results, if any. +func (client PolicyStatesClient) listQueryResultsForSubscriptionNextResults(ctx context.Context, lastResults PolicyStatesQueryResults) (result PolicyStatesQueryResults, err error) { + req, err := lastResults.policyStatesQueryResultsPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "listQueryResultsForSubscriptionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListQueryResultsForSubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "listQueryResultsForSubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListQueryResultsForSubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "listQueryResultsForSubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListQueryResultsForSubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client PolicyStatesClient) ListQueryResultsForSubscriptionComplete(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result PolicyStatesQueryResultsIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyStatesClient.ListQueryResultsForSubscription") + 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.ListQueryResultsForSubscription(ctx, policyStatesResource, subscriptionID, top, orderBy, selectParameter, from, toParameter, filter, apply, skipToken) + return +} + // ListQueryResultsForSubscriptionLevelPolicyAssignment queries policy states for the subscription level policy // assignment. // Parameters: @@ -885,13 +1186,15 @@ func (client PolicyStatesClient) ListQueryResultsForSubscriptionResponder(resp * // specified, the service uses request time. // filter - oData filter expression. // apply - oData apply expression for aggregations. -func (client PolicyStatesClient) ListQueryResultsForSubscriptionLevelPolicyAssignment(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result PolicyStatesQueryResults, err error) { +// skipToken - skiptoken is only provided if a previous response returned a partial result as a part of +// nextLink element. +func (client PolicyStatesClient) ListQueryResultsForSubscriptionLevelPolicyAssignment(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result PolicyStatesQueryResultsPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PolicyStatesClient.ListQueryResultsForSubscriptionLevelPolicyAssignment") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.psqr.Response.Response != nil { + sc = result.psqr.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -903,7 +1206,8 @@ func (client PolicyStatesClient) ListQueryResultsForSubscriptionLevelPolicyAssig return result, validation.NewError("policyinsights.PolicyStatesClient", "ListQueryResultsForSubscriptionLevelPolicyAssignment", err.Error()) } - req, err := client.ListQueryResultsForSubscriptionLevelPolicyAssignmentPreparer(ctx, policyStatesResource, subscriptionID, policyAssignmentName, top, orderBy, selectParameter, from, toParameter, filter, apply) + result.fn = client.listQueryResultsForSubscriptionLevelPolicyAssignmentNextResults + req, err := client.ListQueryResultsForSubscriptionLevelPolicyAssignmentPreparer(ctx, policyStatesResource, subscriptionID, policyAssignmentName, top, orderBy, selectParameter, from, toParameter, filter, apply, skipToken) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForSubscriptionLevelPolicyAssignment", nil, "Failure preparing request") return @@ -911,12 +1215,12 @@ func (client PolicyStatesClient) ListQueryResultsForSubscriptionLevelPolicyAssig resp, err := client.ListQueryResultsForSubscriptionLevelPolicyAssignmentSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} + result.psqr.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForSubscriptionLevelPolicyAssignment", resp, "Failure sending request") return } - result, err = client.ListQueryResultsForSubscriptionLevelPolicyAssignmentResponder(resp) + result.psqr, err = client.ListQueryResultsForSubscriptionLevelPolicyAssignmentResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForSubscriptionLevelPolicyAssignment", resp, "Failure responding to request") } @@ -925,7 +1229,7 @@ func (client PolicyStatesClient) ListQueryResultsForSubscriptionLevelPolicyAssig } // ListQueryResultsForSubscriptionLevelPolicyAssignmentPreparer prepares the ListQueryResultsForSubscriptionLevelPolicyAssignment request. -func (client PolicyStatesClient) ListQueryResultsForSubscriptionLevelPolicyAssignmentPreparer(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (*http.Request, error) { +func (client PolicyStatesClient) ListQueryResultsForSubscriptionLevelPolicyAssignmentPreparer(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (*http.Request, error) { pathParameters := map[string]interface{}{ "authorizationNamespace": autorest.Encode("path", "Microsoft.Authorization"), "policyAssignmentName": autorest.Encode("path", policyAssignmentName), @@ -958,6 +1262,9 @@ func (client PolicyStatesClient) ListQueryResultsForSubscriptionLevelPolicyAssig if len(apply) > 0 { queryParameters["$apply"] = autorest.Encode("query", apply) } + if len(skipToken) > 0 { + queryParameters["$skiptoken"] = autorest.Encode("query", skipToken) + } preparer := autorest.CreatePreparer( autorest.AsPost(), @@ -986,6 +1293,43 @@ func (client PolicyStatesClient) ListQueryResultsForSubscriptionLevelPolicyAssig return } +// listQueryResultsForSubscriptionLevelPolicyAssignmentNextResults retrieves the next set of results, if any. +func (client PolicyStatesClient) listQueryResultsForSubscriptionLevelPolicyAssignmentNextResults(ctx context.Context, lastResults PolicyStatesQueryResults) (result PolicyStatesQueryResults, err error) { + req, err := lastResults.policyStatesQueryResultsPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "listQueryResultsForSubscriptionLevelPolicyAssignmentNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListQueryResultsForSubscriptionLevelPolicyAssignmentSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "listQueryResultsForSubscriptionLevelPolicyAssignmentNextResults", resp, "Failure sending next results request") + } + result, err = client.ListQueryResultsForSubscriptionLevelPolicyAssignmentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "listQueryResultsForSubscriptionLevelPolicyAssignmentNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListQueryResultsForSubscriptionLevelPolicyAssignmentComplete enumerates all values, automatically crossing page boundaries as required. +func (client PolicyStatesClient) ListQueryResultsForSubscriptionLevelPolicyAssignmentComplete(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result PolicyStatesQueryResultsIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyStatesClient.ListQueryResultsForSubscriptionLevelPolicyAssignment") + 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.ListQueryResultsForSubscriptionLevelPolicyAssignment(ctx, policyStatesResource, subscriptionID, policyAssignmentName, top, orderBy, selectParameter, from, toParameter, filter, apply, skipToken) + return +} + // SummarizeForManagementGroup summarizes policy states for the resources under the management group. // Parameters: // managementGroupName - management group name. diff --git a/services/preview/alertsmanagement/mgmt/2019-05-05/alertsmanagement/models.go b/services/preview/alertsmanagement/mgmt/2019-05-05/alertsmanagement/models.go index cb42cbdb47fa..735b904268b8 100644 --- a/services/preview/alertsmanagement/mgmt/2019-05-05/alertsmanagement/models.go +++ b/services/preview/alertsmanagement/mgmt/2019-05-05/alertsmanagement/models.go @@ -49,17 +49,29 @@ func PossibleActionRuleStatusValues() []ActionRuleStatus { type AlertModificationEvent string const ( + // ActionRuleSuppressed ... + ActionRuleSuppressed AlertModificationEvent = "ActionRuleSuppressed" + // ActionRuleTriggered ... + ActionRuleTriggered AlertModificationEvent = "ActionRuleTriggered" + // ActionsFailed ... + ActionsFailed AlertModificationEvent = "ActionsFailed" + // ActionsSuppressed ... + ActionsSuppressed AlertModificationEvent = "ActionsSuppressed" + // ActionsTriggered ... + ActionsTriggered AlertModificationEvent = "ActionsTriggered" // AlertCreated ... AlertCreated AlertModificationEvent = "AlertCreated" // MonitorConditionChange ... MonitorConditionChange AlertModificationEvent = "MonitorConditionChange" + // SeverityChange ... + SeverityChange AlertModificationEvent = "SeverityChange" // StateChange ... StateChange AlertModificationEvent = "StateChange" ) // PossibleAlertModificationEventValues returns an array of possible values for the AlertModificationEvent const type. func PossibleAlertModificationEventValues() []AlertModificationEvent { - return []AlertModificationEvent{AlertCreated, MonitorConditionChange, StateChange} + return []AlertModificationEvent{ActionRuleSuppressed, ActionRuleTriggered, ActionsFailed, ActionsSuppressed, ActionsTriggered, AlertCreated, MonitorConditionChange, SeverityChange, StateChange} } // AlertsSortByFields enumerates the values for alerts sort by fields. @@ -229,11 +241,13 @@ const ( ScopeTypeResource ScopeType = "Resource" // ScopeTypeResourceGroup ... ScopeTypeResourceGroup ScopeType = "ResourceGroup" + // ScopeTypeSubscription ... + ScopeTypeSubscription ScopeType = "Subscription" ) // PossibleScopeTypeValues returns an array of possible values for the ScopeType const type. func PossibleScopeTypeValues() []ScopeType { - return []ScopeType{ScopeTypeResource, ScopeTypeResourceGroup} + return []ScopeType{ScopeTypeResource, ScopeTypeResourceGroup, ScopeTypeSubscription} } // Severity enumerates the values for severity. @@ -856,7 +870,7 @@ type AlertModification struct { // AlertModificationItem alert modification item. type AlertModificationItem struct { - // ModificationEvent - Reason for the modification. Possible values include: 'AlertCreated', 'StateChange', 'MonitorConditionChange' + // ModificationEvent - Reason for the modification. Possible values include: 'AlertCreated', 'StateChange', 'MonitorConditionChange', 'SeverityChange', 'ActionRuleTriggered', 'ActionRuleSuppressed', 'ActionsTriggered', 'ActionsSuppressed', 'ActionsFailed' ModificationEvent AlertModificationEvent `json:"modificationEvent,omitempty"` // OldValue - Old value OldValue *string `json:"oldValue,omitempty"` @@ -1637,7 +1651,7 @@ type Resource struct { // Scope target scope for a given action rule. By default scope will be the subscription. User can also // provide list of resource groups or list of resources from the scope subscription as well. type Scope struct { - // ScopeType - type of target scope. Possible values include: 'ScopeTypeResourceGroup', 'ScopeTypeResource' + // ScopeType - type of target scope. Possible values include: 'ScopeTypeResourceGroup', 'ScopeTypeResource', 'ScopeTypeSubscription' ScopeType ScopeType `json:"scopeType,omitempty"` // Values - list of ARM IDs of the given scope type which will be the target of the given action rule. Values *[]string `json:"values,omitempty"` diff --git a/services/preview/appconfiguration/mgmt/2019-11-01-preview/appconfiguration/models.go b/services/preview/appconfiguration/mgmt/2019-11-01-preview/appconfiguration/models.go index cbbb68dd266c..ee8c0bc6d1b7 100644 --- a/services/preview/appconfiguration/mgmt/2019-11-01-preview/appconfiguration/models.go +++ b/services/preview/appconfiguration/mgmt/2019-11-01-preview/appconfiguration/models.go @@ -107,6 +107,21 @@ func PossibleProvisioningStateValues() []ProvisioningState { return []ProvisioningState{Canceled, Creating, Deleting, Failed, Succeeded, Updating} } +// PublicNetworkAccess enumerates the values for public network access. +type PublicNetworkAccess string + +const ( + // Disabled ... + Disabled PublicNetworkAccess = "Disabled" + // Enabled ... + Enabled PublicNetworkAccess = "Enabled" +) + +// PossiblePublicNetworkAccessValues returns an array of possible values for the PublicNetworkAccess const type. +func PossiblePublicNetworkAccessValues() []PublicNetworkAccess { + return []PublicNetworkAccess{Disabled, Enabled} +} + // APIKey an API key used for authenticating with a configuration store endpoint. type APIKey struct { autorest.Response `json:"-"` @@ -564,6 +579,10 @@ type ConfigurationStoreProperties struct { Endpoint *string `json:"endpoint,omitempty"` // Encryption - The encryption settings of the configuration store. Encryption *EncryptionProperties `json:"encryption,omitempty"` + // PrivateEndpointConnections - READ-ONLY; The list of private endpoint connections that are set up for this resource. + PrivateEndpointConnections *[]PrivateEndpointConnectionReference `json:"privateEndpointConnections,omitempty"` + // PublicNetworkAccess - Control permission for data plane traffic coming from public networks while private endpoint is enabled. Possible values include: 'Enabled', 'Disabled' + PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` } // ConfigurationStorePropertiesUpdateParameters the properties for updating a configuration store. @@ -1209,6 +1228,78 @@ type PrivateEndpointConnectionProperties struct { PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` } +// PrivateEndpointConnectionReference a reference to a related private endpoint connection. +type PrivateEndpointConnectionReference 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"` + // PrivateEndpointConnectionProperties - The properties of a private endpoint connection. + *PrivateEndpointConnectionProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateEndpointConnectionReference. +func (pecr PrivateEndpointConnectionReference) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pecr.PrivateEndpointConnectionProperties != nil { + objectMap["properties"] = pecr.PrivateEndpointConnectionProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PrivateEndpointConnectionReference struct. +func (pecr *PrivateEndpointConnectionReference) 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 "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + pecr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + pecr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pecr.Type = &typeVar + } + case "properties": + if v != nil { + var privateEndpointConnectionProperties PrivateEndpointConnectionProperties + err = json.Unmarshal(*v, &privateEndpointConnectionProperties) + if err != nil { + return err + } + pecr.PrivateEndpointConnectionProperties = &privateEndpointConnectionProperties + } + } + } + + return nil +} + // PrivateEndpointConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results // of a long-running operation. type PrivateEndpointConnectionsCreateOrUpdateFuture struct { @@ -1487,6 +1578,8 @@ type PrivateLinkResourceProperties struct { GroupID *string `json:"groupId,omitempty"` // RequiredMembers - READ-ONLY; The private link resource required member names. RequiredMembers *[]string `json:"requiredMembers,omitempty"` + // RequiredZoneNames - READ-ONLY; The list of required DNS zone names of the private link resource. + RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"` } // PrivateLinkServiceConnectionState the state of a private link service connection. diff --git a/services/preview/appinsights/v1/insights/get.go b/services/preview/appinsights/v1/insights/get.go deleted file mode 100644 index be6b547e8d83..000000000000 --- a/services/preview/appinsights/v1/insights/get.go +++ /dev/null @@ -1,110 +0,0 @@ -package insights - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// 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" -) - -// GetClient is the composite Swagger for Application Insights Data Client -type GetClient struct { - BaseClient -} - -// NewGetClient creates an instance of the GetClient client. -func NewGetClient() GetClient { - return NewGetClientWithBaseURI(DefaultBaseURI) -} - -// NewGetClientWithBaseURI creates an instance of the GetClient 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 NewGetClientWithBaseURI(baseURI string) GetClient { - return GetClient{NewWithBaseURI(baseURI)} -} - -// Metadata retrieve the metadata information for the app, including its schema, etc. -// Parameters: -// appID - ID of the application. This is Application ID from the API Access settings blade in the Azure -// portal. -func (client GetClient) Metadata(ctx context.Context, appID string) (result MetadataResults, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/GetClient.Metadata") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.MetadataPreparer(ctx, appID) - if err != nil { - err = autorest.NewErrorWithError(err, "insights.GetClient", "Metadata", nil, "Failure preparing request") - return - } - - resp, err := client.MetadataSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "insights.GetClient", "Metadata", resp, "Failure sending request") - return - } - - result, err = client.MetadataResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "insights.GetClient", "Metadata", resp, "Failure responding to request") - } - - return -} - -// MetadataPreparer prepares the Metadata request. -func (client GetClient) MetadataPreparer(ctx context.Context, appID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/apps/{appId}/metadata", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// MetadataSender sends the Metadata request. The method will close the -// http.Response Body if it receives an error. -func (client GetClient) MetadataSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// MetadataResponder handles the response to the Metadata request. The method always -// closes the http.Response Body. -func (client GetClient) MetadataResponder(resp *http.Response) (result MetadataResults, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/services/preview/appinsights/v1/insights/insightsapi/interfaces.go b/services/preview/appinsights/v1/insights/insightsapi/interfaces.go index 30a73994c1c6..595068d42ab6 100644 --- a/services/preview/appinsights/v1/insights/insightsapi/interfaces.go +++ b/services/preview/appinsights/v1/insights/insightsapi/interfaces.go @@ -47,16 +47,10 @@ type QueryClientAPI interface { var _ QueryClientAPI = (*insights.QueryClient)(nil) -// PostClientAPI contains the set of methods on the PostClient type. -type PostClientAPI interface { - Metadata(ctx context.Context, appID string) (result insights.MetadataResults, err error) +// MetadataClientAPI contains the set of methods on the MetadataClient type. +type MetadataClientAPI interface { + Get(ctx context.Context, appID string) (result insights.MetadataResults, err error) + Post(ctx context.Context, appID string) (result insights.MetadataResults, err error) } -var _ PostClientAPI = (*insights.PostClient)(nil) - -// GetClientAPI contains the set of methods on the GetClient type. -type GetClientAPI interface { - Metadata(ctx context.Context, appID string) (result insights.MetadataResults, err error) -} - -var _ GetClientAPI = (*insights.GetClient)(nil) +var _ MetadataClientAPI = (*insights.MetadataClient)(nil) diff --git a/services/preview/appinsights/v1/insights/metadata.go b/services/preview/appinsights/v1/insights/metadata.go new file mode 100644 index 000000000000..e7cd7d7b957b --- /dev/null +++ b/services/preview/appinsights/v1/insights/metadata.go @@ -0,0 +1,178 @@ +package insights + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// MetadataClient is the composite Swagger for Application Insights Data Client +type MetadataClient struct { + BaseClient +} + +// NewMetadataClient creates an instance of the MetadataClient client. +func NewMetadataClient() MetadataClient { + return NewMetadataClientWithBaseURI(DefaultBaseURI) +} + +// NewMetadataClientWithBaseURI creates an instance of the MetadataClient 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 NewMetadataClientWithBaseURI(baseURI string) MetadataClient { + return MetadataClient{NewWithBaseURI(baseURI)} +} + +// Get retrieve the metadata information for the app, including its schema, etc. +// Parameters: +// appID - ID of the application. This is Application ID from the API Access settings blade in the Azure +// portal. +func (client MetadataClient) Get(ctx context.Context, appID string) (result MetadataResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MetadataClient.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, appID) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.MetadataClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "insights.MetadataClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.MetadataClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client MetadataClient) GetPreparer(ctx context.Context, appID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "appId": autorest.Encode("path", appID), + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/apps/{appId}/metadata", pathParameters)) + 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 MetadataClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client MetadataClient) GetResponder(resp *http.Response) (result MetadataResults, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Post retrieve the metadata information for the app, including its schema, etc. +// Parameters: +// appID - ID of the application. This is Application ID from the API Access settings blade in the Azure +// portal. +func (client MetadataClient) Post(ctx context.Context, appID string) (result MetadataResults, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/MetadataClient.Post") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PostPreparer(ctx, appID) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.MetadataClient", "Post", nil, "Failure preparing request") + return + } + + resp, err := client.PostSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "insights.MetadataClient", "Post", resp, "Failure sending request") + return + } + + result, err = client.PostResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "insights.MetadataClient", "Post", resp, "Failure responding to request") + } + + return +} + +// PostPreparer prepares the Post request. +func (client MetadataClient) PostPreparer(ctx context.Context, appID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "appId": autorest.Encode("path", appID), + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/apps/{appId}/metadata", pathParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PostSender sends the Post request. The method will close the +// http.Response Body if it receives an error. +func (client MetadataClient) PostSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// PostResponder handles the response to the Post request. The method always +// closes the http.Response Body. +func (client MetadataClient) PostResponder(resp *http.Response) (result MetadataResults, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/appinsights/v1/insights/models.go b/services/preview/appinsights/v1/insights/models.go index 229ba63b9b7b..884091a3a1bb 100644 --- a/services/preview/appinsights/v1/insights/models.go +++ b/services/preview/appinsights/v1/insights/models.go @@ -2095,12 +2095,112 @@ func (erd EventsResultData) AsBasicEventsResultData() (BasicEventsResultData, bo // EventsResultDataCustomDimensions custom dimensions of the event type EventsResultDataCustomDimensions struct { - AdditionalProperties interface{} `json:"additionalProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + AdditionalProperties1 interface{} `json:"additionalProperties,omitempty"` +} + +// MarshalJSON is the custom marshaler for EventsResultDataCustomDimensions. +func (erdD EventsResultDataCustomDimensions) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if erdD.AdditionalProperties1 != nil { + objectMap["additionalProperties"] = erdD.AdditionalProperties1 + } + for k, v := range erdD.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for EventsResultDataCustomDimensions struct. +func (erdD *EventsResultDataCustomDimensions) 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 { + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if erdD.AdditionalProperties == nil { + erdD.AdditionalProperties = make(map[string]interface{}) + } + erdD.AdditionalProperties[k] = additionalProperties + } + case "additionalProperties": + if v != nil { + var additionalProperties1 interface{} + err = json.Unmarshal(*v, &additionalProperties1) + if err != nil { + return err + } + erdD.AdditionalProperties1 = additionalProperties1 + } + } + } + + return nil } // EventsResultDataCustomMeasurements custom measurements of the event type EventsResultDataCustomMeasurements struct { - AdditionalProperties interface{} `json:"additionalProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + AdditionalProperties1 interface{} `json:"additionalProperties,omitempty"` +} + +// MarshalJSON is the custom marshaler for EventsResultDataCustomMeasurements. +func (erdM EventsResultDataCustomMeasurements) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if erdM.AdditionalProperties1 != nil { + objectMap["additionalProperties"] = erdM.AdditionalProperties1 + } + for k, v := range erdM.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for EventsResultDataCustomMeasurements struct. +func (erdM *EventsResultDataCustomMeasurements) 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 { + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if erdM.AdditionalProperties == nil { + erdM.AdditionalProperties = make(map[string]interface{}) + } + erdM.AdditionalProperties[k] = additionalProperties + } + case "additionalProperties": + if v != nil { + var additionalProperties1 interface{} + err = json.Unmarshal(*v, &additionalProperties1) + if err != nil { + return err + } + erdM.AdditionalProperties1 = additionalProperties1 + } + } + } + + return nil } // EventsResults an events query result. diff --git a/services/preview/appinsights/v1/insights/post.go b/services/preview/appinsights/v1/insights/post.go deleted file mode 100644 index d510f596e23e..000000000000 --- a/services/preview/appinsights/v1/insights/post.go +++ /dev/null @@ -1,110 +0,0 @@ -package insights - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// 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" -) - -// PostClient is the composite Swagger for Application Insights Data Client -type PostClient struct { - BaseClient -} - -// NewPostClient creates an instance of the PostClient client. -func NewPostClient() PostClient { - return NewPostClientWithBaseURI(DefaultBaseURI) -} - -// NewPostClientWithBaseURI creates an instance of the PostClient 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 NewPostClientWithBaseURI(baseURI string) PostClient { - return PostClient{NewWithBaseURI(baseURI)} -} - -// Metadata retrieve the metadata information for the app, including its schema, etc. -// Parameters: -// appID - ID of the application. This is Application ID from the API Access settings blade in the Azure -// portal. -func (client PostClient) Metadata(ctx context.Context, appID string) (result MetadataResults, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PostClient.Metadata") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.MetadataPreparer(ctx, appID) - if err != nil { - err = autorest.NewErrorWithError(err, "insights.PostClient", "Metadata", nil, "Failure preparing request") - return - } - - resp, err := client.MetadataSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "insights.PostClient", "Metadata", resp, "Failure sending request") - return - } - - result, err = client.MetadataResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "insights.PostClient", "Metadata", resp, "Failure responding to request") - } - - return -} - -// MetadataPreparer prepares the Metadata request. -func (client PostClient) MetadataPreparer(ctx context.Context, appID string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - } - - preparer := autorest.CreatePreparer( - autorest.AsPost(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/apps/{appId}/metadata", pathParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// MetadataSender sends the Metadata request. The method will close the -// http.Response Body if it receives an error. -func (client PostClient) MetadataSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// MetadataResponder handles the response to the Metadata request. The method always -// closes the http.Response Body. -func (client PostClient) MetadataResponder(resp *http.Response) (result MetadataResults, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/appplatformapi/interfaces.go b/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/appplatformapi/interfaces.go index 5bcb482769b0..6e2a0a6252de 100644 --- a/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/appplatformapi/interfaces.go +++ b/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/appplatformapi/interfaces.go @@ -116,3 +116,11 @@ type OperationsClientAPI interface { } var _ OperationsClientAPI = (*appplatform.OperationsClient)(nil) + +// SkuClientAPI contains the set of methods on the SkuClient type. +type SkuClientAPI interface { + List(ctx context.Context) (result appplatform.ResourceSkuCollectionPage, err error) + ListComplete(ctx context.Context) (result appplatform.ResourceSkuCollectionIterator, err error) +} + +var _ SkuClientAPI = (*appplatform.SkuClient)(nil) diff --git a/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/models.go b/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/models.go index 5218640cd6b8..448bde7a6068 100644 --- a/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/models.go +++ b/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/models.go @@ -115,6 +115,25 @@ func PossibleDeploymentResourceStatusValues() []DeploymentResourceStatus { return []DeploymentResourceStatus{DeploymentResourceStatusAllocating, DeploymentResourceStatusCompiling, DeploymentResourceStatusFailed, DeploymentResourceStatusRunning, DeploymentResourceStatusStopped, DeploymentResourceStatusUnknown, DeploymentResourceStatusUpgrading} } +// ManagedIdentityType enumerates the values for managed identity type. +type ManagedIdentityType string + +const ( + // None ... + None ManagedIdentityType = "None" + // SystemAssigned ... + SystemAssigned ManagedIdentityType = "SystemAssigned" + // SystemAssignedUserAssigned ... + SystemAssignedUserAssigned ManagedIdentityType = "SystemAssigned,UserAssigned" + // UserAssigned ... + UserAssigned ManagedIdentityType = "UserAssigned" +) + +// PossibleManagedIdentityTypeValues returns an array of possible values for the ManagedIdentityType const type. +func PossibleManagedIdentityTypeValues() []ManagedIdentityType { + return []ManagedIdentityType{None, SystemAssigned, SystemAssignedUserAssigned, UserAssigned} +} + // ProvisioningState enumerates the values for provisioning state. type ProvisioningState string @@ -144,6 +163,36 @@ func PossibleProvisioningStateValues() []ProvisioningState { return []ProvisioningState{ProvisioningStateCreating, ProvisioningStateDeleted, ProvisioningStateDeleting, ProvisioningStateFailed, ProvisioningStateMoved, ProvisioningStateMoveFailed, ProvisioningStateMoving, ProvisioningStateSucceeded, ProvisioningStateUpdating} } +// ResourceSkuRestrictionsReasonCode enumerates the values for resource sku restrictions reason code. +type ResourceSkuRestrictionsReasonCode string + +const ( + // NotAvailableForSubscription ... + NotAvailableForSubscription ResourceSkuRestrictionsReasonCode = "NotAvailableForSubscription" + // QuotaID ... + QuotaID ResourceSkuRestrictionsReasonCode = "QuotaId" +) + +// PossibleResourceSkuRestrictionsReasonCodeValues returns an array of possible values for the ResourceSkuRestrictionsReasonCode const type. +func PossibleResourceSkuRestrictionsReasonCodeValues() []ResourceSkuRestrictionsReasonCode { + return []ResourceSkuRestrictionsReasonCode{NotAvailableForSubscription, QuotaID} +} + +// ResourceSkuRestrictionsType enumerates the values for resource sku restrictions type. +type ResourceSkuRestrictionsType string + +const ( + // Location ... + Location ResourceSkuRestrictionsType = "Location" + // Zone ... + Zone ResourceSkuRestrictionsType = "Zone" +) + +// PossibleResourceSkuRestrictionsTypeValues returns an array of possible values for the ResourceSkuRestrictionsType const type. +func PossibleResourceSkuRestrictionsTypeValues() []ResourceSkuRestrictionsType { + return []ResourceSkuRestrictionsType{Location, Zone} +} + // RuntimeVersion enumerates the values for runtime version. type RuntimeVersion string @@ -159,6 +208,23 @@ func PossibleRuntimeVersionValues() []RuntimeVersion { return []RuntimeVersion{Java11, Java8} } +// SkuScaleType enumerates the values for sku scale type. +type SkuScaleType string + +const ( + // SkuScaleTypeAutomatic ... + SkuScaleTypeAutomatic SkuScaleType = "Automatic" + // SkuScaleTypeManual ... + SkuScaleTypeManual SkuScaleType = "Manual" + // SkuScaleTypeNone ... + SkuScaleTypeNone SkuScaleType = "None" +) + +// PossibleSkuScaleTypeValues returns an array of possible values for the SkuScaleType const type. +func PossibleSkuScaleTypeValues() []SkuScaleType { + return []SkuScaleType{SkuScaleTypeAutomatic, SkuScaleTypeManual, SkuScaleTypeNone} +} + // TestKeyType enumerates the values for test key type. type TestKeyType string @@ -213,6 +279,8 @@ type AppResource struct { autorest.Response `json:"-"` // Properties - Properties of the App resource Properties *AppResourceProperties `json:"properties,omitempty"` + // Identity - The Managed Identity type of the app resource + Identity *ManagedIdentityProperties `json:"identity,omitempty"` // Location - The GEO location of the application, always the same with its parent resource Location *string `json:"location,omitempty"` // ID - READ-ONLY; Fully qualified resource Id for the resource. @@ -1651,6 +1719,14 @@ type LogSpecification struct { BlobDuration *string `json:"blobDuration,omitempty"` } +// ManagedIdentityProperties managed identity properties retrieved from ARM request headers. +type ManagedIdentityProperties struct { + // Type - Possible values include: 'None', 'SystemAssigned', 'UserAssigned', 'SystemAssignedUserAssigned' + Type ManagedIdentityType `json:"type,omitempty"` + PrincipalID *string `json:"principalId,omitempty"` + TenantID *string `json:"tenantId,omitempty"` +} + // MetricDimension specifications of the Dimension of metrics type MetricDimension struct { // Name - Name of the dimension @@ -1771,6 +1847,221 @@ type Resource struct { Type *string `json:"type,omitempty"` } +// ResourceSku describes an available Azure Spring Cloud SKU. +type ResourceSku struct { + // ResourceType - Gets the type of resource the SKU applies to. + ResourceType *string `json:"resourceType,omitempty"` + // Name - Gets the name of SKU. + Name *string `json:"name,omitempty"` + // Tier - Gets the tier of SKU. + Tier *string `json:"tier,omitempty"` + // Capacity - Gets the capacity of SKU. + Capacity *SkuCapacity `json:"capacity,omitempty"` + // Locations - Gets the set of locations that the SKU is available. + Locations *[]string `json:"locations,omitempty"` + // LocationInfo - Gets a list of locations and availability zones in those locations where the SKU is available. + LocationInfo *[]ResourceSkuLocationInfo `json:"locationInfo,omitempty"` + // Restrictions - Gets the restrictions because of which SKU cannot be used. This is + // empty if there are no restrictions. + Restrictions *[]ResourceSkuRestrictions `json:"restrictions,omitempty"` +} + +// ResourceSkuCapabilities ... +type ResourceSkuCapabilities struct { + // Name - Gets an invariant to describe the feature. + Name *string `json:"name,omitempty"` + // Value - Gets an invariant if the feature is measured by quantity. + Value *string `json:"value,omitempty"` +} + +// ResourceSkuCollection ... +type ResourceSkuCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resource SKU + Value *[]ResourceSku `json:"value,omitempty"` + // NextLink - URL client should use to fetch the next page (per server side paging). + // It's null for now, added for future use. + NextLink *string `json:"nextLink,omitempty"` +} + +// ResourceSkuCollectionIterator provides access to a complete listing of ResourceSku values. +type ResourceSkuCollectionIterator struct { + i int + page ResourceSkuCollectionPage +} + +// 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 *ResourceSkuCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkuCollectionIterator.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 *ResourceSkuCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ResourceSkuCollectionIterator) 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 ResourceSkuCollectionIterator) Response() ResourceSkuCollection { + 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 ResourceSkuCollectionIterator) Value() ResourceSku { + if !iter.page.NotDone() { + return ResourceSku{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ResourceSkuCollectionIterator type. +func NewResourceSkuCollectionIterator(page ResourceSkuCollectionPage) ResourceSkuCollectionIterator { + return ResourceSkuCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rsc ResourceSkuCollection) IsEmpty() bool { + return rsc.Value == nil || len(*rsc.Value) == 0 +} + +// resourceSkuCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rsc ResourceSkuCollection) resourceSkuCollectionPreparer(ctx context.Context) (*http.Request, error) { + if rsc.NextLink == nil || len(to.String(rsc.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rsc.NextLink))) +} + +// ResourceSkuCollectionPage contains a page of ResourceSku values. +type ResourceSkuCollectionPage struct { + fn func(context.Context, ResourceSkuCollection) (ResourceSkuCollection, error) + rsc ResourceSkuCollection +} + +// 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 *ResourceSkuCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceSkuCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.rsc) + if err != nil { + return err + } + page.rsc = next + 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 *ResourceSkuCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ResourceSkuCollectionPage) NotDone() bool { + return !page.rsc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ResourceSkuCollectionPage) Response() ResourceSkuCollection { + return page.rsc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ResourceSkuCollectionPage) Values() []ResourceSku { + if page.rsc.IsEmpty() { + return nil + } + return *page.rsc.Value +} + +// Creates a new instance of the ResourceSkuCollectionPage type. +func NewResourceSkuCollectionPage(getNextPage func(context.Context, ResourceSkuCollection) (ResourceSkuCollection, error)) ResourceSkuCollectionPage { + return ResourceSkuCollectionPage{fn: getNextPage} +} + +// ResourceSkuLocationInfo ... +type ResourceSkuLocationInfo struct { + // Location - Gets location of the SKU + Location *string `json:"location,omitempty"` + // Zones - Gets list of availability zones where the SKU is supported. + Zones *[]string `json:"zones,omitempty"` + // ZoneDetails - Gets details of capabilities available to a SKU in specific zones. + ZoneDetails *[]ResourceSkuZoneDetails `json:"zoneDetails,omitempty"` +} + +// ResourceSkuRestrictionInfo ... +type ResourceSkuRestrictionInfo struct { + // Locations - Gets locations where the SKU is restricted + Locations *[]string `json:"locations,omitempty"` + // Zones - Gets list of availability zones where the SKU is restricted. + Zones *[]string `json:"zones,omitempty"` +} + +// ResourceSkuRestrictions ... +type ResourceSkuRestrictions struct { + // Type - Gets the type of restrictions. Possible values include: 'Location', 'Zone' + Type ResourceSkuRestrictionsType `json:"type,omitempty"` + // Values - Gets the value of restrictions. If the restriction type is set to + // location. This would be different locations where the SKU is restricted. + Values *[]string `json:"values,omitempty"` + // RestrictionInfo - Gets the information about the restriction where the SKU cannot be used. + RestrictionInfo *ResourceSkuRestrictionInfo `json:"restrictionInfo,omitempty"` + // ReasonCode - Gets the reason for restriction. Possible values include: 'QuotaId', 'NotAvailableForSubscription'. Possible values include: 'QuotaID', 'NotAvailableForSubscription' + ReasonCode ResourceSkuRestrictionsReasonCode `json:"reasonCode,omitempty"` +} + +// ResourceSkuZoneDetails ... +type ResourceSkuZoneDetails struct { + // Name - Gets the set of zones that the SKU is available in with the + // specified capabilities. + Name *[]string `json:"name,omitempty"` + // Capabilities - Gets a list of capabilities that are available for the SKU in the + // specified list of zones. + Capabilities *[]ResourceSkuCapabilities `json:"capabilities,omitempty"` +} + // ResourceUploadDefinition resource upload definition payload type ResourceUploadDefinition struct { autorest.Response `json:"-"` @@ -1785,6 +2076,8 @@ type ServiceResource struct { autorest.Response `json:"-"` // Properties - Properties of the Service resource Properties *ClusterResourceProperties `json:"properties,omitempty"` + // Sku - Sku of the Service resource + Sku *Sku `json:"sku,omitempty"` // Location - The GEO location of the resource. Location *string `json:"location,omitempty"` // Tags - Tags of the service which is a list of key value pairs that describe the resource. @@ -1803,6 +2096,9 @@ func (sr ServiceResource) MarshalJSON() ([]byte, error) { if sr.Properties != nil { objectMap["properties"] = sr.Properties } + if sr.Sku != nil { + objectMap["sku"] = sr.Sku + } if sr.Location != nil { objectMap["location"] = sr.Location } @@ -2048,6 +2344,28 @@ func (future *ServicesUpdateFuture) Result(client ServicesClient) (sr ServiceRes return } +// Sku sku of Azure Spring Cloud +type Sku struct { + // Name - Name of the Sku + Name *string `json:"name,omitempty"` + // Tier - Tier of the Sku + Tier *string `json:"tier,omitempty"` + // Capacity - Current capacity of the target resource + Capacity *int32 `json:"capacity,omitempty"` +} + +// SkuCapacity the SKU capacity +type SkuCapacity struct { + // Minimum - Gets or sets the minimum. + Minimum *int32 `json:"minimum,omitempty"` + // Maximum - Gets or sets the maximum. + Maximum *int32 `json:"maximum,omitempty"` + // Default - Gets or sets the default. + Default *int32 `json:"default,omitempty"` + // ScaleType - Gets or sets the type of the scale. Possible values include: 'SkuScaleTypeNone', 'SkuScaleTypeManual', 'SkuScaleTypeAutomatic' + ScaleType SkuScaleType `json:"scaleType,omitempty"` +} + // TemporaryDisk temporary disk payload type TemporaryDisk struct { // SizeInGB - Size of the temporary disk in GB diff --git a/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/services.go b/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/services.go index 794a9214a28b..6b4bb3a367b8 100644 --- a/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/services.go +++ b/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/services.go @@ -152,7 +152,9 @@ func (client ServicesClient) CreateOrUpdate(ctx context.Context, resourceGroupNa Chain: []validation.Constraint{{Target: "resource.Properties.ConfigServerProperties.ConfigServer.GitProperty.URI", Name: validation.Null, Rule: true, Chain: nil}}}, }}, }}, - }}}}}); err != nil { + }}, + {Target: "resource.Sku", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "resource.Sku.Name", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { return result, validation.NewError("appplatform.ServicesClient", "CreateOrUpdate", err.Error()) } diff --git a/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/sku.go b/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/sku.go new file mode 100644 index 000000000000..e91eacf83e12 --- /dev/null +++ b/services/preview/appplatform/mgmt/2019-05-01-preview/appplatform/sku.go @@ -0,0 +1,151 @@ +package appplatform + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// SkuClient is the REST API for Azure Spring Cloud +type SkuClient struct { + BaseClient +} + +// NewSkuClient creates an instance of the SkuClient client. +func NewSkuClient(subscriptionID string) SkuClient { + return NewSkuClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewSkuClientWithBaseURI creates an instance of the SkuClient 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 NewSkuClientWithBaseURI(baseURI string, subscriptionID string) SkuClient { + return SkuClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List sends the list request. +func (client SkuClient) List(ctx context.Context) (result ResourceSkuCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SkuClient.List") + defer func() { + sc := -1 + if result.rsc.Response.Response != nil { + sc = result.rsc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "appplatform.SkuClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.rsc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "appplatform.SkuClient", "List", resp, "Failure sending request") + return + } + + result.rsc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "appplatform.SkuClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client SkuClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-05-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.AppPlatform/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 SkuClient) 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 SkuClient) ListResponder(resp *http.Response) (result ResourceSkuCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 SkuClient) listNextResults(ctx context.Context, lastResults ResourceSkuCollection) (result ResourceSkuCollection, err error) { + req, err := lastResults.resourceSkuCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "appplatform.SkuClient", "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, "appplatform.SkuClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "appplatform.SkuClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client SkuClient) ListComplete(ctx context.Context) (result ResourceSkuCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SkuClient.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/azuredata/mgmt/2019-07-24-preview/azuredata/azuredataapi/interfaces.go b/services/preview/azuredata/mgmt/2019-07-24-preview/azuredata/azuredataapi/interfaces.go new file mode 100644 index 000000000000..13813429c0b3 --- /dev/null +++ b/services/preview/azuredata/mgmt/2019-07-24-preview/azuredata/azuredataapi/interfaces.go @@ -0,0 +1,113 @@ +package azuredataapi + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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/azuredata/mgmt/2019-07-24-preview/azuredata" + "github.com/Azure/go-autorest/autorest" +) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result azuredata.OperationListResultPage, err error) + ListComplete(ctx context.Context) (result azuredata.OperationListResultIterator, err error) +} + +var _ OperationsClientAPI = (*azuredata.OperationsClient)(nil) + +// SQLServerRegistrationsClientAPI contains the set of methods on the SQLServerRegistrationsClient type. +type SQLServerRegistrationsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, SQLServerRegistrationName string, parameters azuredata.SQLServerRegistration) (result azuredata.SQLServerRegistration, err error) + Delete(ctx context.Context, resourceGroupName string, SQLServerRegistrationName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, SQLServerRegistrationName string) (result azuredata.SQLServerRegistration, err error) + List(ctx context.Context) (result azuredata.SQLServerRegistrationListResultPage, err error) + ListComplete(ctx context.Context) (result azuredata.SQLServerRegistrationListResultIterator, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result azuredata.SQLServerRegistrationListResultPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result azuredata.SQLServerRegistrationListResultIterator, err error) + Update(ctx context.Context, resourceGroupName string, SQLServerRegistrationName string, parameters azuredata.SQLServerRegistrationUpdate) (result azuredata.SQLServerRegistration, err error) +} + +var _ SQLServerRegistrationsClientAPI = (*azuredata.SQLServerRegistrationsClient)(nil) + +// SQLServersClientAPI contains the set of methods on the SQLServersClient type. +type SQLServersClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, SQLServerRegistrationName string, SQLServerName string, parameters azuredata.SQLServer) (result azuredata.SQLServer, err error) + Delete(ctx context.Context, resourceGroupName string, SQLServerRegistrationName string, SQLServerName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, SQLServerRegistrationName string, SQLServerName string, expand string) (result azuredata.SQLServer, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string, SQLServerRegistrationName string, expand string) (result azuredata.SQLServerListResultPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, SQLServerRegistrationName string, expand string) (result azuredata.SQLServerListResultIterator, err error) +} + +var _ SQLServersClientAPI = (*azuredata.SQLServersClient)(nil) + +// SQLInstancesClientAPI contains the set of methods on the SQLInstancesClient type. +type SQLInstancesClientAPI interface { + Create(ctx context.Context, resourceGroupName string, SQLInstanceName string, parameters azuredata.SQLInstance) (result azuredata.SQLInstance, err error) + Delete(ctx context.Context, resourceGroupName string, SQLInstanceName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, SQLInstanceName string) (result azuredata.SQLInstance, err error) + List(ctx context.Context) (result azuredata.SQLInstanceListResultPage, err error) + ListComplete(ctx context.Context) (result azuredata.SQLInstanceListResultIterator, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result azuredata.SQLInstanceListResultPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result azuredata.SQLInstanceListResultIterator, err error) + Update(ctx context.Context, resourceGroupName string, SQLInstanceName string, parameters azuredata.SQLInstanceUpdate) (result azuredata.SQLInstance, err error) +} + +var _ SQLInstancesClientAPI = (*azuredata.SQLInstancesClient)(nil) + +// SQLServerInstancesClientAPI contains the set of methods on the SQLServerInstancesClient type. +type SQLServerInstancesClientAPI interface { + Create(ctx context.Context, resourceGroupName string, SQLServerInstanceName string, parameters azuredata.SQLServerInstance) (result azuredata.SQLServerInstance, err error) + Delete(ctx context.Context, resourceGroupName string, SQLServerInstanceName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, SQLServerInstanceName string) (result azuredata.SQLServerInstance, err error) + List(ctx context.Context) (result azuredata.SQLServerInstanceListResultPage, err error) + ListComplete(ctx context.Context) (result azuredata.SQLServerInstanceListResultIterator, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result azuredata.SQLServerInstanceListResultPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result azuredata.SQLServerInstanceListResultIterator, err error) + Update(ctx context.Context, resourceGroupName string, SQLServerInstanceName string, parameters azuredata.SQLServerInstanceUpdate) (result azuredata.SQLServerInstance, err error) +} + +var _ SQLServerInstancesClientAPI = (*azuredata.SQLServerInstancesClient)(nil) + +// PostgresInstancesClientAPI contains the set of methods on the PostgresInstancesClient type. +type PostgresInstancesClientAPI interface { + Create(ctx context.Context, resourceGroupName string, postgresInstanceName string) (result azuredata.PostgresInstance, err error) + Delete(ctx context.Context, resourceGroupName string, postgresInstanceName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, postgresInstanceName string) (result azuredata.PostgresInstance, err error) + List(ctx context.Context) (result azuredata.PostgresInstanceListResultPage, err error) + ListComplete(ctx context.Context) (result azuredata.PostgresInstanceListResultIterator, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result azuredata.PostgresInstanceListResultPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result azuredata.PostgresInstanceListResultIterator, err error) + Update(ctx context.Context, resourceGroupName string, postgresInstanceName string, parameters azuredata.PostgresInstanceUpdate) (result azuredata.PostgresInstance, err error) +} + +var _ PostgresInstancesClientAPI = (*azuredata.PostgresInstancesClient)(nil) + +// HybridDataManagersClientAPI contains the set of methods on the HybridDataManagersClient type. +type HybridDataManagersClientAPI interface { + Create(ctx context.Context, resourceGroupName string, hybridDataManagerName string) (result azuredata.HybridDataManager, err error) + Delete(ctx context.Context, resourceGroupName string, hybridDataManagerName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, hybridDataManagerName string) (result azuredata.HybridDataManager, err error) + List(ctx context.Context) (result azuredata.HybridDataManagerListResultPage, err error) + ListComplete(ctx context.Context) (result azuredata.HybridDataManagerListResultIterator, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result azuredata.HybridDataManagerListResultPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result azuredata.HybridDataManagerListResultIterator, err error) + Update(ctx context.Context, resourceGroupName string, hybridDataManagerName string, parameters azuredata.HybridDataManagerUpdate) (result azuredata.HybridDataManager, err error) +} + +var _ HybridDataManagersClientAPI = (*azuredata.HybridDataManagersClient)(nil) diff --git a/services/preview/azuredata/mgmt/2019-07-24-preview/azuredata/client.go b/services/preview/azuredata/mgmt/2019-07-24-preview/azuredata/client.go new file mode 100644 index 000000000000..9c799ca8a4ef --- /dev/null +++ b/services/preview/azuredata/mgmt/2019-07-24-preview/azuredata/client.go @@ -0,0 +1,54 @@ +// Package azuredata implements the Azure ARM Azuredata service API version 2019-07-24-preview. +// +// The AzureData management API provides a RESTful set of web APIs to manage Azure Data Resources. +package azuredata + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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 Azuredata + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Azuredata. +type BaseClient struct { + autorest.Client + BaseURI string + SubscriptionID string + SubscriptionID1 string +} + +// New creates an instance of the BaseClient client. +func New(subscriptionID string, subscriptionID1 string) BaseClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) +} + +// 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, subscriptionID1 string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + SubscriptionID: subscriptionID, + SubscriptionID1: subscriptionID1, + } +} diff --git a/services/preview/azuredata/mgmt/2019-07-24-preview/azuredata/hybriddatamanagers.go b/services/preview/azuredata/mgmt/2019-07-24-preview/azuredata/hybriddatamanagers.go new file mode 100644 index 000000000000..27f3f2a61f5b --- /dev/null +++ b/services/preview/azuredata/mgmt/2019-07-24-preview/azuredata/hybriddatamanagers.go @@ -0,0 +1,571 @@ +package azuredata + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// HybridDataManagersClient is the the AzureData management API provides a RESTful set of web APIs to manage Azure Data +// Resources. +type HybridDataManagersClient struct { + BaseClient +} + +// NewHybridDataManagersClient creates an instance of the HybridDataManagersClient client. +func NewHybridDataManagersClient(subscriptionID string, subscriptionID1 string) HybridDataManagersClient { + return NewHybridDataManagersClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) +} + +// NewHybridDataManagersClientWithBaseURI creates an instance of the HybridDataManagersClient 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 NewHybridDataManagersClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) HybridDataManagersClient { + return HybridDataManagersClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} +} + +// Create creates or replaces a hybridDataManager resource +// Parameters: +// resourceGroupName - the name of the Azure resource group +// hybridDataManagerName - name of HybridDataManagerName +func (client HybridDataManagersClient) Create(ctx context.Context, resourceGroupName string, hybridDataManagerName string) (result HybridDataManager, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/HybridDataManagersClient.Create") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, resourceGroupName, hybridDataManagerName) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.HybridDataManagersClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "azuredata.HybridDataManagersClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.HybridDataManagersClient", "Create", resp, "Failure responding to request") + } + + return +} + +// CreatePreparer prepares the Create request. +func (client HybridDataManagersClient) CreatePreparer(ctx context.Context, resourceGroupName string, hybridDataManagerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "hybridDataManagerName": autorest.Encode("path", hybridDataManagerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-07-24-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureData/hybridDataManagers/{hybridDataManagerName}", pathParameters), + 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 HybridDataManagersClient) CreateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client HybridDataManagersClient) CreateResponder(resp *http.Response) (result HybridDataManager, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a hybridDataManager resource +// Parameters: +// resourceGroupName - the name of the Azure resource group +// hybridDataManagerName - name of HybridDataManager +func (client HybridDataManagersClient) Delete(ctx context.Context, resourceGroupName string, hybridDataManagerName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/HybridDataManagersClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, hybridDataManagerName) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.HybridDataManagersClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "azuredata.HybridDataManagersClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.HybridDataManagersClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client HybridDataManagersClient) DeletePreparer(ctx context.Context, resourceGroupName string, hybridDataManagerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "hybridDataManagerName": autorest.Encode("path", hybridDataManagerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-07-24-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.AzureData/hybridDataManagers/{hybridDataManagerName}", 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 HybridDataManagersClient) 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 HybridDataManagersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieves a hybridDataManager resource +// Parameters: +// resourceGroupName - the name of the Azure resource group +// hybridDataManagerName - name of HybridDataManager +func (client HybridDataManagersClient) Get(ctx context.Context, resourceGroupName string, hybridDataManagerName string) (result HybridDataManager, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/HybridDataManagersClient.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, hybridDataManagerName) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.HybridDataManagersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "azuredata.HybridDataManagersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.HybridDataManagersClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client HybridDataManagersClient) GetPreparer(ctx context.Context, resourceGroupName string, hybridDataManagerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "hybridDataManagerName": autorest.Encode("path", hybridDataManagerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-07-24-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.AzureData/hybridDataManagers/{hybridDataManagerName}", 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 HybridDataManagersClient) 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 HybridDataManagersClient) GetResponder(resp *http.Response) (result HybridDataManager, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List sends the list request. +func (client HybridDataManagersClient) List(ctx context.Context) (result HybridDataManagerListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/HybridDataManagersClient.List") + defer func() { + sc := -1 + if result.hdmlr.Response.Response != nil { + sc = result.hdmlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.HybridDataManagersClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.hdmlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "azuredata.HybridDataManagersClient", "List", resp, "Failure sending request") + return + } + + result.hdmlr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.HybridDataManagersClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client HybridDataManagersClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-07-24-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.AzureData/hybridDataManagers", 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 HybridDataManagersClient) 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 HybridDataManagersClient) ListResponder(resp *http.Response) (result HybridDataManagerListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 HybridDataManagersClient) listNextResults(ctx context.Context, lastResults HybridDataManagerListResult) (result HybridDataManagerListResult, err error) { + req, err := lastResults.hybridDataManagerListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "azuredata.HybridDataManagersClient", "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, "azuredata.HybridDataManagersClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.HybridDataManagersClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client HybridDataManagersClient) ListComplete(ctx context.Context) (result HybridDataManagerListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/HybridDataManagersClient.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 get a hybridDataManager list by Resource group name. +// Parameters: +// resourceGroupName - the name of the Azure resource group +func (client HybridDataManagersClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result HybridDataManagerListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/HybridDataManagersClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.hdmlr.Response.Response != nil { + sc = result.hdmlr.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, "azuredata.HybridDataManagersClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.hdmlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "azuredata.HybridDataManagersClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.hdmlr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.HybridDataManagersClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client HybridDataManagersClient) 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 = "2019-07-24-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.AzureData/hybridDataManagers", 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 HybridDataManagersClient) 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 HybridDataManagersClient) ListByResourceGroupResponder(resp *http.Response) (result HybridDataManagerListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 HybridDataManagersClient) listByResourceGroupNextResults(ctx context.Context, lastResults HybridDataManagerListResult) (result HybridDataManagerListResult, err error) { + req, err := lastResults.hybridDataManagerListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "azuredata.HybridDataManagersClient", "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, "azuredata.HybridDataManagersClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.HybridDataManagersClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client HybridDataManagersClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result HybridDataManagerListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/HybridDataManagersClient.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 updates a hybridDataManager resource +// Parameters: +// resourceGroupName - the name of the Azure resource group +// hybridDataManagerName - name of HybridDataManager +// parameters - the HybridDataManager. +func (client HybridDataManagersClient) Update(ctx context.Context, resourceGroupName string, hybridDataManagerName string, parameters HybridDataManagerUpdate) (result HybridDataManager, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/HybridDataManagersClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, hybridDataManagerName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.HybridDataManagersClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "azuredata.HybridDataManagersClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.HybridDataManagersClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client HybridDataManagersClient) UpdatePreparer(ctx context.Context, resourceGroupName string, hybridDataManagerName string, parameters HybridDataManagerUpdate) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "hybridDataManagerName": autorest.Encode("path", hybridDataManagerName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-07-24-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.AzureData/hybridDataManagers/{hybridDataManagerName}", pathParameters), + autorest.WithJSON(parameters), + 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 HybridDataManagersClient) 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 HybridDataManagersClient) UpdateResponder(resp *http.Response) (result HybridDataManager, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/azuredata/mgmt/2019-07-24-preview/azuredata/models.go b/services/preview/azuredata/mgmt/2019-07-24-preview/azuredata/models.go new file mode 100644 index 000000000000..615fab392348 --- /dev/null +++ b/services/preview/azuredata/mgmt/2019-07-24-preview/azuredata/models.go @@ -0,0 +1,1978 @@ +package azuredata + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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/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/azuredata/mgmt/2019-07-24-preview/azuredata" + +// OperationOrigin enumerates the values for operation origin. +type OperationOrigin string + +const ( + // System ... + System OperationOrigin = "system" + // User ... + User OperationOrigin = "user" +) + +// PossibleOperationOriginValues returns an array of possible values for the OperationOrigin const type. +func PossibleOperationOriginValues() []OperationOrigin { + return []OperationOrigin{System, User} +} + +// ResourceIdentityType enumerates the values for resource identity type. +type ResourceIdentityType string + +const ( + // SystemAssigned ... + SystemAssigned ResourceIdentityType = "SystemAssigned" +) + +// PossibleResourceIdentityTypeValues returns an array of possible values for the ResourceIdentityType const type. +func PossibleResourceIdentityTypeValues() []ResourceIdentityType { + return []ResourceIdentityType{SystemAssigned} +} + +// SkuTier enumerates the values for sku tier. +type SkuTier string + +const ( + // Basic ... + Basic SkuTier = "Basic" + // Free ... + Free SkuTier = "Free" + // Premium ... + Premium SkuTier = "Premium" + // Standard ... + Standard SkuTier = "Standard" +) + +// PossibleSkuTierValues returns an array of possible values for the SkuTier const type. +func PossibleSkuTierValues() []SkuTier { + return []SkuTier{Basic, Free, Premium, Standard} +} + +// CloudError an error response from the Azure Data service. +type CloudError struct { + // Error - null + Error *CloudErrorBody `json:"error,omitempty"` +} + +// CloudErrorBody an error response from the Batch service. +type CloudErrorBody struct { + // Code - An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + Code *string `json:"code,omitempty"` + // Message - A message describing the error, intended to be suitable for display in a user interface. + Message *string `json:"message,omitempty"` + // Target - The target of the particular error. For example, the name of the property in error. + Target *string `json:"target,omitempty"` + // Details - A list of additional details about the error. + Details *[]CloudErrorBody `json:"details,omitempty"` +} + +// HybridDataManager hybrid data manager resource +type HybridDataManager struct { + autorest.Response `json:"-"` + // Properties - null + Properties interface{} `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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for HybridDataManager. +func (hdm HybridDataManager) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if hdm.Properties != nil { + objectMap["properties"] = hdm.Properties + } + if hdm.Tags != nil { + objectMap["tags"] = hdm.Tags + } + if hdm.Location != nil { + objectMap["location"] = hdm.Location + } + return json.Marshal(objectMap) +} + +// HybridDataManagerListResult a list of HybridDataManager. +type HybridDataManagerListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; Array of results. + Value *[]HybridDataManager `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to retrieve next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// HybridDataManagerListResultIterator provides access to a complete listing of HybridDataManager values. +type HybridDataManagerListResultIterator struct { + i int + page HybridDataManagerListResultPage +} + +// 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 *HybridDataManagerListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/HybridDataManagerListResultIterator.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 *HybridDataManagerListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter HybridDataManagerListResultIterator) 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 HybridDataManagerListResultIterator) Response() HybridDataManagerListResult { + 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 HybridDataManagerListResultIterator) Value() HybridDataManager { + if !iter.page.NotDone() { + return HybridDataManager{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the HybridDataManagerListResultIterator type. +func NewHybridDataManagerListResultIterator(page HybridDataManagerListResultPage) HybridDataManagerListResultIterator { + return HybridDataManagerListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (hdmlr HybridDataManagerListResult) IsEmpty() bool { + return hdmlr.Value == nil || len(*hdmlr.Value) == 0 +} + +// hybridDataManagerListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (hdmlr HybridDataManagerListResult) hybridDataManagerListResultPreparer(ctx context.Context) (*http.Request, error) { + if hdmlr.NextLink == nil || len(to.String(hdmlr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(hdmlr.NextLink))) +} + +// HybridDataManagerListResultPage contains a page of HybridDataManager values. +type HybridDataManagerListResultPage struct { + fn func(context.Context, HybridDataManagerListResult) (HybridDataManagerListResult, error) + hdmlr HybridDataManagerListResult +} + +// 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 *HybridDataManagerListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/HybridDataManagerListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.hdmlr) + if err != nil { + return err + } + page.hdmlr = next + 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 *HybridDataManagerListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page HybridDataManagerListResultPage) NotDone() bool { + return !page.hdmlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page HybridDataManagerListResultPage) Response() HybridDataManagerListResult { + return page.hdmlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page HybridDataManagerListResultPage) Values() []HybridDataManager { + if page.hdmlr.IsEmpty() { + return nil + } + return *page.hdmlr.Value +} + +// Creates a new instance of the HybridDataManagerListResultPage type. +func NewHybridDataManagerListResultPage(getNextPage func(context.Context, HybridDataManagerListResult) (HybridDataManagerListResult, error)) HybridDataManagerListResultPage { + return HybridDataManagerListResultPage{fn: getNextPage} +} + +// HybridDataManagerUpdate an update to a HybridDataManager. +type HybridDataManagerUpdate struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for HybridDataManagerUpdate. +func (hdmu HybridDataManagerUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if hdmu.Tags != nil { + objectMap["tags"] = hdmu.Tags + } + return json.Marshal(objectMap) +} + +// 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: 'SystemAssigned' + Type ResourceIdentityType `json:"type,omitempty"` +} + +// ODataError information about an error. +type ODataError struct { + // Code - A language-independent error name. + Code *string `json:"code,omitempty"` + // Message - The error message. + Message *string `json:"message,omitempty"` + // Target - The target of the error (for example, the name of the property in error). + Target *string `json:"target,omitempty"` + // Details - The error details. + Details *[]ODataError `json:"details,omitempty"` +} + +// Operation SQL REST API operation definition. +type Operation struct { + // Name - READ-ONLY; The name of the operation being performed on this particular object. + Name *string `json:"name,omitempty"` + // Display - READ-ONLY; The localized display information for this particular operation / action. + Display *OperationDisplay `json:"display,omitempty"` + // Origin - READ-ONLY; The intended executor of the operation. Possible values include: 'User', 'System' + Origin OperationOrigin `json:"origin,omitempty"` + // Properties - READ-ONLY; Additional descriptions for the operation. + Properties map[string]interface{} `json:"properties"` +} + +// MarshalJSON is the custom marshaler for Operation. +func (o Operation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// OperationDisplay display metadata associated with the operation. +type OperationDisplay struct { + // Provider - READ-ONLY; The localized friendly form of the resource provider name. + Provider *string `json:"provider,omitempty"` + // Resource - READ-ONLY; The localized friendly form of the resource type related to this action/operation. + Resource *string `json:"resource,omitempty"` + // Operation - READ-ONLY; The localized friendly name for the operation. + Operation *string `json:"operation,omitempty"` + // Description - READ-ONLY; The localized friendly description for the operation. + Description *string `json:"description,omitempty"` +} + +// OperationListResult result of the request to list SQL operations. +type OperationListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; Array of results. + Value *[]Operation `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to retrieve next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// 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 +} + +// 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.NextLink == nil || len(to.String(olr.NextLink)) < 1 { + 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) + }() + } + next, err := page.fn(ctx, page.olr) + if err != nil { + return err + } + page.olr = next + 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(getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { + return OperationListResultPage{fn: getNextPage} +} + +// 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"` +} + +// PostgresInstance a Postgres Instance. +type PostgresInstance struct { + autorest.Response `json:"-"` + // PostgresInstanceProperties - null + *PostgresInstanceProperties `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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for PostgresInstance. +func (pi PostgresInstance) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pi.PostgresInstanceProperties != nil { + objectMap["properties"] = pi.PostgresInstanceProperties + } + if pi.Tags != nil { + objectMap["tags"] = pi.Tags + } + if pi.Location != nil { + objectMap["location"] = pi.Location + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PostgresInstance struct. +func (pi *PostgresInstance) 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 postgresInstanceProperties PostgresInstanceProperties + err = json.Unmarshal(*v, &postgresInstanceProperties) + if err != nil { + return err + } + pi.PostgresInstanceProperties = &postgresInstanceProperties + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + pi.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + pi.Location = &location + } + 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 "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pi.Type = &typeVar + } + } + } + + return nil +} + +// PostgresInstanceListResult a list of PostgresInstance. +type PostgresInstanceListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; Array of results. + Value *[]PostgresInstance `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to retrieve next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// PostgresInstanceListResultIterator provides access to a complete listing of PostgresInstance values. +type PostgresInstanceListResultIterator struct { + i int + page PostgresInstanceListResultPage +} + +// 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 *PostgresInstanceListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PostgresInstanceListResultIterator.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 *PostgresInstanceListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter PostgresInstanceListResultIterator) 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 PostgresInstanceListResultIterator) Response() PostgresInstanceListResult { + 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 PostgresInstanceListResultIterator) Value() PostgresInstance { + if !iter.page.NotDone() { + return PostgresInstance{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the PostgresInstanceListResultIterator type. +func NewPostgresInstanceListResultIterator(page PostgresInstanceListResultPage) PostgresInstanceListResultIterator { + return PostgresInstanceListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pilr PostgresInstanceListResult) IsEmpty() bool { + return pilr.Value == nil || len(*pilr.Value) == 0 +} + +// postgresInstanceListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pilr PostgresInstanceListResult) postgresInstanceListResultPreparer(ctx context.Context) (*http.Request, error) { + if pilr.NextLink == nil || len(to.String(pilr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pilr.NextLink))) +} + +// PostgresInstanceListResultPage contains a page of PostgresInstance values. +type PostgresInstanceListResultPage struct { + fn func(context.Context, PostgresInstanceListResult) (PostgresInstanceListResult, error) + pilr PostgresInstanceListResult +} + +// 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 *PostgresInstanceListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PostgresInstanceListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.pilr) + if err != nil { + return err + } + page.pilr = next + 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 *PostgresInstanceListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page PostgresInstanceListResultPage) NotDone() bool { + return !page.pilr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page PostgresInstanceListResultPage) Response() PostgresInstanceListResult { + return page.pilr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page PostgresInstanceListResultPage) Values() []PostgresInstance { + if page.pilr.IsEmpty() { + return nil + } + return *page.pilr.Value +} + +// Creates a new instance of the PostgresInstanceListResultPage type. +func NewPostgresInstanceListResultPage(getNextPage func(context.Context, PostgresInstanceListResult) (PostgresInstanceListResult, error)) PostgresInstanceListResultPage { + return PostgresInstanceListResultPage{fn: getNextPage} +} + +// PostgresInstanceProperties postgres Instance properties. +type PostgresInstanceProperties struct { + // HybridDataManagerID - null + HybridDataManagerID *string `json:"hybridDataManagerId,omitempty"` +} + +// PostgresInstanceUpdate an update to a Postgres Instance. +type PostgresInstanceUpdate struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // HybridDataManagerID - null + HybridDataManagerID *string `json:"hybridDataManagerId,omitempty"` +} + +// MarshalJSON is the custom marshaler for PostgresInstanceUpdate. +func (piu PostgresInstanceUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if piu.Tags != nil { + objectMap["tags"] = piu.Tags + } + if piu.HybridDataManagerID != nil { + objectMap["hybridDataManagerId"] = piu.HybridDataManagerID + } + return json.Marshal(objectMap) +} + +// 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; 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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// Resource ... +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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// 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. Ex- 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: 'SystemAssigned' + Type ResourceIdentityType `json:"type,omitempty"` +} + +// 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: 'Free', 'Basic', 'Standard', 'Premium' + 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"` +} + +// 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: 'Free', 'Basic', 'Standard', 'Premium' + 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"` +} + +// SQLInstance a SqlInstance. +type SQLInstance struct { + autorest.Response `json:"-"` + // SQLInstanceProperties - null + *SQLInstanceProperties `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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLInstance. +func (si SQLInstance) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if si.SQLInstanceProperties != nil { + objectMap["properties"] = si.SQLInstanceProperties + } + if si.Tags != nil { + objectMap["tags"] = si.Tags + } + if si.Location != nil { + objectMap["location"] = si.Location + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SQLInstance struct. +func (si *SQLInstance) 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 SQLInstanceProperties SQLInstanceProperties + err = json.Unmarshal(*v, &SQLInstanceProperties) + if err != nil { + return err + } + si.SQLInstanceProperties = &SQLInstanceProperties + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + si.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + si.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + si.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + si.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + si.Type = &typeVar + } + } + } + + return nil +} + +// SQLInstanceListResult a list of SqlInstance. +type SQLInstanceListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; Array of results. + Value *[]SQLInstance `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to retrieve next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// SQLInstanceListResultIterator provides access to a complete listing of SQLInstance values. +type SQLInstanceListResultIterator struct { + i int + page SQLInstanceListResultPage +} + +// 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 *SQLInstanceListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLInstanceListResultIterator.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 *SQLInstanceListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SQLInstanceListResultIterator) 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 SQLInstanceListResultIterator) Response() SQLInstanceListResult { + 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 SQLInstanceListResultIterator) Value() SQLInstance { + if !iter.page.NotDone() { + return SQLInstance{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the SQLInstanceListResultIterator type. +func NewSQLInstanceListResultIterator(page SQLInstanceListResultPage) SQLInstanceListResultIterator { + return SQLInstanceListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (silr SQLInstanceListResult) IsEmpty() bool { + return silr.Value == nil || len(*silr.Value) == 0 +} + +// sQLInstanceListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (silr SQLInstanceListResult) sQLInstanceListResultPreparer(ctx context.Context) (*http.Request, error) { + if silr.NextLink == nil || len(to.String(silr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(silr.NextLink))) +} + +// SQLInstanceListResultPage contains a page of SQLInstance values. +type SQLInstanceListResultPage struct { + fn func(context.Context, SQLInstanceListResult) (SQLInstanceListResult, error) + silr SQLInstanceListResult +} + +// 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 *SQLInstanceListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLInstanceListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.silr) + if err != nil { + return err + } + page.silr = next + 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 *SQLInstanceListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SQLInstanceListResultPage) NotDone() bool { + return !page.silr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SQLInstanceListResultPage) Response() SQLInstanceListResult { + return page.silr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SQLInstanceListResultPage) Values() []SQLInstance { + if page.silr.IsEmpty() { + return nil + } + return *page.silr.Value +} + +// Creates a new instance of the SQLInstanceListResultPage type. +func NewSQLInstanceListResultPage(getNextPage func(context.Context, SQLInstanceListResult) (SQLInstanceListResult, error)) SQLInstanceListResultPage { + return SQLInstanceListResultPage{fn: getNextPage} +} + +// SQLInstanceProperties properties of PostgresInstance. +type SQLInstanceProperties struct { + // HybridDataManagerID - null + HybridDataManagerID *string `json:"hybridDataManagerId,omitempty"` +} + +// SQLInstanceUpdate an update to a SQL Instance. +type SQLInstanceUpdate struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for SQLInstanceUpdate. +func (siu SQLInstanceUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if siu.Tags != nil { + objectMap["tags"] = siu.Tags + } + return json.Marshal(objectMap) +} + +// SQLServer a SQL server. +type SQLServer struct { + autorest.Response `json:"-"` + // SQLServerProperties - Resource properties. + *SQLServerProperties `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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLServer. +func (ss SQLServer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ss.SQLServerProperties != nil { + objectMap["properties"] = ss.SQLServerProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SQLServer struct. +func (ss *SQLServer) 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 SQLServerProperties SQLServerProperties + err = json.Unmarshal(*v, &SQLServerProperties) + if err != nil { + return err + } + ss.SQLServerProperties = &SQLServerProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ss.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ss.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ss.Type = &typeVar + } + } + } + + return nil +} + +// SQLServerInstance a SqlServerInstance. +type SQLServerInstance struct { + autorest.Response `json:"-"` + // SQLServerInstanceProperties - null + *SQLServerInstanceProperties `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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLServerInstance. +func (ssi SQLServerInstance) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ssi.SQLServerInstanceProperties != nil { + objectMap["properties"] = ssi.SQLServerInstanceProperties + } + if ssi.Tags != nil { + objectMap["tags"] = ssi.Tags + } + if ssi.Location != nil { + objectMap["location"] = ssi.Location + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SQLServerInstance struct. +func (ssi *SQLServerInstance) 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 SQLServerInstanceProperties SQLServerInstanceProperties + err = json.Unmarshal(*v, &SQLServerInstanceProperties) + if err != nil { + return err + } + ssi.SQLServerInstanceProperties = &SQLServerInstanceProperties + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + ssi.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + ssi.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ssi.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ssi.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ssi.Type = &typeVar + } + } + } + + return nil +} + +// SQLServerInstanceListResult a list of SqlServerInstance. +type SQLServerInstanceListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; Array of results. + Value *[]SQLServerInstance `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to retrieve next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// SQLServerInstanceListResultIterator provides access to a complete listing of SQLServerInstance values. +type SQLServerInstanceListResultIterator struct { + i int + page SQLServerInstanceListResultPage +} + +// 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 *SQLServerInstanceListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLServerInstanceListResultIterator.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 *SQLServerInstanceListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SQLServerInstanceListResultIterator) 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 SQLServerInstanceListResultIterator) Response() SQLServerInstanceListResult { + 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 SQLServerInstanceListResultIterator) Value() SQLServerInstance { + if !iter.page.NotDone() { + return SQLServerInstance{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the SQLServerInstanceListResultIterator type. +func NewSQLServerInstanceListResultIterator(page SQLServerInstanceListResultPage) SQLServerInstanceListResultIterator { + return SQLServerInstanceListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ssilr SQLServerInstanceListResult) IsEmpty() bool { + return ssilr.Value == nil || len(*ssilr.Value) == 0 +} + +// sQLServerInstanceListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ssilr SQLServerInstanceListResult) sQLServerInstanceListResultPreparer(ctx context.Context) (*http.Request, error) { + if ssilr.NextLink == nil || len(to.String(ssilr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ssilr.NextLink))) +} + +// SQLServerInstanceListResultPage contains a page of SQLServerInstance values. +type SQLServerInstanceListResultPage struct { + fn func(context.Context, SQLServerInstanceListResult) (SQLServerInstanceListResult, error) + ssilr SQLServerInstanceListResult +} + +// 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 *SQLServerInstanceListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLServerInstanceListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.ssilr) + if err != nil { + return err + } + page.ssilr = next + 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 *SQLServerInstanceListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SQLServerInstanceListResultPage) NotDone() bool { + return !page.ssilr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SQLServerInstanceListResultPage) Response() SQLServerInstanceListResult { + return page.ssilr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SQLServerInstanceListResultPage) Values() []SQLServerInstance { + if page.ssilr.IsEmpty() { + return nil + } + return *page.ssilr.Value +} + +// Creates a new instance of the SQLServerInstanceListResultPage type. +func NewSQLServerInstanceListResultPage(getNextPage func(context.Context, SQLServerInstanceListResult) (SQLServerInstanceListResult, error)) SQLServerInstanceListResultPage { + return SQLServerInstanceListResultPage{fn: getNextPage} +} + +// SQLServerInstanceProperties properties of SqlServerInstance. +type SQLServerInstanceProperties struct { + // Version - SQL Server version. + Version *string `json:"version,omitempty"` + // Edition - SQL Server edition. + Edition *string `json:"edition,omitempty"` + // ContainerResourceID - ARM Resource id of the container resource (Azure Arc for Servers) + ContainerResourceID *string `json:"containerResourceId,omitempty"` + // CreateTime - READ-ONLY; The time when the resource was created. + CreateTime *string `json:"createTime,omitempty"` + // UpdateTime - READ-ONLY; The time when the resource was last updated. + UpdateTime *string `json:"updateTime,omitempty"` + // VCore - The number of logical processors used by the SQL Server instance. + VCore *string `json:"vCore,omitempty"` + // Status - The cloud connectivity status. + Status *string `json:"status,omitempty"` +} + +// SQLServerInstanceUpdate an update to a SQL Server Instance. +type SQLServerInstanceUpdate struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for SQLServerInstanceUpdate. +func (ssiu SQLServerInstanceUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ssiu.Tags != nil { + objectMap["tags"] = ssiu.Tags + } + return json.Marshal(objectMap) +} + +// SQLServerListResult a list of SQL servers. +type SQLServerListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; Array of results. + Value *[]SQLServer `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to retrieve next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// SQLServerListResultIterator provides access to a complete listing of SQLServer values. +type SQLServerListResultIterator struct { + i int + page SQLServerListResultPage +} + +// 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 *SQLServerListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLServerListResultIterator.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 *SQLServerListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SQLServerListResultIterator) 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 SQLServerListResultIterator) Response() SQLServerListResult { + 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 SQLServerListResultIterator) Value() SQLServer { + if !iter.page.NotDone() { + return SQLServer{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the SQLServerListResultIterator type. +func NewSQLServerListResultIterator(page SQLServerListResultPage) SQLServerListResultIterator { + return SQLServerListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (sslr SQLServerListResult) IsEmpty() bool { + return sslr.Value == nil || len(*sslr.Value) == 0 +} + +// sQLServerListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (sslr SQLServerListResult) sQLServerListResultPreparer(ctx context.Context) (*http.Request, error) { + if sslr.NextLink == nil || len(to.String(sslr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(sslr.NextLink))) +} + +// SQLServerListResultPage contains a page of SQLServer values. +type SQLServerListResultPage struct { + fn func(context.Context, SQLServerListResult) (SQLServerListResult, error) + sslr SQLServerListResult +} + +// 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 *SQLServerListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLServerListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.sslr) + if err != nil { + return err + } + page.sslr = next + 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 *SQLServerListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SQLServerListResultPage) NotDone() bool { + return !page.sslr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SQLServerListResultPage) Response() SQLServerListResult { + return page.sslr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SQLServerListResultPage) Values() []SQLServer { + if page.sslr.IsEmpty() { + return nil + } + return *page.sslr.Value +} + +// Creates a new instance of the SQLServerListResultPage type. +func NewSQLServerListResultPage(getNextPage func(context.Context, SQLServerListResult) (SQLServerListResult, error)) SQLServerListResultPage { + return SQLServerListResultPage{fn: getNextPage} +} + +// SQLServerProperties the SQL server properties. +type SQLServerProperties struct { + // Cores - Cores of the Sql Server. + Cores *int32 `json:"cores,omitempty"` + // Version - Version of the Sql Server. + Version *string `json:"version,omitempty"` + // Edition - Sql Server Edition. + Edition *string `json:"edition,omitempty"` + // RegistrationID - ID for Parent Sql Server Registration. + RegistrationID *string `json:"registrationID,omitempty"` + // PropertyBag - Sql Server Json Property Bag. + PropertyBag *string `json:"propertyBag,omitempty"` +} + +// SQLServerRegistration a SQL server registration. +type SQLServerRegistration struct { + autorest.Response `json:"-"` + // SQLServerRegistrationProperties - Resource properties. + *SQLServerRegistrationProperties `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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SQLServerRegistration. +func (ssr SQLServerRegistration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ssr.SQLServerRegistrationProperties != nil { + objectMap["properties"] = ssr.SQLServerRegistrationProperties + } + if ssr.Tags != nil { + objectMap["tags"] = ssr.Tags + } + if ssr.Location != nil { + objectMap["location"] = ssr.Location + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SQLServerRegistration struct. +func (ssr *SQLServerRegistration) 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 SQLServerRegistrationProperties SQLServerRegistrationProperties + err = json.Unmarshal(*v, &SQLServerRegistrationProperties) + if err != nil { + return err + } + ssr.SQLServerRegistrationProperties = &SQLServerRegistrationProperties + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + ssr.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + ssr.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ssr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ssr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ssr.Type = &typeVar + } + } + } + + return nil +} + +// SQLServerRegistrationListResult server +type SQLServerRegistrationListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; Array of results. + Value *[]SQLServerRegistration `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to retrieve next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// SQLServerRegistrationListResultIterator provides access to a complete listing of SQLServerRegistration +// values. +type SQLServerRegistrationListResultIterator struct { + i int + page SQLServerRegistrationListResultPage +} + +// 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 *SQLServerRegistrationListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLServerRegistrationListResultIterator.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 *SQLServerRegistrationListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SQLServerRegistrationListResultIterator) 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 SQLServerRegistrationListResultIterator) Response() SQLServerRegistrationListResult { + 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 SQLServerRegistrationListResultIterator) Value() SQLServerRegistration { + if !iter.page.NotDone() { + return SQLServerRegistration{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the SQLServerRegistrationListResultIterator type. +func NewSQLServerRegistrationListResultIterator(page SQLServerRegistrationListResultPage) SQLServerRegistrationListResultIterator { + return SQLServerRegistrationListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ssrlr SQLServerRegistrationListResult) IsEmpty() bool { + return ssrlr.Value == nil || len(*ssrlr.Value) == 0 +} + +// sQLServerRegistrationListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ssrlr SQLServerRegistrationListResult) sQLServerRegistrationListResultPreparer(ctx context.Context) (*http.Request, error) { + if ssrlr.NextLink == nil || len(to.String(ssrlr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ssrlr.NextLink))) +} + +// SQLServerRegistrationListResultPage contains a page of SQLServerRegistration values. +type SQLServerRegistrationListResultPage struct { + fn func(context.Context, SQLServerRegistrationListResult) (SQLServerRegistrationListResult, error) + ssrlr SQLServerRegistrationListResult +} + +// 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 *SQLServerRegistrationListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLServerRegistrationListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.ssrlr) + if err != nil { + return err + } + page.ssrlr = next + 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 *SQLServerRegistrationListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SQLServerRegistrationListResultPage) NotDone() bool { + return !page.ssrlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SQLServerRegistrationListResultPage) Response() SQLServerRegistrationListResult { + return page.ssrlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SQLServerRegistrationListResultPage) Values() []SQLServerRegistration { + if page.ssrlr.IsEmpty() { + return nil + } + return *page.ssrlr.Value +} + +// Creates a new instance of the SQLServerRegistrationListResultPage type. +func NewSQLServerRegistrationListResultPage(getNextPage func(context.Context, SQLServerRegistrationListResult) (SQLServerRegistrationListResult, error)) SQLServerRegistrationListResultPage { + return SQLServerRegistrationListResultPage{fn: getNextPage} +} + +// SQLServerRegistrationProperties the SQL server Registration properties. +type SQLServerRegistrationProperties struct { + // SubscriptionID - Subscription Id + SubscriptionID *string `json:"subscriptionId,omitempty"` + // ResourceGroup - Resource Group Name + ResourceGroup *string `json:"resourceGroup,omitempty"` + // PropertyBag - Optional Properties as JSON string + PropertyBag *string `json:"propertyBag,omitempty"` +} + +// SQLServerRegistrationUpdate an update to a SQL Server Registration. +type SQLServerRegistrationUpdate struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for SQLServerRegistrationUpdate. +func (ssru SQLServerRegistrationUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ssru.Tags != nil { + objectMap["tags"] = ssru.Tags + } + return json.Marshal(objectMap) +} + +// TrackedResource the resource model definition for a ARM tracked top level resource +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. Ex- 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) +} diff --git a/services/preview/azuredata/mgmt/2019-07-24-preview/azuredata/operations.go b/services/preview/azuredata/mgmt/2019-07-24-preview/azuredata/operations.go new file mode 100644 index 000000000000..2278cd74a578 --- /dev/null +++ b/services/preview/azuredata/mgmt/2019-07-24-preview/azuredata/operations.go @@ -0,0 +1,148 @@ +package azuredata + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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 the AzureData management API provides a RESTful set of web APIs to manage Azure Data +// Resources. +type OperationsClient struct { + BaseClient +} + +// NewOperationsClient creates an instance of the OperationsClient client. +func NewOperationsClient(subscriptionID string, subscriptionID1 string) OperationsClient { + return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) +} + +// 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, subscriptionID1 string) OperationsClient { + return OperationsClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} +} + +// List lists all of the available SQL Server Registration 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, "azuredata.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, "azuredata.OperationsClient", "List", resp, "Failure sending request") + return + } + + result.olr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.OperationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2019-07-24-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.AzureData/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, + client.ByInspecting(), + 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, "azuredata.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, "azuredata.OperationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.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/azuredata/mgmt/2019-07-24-preview/azuredata/postgresinstances.go b/services/preview/azuredata/mgmt/2019-07-24-preview/azuredata/postgresinstances.go new file mode 100644 index 000000000000..c78f80288621 --- /dev/null +++ b/services/preview/azuredata/mgmt/2019-07-24-preview/azuredata/postgresinstances.go @@ -0,0 +1,571 @@ +package azuredata + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// PostgresInstancesClient is the the AzureData management API provides a RESTful set of web APIs to manage Azure Data +// Resources. +type PostgresInstancesClient struct { + BaseClient +} + +// NewPostgresInstancesClient creates an instance of the PostgresInstancesClient client. +func NewPostgresInstancesClient(subscriptionID string, subscriptionID1 string) PostgresInstancesClient { + return NewPostgresInstancesClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) +} + +// NewPostgresInstancesClientWithBaseURI creates an instance of the PostgresInstancesClient 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 NewPostgresInstancesClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) PostgresInstancesClient { + return PostgresInstancesClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} +} + +// Create creates or replaces a postgres Instance resource +// Parameters: +// resourceGroupName - the name of the Azure resource group +// postgresInstanceName - name of PostgresInstance +func (client PostgresInstancesClient) Create(ctx context.Context, resourceGroupName string, postgresInstanceName string) (result PostgresInstance, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PostgresInstancesClient.Create") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, resourceGroupName, postgresInstanceName) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.PostgresInstancesClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "azuredata.PostgresInstancesClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.PostgresInstancesClient", "Create", resp, "Failure responding to request") + } + + return +} + +// CreatePreparer prepares the Create request. +func (client PostgresInstancesClient) CreatePreparer(ctx context.Context, resourceGroupName string, postgresInstanceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "postgresInstanceName": autorest.Encode("path", postgresInstanceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-07-24-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureData/postgresInstances/{postgresInstanceName}", pathParameters), + 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 PostgresInstancesClient) CreateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client PostgresInstancesClient) CreateResponder(resp *http.Response) (result PostgresInstance, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a postgres Instance resource +// Parameters: +// resourceGroupName - the name of the Azure resource group +// postgresInstanceName - name of Postgres Instance +func (client PostgresInstancesClient) Delete(ctx context.Context, resourceGroupName string, postgresInstanceName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PostgresInstancesClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, postgresInstanceName) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.PostgresInstancesClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "azuredata.PostgresInstancesClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.PostgresInstancesClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client PostgresInstancesClient) DeletePreparer(ctx context.Context, resourceGroupName string, postgresInstanceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "postgresInstanceName": autorest.Encode("path", postgresInstanceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-07-24-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.AzureData/postgresInstances/{postgresInstanceName}", 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 PostgresInstancesClient) 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 PostgresInstancesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieves a postgres Instance resource +// Parameters: +// resourceGroupName - the name of the Azure resource group +// postgresInstanceName - name of Postgres Instance +func (client PostgresInstancesClient) Get(ctx context.Context, resourceGroupName string, postgresInstanceName string) (result PostgresInstance, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PostgresInstancesClient.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, postgresInstanceName) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.PostgresInstancesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "azuredata.PostgresInstancesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.PostgresInstancesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client PostgresInstancesClient) GetPreparer(ctx context.Context, resourceGroupName string, postgresInstanceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "postgresInstanceName": autorest.Encode("path", postgresInstanceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-07-24-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.AzureData/postgresInstances/{postgresInstanceName}", 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 PostgresInstancesClient) 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 PostgresInstancesClient) GetResponder(resp *http.Response) (result PostgresInstance, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List sends the list request. +func (client PostgresInstancesClient) List(ctx context.Context) (result PostgresInstanceListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PostgresInstancesClient.List") + defer func() { + sc := -1 + if result.pilr.Response.Response != nil { + sc = result.pilr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.PostgresInstancesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.pilr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "azuredata.PostgresInstancesClient", "List", resp, "Failure sending request") + return + } + + result.pilr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.PostgresInstancesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client PostgresInstancesClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-07-24-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.AzureData/postgresInstances", 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 PostgresInstancesClient) 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 PostgresInstancesClient) ListResponder(resp *http.Response) (result PostgresInstanceListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 PostgresInstancesClient) listNextResults(ctx context.Context, lastResults PostgresInstanceListResult) (result PostgresInstanceListResult, err error) { + req, err := lastResults.postgresInstanceListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "azuredata.PostgresInstancesClient", "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, "azuredata.PostgresInstancesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.PostgresInstancesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client PostgresInstancesClient) ListComplete(ctx context.Context) (result PostgresInstanceListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PostgresInstancesClient.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 get a postgres Instances list by Resource group name. +// Parameters: +// resourceGroupName - the name of the Azure resource group +func (client PostgresInstancesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result PostgresInstanceListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PostgresInstancesClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.pilr.Response.Response != nil { + sc = result.pilr.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, "azuredata.PostgresInstancesClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.pilr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "azuredata.PostgresInstancesClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.pilr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.PostgresInstancesClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client PostgresInstancesClient) 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 = "2019-07-24-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.AzureData/postgresInstances", 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 PostgresInstancesClient) 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 PostgresInstancesClient) ListByResourceGroupResponder(resp *http.Response) (result PostgresInstanceListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 PostgresInstancesClient) listByResourceGroupNextResults(ctx context.Context, lastResults PostgresInstanceListResult) (result PostgresInstanceListResult, err error) { + req, err := lastResults.postgresInstanceListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "azuredata.PostgresInstancesClient", "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, "azuredata.PostgresInstancesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.PostgresInstancesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client PostgresInstancesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result PostgresInstanceListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PostgresInstancesClient.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 updates a postgres Instance resource +// Parameters: +// resourceGroupName - the name of the Azure resource group +// postgresInstanceName - name of Postgres Instance +// parameters - the Postgres Instance. +func (client PostgresInstancesClient) Update(ctx context.Context, resourceGroupName string, postgresInstanceName string, parameters PostgresInstanceUpdate) (result PostgresInstance, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PostgresInstancesClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, postgresInstanceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.PostgresInstancesClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "azuredata.PostgresInstancesClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.PostgresInstancesClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client PostgresInstancesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, postgresInstanceName string, parameters PostgresInstanceUpdate) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "postgresInstanceName": autorest.Encode("path", postgresInstanceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-07-24-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.AzureData/postgresInstances/{postgresInstanceName}", pathParameters), + autorest.WithJSON(parameters), + 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 PostgresInstancesClient) 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 PostgresInstancesClient) UpdateResponder(resp *http.Response) (result PostgresInstance, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/azuredata/mgmt/2019-07-24-preview/azuredata/sqlinstances.go b/services/preview/azuredata/mgmt/2019-07-24-preview/azuredata/sqlinstances.go new file mode 100644 index 000000000000..a225331b2a4b --- /dev/null +++ b/services/preview/azuredata/mgmt/2019-07-24-preview/azuredata/sqlinstances.go @@ -0,0 +1,573 @@ +package azuredata + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// SQLInstancesClient is the the AzureData management API provides a RESTful set of web APIs to manage Azure Data +// Resources. +type SQLInstancesClient struct { + BaseClient +} + +// NewSQLInstancesClient creates an instance of the SQLInstancesClient client. +func NewSQLInstancesClient(subscriptionID string, subscriptionID1 string) SQLInstancesClient { + return NewSQLInstancesClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) +} + +// NewSQLInstancesClientWithBaseURI creates an instance of the SQLInstancesClient 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 NewSQLInstancesClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) SQLInstancesClient { + return SQLInstancesClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} +} + +// Create creates or replaces a SQL Instance resource +// Parameters: +// resourceGroupName - the name of the Azure resource group +// SQLInstanceName - the name of SQL Instances +// parameters - the SQL Instance to be created or updated. +func (client SQLInstancesClient) Create(ctx context.Context, resourceGroupName string, SQLInstanceName string, parameters SQLInstance) (result SQLInstance, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLInstancesClient.Create") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreatePreparer(ctx, resourceGroupName, SQLInstanceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.SQLInstancesClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "azuredata.SQLInstancesClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.SQLInstancesClient", "Create", resp, "Failure responding to request") + } + + return +} + +// CreatePreparer prepares the Create request. +func (client SQLInstancesClient) CreatePreparer(ctx context.Context, resourceGroupName string, SQLInstanceName string, parameters SQLInstance) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sqlInstanceName": autorest.Encode("path", SQLInstanceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-07-24-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.AzureData/sqlInstances/{sqlInstanceName}", pathParameters), + autorest.WithJSON(parameters), + 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 SQLInstancesClient) CreateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client SQLInstancesClient) CreateResponder(resp *http.Response) (result SQLInstance, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a SQL Instance resource +// Parameters: +// resourceGroupName - the name of the Azure resource group +// SQLInstanceName - the name of Sql Instances +func (client SQLInstancesClient) Delete(ctx context.Context, resourceGroupName string, SQLInstanceName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLInstancesClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, SQLInstanceName) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.SQLInstancesClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "azuredata.SQLInstancesClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.SQLInstancesClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client SQLInstancesClient) DeletePreparer(ctx context.Context, resourceGroupName string, SQLInstanceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sqlInstanceName": autorest.Encode("path", SQLInstanceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-07-24-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.AzureData/sqlInstances/{sqlInstanceName}", 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 SQLInstancesClient) 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 SQLInstancesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieves a SQL Instance resource +// Parameters: +// resourceGroupName - the name of the Azure resource group +// SQLInstanceName - name of SQL Instance +func (client SQLInstancesClient) Get(ctx context.Context, resourceGroupName string, SQLInstanceName string) (result SQLInstance, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLInstancesClient.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, SQLInstanceName) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.SQLInstancesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "azuredata.SQLInstancesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.SQLInstancesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client SQLInstancesClient) GetPreparer(ctx context.Context, resourceGroupName string, SQLInstanceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sqlInstanceName": autorest.Encode("path", SQLInstanceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-07-24-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.AzureData/sqlInstances/{sqlInstanceName}", 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 SQLInstancesClient) 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 SQLInstancesClient) GetResponder(resp *http.Response) (result SQLInstance, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List sends the list request. +func (client SQLInstancesClient) List(ctx context.Context) (result SQLInstanceListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLInstancesClient.List") + defer func() { + sc := -1 + if result.silr.Response.Response != nil { + sc = result.silr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.SQLInstancesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.silr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "azuredata.SQLInstancesClient", "List", resp, "Failure sending request") + return + } + + result.silr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.SQLInstancesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client SQLInstancesClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-07-24-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.AzureData/sqlInstances", 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 SQLInstancesClient) 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 SQLInstancesClient) ListResponder(resp *http.Response) (result SQLInstanceListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 SQLInstancesClient) listNextResults(ctx context.Context, lastResults SQLInstanceListResult) (result SQLInstanceListResult, err error) { + req, err := lastResults.sQLInstanceListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "azuredata.SQLInstancesClient", "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, "azuredata.SQLInstancesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.SQLInstancesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client SQLInstancesClient) ListComplete(ctx context.Context) (result SQLInstanceListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLInstancesClient.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 gets all sqlInstances in a resource group. +// Parameters: +// resourceGroupName - the name of the Azure resource group +func (client SQLInstancesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result SQLInstanceListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLInstancesClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.silr.Response.Response != nil { + sc = result.silr.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, "azuredata.SQLInstancesClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.silr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "azuredata.SQLInstancesClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.silr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.SQLInstancesClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client SQLInstancesClient) 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 = "2019-07-24-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.AzureData/sqlInstances", 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 SQLInstancesClient) 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 SQLInstancesClient) ListByResourceGroupResponder(resp *http.Response) (result SQLInstanceListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 SQLInstancesClient) listByResourceGroupNextResults(ctx context.Context, lastResults SQLInstanceListResult) (result SQLInstanceListResult, err error) { + req, err := lastResults.sQLInstanceListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "azuredata.SQLInstancesClient", "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, "azuredata.SQLInstancesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.SQLInstancesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client SQLInstancesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result SQLInstanceListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLInstancesClient.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 updates a SQL Instance resource +// Parameters: +// resourceGroupName - the name of the Azure resource group +// SQLInstanceName - name of sqlInstance +// parameters - the SQL Instance. +func (client SQLInstancesClient) Update(ctx context.Context, resourceGroupName string, SQLInstanceName string, parameters SQLInstanceUpdate) (result SQLInstance, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLInstancesClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, SQLInstanceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.SQLInstancesClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "azuredata.SQLInstancesClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.SQLInstancesClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client SQLInstancesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, SQLInstanceName string, parameters SQLInstanceUpdate) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sqlInstanceName": autorest.Encode("path", SQLInstanceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-07-24-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.AzureData/sqlInstances/{sqlInstanceName}", pathParameters), + autorest.WithJSON(parameters), + 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 SQLInstancesClient) 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 SQLInstancesClient) UpdateResponder(resp *http.Response) (result SQLInstance, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/azuredata/mgmt/2019-07-24-preview/azuredata/sqlserverinstances.go b/services/preview/azuredata/mgmt/2019-07-24-preview/azuredata/sqlserverinstances.go new file mode 100644 index 000000000000..80a70ca169fc --- /dev/null +++ b/services/preview/azuredata/mgmt/2019-07-24-preview/azuredata/sqlserverinstances.go @@ -0,0 +1,587 @@ +package azuredata + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// SQLServerInstancesClient is the the AzureData management API provides a RESTful set of web APIs to manage Azure Data +// Resources. +type SQLServerInstancesClient struct { + BaseClient +} + +// NewSQLServerInstancesClient creates an instance of the SQLServerInstancesClient client. +func NewSQLServerInstancesClient(subscriptionID string, subscriptionID1 string) SQLServerInstancesClient { + return NewSQLServerInstancesClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) +} + +// NewSQLServerInstancesClientWithBaseURI creates an instance of the SQLServerInstancesClient 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 NewSQLServerInstancesClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) SQLServerInstancesClient { + return SQLServerInstancesClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} +} + +// Create creates or replaces a SQL Server Instance resource +// Parameters: +// resourceGroupName - the name of the Azure resource group +// SQLServerInstanceName - the name of SQL Server Instance +// parameters - the SQL Server Instance to be created or updated. +func (client SQLServerInstancesClient) Create(ctx context.Context, resourceGroupName string, SQLServerInstanceName string, parameters SQLServerInstance) (result SQLServerInstance, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLServerInstancesClient.Create") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.SQLServerInstanceProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.SQLServerInstanceProperties.Version", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.SQLServerInstanceProperties.Edition", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.SQLServerInstanceProperties.ContainerResourceID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.SQLServerInstanceProperties.VCore", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.SQLServerInstanceProperties.Status", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("azuredata.SQLServerInstancesClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, SQLServerInstanceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.SQLServerInstancesClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "azuredata.SQLServerInstancesClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.SQLServerInstancesClient", "Create", resp, "Failure responding to request") + } + + return +} + +// CreatePreparer prepares the Create request. +func (client SQLServerInstancesClient) CreatePreparer(ctx context.Context, resourceGroupName string, SQLServerInstanceName string, parameters SQLServerInstance) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sqlServerInstanceName": autorest.Encode("path", SQLServerInstanceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-07-24-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.AzureData/sqlServerInstances/{sqlServerInstanceName}", pathParameters), + autorest.WithJSON(parameters), + 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 SQLServerInstancesClient) CreateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client SQLServerInstancesClient) CreateResponder(resp *http.Response) (result SQLServerInstance, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a SQL Server Instance resource +// Parameters: +// resourceGroupName - the name of the Azure resource group +// SQLServerInstanceName - the name of SQL Server Instance +func (client SQLServerInstancesClient) Delete(ctx context.Context, resourceGroupName string, SQLServerInstanceName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLServerInstancesClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, SQLServerInstanceName) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.SQLServerInstancesClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "azuredata.SQLServerInstancesClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.SQLServerInstancesClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client SQLServerInstancesClient) DeletePreparer(ctx context.Context, resourceGroupName string, SQLServerInstanceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sqlServerInstanceName": autorest.Encode("path", SQLServerInstanceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-07-24-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.AzureData/sqlServerInstances/{sqlServerInstanceName}", 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 SQLServerInstancesClient) 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 SQLServerInstancesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieves a SQL Server Instance resource +// Parameters: +// resourceGroupName - the name of the Azure resource group +// SQLServerInstanceName - name of SQL Server Instance +func (client SQLServerInstancesClient) Get(ctx context.Context, resourceGroupName string, SQLServerInstanceName string) (result SQLServerInstance, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLServerInstancesClient.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, SQLServerInstanceName) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.SQLServerInstancesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "azuredata.SQLServerInstancesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.SQLServerInstancesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client SQLServerInstancesClient) GetPreparer(ctx context.Context, resourceGroupName string, SQLServerInstanceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sqlServerInstanceName": autorest.Encode("path", SQLServerInstanceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-07-24-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.AzureData/sqlServerInstances/{sqlServerInstanceName}", 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 SQLServerInstancesClient) 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 SQLServerInstancesClient) GetResponder(resp *http.Response) (result SQLServerInstance, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List sends the list request. +func (client SQLServerInstancesClient) List(ctx context.Context) (result SQLServerInstanceListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLServerInstancesClient.List") + defer func() { + sc := -1 + if result.ssilr.Response.Response != nil { + sc = result.ssilr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.SQLServerInstancesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.ssilr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "azuredata.SQLServerInstancesClient", "List", resp, "Failure sending request") + return + } + + result.ssilr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.SQLServerInstancesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client SQLServerInstancesClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-07-24-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.AzureData/sqlServerInstances", 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 SQLServerInstancesClient) 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 SQLServerInstancesClient) ListResponder(resp *http.Response) (result SQLServerInstanceListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 SQLServerInstancesClient) listNextResults(ctx context.Context, lastResults SQLServerInstanceListResult) (result SQLServerInstanceListResult, err error) { + req, err := lastResults.sQLServerInstanceListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "azuredata.SQLServerInstancesClient", "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, "azuredata.SQLServerInstancesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.SQLServerInstancesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client SQLServerInstancesClient) ListComplete(ctx context.Context) (result SQLServerInstanceListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLServerInstancesClient.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 gets all sqlServerInstances in a resource group. +// Parameters: +// resourceGroupName - the name of the Azure resource group +func (client SQLServerInstancesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result SQLServerInstanceListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLServerInstancesClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.ssilr.Response.Response != nil { + sc = result.ssilr.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, "azuredata.SQLServerInstancesClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.ssilr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "azuredata.SQLServerInstancesClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.ssilr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.SQLServerInstancesClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client SQLServerInstancesClient) 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 = "2019-07-24-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.AzureData/sqlServerInstances", 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 SQLServerInstancesClient) 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 SQLServerInstancesClient) ListByResourceGroupResponder(resp *http.Response) (result SQLServerInstanceListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 SQLServerInstancesClient) listByResourceGroupNextResults(ctx context.Context, lastResults SQLServerInstanceListResult) (result SQLServerInstanceListResult, err error) { + req, err := lastResults.sQLServerInstanceListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "azuredata.SQLServerInstancesClient", "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, "azuredata.SQLServerInstancesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.SQLServerInstancesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client SQLServerInstancesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result SQLServerInstanceListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLServerInstancesClient.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 updates a SQL Server Instance resource +// Parameters: +// resourceGroupName - the name of the Azure resource group +// SQLServerInstanceName - name of sqlServerInstance +// parameters - the SQL Server Instance. +func (client SQLServerInstancesClient) Update(ctx context.Context, resourceGroupName string, SQLServerInstanceName string, parameters SQLServerInstanceUpdate) (result SQLServerInstance, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLServerInstancesClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, SQLServerInstanceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.SQLServerInstancesClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "azuredata.SQLServerInstancesClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.SQLServerInstancesClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client SQLServerInstancesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, SQLServerInstanceName string, parameters SQLServerInstanceUpdate) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sqlServerInstanceName": autorest.Encode("path", SQLServerInstanceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-07-24-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.AzureData/sqlServerInstances/{sqlServerInstanceName}", pathParameters), + autorest.WithJSON(parameters), + 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 SQLServerInstancesClient) 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 SQLServerInstancesClient) UpdateResponder(resp *http.Response) (result SQLServerInstance, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/azuredata/mgmt/2019-07-24-preview/azuredata/sqlserverregistrations.go b/services/preview/azuredata/mgmt/2019-07-24-preview/azuredata/sqlserverregistrations.go new file mode 100644 index 000000000000..874fd6b4be4c --- /dev/null +++ b/services/preview/azuredata/mgmt/2019-07-24-preview/azuredata/sqlserverregistrations.go @@ -0,0 +1,579 @@ +package azuredata + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// SQLServerRegistrationsClient is the the AzureData management API provides a RESTful set of web APIs to manage Azure +// Data Resources. +type SQLServerRegistrationsClient struct { + BaseClient +} + +// NewSQLServerRegistrationsClient creates an instance of the SQLServerRegistrationsClient client. +func NewSQLServerRegistrationsClient(subscriptionID string, subscriptionID1 string) SQLServerRegistrationsClient { + return NewSQLServerRegistrationsClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) +} + +// NewSQLServerRegistrationsClientWithBaseURI creates an instance of the SQLServerRegistrationsClient 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 NewSQLServerRegistrationsClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) SQLServerRegistrationsClient { + return SQLServerRegistrationsClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} +} + +// CreateOrUpdate creates or updates a SQL Server registration. +// Parameters: +// resourceGroupName - name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. +// SQLServerRegistrationName - name of the SQL Server registration. +// parameters - the SQL Server registration to be created or updated. +func (client SQLServerRegistrationsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, SQLServerRegistrationName string, parameters SQLServerRegistration) (result SQLServerRegistration, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLServerRegistrationsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, SQLServerRegistrationName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.SQLServerRegistrationsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "azuredata.SQLServerRegistrationsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.SQLServerRegistrationsClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client SQLServerRegistrationsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, SQLServerRegistrationName string, parameters SQLServerRegistration) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sqlServerRegistrationName": autorest.Encode("path", SQLServerRegistrationName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-07-24-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.AzureData/sqlServerRegistrations/{sqlServerRegistrationName}", pathParameters), + autorest.WithJSON(parameters), + 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 SQLServerRegistrationsClient) 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 SQLServerRegistrationsClient) CreateOrUpdateResponder(resp *http.Response) (result SQLServerRegistration, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a SQL Server registration. +// Parameters: +// resourceGroupName - name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. +// SQLServerRegistrationName - name of the SQL Server registration. +func (client SQLServerRegistrationsClient) Delete(ctx context.Context, resourceGroupName string, SQLServerRegistrationName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLServerRegistrationsClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, SQLServerRegistrationName) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.SQLServerRegistrationsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "azuredata.SQLServerRegistrationsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.SQLServerRegistrationsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client SQLServerRegistrationsClient) DeletePreparer(ctx context.Context, resourceGroupName string, SQLServerRegistrationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sqlServerRegistrationName": autorest.Encode("path", SQLServerRegistrationName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-07-24-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.AzureData/sqlServerRegistrations/{sqlServerRegistrationName}", 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 SQLServerRegistrationsClient) 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 SQLServerRegistrationsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets a SQL Server registration. +// Parameters: +// resourceGroupName - name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. +// SQLServerRegistrationName - name of the SQL Server registration. +func (client SQLServerRegistrationsClient) Get(ctx context.Context, resourceGroupName string, SQLServerRegistrationName string) (result SQLServerRegistration, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLServerRegistrationsClient.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, SQLServerRegistrationName) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.SQLServerRegistrationsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "azuredata.SQLServerRegistrationsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.SQLServerRegistrationsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client SQLServerRegistrationsClient) GetPreparer(ctx context.Context, resourceGroupName string, SQLServerRegistrationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sqlServerRegistrationName": autorest.Encode("path", SQLServerRegistrationName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-07-24-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.AzureData/sqlServerRegistrations/{sqlServerRegistrationName}", 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 SQLServerRegistrationsClient) 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 SQLServerRegistrationsClient) GetResponder(resp *http.Response) (result SQLServerRegistration, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets all SQL Server registrations in a subscription. +func (client SQLServerRegistrationsClient) List(ctx context.Context) (result SQLServerRegistrationListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLServerRegistrationsClient.List") + defer func() { + sc := -1 + if result.ssrlr.Response.Response != nil { + sc = result.ssrlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.SQLServerRegistrationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.ssrlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "azuredata.SQLServerRegistrationsClient", "List", resp, "Failure sending request") + return + } + + result.ssrlr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.SQLServerRegistrationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client SQLServerRegistrationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-07-24-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.AzureData/sqlServerRegistrations", 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 SQLServerRegistrationsClient) 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 SQLServerRegistrationsClient) ListResponder(resp *http.Response) (result SQLServerRegistrationListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 SQLServerRegistrationsClient) listNextResults(ctx context.Context, lastResults SQLServerRegistrationListResult) (result SQLServerRegistrationListResult, err error) { + req, err := lastResults.sQLServerRegistrationListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "azuredata.SQLServerRegistrationsClient", "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, "azuredata.SQLServerRegistrationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.SQLServerRegistrationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client SQLServerRegistrationsClient) ListComplete(ctx context.Context) (result SQLServerRegistrationListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLServerRegistrationsClient.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 gets all SQL Server registrations in a resource group. +// Parameters: +// resourceGroupName - name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. +func (client SQLServerRegistrationsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result SQLServerRegistrationListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLServerRegistrationsClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.ssrlr.Response.Response != nil { + sc = result.ssrlr.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, "azuredata.SQLServerRegistrationsClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.ssrlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "azuredata.SQLServerRegistrationsClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.ssrlr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.SQLServerRegistrationsClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client SQLServerRegistrationsClient) 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 = "2019-07-24-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.AzureData/sqlServerRegistrations", 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 SQLServerRegistrationsClient) 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 SQLServerRegistrationsClient) ListByResourceGroupResponder(resp *http.Response) (result SQLServerRegistrationListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 SQLServerRegistrationsClient) listByResourceGroupNextResults(ctx context.Context, lastResults SQLServerRegistrationListResult) (result SQLServerRegistrationListResult, err error) { + req, err := lastResults.sQLServerRegistrationListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "azuredata.SQLServerRegistrationsClient", "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, "azuredata.SQLServerRegistrationsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.SQLServerRegistrationsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client SQLServerRegistrationsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result SQLServerRegistrationListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLServerRegistrationsClient.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 updates SQL Server Registration tags. +// Parameters: +// resourceGroupName - name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. +// SQLServerRegistrationName - name of the SQL Server registration. +// parameters - the SQL Server Registration. +func (client SQLServerRegistrationsClient) Update(ctx context.Context, resourceGroupName string, SQLServerRegistrationName string, parameters SQLServerRegistrationUpdate) (result SQLServerRegistration, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLServerRegistrationsClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, SQLServerRegistrationName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.SQLServerRegistrationsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "azuredata.SQLServerRegistrationsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.SQLServerRegistrationsClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client SQLServerRegistrationsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, SQLServerRegistrationName string, parameters SQLServerRegistrationUpdate) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sqlServerRegistrationName": autorest.Encode("path", SQLServerRegistrationName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-07-24-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.AzureData/sqlServerRegistrations/{sqlServerRegistrationName}", pathParameters), + autorest.WithJSON(parameters), + 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 SQLServerRegistrationsClient) 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 SQLServerRegistrationsClient) UpdateResponder(resp *http.Response) (result SQLServerRegistration, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/azuredata/mgmt/2019-07-24-preview/azuredata/sqlservers.go b/services/preview/azuredata/mgmt/2019-07-24-preview/azuredata/sqlservers.go new file mode 100644 index 000000000000..6b92bf48434e --- /dev/null +++ b/services/preview/azuredata/mgmt/2019-07-24-preview/azuredata/sqlservers.go @@ -0,0 +1,405 @@ +package azuredata + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// SQLServersClient is the the AzureData management API provides a RESTful set of web APIs to manage Azure Data +// Resources. +type SQLServersClient struct { + BaseClient +} + +// NewSQLServersClient creates an instance of the SQLServersClient client. +func NewSQLServersClient(subscriptionID string, subscriptionID1 string) SQLServersClient { + return NewSQLServersClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) +} + +// NewSQLServersClientWithBaseURI creates an instance of the SQLServersClient 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 NewSQLServersClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) SQLServersClient { + return SQLServersClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} +} + +// CreateOrUpdate creates or updates a SQL Server. +// Parameters: +// resourceGroupName - name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. +// SQLServerRegistrationName - name of the SQL Server registration. +// SQLServerName - name of the SQL Server. +// parameters - the SQL Server to be created or updated. +func (client SQLServersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, SQLServerRegistrationName string, SQLServerName string, parameters SQLServer) (result SQLServer, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLServersClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, SQLServerRegistrationName, SQLServerName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.SQLServersClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "azuredata.SQLServersClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.SQLServersClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client SQLServersClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, SQLServerRegistrationName string, SQLServerName string, parameters SQLServer) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sqlServerName": autorest.Encode("path", SQLServerName), + "sqlServerRegistrationName": autorest.Encode("path", SQLServerRegistrationName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-07-24-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.AzureData/sqlServerRegistrations/{sqlServerRegistrationName}/sqlServers/{sqlServerName}", pathParameters), + autorest.WithJSON(parameters), + 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 SQLServersClient) 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 SQLServersClient) CreateOrUpdateResponder(resp *http.Response) (result SQLServer, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a SQL Server. +// Parameters: +// resourceGroupName - name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. +// SQLServerRegistrationName - name of the SQL Server registration. +// SQLServerName - name of the SQL Server. +func (client SQLServersClient) Delete(ctx context.Context, resourceGroupName string, SQLServerRegistrationName string, SQLServerName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLServersClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, SQLServerRegistrationName, SQLServerName) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.SQLServersClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "azuredata.SQLServersClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.SQLServersClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client SQLServersClient) DeletePreparer(ctx context.Context, resourceGroupName string, SQLServerRegistrationName string, SQLServerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sqlServerName": autorest.Encode("path", SQLServerName), + "sqlServerRegistrationName": autorest.Encode("path", SQLServerRegistrationName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-07-24-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.AzureData/sqlServerRegistrations/{sqlServerRegistrationName}/sqlServers/{sqlServerName}", 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 SQLServersClient) 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 SQLServersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets a SQL Server. +// Parameters: +// resourceGroupName - name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. +// SQLServerRegistrationName - name of the SQL Server registration. +// SQLServerName - name of the SQL Server. +// expand - the child resources to include in the response. +func (client SQLServersClient) Get(ctx context.Context, resourceGroupName string, SQLServerRegistrationName string, SQLServerName string, expand string) (result SQLServer, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLServersClient.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, SQLServerRegistrationName, SQLServerName, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.SQLServersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "azuredata.SQLServersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.SQLServersClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client SQLServersClient) GetPreparer(ctx context.Context, resourceGroupName string, SQLServerRegistrationName string, SQLServerName string, expand string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sqlServerName": autorest.Encode("path", SQLServerName), + "sqlServerRegistrationName": autorest.Encode("path", SQLServerRegistrationName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-07-24-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureData/sqlServerRegistrations/{sqlServerRegistrationName}/sqlServers/{sqlServerName}", 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 SQLServersClient) 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 SQLServersClient) GetResponder(resp *http.Response) (result SQLServer, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByResourceGroup gets all SQL Servers in a SQL Server Registration. +// Parameters: +// resourceGroupName - name of the resource group that contains the resource. You can obtain this value from +// the Azure Resource Manager API or the portal. +// SQLServerRegistrationName - name of the SQL Server registration. +// expand - the child resources to include in the response. +func (client SQLServersClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, SQLServerRegistrationName string, expand string) (result SQLServerListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLServersClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.sslr.Response.Response != nil { + sc = result.sslr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, SQLServerRegistrationName, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.SQLServersClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.sslr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "azuredata.SQLServersClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.sslr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.SQLServersClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client SQLServersClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string, SQLServerRegistrationName string, expand string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sqlServerRegistrationName": autorest.Encode("path", SQLServerRegistrationName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-07-24-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.AzureData/sqlServerRegistrations/{sqlServerRegistrationName}/sqlServers", 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 SQLServersClient) 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 SQLServersClient) ListByResourceGroupResponder(resp *http.Response) (result SQLServerListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 SQLServersClient) listByResourceGroupNextResults(ctx context.Context, lastResults SQLServerListResult) (result SQLServerListResult, err error) { + req, err := lastResults.sQLServerListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "azuredata.SQLServersClient", "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, "azuredata.SQLServersClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "azuredata.SQLServersClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client SQLServersClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, SQLServerRegistrationName string, expand string) (result SQLServerListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SQLServersClient.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, SQLServerRegistrationName, expand) + return +} diff --git a/services/preview/azuredata/mgmt/2019-07-24-preview/azuredata/version.go b/services/preview/azuredata/mgmt/2019-07-24-preview/azuredata/version.go new file mode 100644 index 000000000000..d5fdaa66c757 --- /dev/null +++ b/services/preview/azuredata/mgmt/2019-07-24-preview/azuredata/version.go @@ -0,0 +1,30 @@ +package azuredata + +import "github.com/Azure/azure-sdk-for-go/version" + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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() + " azuredata/2019-07-24-preview" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/services/preview/billing/mgmt/2020-05-01-preview/billing/accounts.go b/services/preview/billing/mgmt/2020-05-01-preview/billing/accounts.go new file mode 100644 index 000000000000..f0dcda753f1a --- /dev/null +++ b/services/preview/billing/mgmt/2020-05-01-preview/billing/accounts.go @@ -0,0 +1,419 @@ +package billing + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// AccountsClient is the billing client provides access to billing resources for Azure subscriptions. +type AccountsClient struct { + BaseClient +} + +// NewAccountsClient creates an instance of the AccountsClient client. +func NewAccountsClient(subscriptionID string) AccountsClient { + return NewAccountsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewAccountsClientWithBaseURI creates an instance of the AccountsClient 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 NewAccountsClientWithBaseURI(baseURI string, subscriptionID string) AccountsClient { + return AccountsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get gets a billing account by its ID. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +// expand - may be used to expand the soldTo, invoice sections and billing profiles. +func (client AccountsClient) Get(ctx context.Context, billingAccountName string, expand string) (result Account, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.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, billingAccountName, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.AccountsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.AccountsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.AccountsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client AccountsClient) GetPreparer(ctx context.Context, billingAccountName string, expand string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountName": autorest.Encode("path", billingAccountName), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}", 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 AccountsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client AccountsClient) GetResponder(resp *http.Response) (result Account, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists the billing accounts that a user has access to. +// Parameters: +// expand - may be used to expand the soldTo, invoice sections and billing profiles. +func (client AccountsClient) List(ctx context.Context, expand string) (result AccountListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.List") + defer func() { + sc := -1 + if result.alr.Response.Response != nil { + sc = result.alr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.AccountsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.alr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.AccountsClient", "List", resp, "Failure sending request") + return + } + + result.alr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.AccountsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client AccountsClient) ListPreparer(ctx context.Context, expand string) (*http.Request, error) { + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.Billing/billingAccounts"), + 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 AccountsClient) 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 AccountsClient) ListResponder(resp *http.Response) (result AccountListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 AccountsClient) listNextResults(ctx context.Context, lastResults AccountListResult) (result AccountListResult, err error) { + req, err := lastResults.accountListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "billing.AccountsClient", "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, "billing.AccountsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.AccountsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client AccountsClient) ListComplete(ctx context.Context, expand string) (result AccountListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.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, expand) + return +} + +// ListInvoiceSectionsByCreateSubscriptionPermission lists the invoice sections for which the user has permission to +// create Azure subscriptions. The operation is supported only for billing accounts with agreement type Microsoft +// Customer Agreement. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +func (client AccountsClient) ListInvoiceSectionsByCreateSubscriptionPermission(ctx context.Context, billingAccountName string) (result InvoiceSectionListWithCreateSubPermissionResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.ListInvoiceSectionsByCreateSubscriptionPermission") + defer func() { + sc := -1 + if result.islwcspr.Response.Response != nil { + sc = result.islwcspr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listInvoiceSectionsByCreateSubscriptionPermissionNextResults + req, err := client.ListInvoiceSectionsByCreateSubscriptionPermissionPreparer(ctx, billingAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.AccountsClient", "ListInvoiceSectionsByCreateSubscriptionPermission", nil, "Failure preparing request") + return + } + + resp, err := client.ListInvoiceSectionsByCreateSubscriptionPermissionSender(req) + if err != nil { + result.islwcspr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.AccountsClient", "ListInvoiceSectionsByCreateSubscriptionPermission", resp, "Failure sending request") + return + } + + result.islwcspr, err = client.ListInvoiceSectionsByCreateSubscriptionPermissionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.AccountsClient", "ListInvoiceSectionsByCreateSubscriptionPermission", resp, "Failure responding to request") + } + + return +} + +// ListInvoiceSectionsByCreateSubscriptionPermissionPreparer prepares the ListInvoiceSectionsByCreateSubscriptionPermission request. +func (client AccountsClient) ListInvoiceSectionsByCreateSubscriptionPermissionPreparer(ctx context.Context, billingAccountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountName": autorest.Encode("path", billingAccountName), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/listInvoiceSectionsWithCreateSubscriptionPermission", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListInvoiceSectionsByCreateSubscriptionPermissionSender sends the ListInvoiceSectionsByCreateSubscriptionPermission request. The method will close the +// http.Response Body if it receives an error. +func (client AccountsClient) ListInvoiceSectionsByCreateSubscriptionPermissionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListInvoiceSectionsByCreateSubscriptionPermissionResponder handles the response to the ListInvoiceSectionsByCreateSubscriptionPermission request. The method always +// closes the http.Response Body. +func (client AccountsClient) ListInvoiceSectionsByCreateSubscriptionPermissionResponder(resp *http.Response) (result InvoiceSectionListWithCreateSubPermissionResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listInvoiceSectionsByCreateSubscriptionPermissionNextResults retrieves the next set of results, if any. +func (client AccountsClient) listInvoiceSectionsByCreateSubscriptionPermissionNextResults(ctx context.Context, lastResults InvoiceSectionListWithCreateSubPermissionResult) (result InvoiceSectionListWithCreateSubPermissionResult, err error) { + req, err := lastResults.invoiceSectionListWithCreateSubPermissionResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "billing.AccountsClient", "listInvoiceSectionsByCreateSubscriptionPermissionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListInvoiceSectionsByCreateSubscriptionPermissionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "billing.AccountsClient", "listInvoiceSectionsByCreateSubscriptionPermissionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListInvoiceSectionsByCreateSubscriptionPermissionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.AccountsClient", "listInvoiceSectionsByCreateSubscriptionPermissionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListInvoiceSectionsByCreateSubscriptionPermissionComplete enumerates all values, automatically crossing page boundaries as required. +func (client AccountsClient) ListInvoiceSectionsByCreateSubscriptionPermissionComplete(ctx context.Context, billingAccountName string) (result InvoiceSectionListWithCreateSubPermissionResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.ListInvoiceSectionsByCreateSubscriptionPermission") + 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.ListInvoiceSectionsByCreateSubscriptionPermission(ctx, billingAccountName) + return +} + +// Update updates the properties of a billing account. Currently, displayName and address can be updated. The operation +// is supported only for billing accounts with agreement type Microsoft Customer Agreement. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +// parameters - request parameters that are provided to the update billing account operation. +func (client AccountsClient) Update(ctx context.Context, billingAccountName string, parameters AccountUpdateRequest) (result AccountsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountsClient.Update") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, billingAccountName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.AccountsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.AccountsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client AccountsClient) UpdatePreparer(ctx context.Context, billingAccountName string, parameters AccountUpdateRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountName": autorest.Encode("path", billingAccountName), + } + + const APIVersion = "2020-05-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("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}", pathParameters), + autorest.WithJSON(parameters), + 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 AccountsClient) UpdateSender(req *http.Request) (future AccountsUpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client AccountsClient) UpdateResponder(resp *http.Response) (result Account, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/billing/mgmt/2020-05-01-preview/billing/address.go b/services/preview/billing/mgmt/2020-05-01-preview/billing/address.go new file mode 100644 index 000000000000..3ebc3dcd9dfa --- /dev/null +++ b/services/preview/billing/mgmt/2020-05-01-preview/billing/address.go @@ -0,0 +1,120 @@ +package billing + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// AddressClient is the billing client provides access to billing resources for Azure subscriptions. +type AddressClient struct { + BaseClient +} + +// NewAddressClient creates an instance of the AddressClient client. +func NewAddressClient(subscriptionID string) AddressClient { + return NewAddressClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewAddressClientWithBaseURI creates an instance of the AddressClient 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 NewAddressClientWithBaseURI(baseURI string, subscriptionID string) AddressClient { + return AddressClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Validate validates an address. Use the operation to validate an address before using it as soldTo or a billTo +// address. +func (client AddressClient) Validate(ctx context.Context, address AddressDetails) (result ValidateAddressResponse, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AddressClient.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: address, + Constraints: []validation.Constraint{{Target: "address.AddressLine1", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "address.Country", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("billing.AddressClient", "Validate", err.Error()) + } + + req, err := client.ValidatePreparer(ctx, address) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.AddressClient", "Validate", nil, "Failure preparing request") + return + } + + resp, err := client.ValidateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.AddressClient", "Validate", resp, "Failure sending request") + return + } + + result, err = client.ValidateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.AddressClient", "Validate", resp, "Failure responding to request") + } + + return +} + +// ValidatePreparer prepares the Validate request. +func (client AddressClient) ValidatePreparer(ctx context.Context, address AddressDetails) (*http.Request, error) { + const APIVersion = "2020-05-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.WithPath("/providers/Microsoft.Billing/validateAddress"), + autorest.WithJSON(address), + 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 AddressClient) ValidateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ValidateResponder handles the response to the Validate request. The method always +// closes the http.Response Body. +func (client AddressClient) ValidateResponder(resp *http.Response) (result ValidateAddressResponse, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/billing/mgmt/2020-05-01-preview/billing/agreements.go b/services/preview/billing/mgmt/2020-05-01-preview/billing/agreements.go new file mode 100644 index 000000000000..0de62a7fe68b --- /dev/null +++ b/services/preview/billing/mgmt/2020-05-01-preview/billing/agreements.go @@ -0,0 +1,236 @@ +package billing + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// AgreementsClient is the billing client provides access to billing resources for Azure subscriptions. +type AgreementsClient struct { + BaseClient +} + +// NewAgreementsClient creates an instance of the AgreementsClient client. +func NewAgreementsClient(subscriptionID string) AgreementsClient { + return NewAgreementsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewAgreementsClientWithBaseURI creates an instance of the AgreementsClient 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 NewAgreementsClientWithBaseURI(baseURI string, subscriptionID string) AgreementsClient { + return AgreementsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get gets an agreement by ID. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +// agreementName - the ID that uniquely identifies an agreement. +// expand - may be used to expand the participants. +func (client AgreementsClient) Get(ctx context.Context, billingAccountName string, agreementName string, expand string) (result Agreement, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AgreementsClient.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, billingAccountName, agreementName, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.AgreementsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.AgreementsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.AgreementsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client AgreementsClient) GetPreparer(ctx context.Context, billingAccountName string, agreementName string, expand string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "agreementName": autorest.Encode("path", agreementName), + "billingAccountName": autorest.Encode("path", billingAccountName), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/agreements/{agreementName}", 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 AgreementsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client AgreementsClient) GetResponder(resp *http.Response) (result Agreement, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByBillingAccount lists the agreements for a billing account. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +// expand - may be used to expand the participants. +func (client AgreementsClient) ListByBillingAccount(ctx context.Context, billingAccountName string, expand string) (result AgreementListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AgreementsClient.ListByBillingAccount") + defer func() { + sc := -1 + if result.alr.Response.Response != nil { + sc = result.alr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByBillingAccountNextResults + req, err := client.ListByBillingAccountPreparer(ctx, billingAccountName, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.AgreementsClient", "ListByBillingAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByBillingAccountSender(req) + if err != nil { + result.alr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.AgreementsClient", "ListByBillingAccount", resp, "Failure sending request") + return + } + + result.alr, err = client.ListByBillingAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.AgreementsClient", "ListByBillingAccount", resp, "Failure responding to request") + } + + return +} + +// ListByBillingAccountPreparer prepares the ListByBillingAccount request. +func (client AgreementsClient) ListByBillingAccountPreparer(ctx context.Context, billingAccountName string, expand string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountName": autorest.Encode("path", billingAccountName), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/agreements", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByBillingAccountSender sends the ListByBillingAccount request. The method will close the +// http.Response Body if it receives an error. +func (client AgreementsClient) ListByBillingAccountSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListByBillingAccountResponder handles the response to the ListByBillingAccount request. The method always +// closes the http.Response Body. +func (client AgreementsClient) ListByBillingAccountResponder(resp *http.Response) (result AgreementListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByBillingAccountNextResults retrieves the next set of results, if any. +func (client AgreementsClient) listByBillingAccountNextResults(ctx context.Context, lastResults AgreementListResult) (result AgreementListResult, err error) { + req, err := lastResults.agreementListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "billing.AgreementsClient", "listByBillingAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByBillingAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "billing.AgreementsClient", "listByBillingAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByBillingAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.AgreementsClient", "listByBillingAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByBillingAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client AgreementsClient) ListByBillingAccountComplete(ctx context.Context, billingAccountName string, expand string) (result AgreementListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AgreementsClient.ListByBillingAccount") + 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.ListByBillingAccount(ctx, billingAccountName, expand) + return +} diff --git a/services/preview/billing/mgmt/2020-05-01-preview/billing/availablebalances.go b/services/preview/billing/mgmt/2020-05-01-preview/billing/availablebalances.go new file mode 100644 index 000000000000..310c5f9e7784 --- /dev/null +++ b/services/preview/billing/mgmt/2020-05-01-preview/billing/availablebalances.go @@ -0,0 +1,120 @@ +package billing + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// AvailableBalancesClient is the billing client provides access to billing resources for Azure subscriptions. +type AvailableBalancesClient struct { + BaseClient +} + +// NewAvailableBalancesClient creates an instance of the AvailableBalancesClient client. +func NewAvailableBalancesClient(subscriptionID string) AvailableBalancesClient { + return NewAvailableBalancesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewAvailableBalancesClientWithBaseURI creates an instance of the AvailableBalancesClient 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 NewAvailableBalancesClientWithBaseURI(baseURI string, subscriptionID string) AvailableBalancesClient { + return AvailableBalancesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get the available credit balance for a billing profile. This is the balance that can be used for pay now to settle +// due or past due invoices. The operation is supported only for billing accounts with agreement type Microsoft +// Customer Agreement. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +// billingProfileName - the ID that uniquely identifies a billing profile. +func (client AvailableBalancesClient) Get(ctx context.Context, billingAccountName string, billingProfileName string) (result AvailableBalance, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AvailableBalancesClient.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, billingAccountName, billingProfileName) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.AvailableBalancesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.AvailableBalancesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.AvailableBalancesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client AvailableBalancesClient) GetPreparer(ctx context.Context, billingAccountName string, billingProfileName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountName": autorest.Encode("path", billingAccountName), + "billingProfileName": autorest.Encode("path", billingProfileName), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/availableBalance/default", 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 AvailableBalancesClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client AvailableBalancesClient) GetResponder(resp *http.Response) (result AvailableBalance, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/billing/mgmt/2020-05-01-preview/billing/billingapi/interfaces.go b/services/preview/billing/mgmt/2020-05-01-preview/billing/billingapi/interfaces.go new file mode 100644 index 000000000000..ad35b78a0cb0 --- /dev/null +++ b/services/preview/billing/mgmt/2020-05-01-preview/billing/billingapi/interfaces.go @@ -0,0 +1,233 @@ +package billingapi + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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/billing/mgmt/2020-05-01-preview/billing" +) + +// AccountsClientAPI contains the set of methods on the AccountsClient type. +type AccountsClientAPI interface { + Get(ctx context.Context, billingAccountName string, expand string) (result billing.Account, err error) + List(ctx context.Context, expand string) (result billing.AccountListResultPage, err error) + ListComplete(ctx context.Context, expand string) (result billing.AccountListResultIterator, err error) + ListInvoiceSectionsByCreateSubscriptionPermission(ctx context.Context, billingAccountName string) (result billing.InvoiceSectionListWithCreateSubPermissionResultPage, err error) + ListInvoiceSectionsByCreateSubscriptionPermissionComplete(ctx context.Context, billingAccountName string) (result billing.InvoiceSectionListWithCreateSubPermissionResultIterator, err error) + Update(ctx context.Context, billingAccountName string, parameters billing.AccountUpdateRequest) (result billing.AccountsUpdateFuture, err error) +} + +var _ AccountsClientAPI = (*billing.AccountsClient)(nil) + +// AddressClientAPI contains the set of methods on the AddressClient type. +type AddressClientAPI interface { + Validate(ctx context.Context, address billing.AddressDetails) (result billing.ValidateAddressResponse, err error) +} + +var _ AddressClientAPI = (*billing.AddressClient)(nil) + +// AvailableBalancesClientAPI contains the set of methods on the AvailableBalancesClient type. +type AvailableBalancesClientAPI interface { + Get(ctx context.Context, billingAccountName string, billingProfileName string) (result billing.AvailableBalance, err error) +} + +var _ AvailableBalancesClientAPI = (*billing.AvailableBalancesClient)(nil) + +// InstructionsClientAPI contains the set of methods on the InstructionsClient type. +type InstructionsClientAPI interface { + Get(ctx context.Context, billingAccountName string, billingProfileName string, instructionName string) (result billing.Instruction, err error) + ListByBillingProfile(ctx context.Context, billingAccountName string, billingProfileName string) (result billing.InstructionListResultPage, err error) + ListByBillingProfileComplete(ctx context.Context, billingAccountName string, billingProfileName string) (result billing.InstructionListResultIterator, err error) + Put(ctx context.Context, billingAccountName string, billingProfileName string, instructionName string, parameters billing.Instruction) (result billing.Instruction, err error) +} + +var _ InstructionsClientAPI = (*billing.InstructionsClient)(nil) + +// ProfilesClientAPI contains the set of methods on the ProfilesClient type. +type ProfilesClientAPI interface { + CreateOrUpdate(ctx context.Context, billingAccountName string, billingProfileName string, parameters billing.Profile) (result billing.ProfilesCreateOrUpdateFuture, err error) + Get(ctx context.Context, billingAccountName string, billingProfileName string, expand string) (result billing.Profile, err error) + ListByBillingAccount(ctx context.Context, billingAccountName string, expand string) (result billing.ProfileListResultPage, err error) + ListByBillingAccountComplete(ctx context.Context, billingAccountName string, expand string) (result billing.ProfileListResultIterator, err error) +} + +var _ ProfilesClientAPI = (*billing.ProfilesClient)(nil) + +// CustomersClientAPI contains the set of methods on the CustomersClient type. +type CustomersClientAPI interface { + Get(ctx context.Context, billingAccountName string, customerName string, expand string) (result billing.Customer, err error) + ListByBillingAccount(ctx context.Context, billingAccountName string, search string, filter string) (result billing.CustomerListResultPage, err error) + ListByBillingAccountComplete(ctx context.Context, billingAccountName string, search string, filter string) (result billing.CustomerListResultIterator, err error) + ListByBillingProfile(ctx context.Context, billingAccountName string, billingProfileName string, search string, filter string) (result billing.CustomerListResultPage, err error) + ListByBillingProfileComplete(ctx context.Context, billingAccountName string, billingProfileName string, search string, filter string) (result billing.CustomerListResultIterator, err error) +} + +var _ CustomersClientAPI = (*billing.CustomersClient)(nil) + +// InvoiceSectionsClientAPI contains the set of methods on the InvoiceSectionsClient type. +type InvoiceSectionsClientAPI interface { + CreateOrUpdate(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string, parameters billing.InvoiceSection) (result billing.InvoiceSectionsCreateOrUpdateFuture, err error) + Get(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string) (result billing.InvoiceSection, err error) + ListByBillingProfile(ctx context.Context, billingAccountName string, billingProfileName string) (result billing.InvoiceSectionListResultPage, err error) + ListByBillingProfileComplete(ctx context.Context, billingAccountName string, billingProfileName string) (result billing.InvoiceSectionListResultIterator, err error) +} + +var _ InvoiceSectionsClientAPI = (*billing.InvoiceSectionsClient)(nil) + +// PermissionsClientAPI contains the set of methods on the PermissionsClient type. +type PermissionsClientAPI interface { + ListByBillingAccount(ctx context.Context, billingAccountName string) (result billing.PermissionsListResultPage, err error) + ListByBillingAccountComplete(ctx context.Context, billingAccountName string) (result billing.PermissionsListResultIterator, err error) + ListByBillingProfile(ctx context.Context, billingAccountName string, billingProfileName string) (result billing.PermissionsListResultPage, err error) + ListByBillingProfileComplete(ctx context.Context, billingAccountName string, billingProfileName string) (result billing.PermissionsListResultIterator, err error) + ListByCustomer(ctx context.Context, billingAccountName string, customerName string) (result billing.PermissionsListResultPage, err error) + ListByCustomerComplete(ctx context.Context, billingAccountName string, customerName string) (result billing.PermissionsListResultIterator, err error) + ListByInvoiceSections(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string) (result billing.PermissionsListResultPage, err error) + ListByInvoiceSectionsComplete(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string) (result billing.PermissionsListResultIterator, err error) +} + +var _ PermissionsClientAPI = (*billing.PermissionsClient)(nil) + +// SubscriptionsClientAPI contains the set of methods on the SubscriptionsClient type. +type SubscriptionsClientAPI interface { + Get(ctx context.Context, billingAccountName string) (result billing.Subscription, err error) + ListByBillingAccount(ctx context.Context, billingAccountName string) (result billing.SubscriptionsListResultPage, err error) + ListByBillingAccountComplete(ctx context.Context, billingAccountName string) (result billing.SubscriptionsListResultIterator, err error) + ListByBillingProfile(ctx context.Context, billingAccountName string, billingProfileName string) (result billing.SubscriptionsListResultPage, err error) + ListByBillingProfileComplete(ctx context.Context, billingAccountName string, billingProfileName string) (result billing.SubscriptionsListResultIterator, err error) + ListByCustomer(ctx context.Context, billingAccountName string, customerName string) (result billing.SubscriptionsListResultPage, err error) + ListByCustomerComplete(ctx context.Context, billingAccountName string, customerName string) (result billing.SubscriptionsListResultIterator, err error) + ListByInvoiceSection(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string) (result billing.SubscriptionsListResultPage, err error) + ListByInvoiceSectionComplete(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string) (result billing.SubscriptionsListResultIterator, err error) + Move(ctx context.Context, billingAccountName string, parameters billing.TransferBillingSubscriptionRequestProperties) (result billing.SubscriptionsMoveFuture, err error) + Update(ctx context.Context, billingAccountName string, parameters billing.Subscription) (result billing.Subscription, err error) + ValidateMove(ctx context.Context, billingAccountName string, parameters billing.TransferBillingSubscriptionRequestProperties) (result billing.ValidateSubscriptionTransferEligibilityResult, err error) +} + +var _ SubscriptionsClientAPI = (*billing.SubscriptionsClient)(nil) + +// ProductsClientAPI contains the set of methods on the ProductsClient type. +type ProductsClientAPI interface { + Get(ctx context.Context, billingAccountName string, productName string) (result billing.Product, err error) + ListByBillingAccount(ctx context.Context, billingAccountName string, filter string) (result billing.ProductsListResultPage, err error) + ListByBillingAccountComplete(ctx context.Context, billingAccountName string, filter string) (result billing.ProductsListResultIterator, err error) + ListByBillingProfile(ctx context.Context, billingAccountName string, billingProfileName string, filter string) (result billing.ProductsListResultPage, err error) + ListByBillingProfileComplete(ctx context.Context, billingAccountName string, billingProfileName string, filter string) (result billing.ProductsListResultIterator, err error) + ListByCustomer(ctx context.Context, billingAccountName string, customerName string) (result billing.ProductsListResultPage, err error) + ListByCustomerComplete(ctx context.Context, billingAccountName string, customerName string) (result billing.ProductsListResultIterator, err error) + ListByInvoiceSection(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string, filter string) (result billing.ProductsListResultPage, err error) + ListByInvoiceSectionComplete(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string, filter string) (result billing.ProductsListResultIterator, err error) + Move(ctx context.Context, billingAccountName string, productName string, parameters billing.TransferProductRequestProperties) (result billing.Product, err error) + Update(ctx context.Context, billingAccountName string, productName string, parameters billing.Product) (result billing.Product, err error) + ValidateMove(ctx context.Context, billingAccountName string, productName string, parameters billing.TransferProductRequestProperties) (result billing.ValidateProductTransferEligibilityResult, err error) +} + +var _ ProductsClientAPI = (*billing.ProductsClient)(nil) + +// InvoicesClientAPI contains the set of methods on the InvoicesClient type. +type InvoicesClientAPI interface { + DownloadBillingSubscriptionInvoice(ctx context.Context, invoiceName string, downloadToken string) (result billing.InvoicesDownloadBillingSubscriptionInvoiceFuture, err error) + DownloadInvoice(ctx context.Context, billingAccountName string, invoiceName string) (result billing.InvoicesDownloadInvoiceFuture, err error) + Get(ctx context.Context, billingAccountName string, invoiceName string) (result billing.Invoice, err error) + GetByID(ctx context.Context, invoiceName string) (result billing.Invoice, err error) + GetBySubscriptionAndInvoiceID(ctx context.Context, invoiceName string) (result billing.Invoice, err error) + ListByBillingAccount(ctx context.Context, billingAccountName string, periodStartDate string, periodEndDate string) (result billing.InvoiceListResultPage, err error) + ListByBillingAccountComplete(ctx context.Context, billingAccountName string, periodStartDate string, periodEndDate string) (result billing.InvoiceListResultIterator, err error) + ListByBillingProfile(ctx context.Context, billingAccountName string, billingProfileName string, periodStartDate string, periodEndDate string) (result billing.InvoiceListResultPage, err error) + ListByBillingProfileComplete(ctx context.Context, billingAccountName string, billingProfileName string, periodStartDate string, periodEndDate string) (result billing.InvoiceListResultIterator, err error) + ListByBillingSubscription(ctx context.Context, periodStartDate string, periodEndDate string) (result billing.InvoiceListResultPage, err error) + ListByBillingSubscriptionComplete(ctx context.Context, periodStartDate string, periodEndDate string) (result billing.InvoiceListResultIterator, err error) +} + +var _ InvoicesClientAPI = (*billing.InvoicesClient)(nil) + +// TransactionsClientAPI contains the set of methods on the TransactionsClient type. +type TransactionsClientAPI interface { + ListByInvoice(ctx context.Context, billingAccountName string, invoiceName string) (result billing.TransactionListResultPage, err error) + ListByInvoiceComplete(ctx context.Context, billingAccountName string, invoiceName string) (result billing.TransactionListResultIterator, err error) +} + +var _ TransactionsClientAPI = (*billing.TransactionsClient)(nil) + +// PoliciesClientAPI contains the set of methods on the PoliciesClient type. +type PoliciesClientAPI interface { + GetByBillingProfile(ctx context.Context, billingAccountName string, billingProfileName string) (result billing.Policy, err error) + GetByCustomer(ctx context.Context, billingAccountName string, customerName string) (result billing.CustomerPolicy, err error) + Update(ctx context.Context, billingAccountName string, billingProfileName string, parameters billing.Policy) (result billing.Policy, err error) + UpdateCustomer(ctx context.Context, billingAccountName string, customerName string, parameters billing.CustomerPolicy) (result billing.CustomerPolicy, err error) +} + +var _ PoliciesClientAPI = (*billing.PoliciesClient)(nil) + +// PropertyClientAPI contains the set of methods on the PropertyClient type. +type PropertyClientAPI interface { + Get(ctx context.Context) (result billing.Property, err error) + Update(ctx context.Context, parameters billing.Property) (result billing.Property, err error) +} + +var _ PropertyClientAPI = (*billing.PropertyClient)(nil) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result billing.OperationListResultPage, err error) + ListComplete(ctx context.Context) (result billing.OperationListResultIterator, err error) +} + +var _ OperationsClientAPI = (*billing.OperationsClient)(nil) + +// RoleDefinitionsClientAPI contains the set of methods on the RoleDefinitionsClient type. +type RoleDefinitionsClientAPI interface { + GetByBillingAccount(ctx context.Context, billingAccountName string, billingRoleDefinitionName string) (result billing.RoleDefinition, err error) + GetByBillingProfile(ctx context.Context, billingAccountName string, billingProfileName string, billingRoleDefinitionName string) (result billing.RoleDefinition, err error) + GetByInvoiceSection(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string, billingRoleDefinitionName string) (result billing.RoleDefinition, err error) + ListByBillingAccount(ctx context.Context, billingAccountName string) (result billing.RoleDefinitionListResultPage, err error) + ListByBillingAccountComplete(ctx context.Context, billingAccountName string) (result billing.RoleDefinitionListResultIterator, err error) + ListByBillingProfile(ctx context.Context, billingAccountName string, billingProfileName string) (result billing.RoleDefinitionListResultPage, err error) + ListByBillingProfileComplete(ctx context.Context, billingAccountName string, billingProfileName string) (result billing.RoleDefinitionListResultIterator, err error) + ListByInvoiceSection(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string) (result billing.RoleDefinitionListResultPage, err error) + ListByInvoiceSectionComplete(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string) (result billing.RoleDefinitionListResultIterator, err error) +} + +var _ RoleDefinitionsClientAPI = (*billing.RoleDefinitionsClient)(nil) + +// RoleAssignmentsClientAPI contains the set of methods on the RoleAssignmentsClient type. +type RoleAssignmentsClientAPI interface { + DeleteByBillingAccount(ctx context.Context, billingAccountName string, billingRoleAssignmentName string) (result billing.RoleAssignment, err error) + DeleteByBillingProfile(ctx context.Context, billingAccountName string, billingProfileName string, billingRoleAssignmentName string) (result billing.RoleAssignment, err error) + DeleteByInvoiceSection(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string, billingRoleAssignmentName string) (result billing.RoleAssignment, err error) + GetByBillingAccount(ctx context.Context, billingAccountName string, billingRoleAssignmentName string) (result billing.RoleAssignment, err error) + GetByBillingProfile(ctx context.Context, billingAccountName string, billingProfileName string, billingRoleAssignmentName string) (result billing.RoleAssignment, err error) + GetByInvoiceSection(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string, billingRoleAssignmentName string) (result billing.RoleAssignment, err error) + ListByBillingAccount(ctx context.Context, billingAccountName string) (result billing.RoleAssignmentListResultPage, err error) + ListByBillingAccountComplete(ctx context.Context, billingAccountName string) (result billing.RoleAssignmentListResultIterator, err error) + ListByBillingProfile(ctx context.Context, billingAccountName string, billingProfileName string) (result billing.RoleAssignmentListResultPage, err error) + ListByBillingProfileComplete(ctx context.Context, billingAccountName string, billingProfileName string) (result billing.RoleAssignmentListResultIterator, err error) + ListByInvoiceSection(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string) (result billing.RoleAssignmentListResultPage, err error) + ListByInvoiceSectionComplete(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string) (result billing.RoleAssignmentListResultIterator, err error) +} + +var _ RoleAssignmentsClientAPI = (*billing.RoleAssignmentsClient)(nil) + +// AgreementsClientAPI contains the set of methods on the AgreementsClient type. +type AgreementsClientAPI interface { + Get(ctx context.Context, billingAccountName string, agreementName string, expand string) (result billing.Agreement, err error) + ListByBillingAccount(ctx context.Context, billingAccountName string, expand string) (result billing.AgreementListResultPage, err error) + ListByBillingAccountComplete(ctx context.Context, billingAccountName string, expand string) (result billing.AgreementListResultIterator, err error) +} + +var _ AgreementsClientAPI = (*billing.AgreementsClient)(nil) diff --git a/services/preview/billing/mgmt/2020-05-01-preview/billing/client.go b/services/preview/billing/mgmt/2020-05-01-preview/billing/client.go new file mode 100644 index 000000000000..ee477d8660c5 --- /dev/null +++ b/services/preview/billing/mgmt/2020-05-01-preview/billing/client.go @@ -0,0 +1,52 @@ +// Package billing implements the Azure ARM Billing service API version 2020-05-01. +// +// Billing client provides access to billing resources for Azure subscriptions. +package billing + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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 Billing + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Billing. +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/billing/mgmt/2020-05-01-preview/billing/customers.go b/services/preview/billing/mgmt/2020-05-01-preview/billing/customers.go new file mode 100644 index 000000000000..da477f88fc84 --- /dev/null +++ b/services/preview/billing/mgmt/2020-05-01-preview/billing/customers.go @@ -0,0 +1,366 @@ +package billing + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// CustomersClient is the billing client provides access to billing resources for Azure subscriptions. +type CustomersClient struct { + BaseClient +} + +// NewCustomersClient creates an instance of the CustomersClient client. +func NewCustomersClient(subscriptionID string) CustomersClient { + return NewCustomersClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewCustomersClientWithBaseURI creates an instance of the CustomersClient 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 NewCustomersClientWithBaseURI(baseURI string, subscriptionID string) CustomersClient { + return CustomersClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get gets a customer by its ID. The operation is supported only for billing accounts with agreement type Microsoft +// Partner Agreement. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +// customerName - the ID that uniquely identifies a customer. +// expand - may be used to expand enabledAzurePlans and resellers +func (client CustomersClient) Get(ctx context.Context, billingAccountName string, customerName string, expand string) (result Customer, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomersClient.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, billingAccountName, customerName, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.CustomersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.CustomersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.CustomersClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client CustomersClient) GetPreparer(ctx context.Context, billingAccountName string, customerName string, expand string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountName": autorest.Encode("path", billingAccountName), + "customerName": autorest.Encode("path", customerName), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}", 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 CustomersClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client CustomersClient) GetResponder(resp *http.Response) (result Customer, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByBillingAccount lists the customers that are billed to a billing account. The operation is supported only for +// billing accounts with agreement type Microsoft Partner Agreement. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +// search - used for searching customers by their name. Any customer with name containing the search text will +// be included in the response +// filter - may be used to filter the list of customers. +func (client CustomersClient) ListByBillingAccount(ctx context.Context, billingAccountName string, search string, filter string) (result CustomerListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomersClient.ListByBillingAccount") + defer func() { + sc := -1 + if result.clr.Response.Response != nil { + sc = result.clr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByBillingAccountNextResults + req, err := client.ListByBillingAccountPreparer(ctx, billingAccountName, search, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.CustomersClient", "ListByBillingAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByBillingAccountSender(req) + if err != nil { + result.clr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.CustomersClient", "ListByBillingAccount", resp, "Failure sending request") + return + } + + result.clr, err = client.ListByBillingAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.CustomersClient", "ListByBillingAccount", resp, "Failure responding to request") + } + + return +} + +// ListByBillingAccountPreparer prepares the ListByBillingAccount request. +func (client CustomersClient) ListByBillingAccountPreparer(ctx context.Context, billingAccountName string, search string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountName": autorest.Encode("path", billingAccountName), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(search) > 0 { + queryParameters["$search"] = autorest.Encode("query", search) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByBillingAccountSender sends the ListByBillingAccount request. The method will close the +// http.Response Body if it receives an error. +func (client CustomersClient) ListByBillingAccountSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListByBillingAccountResponder handles the response to the ListByBillingAccount request. The method always +// closes the http.Response Body. +func (client CustomersClient) ListByBillingAccountResponder(resp *http.Response) (result CustomerListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByBillingAccountNextResults retrieves the next set of results, if any. +func (client CustomersClient) listByBillingAccountNextResults(ctx context.Context, lastResults CustomerListResult) (result CustomerListResult, err error) { + req, err := lastResults.customerListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "billing.CustomersClient", "listByBillingAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByBillingAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "billing.CustomersClient", "listByBillingAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByBillingAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.CustomersClient", "listByBillingAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByBillingAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client CustomersClient) ListByBillingAccountComplete(ctx context.Context, billingAccountName string, search string, filter string) (result CustomerListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomersClient.ListByBillingAccount") + 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.ListByBillingAccount(ctx, billingAccountName, search, filter) + return +} + +// ListByBillingProfile lists the customers that are billed to a billing profile. The operation is supported only for +// billing accounts with agreement type Microsoft Partner Agreement. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +// billingProfileName - the ID that uniquely identifies a billing profile. +// search - used for searching customers by their name. Any customer with name containing the search text will +// be included in the response +// filter - may be used to filter the list of customers. +func (client CustomersClient) ListByBillingProfile(ctx context.Context, billingAccountName string, billingProfileName string, search string, filter string) (result CustomerListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomersClient.ListByBillingProfile") + defer func() { + sc := -1 + if result.clr.Response.Response != nil { + sc = result.clr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByBillingProfileNextResults + req, err := client.ListByBillingProfilePreparer(ctx, billingAccountName, billingProfileName, search, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.CustomersClient", "ListByBillingProfile", nil, "Failure preparing request") + return + } + + resp, err := client.ListByBillingProfileSender(req) + if err != nil { + result.clr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.CustomersClient", "ListByBillingProfile", resp, "Failure sending request") + return + } + + result.clr, err = client.ListByBillingProfileResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.CustomersClient", "ListByBillingProfile", resp, "Failure responding to request") + } + + return +} + +// ListByBillingProfilePreparer prepares the ListByBillingProfile request. +func (client CustomersClient) ListByBillingProfilePreparer(ctx context.Context, billingAccountName string, billingProfileName string, search string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountName": autorest.Encode("path", billingAccountName), + "billingProfileName": autorest.Encode("path", billingProfileName), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(search) > 0 { + queryParameters["$search"] = autorest.Encode("query", search) + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/customers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByBillingProfileSender sends the ListByBillingProfile request. The method will close the +// http.Response Body if it receives an error. +func (client CustomersClient) ListByBillingProfileSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListByBillingProfileResponder handles the response to the ListByBillingProfile request. The method always +// closes the http.Response Body. +func (client CustomersClient) ListByBillingProfileResponder(resp *http.Response) (result CustomerListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByBillingProfileNextResults retrieves the next set of results, if any. +func (client CustomersClient) listByBillingProfileNextResults(ctx context.Context, lastResults CustomerListResult) (result CustomerListResult, err error) { + req, err := lastResults.customerListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "billing.CustomersClient", "listByBillingProfileNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByBillingProfileSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "billing.CustomersClient", "listByBillingProfileNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByBillingProfileResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.CustomersClient", "listByBillingProfileNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByBillingProfileComplete enumerates all values, automatically crossing page boundaries as required. +func (client CustomersClient) ListByBillingProfileComplete(ctx context.Context, billingAccountName string, billingProfileName string, search string, filter string) (result CustomerListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomersClient.ListByBillingProfile") + 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.ListByBillingProfile(ctx, billingAccountName, billingProfileName, search, filter) + return +} diff --git a/services/preview/billing/mgmt/2020-05-01-preview/billing/instructions.go b/services/preview/billing/mgmt/2020-05-01-preview/billing/instructions.go new file mode 100644 index 000000000000..d207ae0cc980 --- /dev/null +++ b/services/preview/billing/mgmt/2020-05-01-preview/billing/instructions.go @@ -0,0 +1,325 @@ +package billing + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// InstructionsClient is the billing client provides access to billing resources for Azure subscriptions. +type InstructionsClient struct { + BaseClient +} + +// NewInstructionsClient creates an instance of the InstructionsClient client. +func NewInstructionsClient(subscriptionID string) InstructionsClient { + return NewInstructionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewInstructionsClientWithBaseURI creates an instance of the InstructionsClient 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 NewInstructionsClientWithBaseURI(baseURI string, subscriptionID string) InstructionsClient { + return InstructionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get get the instruction by name. These are custom billing instructions and are only applicable for certain +// customers. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +// billingProfileName - the ID that uniquely identifies a billing profile. +// instructionName - instruction Name. +func (client InstructionsClient) Get(ctx context.Context, billingAccountName string, billingProfileName string, instructionName string) (result Instruction, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/InstructionsClient.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, billingAccountName, billingProfileName, instructionName) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.InstructionsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.InstructionsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.InstructionsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client InstructionsClient) GetPreparer(ctx context.Context, billingAccountName string, billingProfileName string, instructionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountName": autorest.Encode("path", billingAccountName), + "billingProfileName": autorest.Encode("path", billingProfileName), + "instructionName": autorest.Encode("path", instructionName), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/instructions/{instructionName}", 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 InstructionsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client InstructionsClient) GetResponder(resp *http.Response) (result Instruction, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByBillingProfile lists the instructions by billing profile id. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +// billingProfileName - the ID that uniquely identifies a billing profile. +func (client InstructionsClient) ListByBillingProfile(ctx context.Context, billingAccountName string, billingProfileName string) (result InstructionListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/InstructionsClient.ListByBillingProfile") + defer func() { + sc := -1 + if result.ilr.Response.Response != nil { + sc = result.ilr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByBillingProfileNextResults + req, err := client.ListByBillingProfilePreparer(ctx, billingAccountName, billingProfileName) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.InstructionsClient", "ListByBillingProfile", nil, "Failure preparing request") + return + } + + resp, err := client.ListByBillingProfileSender(req) + if err != nil { + result.ilr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.InstructionsClient", "ListByBillingProfile", resp, "Failure sending request") + return + } + + result.ilr, err = client.ListByBillingProfileResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.InstructionsClient", "ListByBillingProfile", resp, "Failure responding to request") + } + + return +} + +// ListByBillingProfilePreparer prepares the ListByBillingProfile request. +func (client InstructionsClient) ListByBillingProfilePreparer(ctx context.Context, billingAccountName string, billingProfileName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountName": autorest.Encode("path", billingAccountName), + "billingProfileName": autorest.Encode("path", billingProfileName), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/instructions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByBillingProfileSender sends the ListByBillingProfile request. The method will close the +// http.Response Body if it receives an error. +func (client InstructionsClient) ListByBillingProfileSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListByBillingProfileResponder handles the response to the ListByBillingProfile request. The method always +// closes the http.Response Body. +func (client InstructionsClient) ListByBillingProfileResponder(resp *http.Response) (result InstructionListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByBillingProfileNextResults retrieves the next set of results, if any. +func (client InstructionsClient) listByBillingProfileNextResults(ctx context.Context, lastResults InstructionListResult) (result InstructionListResult, err error) { + req, err := lastResults.instructionListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "billing.InstructionsClient", "listByBillingProfileNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByBillingProfileSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "billing.InstructionsClient", "listByBillingProfileNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByBillingProfileResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.InstructionsClient", "listByBillingProfileNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByBillingProfileComplete enumerates all values, automatically crossing page boundaries as required. +func (client InstructionsClient) ListByBillingProfileComplete(ctx context.Context, billingAccountName string, billingProfileName string) (result InstructionListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/InstructionsClient.ListByBillingProfile") + 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.ListByBillingProfile(ctx, billingAccountName, billingProfileName) + return +} + +// Put creates or updates an instruction. These are custom billing instructions and are only applicable for certain +// customers. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +// billingProfileName - the ID that uniquely identifies a billing profile. +// instructionName - instruction Name. +// parameters - the new instruction. +func (client InstructionsClient) Put(ctx context.Context, billingAccountName string, billingProfileName string, instructionName string, parameters Instruction) (result Instruction, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/InstructionsClient.Put") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.InstructionProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.InstructionProperties.Amount", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.InstructionProperties.StartDate", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.InstructionProperties.EndDate", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("billing.InstructionsClient", "Put", err.Error()) + } + + req, err := client.PutPreparer(ctx, billingAccountName, billingProfileName, instructionName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.InstructionsClient", "Put", nil, "Failure preparing request") + return + } + + resp, err := client.PutSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.InstructionsClient", "Put", resp, "Failure sending request") + return + } + + result, err = client.PutResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.InstructionsClient", "Put", resp, "Failure responding to request") + } + + return +} + +// PutPreparer prepares the Put request. +func (client InstructionsClient) PutPreparer(ctx context.Context, billingAccountName string, billingProfileName string, instructionName string, parameters Instruction) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountName": autorest.Encode("path", billingAccountName), + "billingProfileName": autorest.Encode("path", billingProfileName), + "instructionName": autorest.Encode("path", instructionName), + } + + const APIVersion = "2020-05-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.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/instructions/{instructionName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PutSender sends the Put request. The method will close the +// http.Response Body if it receives an error. +func (client InstructionsClient) PutSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// PutResponder handles the response to the Put request. The method always +// closes the http.Response Body. +func (client InstructionsClient) PutResponder(resp *http.Response) (result Instruction, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/billing/mgmt/2020-05-01-preview/billing/invoices.go b/services/preview/billing/mgmt/2020-05-01-preview/billing/invoices.go new file mode 100644 index 000000000000..1bf7f3b8eb9c --- /dev/null +++ b/services/preview/billing/mgmt/2020-05-01-preview/billing/invoices.go @@ -0,0 +1,766 @@ +package billing + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// InvoicesClient is the billing client provides access to billing resources for Azure subscriptions. +type InvoicesClient struct { + BaseClient +} + +// NewInvoicesClient creates an instance of the InvoicesClient client. +func NewInvoicesClient(subscriptionID string) InvoicesClient { + return NewInvoicesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewInvoicesClientWithBaseURI creates an instance of the InvoicesClient 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 NewInvoicesClientWithBaseURI(baseURI string, subscriptionID string) InvoicesClient { + return InvoicesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// DownloadBillingSubscriptionInvoice gets a URL to download an invoice. +// Parameters: +// invoiceName - the ID that uniquely identifies an invoice. +// downloadToken - download token with document source and document ID. +func (client InvoicesClient) DownloadBillingSubscriptionInvoice(ctx context.Context, invoiceName string, downloadToken string) (result InvoicesDownloadBillingSubscriptionInvoiceFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/InvoicesClient.DownloadBillingSubscriptionInvoice") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DownloadBillingSubscriptionInvoicePreparer(ctx, invoiceName, downloadToken) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.InvoicesClient", "DownloadBillingSubscriptionInvoice", nil, "Failure preparing request") + return + } + + result, err = client.DownloadBillingSubscriptionInvoiceSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.InvoicesClient", "DownloadBillingSubscriptionInvoice", result.Response(), "Failure sending request") + return + } + + return +} + +// DownloadBillingSubscriptionInvoicePreparer prepares the DownloadBillingSubscriptionInvoice request. +func (client InvoicesClient) DownloadBillingSubscriptionInvoicePreparer(ctx context.Context, invoiceName string, downloadToken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "invoiceName": autorest.Encode("path", invoiceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + "downloadToken": autorest.Encode("query", downloadToken), + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices/{invoiceName}/download", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DownloadBillingSubscriptionInvoiceSender sends the DownloadBillingSubscriptionInvoice request. The method will close the +// http.Response Body if it receives an error. +func (client InvoicesClient) DownloadBillingSubscriptionInvoiceSender(req *http.Request) (future InvoicesDownloadBillingSubscriptionInvoiceFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DownloadBillingSubscriptionInvoiceResponder handles the response to the DownloadBillingSubscriptionInvoice request. The method always +// closes the http.Response Body. +func (client InvoicesClient) DownloadBillingSubscriptionInvoiceResponder(resp *http.Response) (result DownloadURL, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// DownloadInvoice gets a URL to download an invoice. The operation is supported for billing accounts with agreement +// type Microsoft Partner Agreement or Microsoft Customer Agreement. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +// invoiceName - the ID that uniquely identifies an invoice. +func (client InvoicesClient) DownloadInvoice(ctx context.Context, billingAccountName string, invoiceName string) (result InvoicesDownloadInvoiceFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/InvoicesClient.DownloadInvoice") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DownloadInvoicePreparer(ctx, billingAccountName, invoiceName) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.InvoicesClient", "DownloadInvoice", nil, "Failure preparing request") + return + } + + result, err = client.DownloadInvoiceSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.InvoicesClient", "DownloadInvoice", result.Response(), "Failure sending request") + return + } + + return +} + +// DownloadInvoicePreparer prepares the DownloadInvoice request. +func (client InvoicesClient) DownloadInvoicePreparer(ctx context.Context, billingAccountName string, invoiceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountName": autorest.Encode("path", billingAccountName), + "invoiceName": autorest.Encode("path", invoiceName), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/download", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DownloadInvoiceSender sends the DownloadInvoice request. The method will close the +// http.Response Body if it receives an error. +func (client InvoicesClient) DownloadInvoiceSender(req *http.Request) (future InvoicesDownloadInvoiceFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DownloadInvoiceResponder handles the response to the DownloadInvoice request. The method always +// closes the http.Response Body. +func (client InvoicesClient) DownloadInvoiceResponder(resp *http.Response) (result DownloadURL, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets an invoice by billing account name and ID. The operation is supported for billing accounts with agreement +// type Microsoft Partner Agreement or Microsoft Customer Agreement. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +// invoiceName - the ID that uniquely identifies an invoice. +func (client InvoicesClient) Get(ctx context.Context, billingAccountName string, invoiceName string) (result Invoice, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/InvoicesClient.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, billingAccountName, invoiceName) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.InvoicesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.InvoicesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.InvoicesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client InvoicesClient) GetPreparer(ctx context.Context, billingAccountName string, invoiceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountName": autorest.Encode("path", billingAccountName), + "invoiceName": autorest.Encode("path", invoiceName), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}", 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 InvoicesClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client InvoicesClient) GetResponder(resp *http.Response) (result Invoice, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetByID gets an invoice by ID. The operation is supported for billing accounts with agreement type Microsoft Partner +// Agreement or Microsoft Customer Agreement. +// Parameters: +// invoiceName - the ID that uniquely identifies an invoice. +func (client InvoicesClient) GetByID(ctx context.Context, invoiceName string) (result Invoice, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/InvoicesClient.GetByID") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetByIDPreparer(ctx, invoiceName) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.InvoicesClient", "GetByID", nil, "Failure preparing request") + return + } + + resp, err := client.GetByIDSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.InvoicesClient", "GetByID", resp, "Failure sending request") + return + } + + result, err = client.GetByIDResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.InvoicesClient", "GetByID", resp, "Failure responding to request") + } + + return +} + +// GetByIDPreparer prepares the GetByID request. +func (client InvoicesClient) GetByIDPreparer(ctx context.Context, invoiceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "invoiceName": autorest.Encode("path", invoiceName), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Billing/billingAccounts/default/invoices/{invoiceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetByIDSender sends the GetByID request. The method will close the +// http.Response Body if it receives an error. +func (client InvoicesClient) GetByIDSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetByIDResponder handles the response to the GetByID request. The method always +// closes the http.Response Body. +func (client InvoicesClient) GetByIDResponder(resp *http.Response) (result Invoice, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetBySubscriptionAndInvoiceID gets an invoice by subscription ID and invoice ID. +// Parameters: +// invoiceName - the ID that uniquely identifies an invoice. +func (client InvoicesClient) GetBySubscriptionAndInvoiceID(ctx context.Context, invoiceName string) (result Invoice, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/InvoicesClient.GetBySubscriptionAndInvoiceID") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetBySubscriptionAndInvoiceIDPreparer(ctx, invoiceName) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.InvoicesClient", "GetBySubscriptionAndInvoiceID", nil, "Failure preparing request") + return + } + + resp, err := client.GetBySubscriptionAndInvoiceIDSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.InvoicesClient", "GetBySubscriptionAndInvoiceID", resp, "Failure sending request") + return + } + + result, err = client.GetBySubscriptionAndInvoiceIDResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.InvoicesClient", "GetBySubscriptionAndInvoiceID", resp, "Failure responding to request") + } + + return +} + +// GetBySubscriptionAndInvoiceIDPreparer prepares the GetBySubscriptionAndInvoiceID request. +func (client InvoicesClient) GetBySubscriptionAndInvoiceIDPreparer(ctx context.Context, invoiceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "invoiceName": autorest.Encode("path", invoiceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices/{invoiceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetBySubscriptionAndInvoiceIDSender sends the GetBySubscriptionAndInvoiceID request. The method will close the +// http.Response Body if it receives an error. +func (client InvoicesClient) GetBySubscriptionAndInvoiceIDSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetBySubscriptionAndInvoiceIDResponder handles the response to the GetBySubscriptionAndInvoiceID request. The method always +// closes the http.Response Body. +func (client InvoicesClient) GetBySubscriptionAndInvoiceIDResponder(resp *http.Response) (result Invoice, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByBillingAccount lists the invoices for a billing account for a given start date and end date. The operation is +// supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +// periodStartDate - the start date to fetch the invoices. The date should be specified in MM-DD-YYYY format. +// periodEndDate - the end date to fetch the invoices. The date should be specified in MM-DD-YYYY format. +func (client InvoicesClient) ListByBillingAccount(ctx context.Context, billingAccountName string, periodStartDate string, periodEndDate string) (result InvoiceListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/InvoicesClient.ListByBillingAccount") + defer func() { + sc := -1 + if result.ilr.Response.Response != nil { + sc = result.ilr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByBillingAccountNextResults + req, err := client.ListByBillingAccountPreparer(ctx, billingAccountName, periodStartDate, periodEndDate) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.InvoicesClient", "ListByBillingAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByBillingAccountSender(req) + if err != nil { + result.ilr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.InvoicesClient", "ListByBillingAccount", resp, "Failure sending request") + return + } + + result.ilr, err = client.ListByBillingAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.InvoicesClient", "ListByBillingAccount", resp, "Failure responding to request") + } + + return +} + +// ListByBillingAccountPreparer prepares the ListByBillingAccount request. +func (client InvoicesClient) ListByBillingAccountPreparer(ctx context.Context, billingAccountName string, periodStartDate string, periodEndDate string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountName": autorest.Encode("path", billingAccountName), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + "periodEndDate": autorest.Encode("query", periodEndDate), + "periodStartDate": autorest.Encode("query", periodStartDate), + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByBillingAccountSender sends the ListByBillingAccount request. The method will close the +// http.Response Body if it receives an error. +func (client InvoicesClient) ListByBillingAccountSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListByBillingAccountResponder handles the response to the ListByBillingAccount request. The method always +// closes the http.Response Body. +func (client InvoicesClient) ListByBillingAccountResponder(resp *http.Response) (result InvoiceListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByBillingAccountNextResults retrieves the next set of results, if any. +func (client InvoicesClient) listByBillingAccountNextResults(ctx context.Context, lastResults InvoiceListResult) (result InvoiceListResult, err error) { + req, err := lastResults.invoiceListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "billing.InvoicesClient", "listByBillingAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByBillingAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "billing.InvoicesClient", "listByBillingAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByBillingAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.InvoicesClient", "listByBillingAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByBillingAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client InvoicesClient) ListByBillingAccountComplete(ctx context.Context, billingAccountName string, periodStartDate string, periodEndDate string) (result InvoiceListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/InvoicesClient.ListByBillingAccount") + 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.ListByBillingAccount(ctx, billingAccountName, periodStartDate, periodEndDate) + return +} + +// ListByBillingProfile lists the invoices for a billing profile for a given start date and end date. The operation is +// supported for billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +// billingProfileName - the ID that uniquely identifies a billing profile. +// periodStartDate - the start date to fetch the invoices. The date should be specified in MM-DD-YYYY format. +// periodEndDate - the end date to fetch the invoices. The date should be specified in MM-DD-YYYY format. +func (client InvoicesClient) ListByBillingProfile(ctx context.Context, billingAccountName string, billingProfileName string, periodStartDate string, periodEndDate string) (result InvoiceListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/InvoicesClient.ListByBillingProfile") + defer func() { + sc := -1 + if result.ilr.Response.Response != nil { + sc = result.ilr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByBillingProfileNextResults + req, err := client.ListByBillingProfilePreparer(ctx, billingAccountName, billingProfileName, periodStartDate, periodEndDate) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.InvoicesClient", "ListByBillingProfile", nil, "Failure preparing request") + return + } + + resp, err := client.ListByBillingProfileSender(req) + if err != nil { + result.ilr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.InvoicesClient", "ListByBillingProfile", resp, "Failure sending request") + return + } + + result.ilr, err = client.ListByBillingProfileResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.InvoicesClient", "ListByBillingProfile", resp, "Failure responding to request") + } + + return +} + +// ListByBillingProfilePreparer prepares the ListByBillingProfile request. +func (client InvoicesClient) ListByBillingProfilePreparer(ctx context.Context, billingAccountName string, billingProfileName string, periodStartDate string, periodEndDate string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountName": autorest.Encode("path", billingAccountName), + "billingProfileName": autorest.Encode("path", billingProfileName), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + "periodEndDate": autorest.Encode("query", periodEndDate), + "periodStartDate": autorest.Encode("query", periodStartDate), + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoices", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByBillingProfileSender sends the ListByBillingProfile request. The method will close the +// http.Response Body if it receives an error. +func (client InvoicesClient) ListByBillingProfileSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListByBillingProfileResponder handles the response to the ListByBillingProfile request. The method always +// closes the http.Response Body. +func (client InvoicesClient) ListByBillingProfileResponder(resp *http.Response) (result InvoiceListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByBillingProfileNextResults retrieves the next set of results, if any. +func (client InvoicesClient) listByBillingProfileNextResults(ctx context.Context, lastResults InvoiceListResult) (result InvoiceListResult, err error) { + req, err := lastResults.invoiceListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "billing.InvoicesClient", "listByBillingProfileNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByBillingProfileSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "billing.InvoicesClient", "listByBillingProfileNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByBillingProfileResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.InvoicesClient", "listByBillingProfileNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByBillingProfileComplete enumerates all values, automatically crossing page boundaries as required. +func (client InvoicesClient) ListByBillingProfileComplete(ctx context.Context, billingAccountName string, billingProfileName string, periodStartDate string, periodEndDate string) (result InvoiceListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/InvoicesClient.ListByBillingProfile") + 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.ListByBillingProfile(ctx, billingAccountName, billingProfileName, periodStartDate, periodEndDate) + return +} + +// ListByBillingSubscription lists the invoices for a subscription. +// Parameters: +// periodStartDate - invoice period start date. +// periodEndDate - invoice period end date. +func (client InvoicesClient) ListByBillingSubscription(ctx context.Context, periodStartDate string, periodEndDate string) (result InvoiceListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/InvoicesClient.ListByBillingSubscription") + defer func() { + sc := -1 + if result.ilr.Response.Response != nil { + sc = result.ilr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByBillingSubscriptionNextResults + req, err := client.ListByBillingSubscriptionPreparer(ctx, periodStartDate, periodEndDate) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.InvoicesClient", "ListByBillingSubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListByBillingSubscriptionSender(req) + if err != nil { + result.ilr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.InvoicesClient", "ListByBillingSubscription", resp, "Failure sending request") + return + } + + result.ilr, err = client.ListByBillingSubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.InvoicesClient", "ListByBillingSubscription", resp, "Failure responding to request") + } + + return +} + +// ListByBillingSubscriptionPreparer prepares the ListByBillingSubscription request. +func (client InvoicesClient) ListByBillingSubscriptionPreparer(ctx context.Context, periodStartDate string, periodEndDate string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + "periodEndDate": autorest.Encode("query", periodEndDate), + "periodStartDate": autorest.Encode("query", periodStartDate), + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Billing/billingAccounts/default/billingSubscriptions/{subscriptionId}/invoices", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByBillingSubscriptionSender sends the ListByBillingSubscription request. The method will close the +// http.Response Body if it receives an error. +func (client InvoicesClient) ListByBillingSubscriptionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListByBillingSubscriptionResponder handles the response to the ListByBillingSubscription request. The method always +// closes the http.Response Body. +func (client InvoicesClient) ListByBillingSubscriptionResponder(resp *http.Response) (result InvoiceListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByBillingSubscriptionNextResults retrieves the next set of results, if any. +func (client InvoicesClient) listByBillingSubscriptionNextResults(ctx context.Context, lastResults InvoiceListResult) (result InvoiceListResult, err error) { + req, err := lastResults.invoiceListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "billing.InvoicesClient", "listByBillingSubscriptionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByBillingSubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "billing.InvoicesClient", "listByBillingSubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByBillingSubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.InvoicesClient", "listByBillingSubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByBillingSubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client InvoicesClient) ListByBillingSubscriptionComplete(ctx context.Context, periodStartDate string, periodEndDate string) (result InvoiceListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/InvoicesClient.ListByBillingSubscription") + 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.ListByBillingSubscription(ctx, periodStartDate, periodEndDate) + return +} diff --git a/services/preview/billing/mgmt/2020-05-01-preview/billing/invoicesections.go b/services/preview/billing/mgmt/2020-05-01-preview/billing/invoicesections.go new file mode 100644 index 000000000000..99391448d7a6 --- /dev/null +++ b/services/preview/billing/mgmt/2020-05-01-preview/billing/invoicesections.go @@ -0,0 +1,315 @@ +package billing + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// InvoiceSectionsClient is the billing client provides access to billing resources for Azure subscriptions. +type InvoiceSectionsClient struct { + BaseClient +} + +// NewInvoiceSectionsClient creates an instance of the InvoiceSectionsClient client. +func NewInvoiceSectionsClient(subscriptionID string) InvoiceSectionsClient { + return NewInvoiceSectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewInvoiceSectionsClientWithBaseURI creates an instance of the InvoiceSectionsClient 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 NewInvoiceSectionsClientWithBaseURI(baseURI string, subscriptionID string) InvoiceSectionsClient { + return InvoiceSectionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates an invoice section. The operation is supported only for billing accounts with +// agreement type Microsoft Customer Agreement. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +// billingProfileName - the ID that uniquely identifies a billing profile. +// invoiceSectionName - the ID that uniquely identifies an invoice section. +// parameters - the new or updated invoice section. +func (client InvoiceSectionsClient) CreateOrUpdate(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string, parameters InvoiceSection) (result InvoiceSectionsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/InvoiceSectionsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateOrUpdatePreparer(ctx, billingAccountName, billingProfileName, invoiceSectionName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.InvoiceSectionsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.InvoiceSectionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client InvoiceSectionsClient) CreateOrUpdatePreparer(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string, parameters InvoiceSection) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountName": autorest.Encode("path", billingAccountName), + "billingProfileName": autorest.Encode("path", billingProfileName), + "invoiceSectionName": autorest.Encode("path", invoiceSectionName), + } + + const APIVersion = "2020-05-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.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}", pathParameters), + autorest.WithJSON(parameters), + 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 InvoiceSectionsClient) CreateOrUpdateSender(req *http.Request) (future InvoiceSectionsCreateOrUpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client InvoiceSectionsClient) CreateOrUpdateResponder(resp *http.Response) (result InvoiceSection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets an invoice section by its ID. The operation is supported only for billing accounts with agreement type +// Microsoft Customer Agreement. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +// billingProfileName - the ID that uniquely identifies a billing profile. +// invoiceSectionName - the ID that uniquely identifies an invoice section. +func (client InvoiceSectionsClient) Get(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string) (result InvoiceSection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/InvoiceSectionsClient.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, billingAccountName, billingProfileName, invoiceSectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.InvoiceSectionsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.InvoiceSectionsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.InvoiceSectionsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client InvoiceSectionsClient) GetPreparer(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountName": autorest.Encode("path", billingAccountName), + "billingProfileName": autorest.Encode("path", billingProfileName), + "invoiceSectionName": autorest.Encode("path", invoiceSectionName), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}", 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 InvoiceSectionsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client InvoiceSectionsClient) GetResponder(resp *http.Response) (result InvoiceSection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByBillingProfile lists the invoice sections that a user has access to. The operation is supported only for +// billing accounts with agreement type Microsoft Customer Agreement. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +// billingProfileName - the ID that uniquely identifies a billing profile. +func (client InvoiceSectionsClient) ListByBillingProfile(ctx context.Context, billingAccountName string, billingProfileName string) (result InvoiceSectionListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/InvoiceSectionsClient.ListByBillingProfile") + defer func() { + sc := -1 + if result.islr.Response.Response != nil { + sc = result.islr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByBillingProfileNextResults + req, err := client.ListByBillingProfilePreparer(ctx, billingAccountName, billingProfileName) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.InvoiceSectionsClient", "ListByBillingProfile", nil, "Failure preparing request") + return + } + + resp, err := client.ListByBillingProfileSender(req) + if err != nil { + result.islr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.InvoiceSectionsClient", "ListByBillingProfile", resp, "Failure sending request") + return + } + + result.islr, err = client.ListByBillingProfileResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.InvoiceSectionsClient", "ListByBillingProfile", resp, "Failure responding to request") + } + + return +} + +// ListByBillingProfilePreparer prepares the ListByBillingProfile request. +func (client InvoiceSectionsClient) ListByBillingProfilePreparer(ctx context.Context, billingAccountName string, billingProfileName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountName": autorest.Encode("path", billingAccountName), + "billingProfileName": autorest.Encode("path", billingProfileName), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByBillingProfileSender sends the ListByBillingProfile request. The method will close the +// http.Response Body if it receives an error. +func (client InvoiceSectionsClient) ListByBillingProfileSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListByBillingProfileResponder handles the response to the ListByBillingProfile request. The method always +// closes the http.Response Body. +func (client InvoiceSectionsClient) ListByBillingProfileResponder(resp *http.Response) (result InvoiceSectionListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByBillingProfileNextResults retrieves the next set of results, if any. +func (client InvoiceSectionsClient) listByBillingProfileNextResults(ctx context.Context, lastResults InvoiceSectionListResult) (result InvoiceSectionListResult, err error) { + req, err := lastResults.invoiceSectionListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "billing.InvoiceSectionsClient", "listByBillingProfileNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByBillingProfileSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "billing.InvoiceSectionsClient", "listByBillingProfileNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByBillingProfileResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.InvoiceSectionsClient", "listByBillingProfileNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByBillingProfileComplete enumerates all values, automatically crossing page boundaries as required. +func (client InvoiceSectionsClient) ListByBillingProfileComplete(ctx context.Context, billingAccountName string, billingProfileName string) (result InvoiceSectionListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/InvoiceSectionsClient.ListByBillingProfile") + 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.ListByBillingProfile(ctx, billingAccountName, billingProfileName) + return +} diff --git a/services/preview/billing/mgmt/2020-05-01-preview/billing/models.go b/services/preview/billing/mgmt/2020-05-01-preview/billing/models.go new file mode 100644 index 000000000000..b04a00b80fc9 --- /dev/null +++ b/services/preview/billing/mgmt/2020-05-01-preview/billing/models.go @@ -0,0 +1,5052 @@ +package billing + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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/satori/go.uuid" + "net/http" +) + +// The package's fully qualified name. +const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/billing/mgmt/2020-05/billing" + +// AcceptanceMode enumerates the values for acceptance mode. +type AcceptanceMode string + +const ( + // ClickToAccept ... + ClickToAccept AcceptanceMode = "ClickToAccept" + // ESignEmbedded ... + ESignEmbedded AcceptanceMode = "ESignEmbedded" + // ESignOffline ... + ESignOffline AcceptanceMode = "ESignOffline" +) + +// PossibleAcceptanceModeValues returns an array of possible values for the AcceptanceMode const type. +func PossibleAcceptanceModeValues() []AcceptanceMode { + return []AcceptanceMode{ClickToAccept, ESignEmbedded, ESignOffline} +} + +// AccountStatus enumerates the values for account status. +type AccountStatus string + +const ( + // Active ... + Active AccountStatus = "Active" + // Deleted ... + Deleted AccountStatus = "Deleted" + // Disabled ... + Disabled AccountStatus = "Disabled" + // Expired ... + Expired AccountStatus = "Expired" + // Extended ... + Extended AccountStatus = "Extended" + // Terminated ... + Terminated AccountStatus = "Terminated" + // Transferred ... + Transferred AccountStatus = "Transferred" +) + +// PossibleAccountStatusValues returns an array of possible values for the AccountStatus const type. +func PossibleAccountStatusValues() []AccountStatus { + return []AccountStatus{Active, Deleted, Disabled, Expired, Extended, Terminated, Transferred} +} + +// AccountType enumerates the values for account type. +type AccountType string + +const ( + // Enterprise ... + Enterprise AccountType = "Enterprise" + // Individual ... + Individual AccountType = "Individual" + // Partner ... + Partner AccountType = "Partner" +) + +// PossibleAccountTypeValues returns an array of possible values for the AccountType const type. +func PossibleAccountTypeValues() []AccountType { + return []AccountType{Enterprise, Individual, Partner} +} + +// AddressValidationStatus enumerates the values for address validation status. +type AddressValidationStatus string + +const ( + // Invalid ... + Invalid AddressValidationStatus = "Invalid" + // Valid ... + Valid AddressValidationStatus = "Valid" +) + +// PossibleAddressValidationStatusValues returns an array of possible values for the AddressValidationStatus const type. +func PossibleAddressValidationStatusValues() []AddressValidationStatus { + return []AddressValidationStatus{Invalid, Valid} +} + +// AgreementType enumerates the values for agreement type. +type AgreementType string + +const ( + // EnterpriseAgreement ... + EnterpriseAgreement AgreementType = "EnterpriseAgreement" + // MicrosoftCustomerAgreement ... + MicrosoftCustomerAgreement AgreementType = "MicrosoftCustomerAgreement" + // MicrosoftOnlineServicesProgram ... + MicrosoftOnlineServicesProgram AgreementType = "MicrosoftOnlineServicesProgram" + // MicrosoftPartnerAgreement ... + MicrosoftPartnerAgreement AgreementType = "MicrosoftPartnerAgreement" +) + +// PossibleAgreementTypeValues returns an array of possible values for the AgreementType const type. +func PossibleAgreementTypeValues() []AgreementType { + return []AgreementType{EnterpriseAgreement, MicrosoftCustomerAgreement, MicrosoftOnlineServicesProgram, MicrosoftPartnerAgreement} +} + +// AutoRenew enumerates the values for auto renew. +type AutoRenew string + +const ( + // Off ... + Off AutoRenew = "Off" + // On ... + On AutoRenew = "On" +) + +// PossibleAutoRenewValues returns an array of possible values for the AutoRenew const type. +func PossibleAutoRenewValues() []AutoRenew { + return []AutoRenew{Off, On} +} + +// Category enumerates the values for category. +type Category string + +const ( + // CategoryAffiliatePurchaseTerms ... + CategoryAffiliatePurchaseTerms Category = "AffiliatePurchaseTerms" + // CategoryMicrosoftCustomerAgreement ... + CategoryMicrosoftCustomerAgreement Category = "MicrosoftCustomerAgreement" + // CategoryOther ... + CategoryOther Category = "Other" +) + +// PossibleCategoryValues returns an array of possible values for the Category const type. +func PossibleCategoryValues() []Category { + return []Category{CategoryAffiliatePurchaseTerms, CategoryMicrosoftCustomerAgreement, CategoryOther} +} + +// DocumentSource enumerates the values for document source. +type DocumentSource string + +const ( + // DRS ... + DRS DocumentSource = "DRS" + // ENF ... + ENF DocumentSource = "ENF" +) + +// PossibleDocumentSourceValues returns an array of possible values for the DocumentSource const type. +func PossibleDocumentSourceValues() []DocumentSource { + return []DocumentSource{DRS, ENF} +} + +// DocumentType enumerates the values for document type. +type DocumentType string + +const ( + // DocumentTypeCreditNote ... + DocumentTypeCreditNote DocumentType = "CreditNote" + // DocumentTypeInvoice ... + DocumentTypeInvoice DocumentType = "Invoice" + // DocumentTypeTaxReceipt ... + DocumentTypeTaxReceipt DocumentType = "TaxReceipt" + // DocumentTypeVoidNote ... + DocumentTypeVoidNote DocumentType = "VoidNote" +) + +// PossibleDocumentTypeValues returns an array of possible values for the DocumentType const type. +func PossibleDocumentTypeValues() []DocumentType { + return []DocumentType{DocumentTypeCreditNote, DocumentTypeInvoice, DocumentTypeTaxReceipt, DocumentTypeVoidNote} +} + +// Frequency enumerates the values for frequency. +type Frequency string + +const ( + // Monthly ... + Monthly Frequency = "Monthly" + // OneTime ... + OneTime Frequency = "OneTime" + // UsageBased ... + UsageBased Frequency = "UsageBased" +) + +// PossibleFrequencyValues returns an array of possible values for the Frequency const type. +func PossibleFrequencyValues() []Frequency { + return []Frequency{Monthly, OneTime, UsageBased} +} + +// InvoiceStatus enumerates the values for invoice status. +type InvoiceStatus string + +const ( + // Due ... + Due InvoiceStatus = "Due" + // OverDue ... + OverDue InvoiceStatus = "OverDue" + // Paid ... + Paid InvoiceStatus = "Paid" +) + +// PossibleInvoiceStatusValues returns an array of possible values for the InvoiceStatus const type. +func PossibleInvoiceStatusValues() []InvoiceStatus { + return []InvoiceStatus{Due, OverDue, Paid} +} + +// InvoiceType enumerates the values for invoice type. +type InvoiceType string + +const ( + // AzureMarketplace ... + AzureMarketplace InvoiceType = "AzureMarketplace" + // AzureService ... + AzureService InvoiceType = "AzureService" + // AzureSupport ... + AzureSupport InvoiceType = "AzureSupport" +) + +// PossibleInvoiceTypeValues returns an array of possible values for the InvoiceType const type. +func PossibleInvoiceTypeValues() []InvoiceType { + return []InvoiceType{AzureMarketplace, AzureService, AzureSupport} +} + +// MarketplacePurchasesPolicy enumerates the values for marketplace purchases policy. +type MarketplacePurchasesPolicy string + +const ( + // AllAllowed ... + AllAllowed MarketplacePurchasesPolicy = "AllAllowed" + // NotAllowed ... + NotAllowed MarketplacePurchasesPolicy = "NotAllowed" + // OnlyFreeAllowed ... + OnlyFreeAllowed MarketplacePurchasesPolicy = "OnlyFreeAllowed" +) + +// PossibleMarketplacePurchasesPolicyValues returns an array of possible values for the MarketplacePurchasesPolicy const type. +func PossibleMarketplacePurchasesPolicyValues() []MarketplacePurchasesPolicy { + return []MarketplacePurchasesPolicy{AllAllowed, NotAllowed, OnlyFreeAllowed} +} + +// PaymentMethodFamily enumerates the values for payment method family. +type PaymentMethodFamily string + +const ( + // CheckWire ... + CheckWire PaymentMethodFamily = "CheckWire" + // CreditCard ... + CreditCard PaymentMethodFamily = "CreditCard" + // Credits ... + Credits PaymentMethodFamily = "Credits" + // None ... + None PaymentMethodFamily = "None" +) + +// PossiblePaymentMethodFamilyValues returns an array of possible values for the PaymentMethodFamily const type. +func PossiblePaymentMethodFamilyValues() []PaymentMethodFamily { + return []PaymentMethodFamily{CheckWire, CreditCard, Credits, None} +} + +// ProductStatusType enumerates the values for product status type. +type ProductStatusType string + +const ( + // ProductStatusTypeActive ... + ProductStatusTypeActive ProductStatusType = "Active" + // ProductStatusTypeAutoRenew ... + ProductStatusTypeAutoRenew ProductStatusType = "AutoRenew" + // ProductStatusTypeCancelled ... + ProductStatusTypeCancelled ProductStatusType = "Cancelled" + // ProductStatusTypeDisabled ... + ProductStatusTypeDisabled ProductStatusType = "Disabled" + // ProductStatusTypeExpired ... + ProductStatusTypeExpired ProductStatusType = "Expired" + // ProductStatusTypeExpiring ... + ProductStatusTypeExpiring ProductStatusType = "Expiring" + // ProductStatusTypeInactive ... + ProductStatusTypeInactive ProductStatusType = "Inactive" + // ProductStatusTypePastDue ... + ProductStatusTypePastDue ProductStatusType = "PastDue" +) + +// PossibleProductStatusTypeValues returns an array of possible values for the ProductStatusType const type. +func PossibleProductStatusTypeValues() []ProductStatusType { + return []ProductStatusType{ProductStatusTypeActive, ProductStatusTypeAutoRenew, ProductStatusTypeCancelled, ProductStatusTypeDisabled, ProductStatusTypeExpired, ProductStatusTypeExpiring, ProductStatusTypeInactive, ProductStatusTypePastDue} +} + +// ProductTransferValidationErrorCode enumerates the values for product transfer validation error code. +type ProductTransferValidationErrorCode string + +const ( + // CrossBillingAccountNotAllowed ... + CrossBillingAccountNotAllowed ProductTransferValidationErrorCode = "CrossBillingAccountNotAllowed" + // DestinationBillingProfilePastDue ... + DestinationBillingProfilePastDue ProductTransferValidationErrorCode = "DestinationBillingProfilePastDue" + // InsufficientPermissionOnDestination ... + InsufficientPermissionOnDestination ProductTransferValidationErrorCode = "InsufficientPermissionOnDestination" + // InsufficientPermissionOnSource ... + InsufficientPermissionOnSource ProductTransferValidationErrorCode = "InsufficientPermissionOnSource" + // InvalidSource ... + InvalidSource ProductTransferValidationErrorCode = "InvalidSource" + // NotAvailableForDestinationMarket ... + NotAvailableForDestinationMarket ProductTransferValidationErrorCode = "NotAvailableForDestinationMarket" + // OneTimePurchaseProductTransferNotAllowed ... + OneTimePurchaseProductTransferNotAllowed ProductTransferValidationErrorCode = "OneTimePurchaseProductTransferNotAllowed" + // ProductNotActive ... + ProductNotActive ProductTransferValidationErrorCode = "ProductNotActive" + // ProductTypeNotSupported ... + ProductTypeNotSupported ProductTransferValidationErrorCode = "ProductTypeNotSupported" +) + +// PossibleProductTransferValidationErrorCodeValues returns an array of possible values for the ProductTransferValidationErrorCode const type. +func PossibleProductTransferValidationErrorCodeValues() []ProductTransferValidationErrorCode { + return []ProductTransferValidationErrorCode{CrossBillingAccountNotAllowed, DestinationBillingProfilePastDue, InsufficientPermissionOnDestination, InsufficientPermissionOnSource, InvalidSource, NotAvailableForDestinationMarket, OneTimePurchaseProductTransferNotAllowed, ProductNotActive, ProductTypeNotSupported} +} + +// ProfileSpendingLimit enumerates the values for profile spending limit. +type ProfileSpendingLimit string + +const ( + // ProfileSpendingLimitOff ... + ProfileSpendingLimitOff ProfileSpendingLimit = "Off" + // ProfileSpendingLimitOn ... + ProfileSpendingLimitOn ProfileSpendingLimit = "On" +) + +// PossibleProfileSpendingLimitValues returns an array of possible values for the ProfileSpendingLimit const type. +func PossibleProfileSpendingLimitValues() []ProfileSpendingLimit { + return []ProfileSpendingLimit{ProfileSpendingLimitOff, ProfileSpendingLimitOn} +} + +// ProfileStatus enumerates the values for profile status. +type ProfileStatus string + +const ( + // ProfileStatusActive ... + ProfileStatusActive ProfileStatus = "Active" + // ProfileStatusDisabled ... + ProfileStatusDisabled ProfileStatus = "Disabled" + // ProfileStatusWarned ... + ProfileStatusWarned ProfileStatus = "Warned" +) + +// PossibleProfileStatusValues returns an array of possible values for the ProfileStatus const type. +func PossibleProfileStatusValues() []ProfileStatus { + return []ProfileStatus{ProfileStatusActive, ProfileStatusDisabled, ProfileStatusWarned} +} + +// ProfileStatusReasonCode enumerates the values for profile status reason code. +type ProfileStatusReasonCode string + +const ( + // PastDue ... + PastDue ProfileStatusReasonCode = "PastDue" + // SpendingLimitExpired ... + SpendingLimitExpired ProfileStatusReasonCode = "SpendingLimitExpired" + // SpendingLimitReached ... + SpendingLimitReached ProfileStatusReasonCode = "SpendingLimitReached" +) + +// PossibleProfileStatusReasonCodeValues returns an array of possible values for the ProfileStatusReasonCode const type. +func PossibleProfileStatusReasonCodeValues() []ProfileStatusReasonCode { + return []ProfileStatusReasonCode{PastDue, SpendingLimitExpired, SpendingLimitReached} +} + +// ReservationPurchasesPolicy enumerates the values for reservation purchases policy. +type ReservationPurchasesPolicy string + +const ( + // ReservationPurchasesPolicyAllowed ... + ReservationPurchasesPolicyAllowed ReservationPurchasesPolicy = "Allowed" + // ReservationPurchasesPolicyNotAllowed ... + ReservationPurchasesPolicyNotAllowed ReservationPurchasesPolicy = "NotAllowed" +) + +// PossibleReservationPurchasesPolicyValues returns an array of possible values for the ReservationPurchasesPolicy const type. +func PossibleReservationPurchasesPolicyValues() []ReservationPurchasesPolicy { + return []ReservationPurchasesPolicy{ReservationPurchasesPolicyAllowed, ReservationPurchasesPolicyNotAllowed} +} + +// ReservationType enumerates the values for reservation type. +type ReservationType string + +const ( + // Purchase ... + Purchase ReservationType = "Purchase" + // UsageCharge ... + UsageCharge ReservationType = "Usage Charge" +) + +// PossibleReservationTypeValues returns an array of possible values for the ReservationType const type. +func PossibleReservationTypeValues() []ReservationType { + return []ReservationType{Purchase, UsageCharge} +} + +// SpendingLimit enumerates the values for spending limit. +type SpendingLimit string + +const ( + // SpendingLimitOff ... + SpendingLimitOff SpendingLimit = "Off" + // SpendingLimitOn ... + SpendingLimitOn SpendingLimit = "On" +) + +// PossibleSpendingLimitValues returns an array of possible values for the SpendingLimit const type. +func PossibleSpendingLimitValues() []SpendingLimit { + return []SpendingLimit{SpendingLimitOff, SpendingLimitOn} +} + +// SpendingLimitForBillingProfile enumerates the values for spending limit for billing profile. +type SpendingLimitForBillingProfile string + +const ( + // SpendingLimitForBillingProfileOff ... + SpendingLimitForBillingProfileOff SpendingLimitForBillingProfile = "Off" + // SpendingLimitForBillingProfileOn ... + SpendingLimitForBillingProfileOn SpendingLimitForBillingProfile = "On" +) + +// PossibleSpendingLimitForBillingProfileValues returns an array of possible values for the SpendingLimitForBillingProfile const type. +func PossibleSpendingLimitForBillingProfileValues() []SpendingLimitForBillingProfile { + return []SpendingLimitForBillingProfile{SpendingLimitForBillingProfileOff, SpendingLimitForBillingProfileOn} +} + +// StatusReasonCode enumerates the values for status reason code. +type StatusReasonCode string + +const ( + // StatusReasonCodePastDue ... + StatusReasonCodePastDue StatusReasonCode = "PastDue" + // StatusReasonCodeSpendingLimitExpired ... + StatusReasonCodeSpendingLimitExpired StatusReasonCode = "SpendingLimitExpired" + // StatusReasonCodeSpendingLimitReached ... + StatusReasonCodeSpendingLimitReached StatusReasonCode = "SpendingLimitReached" +) + +// PossibleStatusReasonCodeValues returns an array of possible values for the StatusReasonCode const type. +func PossibleStatusReasonCodeValues() []StatusReasonCode { + return []StatusReasonCode{StatusReasonCodePastDue, StatusReasonCodeSpendingLimitExpired, StatusReasonCodeSpendingLimitReached} +} + +// StatusReasonCodeForBillingProfile enumerates the values for status reason code for billing profile. +type StatusReasonCodeForBillingProfile string + +const ( + // StatusReasonCodeForBillingProfilePastDue ... + StatusReasonCodeForBillingProfilePastDue StatusReasonCodeForBillingProfile = "PastDue" + // StatusReasonCodeForBillingProfileSpendingLimitExpired ... + StatusReasonCodeForBillingProfileSpendingLimitExpired StatusReasonCodeForBillingProfile = "SpendingLimitExpired" + // StatusReasonCodeForBillingProfileSpendingLimitReached ... + StatusReasonCodeForBillingProfileSpendingLimitReached StatusReasonCodeForBillingProfile = "SpendingLimitReached" +) + +// PossibleStatusReasonCodeForBillingProfileValues returns an array of possible values for the StatusReasonCodeForBillingProfile const type. +func PossibleStatusReasonCodeForBillingProfileValues() []StatusReasonCodeForBillingProfile { + return []StatusReasonCodeForBillingProfile{StatusReasonCodeForBillingProfilePastDue, StatusReasonCodeForBillingProfileSpendingLimitExpired, StatusReasonCodeForBillingProfileSpendingLimitReached} +} + +// SubscriptionStatusType enumerates the values for subscription status type. +type SubscriptionStatusType string + +const ( + // SubscriptionStatusTypeAbandoned ... + SubscriptionStatusTypeAbandoned SubscriptionStatusType = "Abandoned" + // SubscriptionStatusTypeActive ... + SubscriptionStatusTypeActive SubscriptionStatusType = "Active" + // SubscriptionStatusTypeDeleted ... + SubscriptionStatusTypeDeleted SubscriptionStatusType = "Deleted" + // SubscriptionStatusTypeInactive ... + SubscriptionStatusTypeInactive SubscriptionStatusType = "Inactive" + // SubscriptionStatusTypeWarning ... + SubscriptionStatusTypeWarning SubscriptionStatusType = "Warning" +) + +// PossibleSubscriptionStatusTypeValues returns an array of possible values for the SubscriptionStatusType const type. +func PossibleSubscriptionStatusTypeValues() []SubscriptionStatusType { + return []SubscriptionStatusType{SubscriptionStatusTypeAbandoned, SubscriptionStatusTypeActive, SubscriptionStatusTypeDeleted, SubscriptionStatusTypeInactive, SubscriptionStatusTypeWarning} +} + +// SubscriptionTransferValidationErrorCode enumerates the values for subscription transfer validation error +// code. +type SubscriptionTransferValidationErrorCode string + +const ( + // SubscriptionTransferValidationErrorCodeCrossBillingAccountNotAllowed ... + SubscriptionTransferValidationErrorCodeCrossBillingAccountNotAllowed SubscriptionTransferValidationErrorCode = "CrossBillingAccountNotAllowed" + // SubscriptionTransferValidationErrorCodeDestinationBillingProfilePastDue ... + SubscriptionTransferValidationErrorCodeDestinationBillingProfilePastDue SubscriptionTransferValidationErrorCode = "DestinationBillingProfilePastDue" + // SubscriptionTransferValidationErrorCodeInsufficientPermissionOnDestination ... + SubscriptionTransferValidationErrorCodeInsufficientPermissionOnDestination SubscriptionTransferValidationErrorCode = "InsufficientPermissionOnDestination" + // SubscriptionTransferValidationErrorCodeInsufficientPermissionOnSource ... + SubscriptionTransferValidationErrorCodeInsufficientPermissionOnSource SubscriptionTransferValidationErrorCode = "InsufficientPermissionOnSource" + // SubscriptionTransferValidationErrorCodeInvalidSource ... + SubscriptionTransferValidationErrorCodeInvalidSource SubscriptionTransferValidationErrorCode = "InvalidSource" + // SubscriptionTransferValidationErrorCodeNotAvailableForDestinationMarket ... + SubscriptionTransferValidationErrorCodeNotAvailableForDestinationMarket SubscriptionTransferValidationErrorCode = "NotAvailableForDestinationMarket" + // SubscriptionTransferValidationErrorCodeSubscriptionNotActive ... + SubscriptionTransferValidationErrorCodeSubscriptionNotActive SubscriptionTransferValidationErrorCode = "SubscriptionNotActive" + // SubscriptionTransferValidationErrorCodeSubscriptionTypeNotSupported ... + SubscriptionTransferValidationErrorCodeSubscriptionTypeNotSupported SubscriptionTransferValidationErrorCode = "SubscriptionTypeNotSupported" +) + +// PossibleSubscriptionTransferValidationErrorCodeValues returns an array of possible values for the SubscriptionTransferValidationErrorCode const type. +func PossibleSubscriptionTransferValidationErrorCodeValues() []SubscriptionTransferValidationErrorCode { + return []SubscriptionTransferValidationErrorCode{SubscriptionTransferValidationErrorCodeCrossBillingAccountNotAllowed, SubscriptionTransferValidationErrorCodeDestinationBillingProfilePastDue, SubscriptionTransferValidationErrorCodeInsufficientPermissionOnDestination, SubscriptionTransferValidationErrorCodeInsufficientPermissionOnSource, SubscriptionTransferValidationErrorCodeInvalidSource, SubscriptionTransferValidationErrorCodeNotAvailableForDestinationMarket, SubscriptionTransferValidationErrorCodeSubscriptionNotActive, SubscriptionTransferValidationErrorCodeSubscriptionTypeNotSupported} +} + +// TransactionTypeKind enumerates the values for transaction type kind. +type TransactionTypeKind string + +const ( + // All ... + All TransactionTypeKind = "all" + // Reservation ... + Reservation TransactionTypeKind = "reservation" +) + +// PossibleTransactionTypeKindValues returns an array of possible values for the TransactionTypeKind const type. +func PossibleTransactionTypeKindValues() []TransactionTypeKind { + return []TransactionTypeKind{All, Reservation} +} + +// ViewCharges enumerates the values for view charges. +type ViewCharges string + +const ( + // ViewChargesAllowed ... + ViewChargesAllowed ViewCharges = "Allowed" + // ViewChargesNotAllowed ... + ViewChargesNotAllowed ViewCharges = "NotAllowed" +) + +// PossibleViewChargesValues returns an array of possible values for the ViewCharges const type. +func PossibleViewChargesValues() []ViewCharges { + return []ViewCharges{ViewChargesAllowed, ViewChargesNotAllowed} +} + +// ViewChargesPolicy enumerates the values for view charges policy. +type ViewChargesPolicy string + +const ( + // ViewChargesPolicyAllowed ... + ViewChargesPolicyAllowed ViewChargesPolicy = "Allowed" + // ViewChargesPolicyNotAllowed ... + ViewChargesPolicyNotAllowed ViewChargesPolicy = "NotAllowed" +) + +// PossibleViewChargesPolicyValues returns an array of possible values for the ViewChargesPolicy const type. +func PossibleViewChargesPolicyValues() []ViewChargesPolicy { + return []ViewChargesPolicy{ViewChargesPolicyAllowed, ViewChargesPolicyNotAllowed} +} + +// Account a billing account. +type Account struct { + autorest.Response `json:"-"` + // AccountProperties - The properties of the billing account. + *AccountProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Account. +func (a Account) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if a.AccountProperties != nil { + objectMap["properties"] = a.AccountProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Account struct. +func (a *Account) 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 accountProperties AccountProperties + err = json.Unmarshal(*v, &accountProperties) + if err != nil { + return err + } + a.AccountProperties = &accountProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + a.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + a.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + a.Type = &typeVar + } + } + } + + return nil +} + +// AccountListResult the list of billing accounts. +type AccountListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of billing accounts. + Value *[]Account `json:"value,omitempty"` + // NextLink - READ-ONLY; The link (url) to the next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// AccountListResultIterator provides access to a complete listing of Account values. +type AccountListResultIterator struct { + i int + page AccountListResultPage +} + +// 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 *AccountListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountListResultIterator.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 *AccountListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter AccountListResultIterator) 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 AccountListResultIterator) Response() AccountListResult { + 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 AccountListResultIterator) Value() Account { + if !iter.page.NotDone() { + return Account{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the AccountListResultIterator type. +func NewAccountListResultIterator(page AccountListResultPage) AccountListResultIterator { + return AccountListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (alr AccountListResult) IsEmpty() bool { + return alr.Value == nil || len(*alr.Value) == 0 +} + +// accountListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (alr AccountListResult) accountListResultPreparer(ctx context.Context) (*http.Request, error) { + if alr.NextLink == nil || len(to.String(alr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(alr.NextLink))) +} + +// AccountListResultPage contains a page of Account values. +type AccountListResultPage struct { + fn func(context.Context, AccountListResult) (AccountListResult, error) + alr AccountListResult +} + +// 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 *AccountListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AccountListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.alr) + if err != nil { + return err + } + page.alr = next + 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 *AccountListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page AccountListResultPage) NotDone() bool { + return !page.alr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page AccountListResultPage) Response() AccountListResult { + return page.alr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page AccountListResultPage) Values() []Account { + if page.alr.IsEmpty() { + return nil + } + return *page.alr.Value +} + +// Creates a new instance of the AccountListResultPage type. +func NewAccountListResultPage(getNextPage func(context.Context, AccountListResult) (AccountListResult, error)) AccountListResultPage { + return AccountListResultPage{fn: getNextPage} +} + +// AccountProperties the properties of the billing account. +type AccountProperties struct { + // DisplayName - The billing account name. + DisplayName *string `json:"displayName,omitempty"` + // SoldTo - The address of the individual or organization that is responsible for the billing account. + SoldTo *AddressDetails `json:"soldTo,omitempty"` + // AgreementType - READ-ONLY; The type of agreement. Possible values include: 'MicrosoftCustomerAgreement', 'EnterpriseAgreement', 'MicrosoftOnlineServicesProgram', 'MicrosoftPartnerAgreement' + AgreementType AgreementType `json:"agreementType,omitempty"` + // AccountType - READ-ONLY; The type of customer. Possible values include: 'Enterprise', 'Individual', 'Partner' + AccountType AccountType `json:"accountType,omitempty"` + // AccountStatus - READ-ONLY; The current status of the billing account. Possible values include: 'Active', 'Deleted', 'Disabled', 'Expired', 'Transferred', 'Extended', 'Terminated' + AccountStatus AccountStatus `json:"accountStatus,omitempty"` + // BillingProfiles - The billing profiles associated with the billing account. By default this is not populated, unless it's specified in $expand. + BillingProfiles *ProfilesOnExpand `json:"billingProfiles,omitempty"` + // EnrollmentDetails - READ-ONLY; The details about the associated legacy enrollment. By default this is not populated, unless it's specified in $expand. + EnrollmentDetails *Enrollment `json:"enrollmentDetails,omitempty"` + // Departments - The departments associated to the enrollment. + Departments *[]Department `json:"departments,omitempty"` + // EnrollmentAccounts - The accounts associated to the enrollment. + EnrollmentAccounts *[]EnrollmentAccount `json:"enrollmentAccounts,omitempty"` + // HasReadAccess - READ-ONLY; Indicates whether user has read access to the billing account. + HasReadAccess *bool `json:"hasReadAccess,omitempty"` +} + +// AccountsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type AccountsUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *AccountsUpdateFuture) Result(client AccountsClient) (a Account, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.AccountsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("billing.AccountsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if a.Response.Response, err = future.GetResult(sender); err == nil && a.Response.Response.StatusCode != http.StatusNoContent { + a, err = client.UpdateResponder(a.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.AccountsUpdateFuture", "Result", a.Response.Response, "Failure responding to request") + } + } + return +} + +// AccountUpdateRequest the request properties of the billing account that can be updated. +type AccountUpdateRequest struct { + // AccountProperties - A billing property. + *AccountProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for AccountUpdateRequest. +func (aur AccountUpdateRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if aur.AccountProperties != nil { + objectMap["properties"] = aur.AccountProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AccountUpdateRequest struct. +func (aur *AccountUpdateRequest) 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 accountProperties AccountProperties + err = json.Unmarshal(*v, &accountProperties) + if err != nil { + return err + } + aur.AccountProperties = &accountProperties + } + } + } + + return nil +} + +// AddressDetails address details. +type AddressDetails struct { + // FirstName - First name. + FirstName *string `json:"firstName,omitempty"` + // LastName - Last name. + LastName *string `json:"lastName,omitempty"` + // CompanyName - Company name. + CompanyName *string `json:"companyName,omitempty"` + // AddressLine1 - Address line 1. + AddressLine1 *string `json:"addressLine1,omitempty"` + // AddressLine2 - Address line 2. + AddressLine2 *string `json:"addressLine2,omitempty"` + // AddressLine3 - Address line 3. + AddressLine3 *string `json:"addressLine3,omitempty"` + // City - Address city. + City *string `json:"city,omitempty"` + // District - Address district. + District *string `json:"district,omitempty"` + // Region - Address region. + Region *string `json:"region,omitempty"` + // Country - Country code uses ISO2, 2-digit format. + Country *string `json:"country,omitempty"` + // PostalCode - Postal code. + PostalCode *string `json:"postalCode,omitempty"` + // Email - Email address. + Email *string `json:"email,omitempty"` + // PhoneNumber - Phone number. + PhoneNumber *string `json:"phoneNumber,omitempty"` +} + +// Agreement an agreement. +type Agreement struct { + autorest.Response `json:"-"` + // AgreementProperties - The properties of an agreement. + *AgreementProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Agreement. +func (a Agreement) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if a.AgreementProperties != nil { + objectMap["properties"] = a.AgreementProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Agreement struct. +func (a *Agreement) 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 agreementProperties AgreementProperties + err = json.Unmarshal(*v, &agreementProperties) + if err != nil { + return err + } + a.AgreementProperties = &agreementProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + a.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + a.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + a.Type = &typeVar + } + } + } + + return nil +} + +// AgreementListResult result of listing agreements. +type AgreementListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of agreements. + Value *[]Agreement `json:"value,omitempty"` + // NextLink - READ-ONLY; The link (url) to the next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// AgreementListResultIterator provides access to a complete listing of Agreement values. +type AgreementListResultIterator struct { + i int + page AgreementListResultPage +} + +// 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 *AgreementListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AgreementListResultIterator.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 *AgreementListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter AgreementListResultIterator) 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 AgreementListResultIterator) Response() AgreementListResult { + 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 AgreementListResultIterator) Value() Agreement { + if !iter.page.NotDone() { + return Agreement{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the AgreementListResultIterator type. +func NewAgreementListResultIterator(page AgreementListResultPage) AgreementListResultIterator { + return AgreementListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (alr AgreementListResult) IsEmpty() bool { + return alr.Value == nil || len(*alr.Value) == 0 +} + +// agreementListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (alr AgreementListResult) agreementListResultPreparer(ctx context.Context) (*http.Request, error) { + if alr.NextLink == nil || len(to.String(alr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(alr.NextLink))) +} + +// AgreementListResultPage contains a page of Agreement values. +type AgreementListResultPage struct { + fn func(context.Context, AgreementListResult) (AgreementListResult, error) + alr AgreementListResult +} + +// 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 *AgreementListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AgreementListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.alr) + if err != nil { + return err + } + page.alr = next + 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 *AgreementListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page AgreementListResultPage) NotDone() bool { + return !page.alr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page AgreementListResultPage) Response() AgreementListResult { + return page.alr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page AgreementListResultPage) Values() []Agreement { + if page.alr.IsEmpty() { + return nil + } + return *page.alr.Value +} + +// Creates a new instance of the AgreementListResultPage type. +func NewAgreementListResultPage(getNextPage func(context.Context, AgreementListResult) (AgreementListResult, error)) AgreementListResultPage { + return AgreementListResultPage{fn: getNextPage} +} + +// AgreementProperties the properties of an agreement. +type AgreementProperties struct { + // AgreementLink - READ-ONLY; The URL to download the agreement. + AgreementLink *string `json:"agreementLink,omitempty"` + // Category - READ-ONLY; The category of the agreement signed by a customer. Possible values include: 'CategoryMicrosoftCustomerAgreement', 'CategoryAffiliatePurchaseTerms', 'CategoryOther' + Category Category `json:"category,omitempty"` + // AcceptanceMode - READ-ONLY; The mode of acceptance for an agreement. Possible values include: 'ClickToAccept', 'ESignEmbedded', 'ESignOffline' + AcceptanceMode AcceptanceMode `json:"acceptanceMode,omitempty"` + // EffectiveDate - READ-ONLY; The date from which the agreement is effective. + EffectiveDate *date.Time `json:"effectiveDate,omitempty"` + // ExpirationDate - READ-ONLY; The date when the agreement expires. + ExpirationDate *date.Time `json:"expirationDate,omitempty"` + // Participants - The list of participants that participates in acceptance of an agreement. + Participants *[]Participants `json:"participants,omitempty"` + // Status - READ-ONLY; The current status of the agreement. + Status *string `json:"status,omitempty"` +} + +// Amount the amount. +type Amount struct { + // Currency - READ-ONLY; The currency for the amount value. + Currency *string `json:"currency,omitempty"` + // Value - Amount value. + Value *float64 `json:"value,omitempty"` +} + +// AvailableBalance the latest Azure credit balance. This is the balance available for pay now. +type AvailableBalance struct { + autorest.Response `json:"-"` + *AvailableBalanceProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AvailableBalance. +func (ab AvailableBalance) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ab.AvailableBalanceProperties != nil { + objectMap["properties"] = ab.AvailableBalanceProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AvailableBalance struct. +func (ab *AvailableBalance) 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 availableBalanceProperties AvailableBalanceProperties + err = json.Unmarshal(*v, &availableBalanceProperties) + if err != nil { + return err + } + ab.AvailableBalanceProperties = &availableBalanceProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ab.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ab.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ab.Type = &typeVar + } + } + } + + return nil +} + +// AvailableBalanceProperties the properties of available balance. +type AvailableBalanceProperties struct { + // Amount - READ-ONLY; Balance amount. + Amount *Amount `json:"amount,omitempty"` +} + +// AzurePlan details of the Azure plan. +type AzurePlan struct { + // SkuID - The sku id. + SkuID *string `json:"skuId,omitempty"` + // SkuDescription - READ-ONLY; The sku description. + SkuDescription *string `json:"skuDescription,omitempty"` +} + +// Customer a partner's customer. +type Customer struct { + autorest.Response `json:"-"` + // CustomerProperties - The customer. + *CustomerProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Customer. +func (c Customer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if c.CustomerProperties != nil { + objectMap["properties"] = c.CustomerProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Customer struct. +func (c *Customer) 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 customerProperties CustomerProperties + err = json.Unmarshal(*v, &customerProperties) + if err != nil { + return err + } + c.CustomerProperties = &customerProperties + } + 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 "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + c.Type = &typeVar + } + } + } + + return nil +} + +// CustomerListResult the list of customers. +type CustomerListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of customers. + Value *[]Customer `json:"value,omitempty"` + // NextLink - READ-ONLY; The link (url) to the next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// CustomerListResultIterator provides access to a complete listing of Customer values. +type CustomerListResultIterator struct { + i int + page CustomerListResultPage +} + +// 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 *CustomerListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomerListResultIterator.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 *CustomerListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter CustomerListResultIterator) 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 CustomerListResultIterator) Response() CustomerListResult { + 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 CustomerListResultIterator) Value() Customer { + if !iter.page.NotDone() { + return Customer{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the CustomerListResultIterator type. +func NewCustomerListResultIterator(page CustomerListResultPage) CustomerListResultIterator { + return CustomerListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (clr CustomerListResult) IsEmpty() bool { + return clr.Value == nil || len(*clr.Value) == 0 +} + +// customerListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (clr CustomerListResult) customerListResultPreparer(ctx context.Context) (*http.Request, error) { + if clr.NextLink == nil || len(to.String(clr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(clr.NextLink))) +} + +// CustomerListResultPage contains a page of Customer values. +type CustomerListResultPage struct { + fn func(context.Context, CustomerListResult) (CustomerListResult, error) + clr CustomerListResult +} + +// 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 *CustomerListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomerListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.clr) + if err != nil { + return err + } + page.clr = next + 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 *CustomerListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page CustomerListResultPage) NotDone() bool { + return !page.clr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page CustomerListResultPage) Response() CustomerListResult { + return page.clr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page CustomerListResultPage) Values() []Customer { + if page.clr.IsEmpty() { + return nil + } + return *page.clr.Value +} + +// Creates a new instance of the CustomerListResultPage type. +func NewCustomerListResultPage(getNextPage func(context.Context, CustomerListResult) (CustomerListResult, error)) CustomerListResultPage { + return CustomerListResultPage{fn: getNextPage} +} + +// CustomerPolicy the customer's Policy. +type CustomerPolicy struct { + autorest.Response `json:"-"` + *CustomerPolicyProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for CustomerPolicy. +func (cp CustomerPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cp.CustomerPolicyProperties != nil { + objectMap["properties"] = cp.CustomerPolicyProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CustomerPolicy struct. +func (cp *CustomerPolicy) 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 customerPolicyProperties CustomerPolicyProperties + err = json.Unmarshal(*v, &customerPolicyProperties) + if err != nil { + return err + } + cp.CustomerPolicyProperties = &customerPolicyProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + cp.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + cp.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + cp.Type = &typeVar + } + } + } + + return nil +} + +// CustomerPolicyProperties the properties of a customer's policy. +type CustomerPolicyProperties struct { + // ViewCharges - The policy that controls whether the users in customer's organization can view charges at pay-as-you-go prices. Possible values include: 'ViewChargesAllowed', 'ViewChargesNotAllowed' + ViewCharges ViewCharges `json:"viewCharges,omitempty"` +} + +// CustomerProperties the properties of a customer. +type CustomerProperties struct { + // BillingProfileID - READ-ONLY; The ID of the billing profile for the invoice section. + BillingProfileID *string `json:"billingProfileId,omitempty"` + // BillingProfileDisplayName - READ-ONLY; The name of the billing profile for the invoice section. + BillingProfileDisplayName *string `json:"billingProfileDisplayName,omitempty"` + // DisplayName - The name of the customer. + DisplayName *string `json:"displayName,omitempty"` + // EnabledAzurePlans - Azure plans enabled for the customer. + EnabledAzurePlans *[]AzurePlan `json:"enabledAzurePlans,omitempty"` + // Resellers - The list of resellers for which an Azure plan is enabled for the customer. + Resellers *[]Reseller `json:"resellers,omitempty"` +} + +// Department a department. +type Department struct { + // DepartmentProperties - A department. + *DepartmentProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Department. +func (d Department) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if d.DepartmentProperties != nil { + objectMap["properties"] = d.DepartmentProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Department struct. +func (d *Department) 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 departmentProperties DepartmentProperties + err = json.Unmarshal(*v, &departmentProperties) + if err != nil { + return err + } + d.DepartmentProperties = &departmentProperties + } + 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 "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + d.Type = &typeVar + } + } + } + + return nil +} + +// DepartmentProperties the properties of a department. +type DepartmentProperties struct { + // DepartmentName - The name of the department. + DepartmentName *string `json:"departmentName,omitempty"` + // CostCenter - The cost center associated with the department. + CostCenter *string `json:"costCenter,omitempty"` + // Status - The status of the department. + Status *string `json:"status,omitempty"` + // EnrollmentAccounts - Associated enrollment accounts. By default this is not populated, unless it's specified in $expand. + EnrollmentAccounts *[]EnrollmentAccount `json:"enrollmentAccounts,omitempty"` +} + +// Document the properties of a document. +type Document struct { + // Kind - READ-ONLY; The type of the document. Possible values include: 'DocumentTypeInvoice', 'DocumentTypeVoidNote', 'DocumentTypeTaxReceipt', 'DocumentTypeCreditNote' + Kind DocumentType `json:"kind,omitempty"` + // URL - READ-ONLY; Document URL. + URL *string `json:"url,omitempty"` + // Source - READ-ONLY; The source of the document. ENF for Brazil and DRS for rest of the world. Possible values include: 'DRS', 'ENF' + Source DocumentSource `json:"source,omitempty"` +} + +// DownloadURL a secure URL that can be used to download a an entity until the URL expires. +type DownloadURL struct { + autorest.Response `json:"-"` + // ExpiryTime - READ-ONLY; The time in UTC when the download URL will expire. + ExpiryTime *date.Time `json:"expiryTime,omitempty"` + // URL - READ-ONLY; The URL to the PDF file. + URL *string `json:"url,omitempty"` +} + +// Enrollment the properties of an enrollment. +type Enrollment struct { + // StartDate - The start date of the enrollment. + StartDate *date.Time `json:"startDate,omitempty"` + // EndDate - The end date of the enrollment. + EndDate *date.Time `json:"endDate,omitempty"` + // Currency - READ-ONLY; The billing currency for the enrollment. + Currency *string `json:"currency,omitempty"` + // Channel - READ-ONLY; The channel type of the enrollment. + Channel *string `json:"channel,omitempty"` + // Policies - READ-ONLY; The policies for Enterprise Agreement enrollments. + Policies *EnrollmentPolicies `json:"policies,omitempty"` + // Language - READ-ONLY; The language for the enrollment. + Language *string `json:"language,omitempty"` + // CountryCode - READ-ONLY; The country code of the enrollment. + CountryCode *string `json:"countryCode,omitempty"` + // Status - READ-ONLY; The current status of the enrollment. + Status *string `json:"status,omitempty"` + // BillingCycle - READ-ONLY; The billing cycle for the enrollment. + BillingCycle *string `json:"billingCycle,omitempty"` +} + +// EnrollmentAccount an enrollment account. +type EnrollmentAccount struct { + // EnrollmentAccountProperties - The properties of an enrollment account. + *EnrollmentAccountProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for EnrollmentAccount. +func (ea EnrollmentAccount) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ea.EnrollmentAccountProperties != nil { + objectMap["properties"] = ea.EnrollmentAccountProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for EnrollmentAccount struct. +func (ea *EnrollmentAccount) 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 enrollmentAccountProperties EnrollmentAccountProperties + err = json.Unmarshal(*v, &enrollmentAccountProperties) + if err != nil { + return err + } + ea.EnrollmentAccountProperties = &enrollmentAccountProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ea.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ea.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ea.Type = &typeVar + } + } + } + + return nil +} + +// EnrollmentAccountContext the enrollment account context +type EnrollmentAccountContext struct { + // CostCenter - The cost center associated with the enrollment account. + CostCenter *string `json:"costCenter,omitempty"` + // StartDate - The start date of the enrollment account. + StartDate *date.Time `json:"startDate,omitempty"` + // EndDate - The end date of the enrollment account. + EndDate *date.Time `json:"endDate,omitempty"` + // EnrollmentAccountName - The ID of the enrollment account. + EnrollmentAccountName *string `json:"enrollmentAccountName,omitempty"` +} + +// EnrollmentAccountProperties the properties of an enrollment account. +type EnrollmentAccountProperties struct { + // AccountName - The name of the enrollment account. + AccountName *string `json:"accountName,omitempty"` + // CostCenter - The cost center associated with the enrollment account. + CostCenter *string `json:"costCenter,omitempty"` + // AccountOwner - The owner of the enrollment account. + AccountOwner *string `json:"accountOwner,omitempty"` + // Status - The status of the enrollment account. + Status *string `json:"status,omitempty"` + // StartDate - The start date of the enrollment account. + StartDate *date.Time `json:"startDate,omitempty"` + // EndDate - The end date of the enrollment account. + EndDate *date.Time `json:"endDate,omitempty"` + // Department - Associated department. By default this is not populated, unless it's specified in $expand. + Department *Department `json:"department,omitempty"` +} + +// EnrollmentPolicies the policies for Enterprise Agreement enrollments. +type EnrollmentPolicies struct { + // AccountOwnerViewCharges - READ-ONLY; The policy that controls whether Account Owners can view charges. + AccountOwnerViewCharges *bool `json:"accountOwnerViewCharges,omitempty"` + // DepartmentAdminViewCharges - READ-ONLY; The policy that controls whether Department Administrators can view charges. + DepartmentAdminViewCharges *bool `json:"departmentAdminViewCharges,omitempty"` + // MarketplacesEnabled - READ-ONLY; The policy that controls whether Azure marketplace purchases are allowed in the enrollment. + MarketplacesEnabled *bool `json:"marketplacesEnabled,omitempty"` + // ReservedInstancesEnabled - READ-ONLY; The policy that controls whether Azure reservation purchases are allowed in the enrollment. + ReservedInstancesEnabled *bool `json:"reservedInstancesEnabled,omitempty"` +} + +// ErrorDetails the details of the error. +type ErrorDetails struct { + // Code - READ-ONLY; Error code. + Code *string `json:"code,omitempty"` + // Message - READ-ONLY; Error message indicating why the operation failed. + Message *string `json:"message,omitempty"` + // Target - READ-ONLY; The target of the particular error. + Target *string `json:"target,omitempty"` +} + +// ErrorResponse error response indicates that the service is not able to process the incoming request. The +// reason is provided in the error message. +type ErrorResponse struct { + // Error - The details of the error. + Error *ErrorDetails `json:"error,omitempty"` +} + +// Instruction an instruction. +type Instruction struct { + autorest.Response `json:"-"` + // InstructionProperties - A billing instruction used during invoice generation. + *InstructionProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Instruction. +func (i Instruction) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if i.InstructionProperties != nil { + objectMap["properties"] = i.InstructionProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Instruction struct. +func (i *Instruction) 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 instructionProperties InstructionProperties + err = json.Unmarshal(*v, &instructionProperties) + if err != nil { + return err + } + i.InstructionProperties = &instructionProperties + } + 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 +} + +// InstructionListResult the list of billing instructions used during invoice generation. +type InstructionListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of billing instructions used during invoice generation. + Value *[]Instruction `json:"value,omitempty"` + // NextLink - READ-ONLY; The link (url) to the next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// InstructionListResultIterator provides access to a complete listing of Instruction values. +type InstructionListResultIterator struct { + i int + page InstructionListResultPage +} + +// 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 *InstructionListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/InstructionListResultIterator.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 *InstructionListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter InstructionListResultIterator) 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 InstructionListResultIterator) Response() InstructionListResult { + 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 InstructionListResultIterator) Value() Instruction { + if !iter.page.NotDone() { + return Instruction{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the InstructionListResultIterator type. +func NewInstructionListResultIterator(page InstructionListResultPage) InstructionListResultIterator { + return InstructionListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ilr InstructionListResult) IsEmpty() bool { + return ilr.Value == nil || len(*ilr.Value) == 0 +} + +// instructionListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ilr InstructionListResult) instructionListResultPreparer(ctx context.Context) (*http.Request, error) { + if ilr.NextLink == nil || len(to.String(ilr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ilr.NextLink))) +} + +// InstructionListResultPage contains a page of Instruction values. +type InstructionListResultPage struct { + fn func(context.Context, InstructionListResult) (InstructionListResult, error) + ilr InstructionListResult +} + +// 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 *InstructionListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/InstructionListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.ilr) + if err != nil { + return err + } + page.ilr = next + 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 *InstructionListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page InstructionListResultPage) NotDone() bool { + return !page.ilr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page InstructionListResultPage) Response() InstructionListResult { + return page.ilr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page InstructionListResultPage) Values() []Instruction { + if page.ilr.IsEmpty() { + return nil + } + return *page.ilr.Value +} + +// Creates a new instance of the InstructionListResultPage type. +func NewInstructionListResultPage(getNextPage func(context.Context, InstructionListResult) (InstructionListResult, error)) InstructionListResultPage { + return InstructionListResultPage{fn: getNextPage} +} + +// InstructionProperties a billing instruction used during invoice generation. +type InstructionProperties struct { + // Amount - The amount budgeted for this billing instruction. + Amount *float64 `json:"amount,omitempty"` + // StartDate - The date this billing instruction goes into effect. + StartDate *date.Time `json:"startDate,omitempty"` + // EndDate - The date this billing instruction is no longer in effect. + EndDate *date.Time `json:"endDate,omitempty"` + // CreationDate - The date this billing instruction was created. + CreationDate *date.Time `json:"creationDate,omitempty"` +} + +// Invoice an invoice. +type Invoice struct { + autorest.Response `json:"-"` + // InvoiceProperties - An invoice. + *InvoiceProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Invoice. +func (i Invoice) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if i.InvoiceProperties != nil { + objectMap["properties"] = i.InvoiceProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Invoice struct. +func (i *Invoice) 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 invoiceProperties InvoiceProperties + err = json.Unmarshal(*v, &invoiceProperties) + if err != nil { + return err + } + i.InvoiceProperties = &invoiceProperties + } + 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 +} + +// InvoiceListResult the list of invoices. +type InvoiceListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of invoices. + Value *[]Invoice `json:"value,omitempty"` + // NextLink - READ-ONLY; The link (url) to the next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// InvoiceListResultIterator provides access to a complete listing of Invoice values. +type InvoiceListResultIterator struct { + i int + page InvoiceListResultPage +} + +// 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 *InvoiceListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/InvoiceListResultIterator.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 *InvoiceListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter InvoiceListResultIterator) 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 InvoiceListResultIterator) Response() InvoiceListResult { + 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 InvoiceListResultIterator) Value() Invoice { + if !iter.page.NotDone() { + return Invoice{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the InvoiceListResultIterator type. +func NewInvoiceListResultIterator(page InvoiceListResultPage) InvoiceListResultIterator { + return InvoiceListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ilr InvoiceListResult) IsEmpty() bool { + return ilr.Value == nil || len(*ilr.Value) == 0 +} + +// invoiceListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ilr InvoiceListResult) invoiceListResultPreparer(ctx context.Context) (*http.Request, error) { + if ilr.NextLink == nil || len(to.String(ilr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ilr.NextLink))) +} + +// InvoiceListResultPage contains a page of Invoice values. +type InvoiceListResultPage struct { + fn func(context.Context, InvoiceListResult) (InvoiceListResult, error) + ilr InvoiceListResult +} + +// 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 *InvoiceListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/InvoiceListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.ilr) + if err != nil { + return err + } + page.ilr = next + 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 *InvoiceListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page InvoiceListResultPage) NotDone() bool { + return !page.ilr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page InvoiceListResultPage) Response() InvoiceListResult { + return page.ilr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page InvoiceListResultPage) Values() []Invoice { + if page.ilr.IsEmpty() { + return nil + } + return *page.ilr.Value +} + +// Creates a new instance of the InvoiceListResultPage type. +func NewInvoiceListResultPage(getNextPage func(context.Context, InvoiceListResult) (InvoiceListResult, error)) InvoiceListResultPage { + return InvoiceListResultPage{fn: getNextPage} +} + +// InvoiceProperties the properties of the invoice. +type InvoiceProperties struct { + // DueDate - READ-ONLY; The due date for the invoice. + DueDate *date.Time `json:"dueDate,omitempty"` + // InvoiceDate - READ-ONLY; The date when the invoice was generated. + InvoiceDate *date.Time `json:"invoiceDate,omitempty"` + // Status - READ-ONLY; The current status of the invoice. Possible values include: 'Due', 'OverDue', 'Paid' + Status InvoiceStatus `json:"status,omitempty"` + // AmountDue - READ-ONLY; The amount due as of now. + AmountDue *Amount `json:"amountDue,omitempty"` + // AzurePrepaymentApplied - READ-ONLY; The amount of Azure prepayment applied to the charges. This field is applicable to billing accounts with agreement type Microsoft Customer Agreement. + AzurePrepaymentApplied *Amount `json:"azurePrepaymentApplied,omitempty"` + // BilledAmount - READ-ONLY; The total charges for the invoice billing period. + BilledAmount *Amount `json:"billedAmount,omitempty"` + // CreditAmount - READ-ONLY; The total refund for returns and cancellations during the invoice billing period. This field is applicable to billing accounts with agreement type Microsoft Customer Agreement. + CreditAmount *Amount `json:"creditAmount,omitempty"` + // FreeAzureCreditApplied - READ-ONLY; The amount of free Azure credits applied to the charges. This field is applicable to billing accounts with agreement type Microsoft Customer Agreement. + FreeAzureCreditApplied *Amount `json:"freeAzureCreditApplied,omitempty"` + // SubTotal - READ-ONLY; The pre-tax amount due. This field is applicable to billing accounts with agreement type Microsoft Customer Agreement. + SubTotal *Amount `json:"subTotal,omitempty"` + // TaxAmount - READ-ONLY; The amount of tax charged for the billing period. This field is applicable to billing accounts with agreement type Microsoft Customer Agreement. + TaxAmount *Amount `json:"taxAmount,omitempty"` + // TotalAmount - READ-ONLY; The amount due when the invoice was generated. This field is applicable to billing accounts with agreement type Microsoft Customer Agreement. + TotalAmount *Amount `json:"totalAmount,omitempty"` + // InvoicePeriodStartDate - READ-ONLY; The start date of the billing period for which the invoice is generated. + InvoicePeriodStartDate *date.Time `json:"invoicePeriodStartDate,omitempty"` + // InvoicePeriodEndDate - READ-ONLY; The end date of the billing period for which the invoice is generated. + InvoicePeriodEndDate *date.Time `json:"invoicePeriodEndDate,omitempty"` + // InvoiceType - READ-ONLY; Invoice type. Possible values include: 'AzureService', 'AzureMarketplace', 'AzureSupport' + InvoiceType InvoiceType `json:"invoiceType,omitempty"` + // IsMonthlyInvoice - READ-ONLY; Specifies if the invoice is generated as part of monthly invoicing cycle or not. This field is applicable to billing accounts with agreement type Microsoft Customer Agreement. + IsMonthlyInvoice *bool `json:"isMonthlyInvoice,omitempty"` + // BillingProfileID - READ-ONLY; The ID of the billing profile for which the invoice is generated. + BillingProfileID *string `json:"billingProfileId,omitempty"` + // BillingProfileDisplayName - READ-ONLY; The name of the billing profile for which the invoice is generated. + BillingProfileDisplayName *string `json:"billingProfileDisplayName,omitempty"` + // PurchaseOrderNumber - READ-ONLY; An optional purchase order number for the invoice. + PurchaseOrderNumber *string `json:"purchaseOrderNumber,omitempty"` + // Documents - READ-ONLY; List of documents available to download such as invoice and tax receipt. + Documents *[]Document `json:"documents,omitempty"` + // Payments - READ-ONLY; List of payments. + Payments *[]PaymentProperties `json:"payments,omitempty"` + // SubscriptionID - READ-ONLY; The ID of the subscription for which the invoice is generated. + SubscriptionID *string `json:"subscriptionId,omitempty"` +} + +// InvoicesDownloadBillingSubscriptionInvoiceFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type InvoicesDownloadBillingSubscriptionInvoiceFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *InvoicesDownloadBillingSubscriptionInvoiceFuture) Result(client InvoicesClient) (du DownloadURL, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.InvoicesDownloadBillingSubscriptionInvoiceFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("billing.InvoicesDownloadBillingSubscriptionInvoiceFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if du.Response.Response, err = future.GetResult(sender); err == nil && du.Response.Response.StatusCode != http.StatusNoContent { + du, err = client.DownloadBillingSubscriptionInvoiceResponder(du.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.InvoicesDownloadBillingSubscriptionInvoiceFuture", "Result", du.Response.Response, "Failure responding to request") + } + } + return +} + +// InvoicesDownloadInvoiceFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type InvoicesDownloadInvoiceFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *InvoicesDownloadInvoiceFuture) Result(client InvoicesClient) (du DownloadURL, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.InvoicesDownloadInvoiceFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("billing.InvoicesDownloadInvoiceFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if du.Response.Response, err = future.GetResult(sender); err == nil && du.Response.Response.StatusCode != http.StatusNoContent { + du, err = client.DownloadInvoiceResponder(du.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.InvoicesDownloadInvoiceFuture", "Result", du.Response.Response, "Failure responding to request") + } + } + return +} + +// InvoiceSection an invoice section. +type InvoiceSection struct { + autorest.Response `json:"-"` + // InvoiceSectionProperties - The properties of an invoice section. + *InvoiceSectionProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for InvoiceSection. +func (is InvoiceSection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if is.InvoiceSectionProperties != nil { + objectMap["properties"] = is.InvoiceSectionProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for InvoiceSection struct. +func (is *InvoiceSection) 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 invoiceSectionProperties InvoiceSectionProperties + err = json.Unmarshal(*v, &invoiceSectionProperties) + if err != nil { + return err + } + is.InvoiceSectionProperties = &invoiceSectionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + is.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + is.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + is.Type = &typeVar + } + } + } + + return nil +} + +// InvoiceSectionCreationRequest the properties of the invoice section. +type InvoiceSectionCreationRequest struct { + // DisplayName - The name of the invoice section. + DisplayName *string `json:"displayName,omitempty"` +} + +// InvoiceSectionListResult the list of invoice sections. +type InvoiceSectionListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of invoice sections. + Value *[]InvoiceSection `json:"value,omitempty"` + // NextLink - READ-ONLY; The link (url) to the next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// InvoiceSectionListResultIterator provides access to a complete listing of InvoiceSection values. +type InvoiceSectionListResultIterator struct { + i int + page InvoiceSectionListResultPage +} + +// 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 *InvoiceSectionListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/InvoiceSectionListResultIterator.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 *InvoiceSectionListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter InvoiceSectionListResultIterator) 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 InvoiceSectionListResultIterator) Response() InvoiceSectionListResult { + 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 InvoiceSectionListResultIterator) Value() InvoiceSection { + if !iter.page.NotDone() { + return InvoiceSection{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the InvoiceSectionListResultIterator type. +func NewInvoiceSectionListResultIterator(page InvoiceSectionListResultPage) InvoiceSectionListResultIterator { + return InvoiceSectionListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (islr InvoiceSectionListResult) IsEmpty() bool { + return islr.Value == nil || len(*islr.Value) == 0 +} + +// invoiceSectionListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (islr InvoiceSectionListResult) invoiceSectionListResultPreparer(ctx context.Context) (*http.Request, error) { + if islr.NextLink == nil || len(to.String(islr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(islr.NextLink))) +} + +// InvoiceSectionListResultPage contains a page of InvoiceSection values. +type InvoiceSectionListResultPage struct { + fn func(context.Context, InvoiceSectionListResult) (InvoiceSectionListResult, error) + islr InvoiceSectionListResult +} + +// 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 *InvoiceSectionListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/InvoiceSectionListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.islr) + if err != nil { + return err + } + page.islr = next + 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 *InvoiceSectionListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page InvoiceSectionListResultPage) NotDone() bool { + return !page.islr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page InvoiceSectionListResultPage) Response() InvoiceSectionListResult { + return page.islr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page InvoiceSectionListResultPage) Values() []InvoiceSection { + if page.islr.IsEmpty() { + return nil + } + return *page.islr.Value +} + +// Creates a new instance of the InvoiceSectionListResultPage type. +func NewInvoiceSectionListResultPage(getNextPage func(context.Context, InvoiceSectionListResult) (InvoiceSectionListResult, error)) InvoiceSectionListResultPage { + return InvoiceSectionListResultPage{fn: getNextPage} +} + +// InvoiceSectionListWithCreateSubPermissionResult the list of invoice section properties with create +// subscription permission. +type InvoiceSectionListWithCreateSubPermissionResult struct { + autorest.Response `json:"-"` + // Value - The list of invoice section properties with create subscription permission. + Value *[]InvoiceSectionWithCreateSubPermission `json:"value,omitempty"` + // NextLink - READ-ONLY; The link (url) to the next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// InvoiceSectionListWithCreateSubPermissionResultIterator provides access to a complete listing of +// InvoiceSectionWithCreateSubPermission values. +type InvoiceSectionListWithCreateSubPermissionResultIterator struct { + i int + page InvoiceSectionListWithCreateSubPermissionResultPage +} + +// 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 *InvoiceSectionListWithCreateSubPermissionResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/InvoiceSectionListWithCreateSubPermissionResultIterator.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 *InvoiceSectionListWithCreateSubPermissionResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter InvoiceSectionListWithCreateSubPermissionResultIterator) 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 InvoiceSectionListWithCreateSubPermissionResultIterator) Response() InvoiceSectionListWithCreateSubPermissionResult { + 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 InvoiceSectionListWithCreateSubPermissionResultIterator) Value() InvoiceSectionWithCreateSubPermission { + if !iter.page.NotDone() { + return InvoiceSectionWithCreateSubPermission{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the InvoiceSectionListWithCreateSubPermissionResultIterator type. +func NewInvoiceSectionListWithCreateSubPermissionResultIterator(page InvoiceSectionListWithCreateSubPermissionResultPage) InvoiceSectionListWithCreateSubPermissionResultIterator { + return InvoiceSectionListWithCreateSubPermissionResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (islwcspr InvoiceSectionListWithCreateSubPermissionResult) IsEmpty() bool { + return islwcspr.Value == nil || len(*islwcspr.Value) == 0 +} + +// invoiceSectionListWithCreateSubPermissionResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (islwcspr InvoiceSectionListWithCreateSubPermissionResult) invoiceSectionListWithCreateSubPermissionResultPreparer(ctx context.Context) (*http.Request, error) { + if islwcspr.NextLink == nil || len(to.String(islwcspr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(islwcspr.NextLink))) +} + +// InvoiceSectionListWithCreateSubPermissionResultPage contains a page of +// InvoiceSectionWithCreateSubPermission values. +type InvoiceSectionListWithCreateSubPermissionResultPage struct { + fn func(context.Context, InvoiceSectionListWithCreateSubPermissionResult) (InvoiceSectionListWithCreateSubPermissionResult, error) + islwcspr InvoiceSectionListWithCreateSubPermissionResult +} + +// 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 *InvoiceSectionListWithCreateSubPermissionResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/InvoiceSectionListWithCreateSubPermissionResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.islwcspr) + if err != nil { + return err + } + page.islwcspr = next + 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 *InvoiceSectionListWithCreateSubPermissionResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page InvoiceSectionListWithCreateSubPermissionResultPage) NotDone() bool { + return !page.islwcspr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page InvoiceSectionListWithCreateSubPermissionResultPage) Response() InvoiceSectionListWithCreateSubPermissionResult { + return page.islwcspr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page InvoiceSectionListWithCreateSubPermissionResultPage) Values() []InvoiceSectionWithCreateSubPermission { + if page.islwcspr.IsEmpty() { + return nil + } + return *page.islwcspr.Value +} + +// Creates a new instance of the InvoiceSectionListWithCreateSubPermissionResultPage type. +func NewInvoiceSectionListWithCreateSubPermissionResultPage(getNextPage func(context.Context, InvoiceSectionListWithCreateSubPermissionResult) (InvoiceSectionListWithCreateSubPermissionResult, error)) InvoiceSectionListWithCreateSubPermissionResultPage { + return InvoiceSectionListWithCreateSubPermissionResultPage{fn: getNextPage} +} + +// InvoiceSectionProperties the properties of an invoice section. +type InvoiceSectionProperties struct { + // DisplayName - The name of the invoice section. + DisplayName *string `json:"displayName,omitempty"` + // Labels - Dictionary of metadata associated with the invoice section. + Labels map[string]*string `json:"labels"` + // SystemID - READ-ONLY; The system generated unique identifier for an invoice section. + SystemID *string `json:"systemId,omitempty"` +} + +// MarshalJSON is the custom marshaler for InvoiceSectionProperties. +func (isp InvoiceSectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if isp.DisplayName != nil { + objectMap["displayName"] = isp.DisplayName + } + if isp.Labels != nil { + objectMap["labels"] = isp.Labels + } + return json.Marshal(objectMap) +} + +// InvoiceSectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type InvoiceSectionsCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *InvoiceSectionsCreateOrUpdateFuture) Result(client InvoiceSectionsClient) (is InvoiceSection, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.InvoiceSectionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("billing.InvoiceSectionsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if is.Response.Response, err = future.GetResult(sender); err == nil && is.Response.Response.StatusCode != http.StatusNoContent { + is, err = client.CreateOrUpdateResponder(is.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.InvoiceSectionsCreateOrUpdateFuture", "Result", is.Response.Response, "Failure responding to request") + } + } + return +} + +// InvoiceSectionsOnExpand the invoice sections associated to the billing profile. By default this is not +// populated, unless it's specified in $expand. +type InvoiceSectionsOnExpand struct { + // HasMoreResults - READ-ONLY; Indicates whether there are more invoice sections than the ones listed in this collection. The collection lists a maximum of 50 invoice sections. To get all invoice sections, use the list invoice sections API. + HasMoreResults *bool `json:"hasMoreResults,omitempty"` + // Value - The invoice sections associated to the billing profile. + Value *[]InvoiceSection `json:"value,omitempty"` +} + +// InvoiceSectionWithCreateSubPermission invoice section properties with create subscription permission. +type InvoiceSectionWithCreateSubPermission struct { + // InvoiceSectionID - READ-ONLY; The ID of the invoice section. + InvoiceSectionID *string `json:"invoiceSectionId,omitempty"` + // InvoiceSectionDisplayName - READ-ONLY; The name of the invoice section. + InvoiceSectionDisplayName *string `json:"invoiceSectionDisplayName,omitempty"` + // InvoiceSectionSystemID - READ-ONLY; The system generated unique identifier for an invoice section. + InvoiceSectionSystemID *string `json:"invoiceSectionSystemId,omitempty"` + // BillingProfileID - READ-ONLY; The ID of the billing profile for the invoice section. + BillingProfileID *string `json:"billingProfileId,omitempty"` + // BillingProfileDisplayName - READ-ONLY; The name of the billing profile for the invoice section. + BillingProfileDisplayName *string `json:"billingProfileDisplayName,omitempty"` + // BillingProfileStatus - READ-ONLY; The status of the billing profile. Possible values include: 'ProfileStatusActive', 'ProfileStatusDisabled', 'ProfileStatusWarned' + BillingProfileStatus ProfileStatus `json:"billingProfileStatus,omitempty"` + // BillingProfileStatusReasonCode - READ-ONLY; Reason for the specified billing profile status. Possible values include: 'StatusReasonCodeForBillingProfilePastDue', 'StatusReasonCodeForBillingProfileSpendingLimitReached', 'StatusReasonCodeForBillingProfileSpendingLimitExpired' + BillingProfileStatusReasonCode StatusReasonCodeForBillingProfile `json:"billingProfileStatusReasonCode,omitempty"` + // BillingProfileSpendingLimit - READ-ONLY; The billing profile spending limit. Possible values include: 'SpendingLimitForBillingProfileOff', 'SpendingLimitForBillingProfileOn' + BillingProfileSpendingLimit SpendingLimitForBillingProfile `json:"billingProfileSpendingLimit,omitempty"` + // BillingProfileSystemID - READ-ONLY; The system generated unique identifier for a billing profile. + BillingProfileSystemID *string `json:"billingProfileSystemId,omitempty"` + // EnabledAzurePlans - Enabled azure plans for the associated billing profile. + EnabledAzurePlans *[]AzurePlan `json:"enabledAzurePlans,omitempty"` +} + +// Operation a Billing REST API operation. +type Operation struct { + // Name - READ-ONLY; Operation name: {provider}/{resource}/{operation}. + Name *string `json:"name,omitempty"` + // Display - The object that represents the operation. + Display *OperationDisplay `json:"display,omitempty"` +} + +// OperationDisplay the object that represents the operation. +type OperationDisplay struct { + // Provider - READ-ONLY; Service provider: Microsoft.Billing. + Provider *string `json:"provider,omitempty"` + // Resource - READ-ONLY; Resource on which the operation is performed such as invoice and billing subscription. + Resource *string `json:"resource,omitempty"` + // Operation - READ-ONLY; Operation type such as read, write and delete. + Operation *string `json:"operation,omitempty"` +} + +// OperationListResult the list of billing operations and a URL link to get the next set of results. +type OperationListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of billing operations supported by the Microsoft.Billing 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"` +} + +// 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 +} + +// 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.NextLink == nil || len(to.String(olr.NextLink)) < 1 { + 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) + }() + } + next, err := page.fn(ctx, page.olr) + if err != nil { + return err + } + page.olr = next + 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(getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { + return OperationListResultPage{fn: getNextPage} +} + +// Participants the details about a participant. +type Participants struct { + // Status - READ-ONLY; The acceptance status of the participant. + Status *string `json:"status,omitempty"` + // StatusDate - READ-ONLY; The date when the status got changed. + StatusDate *date.Time `json:"statusDate,omitempty"` + // Email - READ-ONLY; The email address of the participant. + Email *string `json:"email,omitempty"` +} + +// PaymentProperties the properties of a payment. +type PaymentProperties struct { + // PaymentType - READ-ONLY; The type of payment. + PaymentType *string `json:"paymentType,omitempty"` + // Amount - READ-ONLY; The paid amount. + Amount *Amount `json:"amount,omitempty"` + // Date - READ-ONLY; The date when the payment was made. + Date *date.Time `json:"date,omitempty"` + // PaymentMethodFamily - The family of payment method. Possible values include: 'Credits', 'CheckWire', 'CreditCard', 'None' + PaymentMethodFamily PaymentMethodFamily `json:"paymentMethodFamily,omitempty"` + // PaymentMethodType - READ-ONLY; The type of payment method. + PaymentMethodType *string `json:"paymentMethodType,omitempty"` +} + +// PermissionsListResult result of list billingPermissions a caller has on a billing account. +type PermissionsListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of billingPermissions a caller has on a billing account. + Value *[]PermissionsProperties `json:"value,omitempty"` + // NextLink - READ-ONLY; The link (url) to the next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// PermissionsListResultIterator provides access to a complete listing of PermissionsProperties values. +type PermissionsListResultIterator struct { + i int + page PermissionsListResultPage +} + +// 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 *PermissionsListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PermissionsListResultIterator.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 *PermissionsListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter PermissionsListResultIterator) 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 PermissionsListResultIterator) Response() PermissionsListResult { + 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 PermissionsListResultIterator) Value() PermissionsProperties { + if !iter.page.NotDone() { + return PermissionsProperties{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the PermissionsListResultIterator type. +func NewPermissionsListResultIterator(page PermissionsListResultPage) PermissionsListResultIterator { + return PermissionsListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (plr PermissionsListResult) IsEmpty() bool { + return plr.Value == nil || len(*plr.Value) == 0 +} + +// permissionsListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (plr PermissionsListResult) permissionsListResultPreparer(ctx context.Context) (*http.Request, error) { + if plr.NextLink == nil || len(to.String(plr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(plr.NextLink))) +} + +// PermissionsListResultPage contains a page of PermissionsProperties values. +type PermissionsListResultPage struct { + fn func(context.Context, PermissionsListResult) (PermissionsListResult, error) + plr PermissionsListResult +} + +// 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 *PermissionsListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PermissionsListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.plr) + if err != nil { + return err + } + page.plr = next + 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 *PermissionsListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page PermissionsListResultPage) NotDone() bool { + return !page.plr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page PermissionsListResultPage) Response() PermissionsListResult { + return page.plr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page PermissionsListResultPage) Values() []PermissionsProperties { + if page.plr.IsEmpty() { + return nil + } + return *page.plr.Value +} + +// Creates a new instance of the PermissionsListResultPage type. +func NewPermissionsListResultPage(getNextPage func(context.Context, PermissionsListResult) (PermissionsListResult, error)) PermissionsListResultPage { + return PermissionsListResultPage{fn: getNextPage} +} + +// PermissionsProperties the set of allowed action and not allowed actions a caller has on a billing +// account +type PermissionsProperties struct { + // Actions - READ-ONLY; The set of actions that the caller is allowed to perform. + Actions *[]string `json:"actions,omitempty"` + // NotActions - READ-ONLY; The set of actions that the caller is not allowed to perform. + NotActions *[]string `json:"notActions,omitempty"` +} + +// Policy a policy. +type Policy struct { + autorest.Response `json:"-"` + *PolicyProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Policy. +func (p Policy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if p.PolicyProperties != nil { + objectMap["properties"] = p.PolicyProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Policy struct. +func (p *Policy) 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 policyProperties PolicyProperties + err = json.Unmarshal(*v, &policyProperties) + if err != nil { + return err + } + p.PolicyProperties = &policyProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + p.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + p.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + p.Type = &typeVar + } + } + } + + return nil +} + +// PolicyProperties the properties of a policy. +type PolicyProperties struct { + // MarketplacePurchases - The policy that controls whether Azure marketplace purchases are allowed for a billing profile. Possible values include: 'AllAllowed', 'OnlyFreeAllowed', 'NotAllowed' + MarketplacePurchases MarketplacePurchasesPolicy `json:"marketplacePurchases,omitempty"` + // ReservationPurchases - The policy that controls whether Azure reservation purchases are allowed for a billing profile. Possible values include: 'ReservationPurchasesPolicyAllowed', 'ReservationPurchasesPolicyNotAllowed' + ReservationPurchases ReservationPurchasesPolicy `json:"reservationPurchases,omitempty"` + // ViewCharges - The policy that controls whether users with Azure RBAC access to a subscription can view its charges. Possible values include: 'ViewChargesPolicyAllowed', 'ViewChargesPolicyNotAllowed' + ViewCharges ViewChargesPolicy `json:"viewCharges,omitempty"` +} + +// Product a product. +type Product struct { + autorest.Response `json:"-"` + *ProductProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Product. +func (p Product) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if p.ProductProperties != nil { + objectMap["properties"] = p.ProductProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Product struct. +func (p *Product) 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 productProperties ProductProperties + err = json.Unmarshal(*v, &productProperties) + if err != nil { + return err + } + p.ProductProperties = &productProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + p.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + p.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + p.Type = &typeVar + } + } + } + + return nil +} + +// ProductProperties the properties of a product. +type ProductProperties struct { + // AutoRenew - Indicates whether auto renewal is turned on or off for a product. Possible values include: 'Off', 'On' + AutoRenew AutoRenew `json:"autoRenew,omitempty"` + // DisplayName - READ-ONLY; The display name of the product. + DisplayName *string `json:"displayName,omitempty"` + // PurchaseDate - READ-ONLY; The date when the product was purchased. + PurchaseDate *date.Time `json:"purchaseDate,omitempty"` + // ProductTypeID - READ-ONLY; The ID of the type of product. + ProductTypeID *string `json:"productTypeId,omitempty"` + // ProductType - READ-ONLY; The description of the type of product. + ProductType *string `json:"productType,omitempty"` + // Status - The current status of the product. Possible values include: 'ProductStatusTypeActive', 'ProductStatusTypeInactive', 'ProductStatusTypePastDue', 'ProductStatusTypeExpiring', 'ProductStatusTypeExpired', 'ProductStatusTypeDisabled', 'ProductStatusTypeCancelled', 'ProductStatusTypeAutoRenew' + Status ProductStatusType `json:"status,omitempty"` + // EndDate - READ-ONLY; The date when the product will be renewed or canceled. + EndDate *date.Time `json:"endDate,omitempty"` + // BillingFrequency - The frequency at which the product will be billed. Possible values include: 'OneTime', 'Monthly', 'UsageBased' + BillingFrequency Frequency `json:"billingFrequency,omitempty"` + // LastCharge - READ-ONLY; The last month charges. + LastCharge *Amount `json:"lastCharge,omitempty"` + // LastChargeDate - READ-ONLY; The date of the last charge. + LastChargeDate *date.Time `json:"lastChargeDate,omitempty"` + // Quantity - READ-ONLY; The quantity purchased for the product. + Quantity *float64 `json:"quantity,omitempty"` + // SkuID - READ-ONLY; The sku ID of the product. + SkuID *string `json:"skuId,omitempty"` + // SkuDescription - READ-ONLY; The sku description of the product. + SkuDescription *string `json:"skuDescription,omitempty"` + // TenantID - READ-ONLY; The id of the tenant in which the product is used. + TenantID *string `json:"tenantId,omitempty"` + // AvailabilityID - READ-ONLY; The availability of the product. + AvailabilityID *string `json:"availabilityId,omitempty"` + // InvoiceSectionID - READ-ONLY; The ID of the invoice section to which the product is billed. + InvoiceSectionID *string `json:"invoiceSectionId,omitempty"` + // InvoiceSectionDisplayName - READ-ONLY; The name of the invoice section to which the product is billed. + InvoiceSectionDisplayName *string `json:"invoiceSectionDisplayName,omitempty"` + // BillingProfileID - READ-ONLY; The ID of the billing profile to which the product is billed. + BillingProfileID *string `json:"billingProfileId,omitempty"` + // BillingProfileDisplayName - READ-ONLY; The name of the billing profile to which the product is billed. + BillingProfileDisplayName *string `json:"billingProfileDisplayName,omitempty"` + // CustomerID - READ-ONLY; The ID of the customer for whom the product was purchased. The field is applicable only for Microsoft Partner Agreement billing account. + CustomerID *string `json:"customerId,omitempty"` + // CustomerDisplayName - READ-ONLY; The name of the customer for whom the product was purchased. The field is applicable only for Microsoft Partner Agreement billing account. + CustomerDisplayName *string `json:"customerDisplayName,omitempty"` + // Reseller - READ-ONLY; Reseller for this product. + Reseller *Reseller `json:"reseller,omitempty"` +} + +// ProductsListResult the list of products. It contains a list of available product summaries in reverse +// chronological order by purchase date. +type ProductsListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of products. + Value *[]Product `json:"value,omitempty"` + // NextLink - READ-ONLY; The link (url) to the next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// ProductsListResultIterator provides access to a complete listing of Product values. +type ProductsListResultIterator struct { + i int + page ProductsListResultPage +} + +// 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 *ProductsListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProductsListResultIterator.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 *ProductsListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ProductsListResultIterator) 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 ProductsListResultIterator) Response() ProductsListResult { + 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 ProductsListResultIterator) Value() Product { + if !iter.page.NotDone() { + return Product{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ProductsListResultIterator type. +func NewProductsListResultIterator(page ProductsListResultPage) ProductsListResultIterator { + return ProductsListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (plr ProductsListResult) IsEmpty() bool { + return plr.Value == nil || len(*plr.Value) == 0 +} + +// productsListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (plr ProductsListResult) productsListResultPreparer(ctx context.Context) (*http.Request, error) { + if plr.NextLink == nil || len(to.String(plr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(plr.NextLink))) +} + +// ProductsListResultPage contains a page of Product values. +type ProductsListResultPage struct { + fn func(context.Context, ProductsListResult) (ProductsListResult, error) + plr ProductsListResult +} + +// 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 *ProductsListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProductsListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.plr) + if err != nil { + return err + } + page.plr = next + 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 *ProductsListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ProductsListResultPage) NotDone() bool { + return !page.plr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ProductsListResultPage) Response() ProductsListResult { + return page.plr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ProductsListResultPage) Values() []Product { + if page.plr.IsEmpty() { + return nil + } + return *page.plr.Value +} + +// Creates a new instance of the ProductsListResultPage type. +func NewProductsListResultPage(getNextPage func(context.Context, ProductsListResult) (ProductsListResult, error)) ProductsListResultPage { + return ProductsListResultPage{fn: getNextPage} +} + +// Profile a billing profile. +type Profile struct { + autorest.Response `json:"-"` + // ProfileProperties - The properties of the billing profile. + *ProfileProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Profile. +func (p Profile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if p.ProfileProperties != nil { + objectMap["properties"] = p.ProfileProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Profile struct. +func (p *Profile) 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 profileProperties ProfileProperties + err = json.Unmarshal(*v, &profileProperties) + if err != nil { + return err + } + p.ProfileProperties = &profileProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + p.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + p.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + p.Type = &typeVar + } + } + } + + return nil +} + +// ProfileCreationRequest the request parameters for creating a new billing profile. +type ProfileCreationRequest struct { + // DisplayName - The name of the billing profile. + DisplayName *string `json:"displayName,omitempty"` + // PoNumber - The purchase order name that will appear on the invoices generated for the billing profile. + PoNumber *string `json:"poNumber,omitempty"` + // BillTo - The address of the individual or organization that is responsible for the billing profile. + BillTo *AddressDetails `json:"billTo,omitempty"` + // InvoiceEmailOptIn - Flag controlling whether the invoices for the billing profile are sent through email. + InvoiceEmailOptIn *bool `json:"invoiceEmailOptIn,omitempty"` + // EnabledAzurePlans - Enabled azure plans for the billing profile. + EnabledAzurePlans *[]AzurePlan `json:"enabledAzurePlans,omitempty"` +} + +// ProfileListResult the list of billing profiles. +type ProfileListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of billing profiles. + Value *[]Profile `json:"value,omitempty"` + // NextLink - READ-ONLY; The link (url) to the next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// ProfileListResultIterator provides access to a complete listing of Profile values. +type ProfileListResultIterator struct { + i int + page ProfileListResultPage +} + +// 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 *ProfileListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProfileListResultIterator.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 *ProfileListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ProfileListResultIterator) 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 ProfileListResultIterator) Response() ProfileListResult { + 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 ProfileListResultIterator) Value() Profile { + if !iter.page.NotDone() { + return Profile{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ProfileListResultIterator type. +func NewProfileListResultIterator(page ProfileListResultPage) ProfileListResultIterator { + return ProfileListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (plr ProfileListResult) IsEmpty() bool { + return plr.Value == nil || len(*plr.Value) == 0 +} + +// profileListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (plr ProfileListResult) profileListResultPreparer(ctx context.Context) (*http.Request, error) { + if plr.NextLink == nil || len(to.String(plr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(plr.NextLink))) +} + +// ProfileListResultPage contains a page of Profile values. +type ProfileListResultPage struct { + fn func(context.Context, ProfileListResult) (ProfileListResult, error) + plr ProfileListResult +} + +// 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 *ProfileListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProfileListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.plr) + if err != nil { + return err + } + page.plr = next + 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 *ProfileListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ProfileListResultPage) NotDone() bool { + return !page.plr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ProfileListResultPage) Response() ProfileListResult { + return page.plr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ProfileListResultPage) Values() []Profile { + if page.plr.IsEmpty() { + return nil + } + return *page.plr.Value +} + +// Creates a new instance of the ProfileListResultPage type. +func NewProfileListResultPage(getNextPage func(context.Context, ProfileListResult) (ProfileListResult, error)) ProfileListResultPage { + return ProfileListResultPage{fn: getNextPage} +} + +// ProfileProperties the properties of the billing profile. +type ProfileProperties struct { + // DisplayName - The name of the billing profile. + DisplayName *string `json:"displayName,omitempty"` + // PoNumber - The purchase order name that will appear on the invoices generated for the billing profile. + PoNumber *string `json:"poNumber,omitempty"` + // BillTo - Billing address. + BillTo *AddressDetails `json:"billTo,omitempty"` + // InvoiceEmailOptIn - Flag controlling whether the invoices for the billing profile are sent through email. + InvoiceEmailOptIn *bool `json:"invoiceEmailOptIn,omitempty"` + // InvoiceDay - READ-ONLY; The day of the month when the invoice for the billing profile is generated. + InvoiceDay *int32 `json:"invoiceDay,omitempty"` + // Currency - READ-ONLY; The currency in which the charges for the billing profile are billed. + Currency *string `json:"currency,omitempty"` + // EnabledAzurePlans - Information about the enabled azure plans. + EnabledAzurePlans *[]AzurePlan `json:"enabledAzurePlans,omitempty"` + // InvoiceSections - The invoice sections associated to the billing profile. By default this is not populated, unless it's specified in $expand. + InvoiceSections *InvoiceSectionsOnExpand `json:"invoiceSections,omitempty"` + // HasReadAccess - READ-ONLY; Indicates whether user has read access to the billing profile. + HasReadAccess *bool `json:"hasReadAccess,omitempty"` + // SystemID - READ-ONLY; The system generated unique identifier for a billing profile. + SystemID *string `json:"systemId,omitempty"` + // Status - READ-ONLY; The status of the billing profile. Possible values include: 'ProfileStatusActive', 'ProfileStatusDisabled', 'ProfileStatusWarned' + Status ProfileStatus `json:"status,omitempty"` + // StatusReasonCode - READ-ONLY; Reason for the specified billing profile status. Possible values include: 'StatusReasonCodePastDue', 'StatusReasonCodeSpendingLimitReached', 'StatusReasonCodeSpendingLimitExpired' + StatusReasonCode StatusReasonCode `json:"statusReasonCode,omitempty"` + // SpendingLimit - READ-ONLY; The billing profile spending limit. Possible values include: 'SpendingLimitOff', 'SpendingLimitOn' + SpendingLimit SpendingLimit `json:"spendingLimit,omitempty"` +} + +// ProfilesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ProfilesCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ProfilesCreateOrUpdateFuture) Result(client ProfilesClient) (p Profile, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.ProfilesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("billing.ProfilesCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if p.Response.Response, err = future.GetResult(sender); err == nil && p.Response.Response.StatusCode != http.StatusNoContent { + p, err = client.CreateOrUpdateResponder(p.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.ProfilesCreateOrUpdateFuture", "Result", p.Response.Response, "Failure responding to request") + } + } + return +} + +// ProfilesOnExpand the billing profiles associated with the billing account. By default this is not +// populated, unless it's specified in $expand. +type ProfilesOnExpand struct { + // HasMoreResults - READ-ONLY; Indicates whether there are more billing profiles than the ones listed in this collection. The collection lists a maximum of 50 billing profiles. To get all billing profiles, use the list billing profiles API. + HasMoreResults *bool `json:"hasMoreResults,omitempty"` + // Value - The billing profiles associated with the billing account. + Value *[]Profile `json:"value,omitempty"` +} + +// Property a billing property. +type Property struct { + autorest.Response `json:"-"` + // PropertyProperties - A billing property. + *PropertyProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Property. +func (p Property) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if p.PropertyProperties != nil { + objectMap["properties"] = p.PropertyProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Property struct. +func (p *Property) 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 propertyProperties PropertyProperties + err = json.Unmarshal(*v, &propertyProperties) + if err != nil { + return err + } + p.PropertyProperties = &propertyProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + p.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + p.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + p.Type = &typeVar + } + } + } + + return nil +} + +// PropertyProperties the billing property. +type PropertyProperties struct { + // AccountAdminNotificationEmailAddress - READ-ONLY; The email address on which the account admin gets all Azure notifications. + AccountAdminNotificationEmailAddress *string `json:"accountAdminNotificationEmailAddress,omitempty"` + // BillingTenantID - READ-ONLY; The Azure AD tenant ID of the billing account for the subscription. + BillingTenantID *string `json:"billingTenantId,omitempty"` + // BillingAccountID - READ-ONLY; The ID of the billing account to which the subscription is billed. + BillingAccountID *string `json:"billingAccountId,omitempty"` + // BillingAccountDisplayName - READ-ONLY; The name of the billing account to which the subscription is billed. + BillingAccountDisplayName *string `json:"billingAccountDisplayName,omitempty"` + // BillingProfileID - READ-ONLY; The ID of the billing profile to which the subscription is billed. + BillingProfileID *string `json:"billingProfileId,omitempty"` + // BillingProfileDisplayName - READ-ONLY; The name of the billing profile to which the subscription is billed. + BillingProfileDisplayName *string `json:"billingProfileDisplayName,omitempty"` + // BillingProfileStatus - READ-ONLY; The status of the billing profile. Possible values include: 'ProfileStatusActive', 'ProfileStatusDisabled', 'ProfileStatusWarned' + BillingProfileStatus ProfileStatus `json:"billingProfileStatus,omitempty"` + // BillingProfileStatusReasonCode - READ-ONLY; Reason for the specified billing profile status. Possible values include: 'PastDue', 'SpendingLimitReached', 'SpendingLimitExpired' + BillingProfileStatusReasonCode ProfileStatusReasonCode `json:"billingProfileStatusReasonCode,omitempty"` + // BillingProfileSpendingLimit - READ-ONLY; The billing profile spending limit. Possible values include: 'ProfileSpendingLimitOff', 'ProfileSpendingLimitOn' + BillingProfileSpendingLimit ProfileSpendingLimit `json:"billingProfileSpendingLimit,omitempty"` + // CostCenter - The cost center applied to the subscription. + CostCenter *string `json:"costCenter,omitempty"` + // InvoiceSectionID - READ-ONLY; The ID of the invoice section to which the subscription is billed. + InvoiceSectionID *string `json:"invoiceSectionId,omitempty"` + // InvoiceSectionDisplayName - READ-ONLY; The name of the invoice section to which the subscription is billed. + InvoiceSectionDisplayName *string `json:"invoiceSectionDisplayName,omitempty"` + // IsAccountAdmin - READ-ONLY; Indicates whether user is the account admin. + IsAccountAdmin *bool `json:"isAccountAdmin,omitempty"` + // ProductID - READ-ONLY; The product ID of the Azure plan. + ProductID *string `json:"productId,omitempty"` + // ProductName - READ-ONLY; The product name of the Azure plan. + ProductName *string `json:"productName,omitempty"` + // SkuID - READ-ONLY; The sku ID of the Azure plan for the subscription. + SkuID *string `json:"skuId,omitempty"` + // SkuDescription - READ-ONLY; The sku description of the Azure plan for the subscription. + SkuDescription *string `json:"skuDescription,omitempty"` +} + +// Reseller details of the reseller. +type Reseller struct { + // ResellerID - READ-ONLY; The MPN ID of the reseller. + ResellerID *string `json:"resellerId,omitempty"` + // Description - READ-ONLY; The name of the reseller. + Description *string `json:"description,omitempty"` +} + +// Resource the Resource model definition. +type Resource struct { + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// RoleAssignment the role assignment +type RoleAssignment struct { + autorest.Response `json:"-"` + // RoleAssignmentProperties - The properties of the role assignment. + *RoleAssignmentProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for RoleAssignment. +func (ra RoleAssignment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ra.RoleAssignmentProperties != nil { + objectMap["properties"] = ra.RoleAssignmentProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for RoleAssignment struct. +func (ra *RoleAssignment) 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 roleAssignmentProperties RoleAssignmentProperties + err = json.Unmarshal(*v, &roleAssignmentProperties) + if err != nil { + return err + } + ra.RoleAssignmentProperties = &roleAssignmentProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ra.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ra.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ra.Type = &typeVar + } + } + } + + return nil +} + +// RoleAssignmentListResult the list of role assignments. +type RoleAssignmentListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of role assignments. + Value *[]RoleAssignment `json:"value,omitempty"` + // NextLink - READ-ONLY; The link (url) to the next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// RoleAssignmentListResultIterator provides access to a complete listing of RoleAssignment values. +type RoleAssignmentListResultIterator struct { + i int + page RoleAssignmentListResultPage +} + +// 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 *RoleAssignmentListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RoleAssignmentListResultIterator.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 *RoleAssignmentListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter RoleAssignmentListResultIterator) 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 RoleAssignmentListResultIterator) Response() RoleAssignmentListResult { + 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 RoleAssignmentListResultIterator) Value() RoleAssignment { + if !iter.page.NotDone() { + return RoleAssignment{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the RoleAssignmentListResultIterator type. +func NewRoleAssignmentListResultIterator(page RoleAssignmentListResultPage) RoleAssignmentListResultIterator { + return RoleAssignmentListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ralr RoleAssignmentListResult) IsEmpty() bool { + return ralr.Value == nil || len(*ralr.Value) == 0 +} + +// roleAssignmentListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ralr RoleAssignmentListResult) roleAssignmentListResultPreparer(ctx context.Context) (*http.Request, error) { + if ralr.NextLink == nil || len(to.String(ralr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ralr.NextLink))) +} + +// RoleAssignmentListResultPage contains a page of RoleAssignment values. +type RoleAssignmentListResultPage struct { + fn func(context.Context, RoleAssignmentListResult) (RoleAssignmentListResult, error) + ralr RoleAssignmentListResult +} + +// 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 *RoleAssignmentListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RoleAssignmentListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.ralr) + if err != nil { + return err + } + page.ralr = next + 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 *RoleAssignmentListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page RoleAssignmentListResultPage) NotDone() bool { + return !page.ralr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page RoleAssignmentListResultPage) Response() RoleAssignmentListResult { + return page.ralr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page RoleAssignmentListResultPage) Values() []RoleAssignment { + if page.ralr.IsEmpty() { + return nil + } + return *page.ralr.Value +} + +// Creates a new instance of the RoleAssignmentListResultPage type. +func NewRoleAssignmentListResultPage(getNextPage func(context.Context, RoleAssignmentListResult) (RoleAssignmentListResult, error)) RoleAssignmentListResultPage { + return RoleAssignmentListResultPage{fn: getNextPage} +} + +// RoleAssignmentProperties the properties of the role assignment. +type RoleAssignmentProperties struct { + // CreatedOn - READ-ONLY; The date the role assignment was created. + CreatedOn *string `json:"createdOn,omitempty"` + // CreatedByPrincipalTenantID - READ-ONLY; The tenant Id of the user who created the role assignment. + CreatedByPrincipalTenantID *string `json:"createdByPrincipalTenantId,omitempty"` + // CreatedByPrincipalID - READ-ONLY; The principal Id of the user who created the role assignment. + CreatedByPrincipalID *string `json:"createdByPrincipalId,omitempty"` + // CreatedByUserEmailAddress - READ-ONLY; The email address of the user who created the role assignment. + CreatedByUserEmailAddress *string `json:"createdByUserEmailAddress,omitempty"` + // PrincipalID - READ-ONLY; The principal id of the user to whom the role was assigned. + PrincipalID *string `json:"principalId,omitempty"` + // PrincipalTenantID - READ-ONLY; The principal tenant id of the user to whom the role was assigned. + PrincipalTenantID *string `json:"principalTenantId,omitempty"` + // RoleDefinitionID - READ-ONLY; The ID of the role definition. + RoleDefinitionID *string `json:"roleDefinitionId,omitempty"` + // Scope - READ-ONLY; The scope at which the role was assigned. + Scope *string `json:"scope,omitempty"` + // UserAuthenticationType - READ-ONLY; The authentication type. + UserAuthenticationType *string `json:"userAuthenticationType,omitempty"` + // UserEmailAddress - READ-ONLY; The email address of the user. + UserEmailAddress *string `json:"userEmailAddress,omitempty"` +} + +// RoleDefinition the properties of a role definition. +type RoleDefinition struct { + autorest.Response `json:"-"` + // RoleDefinitionProperties - The properties of the a role definition. + *RoleDefinitionProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for RoleDefinition. +func (rd RoleDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rd.RoleDefinitionProperties != nil { + objectMap["properties"] = rd.RoleDefinitionProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for RoleDefinition struct. +func (rd *RoleDefinition) 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 roleDefinitionProperties RoleDefinitionProperties + err = json.Unmarshal(*v, &roleDefinitionProperties) + if err != nil { + return err + } + rd.RoleDefinitionProperties = &roleDefinitionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rd.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rd.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rd.Type = &typeVar + } + } + } + + return nil +} + +// RoleDefinitionListResult the list of role definitions. +type RoleDefinitionListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The role definitions. + Value *[]RoleDefinition `json:"value,omitempty"` + // NextLink - READ-ONLY; The link (url) to the next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// RoleDefinitionListResultIterator provides access to a complete listing of RoleDefinition values. +type RoleDefinitionListResultIterator struct { + i int + page RoleDefinitionListResultPage +} + +// 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 *RoleDefinitionListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RoleDefinitionListResultIterator.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 *RoleDefinitionListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter RoleDefinitionListResultIterator) 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 RoleDefinitionListResultIterator) Response() RoleDefinitionListResult { + 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 RoleDefinitionListResultIterator) Value() RoleDefinition { + if !iter.page.NotDone() { + return RoleDefinition{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the RoleDefinitionListResultIterator type. +func NewRoleDefinitionListResultIterator(page RoleDefinitionListResultPage) RoleDefinitionListResultIterator { + return RoleDefinitionListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rdlr RoleDefinitionListResult) IsEmpty() bool { + return rdlr.Value == nil || len(*rdlr.Value) == 0 +} + +// roleDefinitionListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rdlr RoleDefinitionListResult) roleDefinitionListResultPreparer(ctx context.Context) (*http.Request, error) { + if rdlr.NextLink == nil || len(to.String(rdlr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rdlr.NextLink))) +} + +// RoleDefinitionListResultPage contains a page of RoleDefinition values. +type RoleDefinitionListResultPage struct { + fn func(context.Context, RoleDefinitionListResult) (RoleDefinitionListResult, error) + rdlr RoleDefinitionListResult +} + +// 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 *RoleDefinitionListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RoleDefinitionListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.rdlr) + if err != nil { + return err + } + page.rdlr = next + 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 *RoleDefinitionListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page RoleDefinitionListResultPage) NotDone() bool { + return !page.rdlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page RoleDefinitionListResultPage) Response() RoleDefinitionListResult { + return page.rdlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page RoleDefinitionListResultPage) Values() []RoleDefinition { + if page.rdlr.IsEmpty() { + return nil + } + return *page.rdlr.Value +} + +// Creates a new instance of the RoleDefinitionListResultPage type. +func NewRoleDefinitionListResultPage(getNextPage func(context.Context, RoleDefinitionListResult) (RoleDefinitionListResult, error)) RoleDefinitionListResultPage { + return RoleDefinitionListResultPage{fn: getNextPage} +} + +// RoleDefinitionProperties the properties of the a role definition. +type RoleDefinitionProperties struct { + // Description - READ-ONLY; The role description + Description *string `json:"description,omitempty"` + // Permissions - The billingPermissions the role has + Permissions *[]PermissionsProperties `json:"permissions,omitempty"` + // RoleName - READ-ONLY; The name of the role + RoleName *string `json:"roleName,omitempty"` +} + +// Subscription a billing subscription. +type Subscription struct { + autorest.Response `json:"-"` + *SubscriptionProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Subscription. +func (s Subscription) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if s.SubscriptionProperties != nil { + objectMap["properties"] = s.SubscriptionProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Subscription struct. +func (s *Subscription) 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 subscriptionProperties SubscriptionProperties + err = json.Unmarshal(*v, &subscriptionProperties) + if err != nil { + return err + } + s.SubscriptionProperties = &subscriptionProperties + } + 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 +} + +// SubscriptionProperties the billing properties of a subscription. +type SubscriptionProperties struct { + // DisplayName - READ-ONLY; The name of the subscription. + DisplayName *string `json:"displayName,omitempty"` + // SubscriptionID - READ-ONLY; The ID of the subscription. + SubscriptionID *uuid.UUID `json:"subscriptionId,omitempty"` + // SubscriptionBillingStatus - The current billing status of the subscription. Possible values include: 'SubscriptionStatusTypeActive', 'SubscriptionStatusTypeInactive', 'SubscriptionStatusTypeAbandoned', 'SubscriptionStatusTypeDeleted', 'SubscriptionStatusTypeWarning' + SubscriptionBillingStatus SubscriptionStatusType `json:"subscriptionBillingStatus,omitempty"` + // LastMonthCharges - READ-ONLY; The last month charges. + LastMonthCharges *Amount `json:"lastMonthCharges,omitempty"` + // MonthToDateCharges - READ-ONLY; The current month to date charges. + MonthToDateCharges *Amount `json:"monthToDateCharges,omitempty"` + // BillingProfileID - READ-ONLY; The ID of the billing profile to which the subscription is billed. + BillingProfileID *string `json:"billingProfileId,omitempty"` + // BillingProfileDisplayName - READ-ONLY; The name of the billing profile to which the subscription is billed. + BillingProfileDisplayName *string `json:"billingProfileDisplayName,omitempty"` + // CostCenter - The cost center applied to the subscription. + CostCenter *string `json:"costCenter,omitempty"` + // CustomerID - READ-ONLY; The ID of the customer for whom the subscription was created. The field is applicable only for Microsoft Partner Agreement billing account. + CustomerID *string `json:"customerId,omitempty"` + // CustomerDisplayName - READ-ONLY; The name of the customer for whom the subscription was created. The field is applicable only for Microsoft Partner Agreement billing account. + CustomerDisplayName *string `json:"customerDisplayName,omitempty"` + // InvoiceSectionID - READ-ONLY; The ID of the invoice section to which the subscription is billed. + InvoiceSectionID *string `json:"invoiceSectionId,omitempty"` + // InvoiceSectionDisplayName - READ-ONLY; The name of the invoice section to which the subscription is billed. + InvoiceSectionDisplayName *string `json:"invoiceSectionDisplayName,omitempty"` + // Reseller - READ-ONLY; Reseller for this subscription. + Reseller *Reseller `json:"reseller,omitempty"` + // SkuID - The sku ID of the Azure plan for the subscription. + SkuID *string `json:"skuId,omitempty"` + // SkuDescription - READ-ONLY; The sku description of the Azure plan for the subscription. + SkuDescription *string `json:"skuDescription,omitempty"` +} + +// SubscriptionsListResult the list of billing subscriptions. +type SubscriptionsListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of billing subscriptions. + Value *[]Subscription `json:"value,omitempty"` + // NextLink - READ-ONLY; The link (url) to the next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// SubscriptionsListResultIterator provides access to a complete listing of Subscription values. +type SubscriptionsListResultIterator struct { + i int + page SubscriptionsListResultPage +} + +// 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 *SubscriptionsListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionsListResultIterator.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 *SubscriptionsListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SubscriptionsListResultIterator) 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 SubscriptionsListResultIterator) Response() SubscriptionsListResult { + 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 SubscriptionsListResultIterator) Value() Subscription { + if !iter.page.NotDone() { + return Subscription{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the SubscriptionsListResultIterator type. +func NewSubscriptionsListResultIterator(page SubscriptionsListResultPage) SubscriptionsListResultIterator { + return SubscriptionsListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (slr SubscriptionsListResult) IsEmpty() bool { + return slr.Value == nil || len(*slr.Value) == 0 +} + +// subscriptionsListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (slr SubscriptionsListResult) subscriptionsListResultPreparer(ctx context.Context) (*http.Request, error) { + if slr.NextLink == nil || len(to.String(slr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(slr.NextLink))) +} + +// SubscriptionsListResultPage contains a page of Subscription values. +type SubscriptionsListResultPage struct { + fn func(context.Context, SubscriptionsListResult) (SubscriptionsListResult, error) + slr SubscriptionsListResult +} + +// 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 *SubscriptionsListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionsListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.slr) + if err != nil { + return err + } + page.slr = next + 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 *SubscriptionsListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SubscriptionsListResultPage) NotDone() bool { + return !page.slr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SubscriptionsListResultPage) Response() SubscriptionsListResult { + return page.slr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SubscriptionsListResultPage) Values() []Subscription { + if page.slr.IsEmpty() { + return nil + } + return *page.slr.Value +} + +// Creates a new instance of the SubscriptionsListResultPage type. +func NewSubscriptionsListResultPage(getNextPage func(context.Context, SubscriptionsListResult) (SubscriptionsListResult, error)) SubscriptionsListResultPage { + return SubscriptionsListResultPage{fn: getNextPage} +} + +// SubscriptionsMoveFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type SubscriptionsMoveFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *SubscriptionsMoveFuture) Result(client SubscriptionsClient) (s Subscription, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.SubscriptionsMoveFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("billing.SubscriptionsMoveFuture") + 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.MoveResponder(s.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.SubscriptionsMoveFuture", "Result", s.Response.Response, "Failure responding to request") + } + } + return +} + +// Transaction a transaction. +type Transaction struct { + *TransactionProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Transaction. +func (t Transaction) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if t.TransactionProperties != nil { + objectMap["properties"] = t.TransactionProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Transaction struct. +func (t *Transaction) 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 transactionProperties TransactionProperties + err = json.Unmarshal(*v, &transactionProperties) + if err != nil { + return err + } + t.TransactionProperties = &transactionProperties + } + 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 + } + } + } + + return nil +} + +// TransactionListResult the list of transactions. +type TransactionListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The list of transactions. + Value *[]Transaction `json:"value,omitempty"` + // NextLink - READ-ONLY; The link (url) to the next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// TransactionListResultIterator provides access to a complete listing of Transaction values. +type TransactionListResultIterator struct { + i int + page TransactionListResultPage +} + +// 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 *TransactionListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TransactionListResultIterator.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 *TransactionListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter TransactionListResultIterator) 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 TransactionListResultIterator) Response() TransactionListResult { + 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 TransactionListResultIterator) Value() Transaction { + if !iter.page.NotDone() { + return Transaction{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the TransactionListResultIterator type. +func NewTransactionListResultIterator(page TransactionListResultPage) TransactionListResultIterator { + return TransactionListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (tlr TransactionListResult) IsEmpty() bool { + return tlr.Value == nil || len(*tlr.Value) == 0 +} + +// transactionListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (tlr TransactionListResult) transactionListResultPreparer(ctx context.Context) (*http.Request, error) { + if tlr.NextLink == nil || len(to.String(tlr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(tlr.NextLink))) +} + +// TransactionListResultPage contains a page of Transaction values. +type TransactionListResultPage struct { + fn func(context.Context, TransactionListResult) (TransactionListResult, error) + tlr TransactionListResult +} + +// 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 *TransactionListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TransactionListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.tlr) + if err != nil { + return err + } + page.tlr = next + 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 *TransactionListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page TransactionListResultPage) NotDone() bool { + return !page.tlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page TransactionListResultPage) Response() TransactionListResult { + return page.tlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page TransactionListResultPage) Values() []Transaction { + if page.tlr.IsEmpty() { + return nil + } + return *page.tlr.Value +} + +// Creates a new instance of the TransactionListResultPage type. +func NewTransactionListResultPage(getNextPage func(context.Context, TransactionListResult) (TransactionListResult, error)) TransactionListResultPage { + return TransactionListResultPage{fn: getNextPage} +} + +// TransactionProperties the properties of a transaction. +type TransactionProperties struct { + // Kind - The kind of transaction. Options are all or reservation. Possible values include: 'All', 'Reservation' + Kind TransactionTypeKind `json:"kind,omitempty"` + // Date - READ-ONLY; The date of transaction. + Date *date.Time `json:"date,omitempty"` + // Invoice - READ-ONLY; Invoice on which the transaction was billed or 'pending' if the transaction is not billed. + Invoice *string `json:"invoice,omitempty"` + // InvoiceID - READ-ONLY; The ID of the invoice on which the transaction was billed. This field is only applicable for transactions which are billed. + InvoiceID *string `json:"invoiceId,omitempty"` + // OrderID - READ-ONLY; The order ID of the reservation. The field is only applicable for transaction of kind reservation. + OrderID *string `json:"orderId,omitempty"` + // OrderName - READ-ONLY; The name of the reservation order. The field is only applicable for transactions of kind reservation. + OrderName *string `json:"orderName,omitempty"` + // ProductFamily - READ-ONLY; The family of the product for which the transaction took place. + ProductFamily *string `json:"productFamily,omitempty"` + // ProductTypeID - READ-ONLY; The ID of the product type for which the transaction took place. + ProductTypeID *string `json:"productTypeId,omitempty"` + // ProductType - READ-ONLY; The type of the product for which the transaction took place. + ProductType *string `json:"productType,omitempty"` + // ProductDescription - READ-ONLY; The description of the product for which the transaction took place. + ProductDescription *string `json:"productDescription,omitempty"` + // TransactionType - The type of transaction. Possible values include: 'Purchase', 'UsageCharge' + TransactionType ReservationType `json:"transactionType,omitempty"` + // TransactionAmount - READ-ONLY; The charge associated with the transaction. + TransactionAmount *Amount `json:"transactionAmount,omitempty"` + // Quantity - READ-ONLY; The quantity purchased in the transaction. + Quantity *int32 `json:"quantity,omitempty"` + // InvoiceSectionID - READ-ONLY; The ID of the invoice section which will be billed for the transaction. + InvoiceSectionID *string `json:"invoiceSectionId,omitempty"` + // InvoiceSectionDisplayName - READ-ONLY; The name of the invoice section which will be billed for the transaction. + InvoiceSectionDisplayName *string `json:"invoiceSectionDisplayName,omitempty"` + // BillingProfileID - READ-ONLY; The ID of the billing profile which will be billed for the transaction. + BillingProfileID *string `json:"billingProfileId,omitempty"` + // BillingProfileDisplayName - READ-ONLY; The name of the billing profile which will be billed for the transaction. + BillingProfileDisplayName *string `json:"billingProfileDisplayName,omitempty"` + // CustomerID - READ-ONLY; The ID of the customer for which the transaction took place. The field is applicable only for Microsoft Partner Agreement billing account. + CustomerID *string `json:"customerId,omitempty"` + // CustomerDisplayName - READ-ONLY; The name of the customer for which the transaction took place. The field is applicable only for Microsoft Partner Agreement billing account. + CustomerDisplayName *string `json:"customerDisplayName,omitempty"` + // SubscriptionID - READ-ONLY; The ID of the subscription that was used for the transaction. The field is only applicable for transaction of kind reservation. + SubscriptionID *string `json:"subscriptionId,omitempty"` + // SubscriptionName - READ-ONLY; The name of the subscription that was used for the transaction. The field is only applicable for transaction of kind reservation. + SubscriptionName *string `json:"subscriptionName,omitempty"` + // AzurePlan - READ-ONLY; The type of azure plan of the subscription that was used for the transaction. + AzurePlan *string `json:"azurePlan,omitempty"` + // AzureCreditApplied - READ-ONLY; The amount of any Azure credits automatically applied to this transaction. + AzureCreditApplied *Amount `json:"azureCreditApplied,omitempty"` + // BillingCurrency - READ-ONLY; The ISO 4217 code for the currency in which this transaction is billed. + BillingCurrency *string `json:"billingCurrency,omitempty"` + // Discount - READ-ONLY; The percentage discount, if any, applied to this transaction. + Discount *float64 `json:"discount,omitempty"` + // EffectivePrice - READ-ONLY; The price of the product after applying any discounts. + EffectivePrice *Amount `json:"effectivePrice,omitempty"` + // ExchangeRate - READ-ONLY; The exchange rate used to convert charged amount to billing currency, if applicable. + ExchangeRate *float64 `json:"exchangeRate,omitempty"` + // MarketPrice - READ-ONLY; The retail price of the product. + MarketPrice *Amount `json:"marketPrice,omitempty"` + // PricingCurrency - READ-ONLY; The ISO 4217 code for the currency in which the product is priced. + PricingCurrency *string `json:"pricingCurrency,omitempty"` + // ServicePeriodStartDate - READ-ONLY; The date of the purchase of the product, or the start date of the month in which usage started. + ServicePeriodStartDate *date.Time `json:"servicePeriodStartDate,omitempty"` + // ServicePeriodEndDate - READ-ONLY; The end date of the product term, or the end date of the month in which usage ended. + ServicePeriodEndDate *date.Time `json:"servicePeriodEndDate,omitempty"` + // SubTotal - READ-ONLY; The pre-tax charged amount for the transaction. + SubTotal *Amount `json:"subTotal,omitempty"` + // Tax - READ-ONLY; The tax amount applied to the transaction. + Tax *Amount `json:"tax,omitempty"` + // UnitOfMeasure - READ-ONLY; The unit of measure used to bill for the product. For example, compute services are billed per hour. + UnitOfMeasure *string `json:"unitOfMeasure,omitempty"` + // Units - READ-ONLY; The number of units used for a given product. + Units *float64 `json:"units,omitempty"` + // UnitType - READ-ONLY; The description for the unit of measure for a given product. + UnitType *string `json:"unitType,omitempty"` +} + +// TransferBillingSubscriptionRequestProperties request parameters to transfer billing subscription. +type TransferBillingSubscriptionRequestProperties struct { + // DestinationInvoiceSectionID - The destination invoice section id. + DestinationInvoiceSectionID *string `json:"destinationInvoiceSectionId,omitempty"` +} + +// TransferProductRequestProperties the properties of the product to initiate a transfer. +type TransferProductRequestProperties struct { + // DestinationInvoiceSectionID - The destination invoice section id. + DestinationInvoiceSectionID *string `json:"destinationInvoiceSectionId,omitempty"` +} + +// ValidateAddressResponse result of the address validation +type ValidateAddressResponse struct { + autorest.Response `json:"-"` + // Status - status of the address validation. Possible values include: 'Valid', 'Invalid' + Status AddressValidationStatus `json:"status,omitempty"` + // SuggestedAddresses - The list of suggested addresses. + SuggestedAddresses *[]AddressDetails `json:"suggestedAddresses,omitempty"` + // ValidationMessage - Validation error message. + ValidationMessage *string `json:"validationMessage,omitempty"` +} + +// ValidateProductTransferEligibilityError error details of the product transfer eligibility validation. +type ValidateProductTransferEligibilityError struct { + // Code - Error code for the product transfer validation. Possible values include: 'InvalidSource', 'ProductNotActive', 'InsufficientPermissionOnSource', 'InsufficientPermissionOnDestination', 'DestinationBillingProfilePastDue', 'ProductTypeNotSupported', 'CrossBillingAccountNotAllowed', 'NotAvailableForDestinationMarket', 'OneTimePurchaseProductTransferNotAllowed' + Code ProductTransferValidationErrorCode `json:"code,omitempty"` + // Message - The error message. + Message *string `json:"message,omitempty"` + // Details - Detailed error message explaining the error. + Details *string `json:"details,omitempty"` +} + +// ValidateProductTransferEligibilityResult result of the product transfer eligibility validation. +type ValidateProductTransferEligibilityResult struct { + autorest.Response `json:"-"` + // IsMoveEligible - READ-ONLY; Specifies whether the transfer is eligible or not. + IsMoveEligible *bool `json:"isMoveEligible,omitempty"` + // ErrorDetails - Validation error details. + ErrorDetails *ValidateProductTransferEligibilityError `json:"errorDetails,omitempty"` +} + +// ValidateSubscriptionTransferEligibilityError error details of the transfer eligibility validation +type ValidateSubscriptionTransferEligibilityError struct { + // Code - Error code for the product transfer validation. Possible values include: 'SubscriptionTransferValidationErrorCodeInvalidSource', 'SubscriptionTransferValidationErrorCodeSubscriptionNotActive', 'SubscriptionTransferValidationErrorCodeInsufficientPermissionOnSource', 'SubscriptionTransferValidationErrorCodeInsufficientPermissionOnDestination', 'SubscriptionTransferValidationErrorCodeDestinationBillingProfilePastDue', 'SubscriptionTransferValidationErrorCodeSubscriptionTypeNotSupported', 'SubscriptionTransferValidationErrorCodeCrossBillingAccountNotAllowed', 'SubscriptionTransferValidationErrorCodeNotAvailableForDestinationMarket' + Code SubscriptionTransferValidationErrorCode `json:"code,omitempty"` + // Message - The error message. + Message *string `json:"message,omitempty"` + // Details - Detailed error message explaining the error. + Details *string `json:"details,omitempty"` +} + +// ValidateSubscriptionTransferEligibilityResult result of the transfer eligibility validation. +type ValidateSubscriptionTransferEligibilityResult struct { + autorest.Response `json:"-"` + // IsMoveEligible - READ-ONLY; Specifies whether the subscription is eligible to be transferred. + IsMoveEligible *bool `json:"isMoveEligible,omitempty"` + // ErrorDetails - Validation error details. + ErrorDetails *ValidateSubscriptionTransferEligibilityError `json:"errorDetails,omitempty"` +} diff --git a/services/preview/billing/mgmt/2020-05-01-preview/billing/operations.go b/services/preview/billing/mgmt/2020-05-01-preview/billing/operations.go new file mode 100644 index 000000000000..777d371b72b9 --- /dev/null +++ b/services/preview/billing/mgmt/2020-05-01-preview/billing/operations.go @@ -0,0 +1,147 @@ +package billing + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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 billing client provides access to billing resources for Azure subscriptions. +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 the available billing 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, "billing.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, "billing.OperationsClient", "List", resp, "Failure sending request") + return + } + + result.olr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.OperationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.Billing/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, + client.ByInspecting(), + 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, "billing.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, "billing.OperationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.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/billing/mgmt/2020-05-01-preview/billing/permissions.go b/services/preview/billing/mgmt/2020-05-01-preview/billing/permissions.go new file mode 100644 index 000000000000..1c5b608bbf1a --- /dev/null +++ b/services/preview/billing/mgmt/2020-05-01-preview/billing/permissions.go @@ -0,0 +1,494 @@ +package billing + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// PermissionsClient is the billing client provides access to billing resources for Azure subscriptions. +type PermissionsClient struct { + BaseClient +} + +// NewPermissionsClient creates an instance of the PermissionsClient client. +func NewPermissionsClient(subscriptionID string) PermissionsClient { + return NewPermissionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPermissionsClientWithBaseURI creates an instance of the PermissionsClient 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 NewPermissionsClientWithBaseURI(baseURI string, subscriptionID string) PermissionsClient { + return PermissionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListByBillingAccount lists the billing permissions the caller has on a billing account. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +func (client PermissionsClient) ListByBillingAccount(ctx context.Context, billingAccountName string) (result PermissionsListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PermissionsClient.ListByBillingAccount") + defer func() { + sc := -1 + if result.plr.Response.Response != nil { + sc = result.plr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByBillingAccountNextResults + req, err := client.ListByBillingAccountPreparer(ctx, billingAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.PermissionsClient", "ListByBillingAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByBillingAccountSender(req) + if err != nil { + result.plr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.PermissionsClient", "ListByBillingAccount", resp, "Failure sending request") + return + } + + result.plr, err = client.ListByBillingAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.PermissionsClient", "ListByBillingAccount", resp, "Failure responding to request") + } + + return +} + +// ListByBillingAccountPreparer prepares the ListByBillingAccount request. +func (client PermissionsClient) ListByBillingAccountPreparer(ctx context.Context, billingAccountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountName": autorest.Encode("path", billingAccountName), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingPermissions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByBillingAccountSender sends the ListByBillingAccount request. The method will close the +// http.Response Body if it receives an error. +func (client PermissionsClient) ListByBillingAccountSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListByBillingAccountResponder handles the response to the ListByBillingAccount request. The method always +// closes the http.Response Body. +func (client PermissionsClient) ListByBillingAccountResponder(resp *http.Response) (result PermissionsListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByBillingAccountNextResults retrieves the next set of results, if any. +func (client PermissionsClient) listByBillingAccountNextResults(ctx context.Context, lastResults PermissionsListResult) (result PermissionsListResult, err error) { + req, err := lastResults.permissionsListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "billing.PermissionsClient", "listByBillingAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByBillingAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "billing.PermissionsClient", "listByBillingAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByBillingAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.PermissionsClient", "listByBillingAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByBillingAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client PermissionsClient) ListByBillingAccountComplete(ctx context.Context, billingAccountName string) (result PermissionsListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PermissionsClient.ListByBillingAccount") + 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.ListByBillingAccount(ctx, billingAccountName) + return +} + +// ListByBillingProfile lists the billing permissions the caller has on a billing profile. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +// billingProfileName - the ID that uniquely identifies a billing profile. +func (client PermissionsClient) ListByBillingProfile(ctx context.Context, billingAccountName string, billingProfileName string) (result PermissionsListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PermissionsClient.ListByBillingProfile") + defer func() { + sc := -1 + if result.plr.Response.Response != nil { + sc = result.plr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByBillingProfileNextResults + req, err := client.ListByBillingProfilePreparer(ctx, billingAccountName, billingProfileName) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.PermissionsClient", "ListByBillingProfile", nil, "Failure preparing request") + return + } + + resp, err := client.ListByBillingProfileSender(req) + if err != nil { + result.plr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.PermissionsClient", "ListByBillingProfile", resp, "Failure sending request") + return + } + + result.plr, err = client.ListByBillingProfileResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.PermissionsClient", "ListByBillingProfile", resp, "Failure responding to request") + } + + return +} + +// ListByBillingProfilePreparer prepares the ListByBillingProfile request. +func (client PermissionsClient) ListByBillingProfilePreparer(ctx context.Context, billingAccountName string, billingProfileName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountName": autorest.Encode("path", billingAccountName), + "billingProfileName": autorest.Encode("path", billingProfileName), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingPermissions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByBillingProfileSender sends the ListByBillingProfile request. The method will close the +// http.Response Body if it receives an error. +func (client PermissionsClient) ListByBillingProfileSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListByBillingProfileResponder handles the response to the ListByBillingProfile request. The method always +// closes the http.Response Body. +func (client PermissionsClient) ListByBillingProfileResponder(resp *http.Response) (result PermissionsListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByBillingProfileNextResults retrieves the next set of results, if any. +func (client PermissionsClient) listByBillingProfileNextResults(ctx context.Context, lastResults PermissionsListResult) (result PermissionsListResult, err error) { + req, err := lastResults.permissionsListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "billing.PermissionsClient", "listByBillingProfileNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByBillingProfileSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "billing.PermissionsClient", "listByBillingProfileNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByBillingProfileResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.PermissionsClient", "listByBillingProfileNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByBillingProfileComplete enumerates all values, automatically crossing page boundaries as required. +func (client PermissionsClient) ListByBillingProfileComplete(ctx context.Context, billingAccountName string, billingProfileName string) (result PermissionsListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PermissionsClient.ListByBillingProfile") + 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.ListByBillingProfile(ctx, billingAccountName, billingProfileName) + return +} + +// ListByCustomer lists the billing permissions the caller has for a customer. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +// customerName - the ID that uniquely identifies a customer. +func (client PermissionsClient) ListByCustomer(ctx context.Context, billingAccountName string, customerName string) (result PermissionsListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PermissionsClient.ListByCustomer") + defer func() { + sc := -1 + if result.plr.Response.Response != nil { + sc = result.plr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByCustomerNextResults + req, err := client.ListByCustomerPreparer(ctx, billingAccountName, customerName) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.PermissionsClient", "ListByCustomer", nil, "Failure preparing request") + return + } + + resp, err := client.ListByCustomerSender(req) + if err != nil { + result.plr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.PermissionsClient", "ListByCustomer", resp, "Failure sending request") + return + } + + result.plr, err = client.ListByCustomerResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.PermissionsClient", "ListByCustomer", resp, "Failure responding to request") + } + + return +} + +// ListByCustomerPreparer prepares the ListByCustomer request. +func (client PermissionsClient) ListByCustomerPreparer(ctx context.Context, billingAccountName string, customerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountName": autorest.Encode("path", billingAccountName), + "customerName": autorest.Encode("path", customerName), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}/billingPermissions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByCustomerSender sends the ListByCustomer request. The method will close the +// http.Response Body if it receives an error. +func (client PermissionsClient) ListByCustomerSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListByCustomerResponder handles the response to the ListByCustomer request. The method always +// closes the http.Response Body. +func (client PermissionsClient) ListByCustomerResponder(resp *http.Response) (result PermissionsListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByCustomerNextResults retrieves the next set of results, if any. +func (client PermissionsClient) listByCustomerNextResults(ctx context.Context, lastResults PermissionsListResult) (result PermissionsListResult, err error) { + req, err := lastResults.permissionsListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "billing.PermissionsClient", "listByCustomerNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByCustomerSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "billing.PermissionsClient", "listByCustomerNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByCustomerResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.PermissionsClient", "listByCustomerNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByCustomerComplete enumerates all values, automatically crossing page boundaries as required. +func (client PermissionsClient) ListByCustomerComplete(ctx context.Context, billingAccountName string, customerName string) (result PermissionsListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PermissionsClient.ListByCustomer") + 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.ListByCustomer(ctx, billingAccountName, customerName) + return +} + +// ListByInvoiceSections lists the billing permissions the caller has on an invoice section. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +// billingProfileName - the ID that uniquely identifies a billing profile. +// invoiceSectionName - the ID that uniquely identifies an invoice section. +func (client PermissionsClient) ListByInvoiceSections(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string) (result PermissionsListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PermissionsClient.ListByInvoiceSections") + defer func() { + sc := -1 + if result.plr.Response.Response != nil { + sc = result.plr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByInvoiceSectionsNextResults + req, err := client.ListByInvoiceSectionsPreparer(ctx, billingAccountName, billingProfileName, invoiceSectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.PermissionsClient", "ListByInvoiceSections", nil, "Failure preparing request") + return + } + + resp, err := client.ListByInvoiceSectionsSender(req) + if err != nil { + result.plr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.PermissionsClient", "ListByInvoiceSections", resp, "Failure sending request") + return + } + + result.plr, err = client.ListByInvoiceSectionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.PermissionsClient", "ListByInvoiceSections", resp, "Failure responding to request") + } + + return +} + +// ListByInvoiceSectionsPreparer prepares the ListByInvoiceSections request. +func (client PermissionsClient) ListByInvoiceSectionsPreparer(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountName": autorest.Encode("path", billingAccountName), + "billingProfileName": autorest.Encode("path", billingProfileName), + "invoiceSectionName": autorest.Encode("path", invoiceSectionName), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingPermissions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByInvoiceSectionsSender sends the ListByInvoiceSections request. The method will close the +// http.Response Body if it receives an error. +func (client PermissionsClient) ListByInvoiceSectionsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListByInvoiceSectionsResponder handles the response to the ListByInvoiceSections request. The method always +// closes the http.Response Body. +func (client PermissionsClient) ListByInvoiceSectionsResponder(resp *http.Response) (result PermissionsListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByInvoiceSectionsNextResults retrieves the next set of results, if any. +func (client PermissionsClient) listByInvoiceSectionsNextResults(ctx context.Context, lastResults PermissionsListResult) (result PermissionsListResult, err error) { + req, err := lastResults.permissionsListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "billing.PermissionsClient", "listByInvoiceSectionsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByInvoiceSectionsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "billing.PermissionsClient", "listByInvoiceSectionsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByInvoiceSectionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.PermissionsClient", "listByInvoiceSectionsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByInvoiceSectionsComplete enumerates all values, automatically crossing page boundaries as required. +func (client PermissionsClient) ListByInvoiceSectionsComplete(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string) (result PermissionsListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PermissionsClient.ListByInvoiceSections") + 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.ListByInvoiceSections(ctx, billingAccountName, billingProfileName, invoiceSectionName) + return +} diff --git a/services/preview/billing/mgmt/2020-05-01-preview/billing/policies.go b/services/preview/billing/mgmt/2020-05-01-preview/billing/policies.go new file mode 100644 index 000000000000..d92b5b0d0941 --- /dev/null +++ b/services/preview/billing/mgmt/2020-05-01-preview/billing/policies.go @@ -0,0 +1,352 @@ +package billing + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// PoliciesClient is the billing client provides access to billing resources for Azure subscriptions. +type PoliciesClient struct { + BaseClient +} + +// NewPoliciesClient creates an instance of the PoliciesClient client. +func NewPoliciesClient(subscriptionID string) PoliciesClient { + return NewPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPoliciesClientWithBaseURI creates an instance of the PoliciesClient 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 NewPoliciesClientWithBaseURI(baseURI string, subscriptionID string) PoliciesClient { + return PoliciesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// GetByBillingProfile lists the policies for a billing profile. This operation is supported only for billing accounts +// with agreement type Microsoft Customer Agreement. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +// billingProfileName - the ID that uniquely identifies a billing profile. +func (client PoliciesClient) GetByBillingProfile(ctx context.Context, billingAccountName string, billingProfileName string) (result Policy, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PoliciesClient.GetByBillingProfile") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetByBillingProfilePreparer(ctx, billingAccountName, billingProfileName) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.PoliciesClient", "GetByBillingProfile", nil, "Failure preparing request") + return + } + + resp, err := client.GetByBillingProfileSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.PoliciesClient", "GetByBillingProfile", resp, "Failure sending request") + return + } + + result, err = client.GetByBillingProfileResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.PoliciesClient", "GetByBillingProfile", resp, "Failure responding to request") + } + + return +} + +// GetByBillingProfilePreparer prepares the GetByBillingProfile request. +func (client PoliciesClient) GetByBillingProfilePreparer(ctx context.Context, billingAccountName string, billingProfileName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountName": autorest.Encode("path", billingAccountName), + "billingProfileName": autorest.Encode("path", billingProfileName), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/policies/default", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetByBillingProfileSender sends the GetByBillingProfile request. The method will close the +// http.Response Body if it receives an error. +func (client PoliciesClient) GetByBillingProfileSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetByBillingProfileResponder handles the response to the GetByBillingProfile request. The method always +// closes the http.Response Body. +func (client PoliciesClient) GetByBillingProfileResponder(resp *http.Response) (result Policy, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetByCustomer lists the policies for a customer. This operation is supported only for billing accounts with +// agreement type Microsoft Partner Agreement. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +// customerName - the ID that uniquely identifies a customer. +func (client PoliciesClient) GetByCustomer(ctx context.Context, billingAccountName string, customerName string) (result CustomerPolicy, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PoliciesClient.GetByCustomer") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetByCustomerPreparer(ctx, billingAccountName, customerName) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.PoliciesClient", "GetByCustomer", nil, "Failure preparing request") + return + } + + resp, err := client.GetByCustomerSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.PoliciesClient", "GetByCustomer", resp, "Failure sending request") + return + } + + result, err = client.GetByCustomerResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.PoliciesClient", "GetByCustomer", resp, "Failure responding to request") + } + + return +} + +// GetByCustomerPreparer prepares the GetByCustomer request. +func (client PoliciesClient) GetByCustomerPreparer(ctx context.Context, billingAccountName string, customerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountName": autorest.Encode("path", billingAccountName), + "customerName": autorest.Encode("path", customerName), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}/policies/default", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetByCustomerSender sends the GetByCustomer request. The method will close the +// http.Response Body if it receives an error. +func (client PoliciesClient) GetByCustomerSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetByCustomerResponder handles the response to the GetByCustomer request. The method always +// closes the http.Response Body. +func (client PoliciesClient) GetByCustomerResponder(resp *http.Response) (result CustomerPolicy, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update updates the policies for a billing profile. This operation is supported only for billing accounts with +// agreement type Microsoft Customer Agreement. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +// billingProfileName - the ID that uniquely identifies a billing profile. +// parameters - request parameters that are provided to the update policies operation. +func (client PoliciesClient) Update(ctx context.Context, billingAccountName string, billingProfileName string, parameters Policy) (result Policy, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PoliciesClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, billingAccountName, billingProfileName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.PoliciesClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.PoliciesClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.PoliciesClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client PoliciesClient) UpdatePreparer(ctx context.Context, billingAccountName string, billingProfileName string, parameters Policy) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountName": autorest.Encode("path", billingAccountName), + "billingProfileName": autorest.Encode("path", billingProfileName), + } + + const APIVersion = "2020-05-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.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/policies/default", pathParameters), + autorest.WithJSON(parameters), + 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 PoliciesClient) UpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client PoliciesClient) UpdateResponder(resp *http.Response) (result Policy, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateCustomer updates the policies for a customer. This operation is supported only for billing accounts with +// agreement type Microsoft Partner Agreement. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +// customerName - the ID that uniquely identifies a customer. +// parameters - request parameters that are provided to the update policies operation. +func (client PoliciesClient) UpdateCustomer(ctx context.Context, billingAccountName string, customerName string, parameters CustomerPolicy) (result CustomerPolicy, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PoliciesClient.UpdateCustomer") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdateCustomerPreparer(ctx, billingAccountName, customerName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.PoliciesClient", "UpdateCustomer", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateCustomerSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.PoliciesClient", "UpdateCustomer", resp, "Failure sending request") + return + } + + result, err = client.UpdateCustomerResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.PoliciesClient", "UpdateCustomer", resp, "Failure responding to request") + } + + return +} + +// UpdateCustomerPreparer prepares the UpdateCustomer request. +func (client PoliciesClient) UpdateCustomerPreparer(ctx context.Context, billingAccountName string, customerName string, parameters CustomerPolicy) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountName": autorest.Encode("path", billingAccountName), + "customerName": autorest.Encode("path", customerName), + } + + const APIVersion = "2020-05-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.Billing/billingAccounts/{billingAccountName}/customers/{customerName}/policies/default", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateCustomerSender sends the UpdateCustomer request. The method will close the +// http.Response Body if it receives an error. +func (client PoliciesClient) UpdateCustomerSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// UpdateCustomerResponder handles the response to the UpdateCustomer request. The method always +// closes the http.Response Body. +func (client PoliciesClient) UpdateCustomerResponder(resp *http.Response) (result CustomerPolicy, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/billing/mgmt/2020-05-01-preview/billing/products.go b/services/preview/billing/mgmt/2020-05-01-preview/billing/products.go new file mode 100644 index 000000000000..d67cb3f5be96 --- /dev/null +++ b/services/preview/billing/mgmt/2020-05-01-preview/billing/products.go @@ -0,0 +1,827 @@ +package billing + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// ProductsClient is the billing client provides access to billing resources for Azure subscriptions. +type ProductsClient struct { + BaseClient +} + +// NewProductsClient creates an instance of the ProductsClient client. +func NewProductsClient(subscriptionID string) ProductsClient { + return NewProductsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewProductsClientWithBaseURI creates an instance of the ProductsClient 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 NewProductsClientWithBaseURI(baseURI string, subscriptionID string) ProductsClient { + return ProductsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get gets a product by ID. The operation is supported only for billing accounts with agreement type Microsoft +// Customer Agreement. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +// productName - the ID that uniquely identifies a product. +func (client ProductsClient) Get(ctx context.Context, billingAccountName string, productName string) (result Product, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProductsClient.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, billingAccountName, productName) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.ProductsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.ProductsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.ProductsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ProductsClient) GetPreparer(ctx context.Context, billingAccountName string, productName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountName": autorest.Encode("path", billingAccountName), + "productName": autorest.Encode("path", productName), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/products/{productName}", 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 ProductsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ProductsClient) GetResponder(resp *http.Response) (result Product, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByBillingAccount lists the products for a billing account. These don't include products billed based on usage. +// The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft +// Partner Agreement. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +// filter - may be used to filter by product type. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. +// It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and +// value are separated by a colon (:). +func (client ProductsClient) ListByBillingAccount(ctx context.Context, billingAccountName string, filter string) (result ProductsListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProductsClient.ListByBillingAccount") + defer func() { + sc := -1 + if result.plr.Response.Response != nil { + sc = result.plr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByBillingAccountNextResults + req, err := client.ListByBillingAccountPreparer(ctx, billingAccountName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.ProductsClient", "ListByBillingAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByBillingAccountSender(req) + if err != nil { + result.plr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.ProductsClient", "ListByBillingAccount", resp, "Failure sending request") + return + } + + result.plr, err = client.ListByBillingAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.ProductsClient", "ListByBillingAccount", resp, "Failure responding to request") + } + + return +} + +// ListByBillingAccountPreparer prepares the ListByBillingAccount request. +func (client ProductsClient) ListByBillingAccountPreparer(ctx context.Context, billingAccountName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountName": autorest.Encode("path", billingAccountName), + } + + const APIVersion = "2020-05-01" + 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("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/products", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByBillingAccountSender sends the ListByBillingAccount request. The method will close the +// http.Response Body if it receives an error. +func (client ProductsClient) ListByBillingAccountSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListByBillingAccountResponder handles the response to the ListByBillingAccount request. The method always +// closes the http.Response Body. +func (client ProductsClient) ListByBillingAccountResponder(resp *http.Response) (result ProductsListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByBillingAccountNextResults retrieves the next set of results, if any. +func (client ProductsClient) listByBillingAccountNextResults(ctx context.Context, lastResults ProductsListResult) (result ProductsListResult, err error) { + req, err := lastResults.productsListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "billing.ProductsClient", "listByBillingAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByBillingAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "billing.ProductsClient", "listByBillingAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByBillingAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.ProductsClient", "listByBillingAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByBillingAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client ProductsClient) ListByBillingAccountComplete(ctx context.Context, billingAccountName string, filter string) (result ProductsListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProductsClient.ListByBillingAccount") + 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.ListByBillingAccount(ctx, billingAccountName, filter) + return +} + +// ListByBillingProfile lists the products for a billing profile. These don't include products billed based on usage. +// The operation is supported for billing accounts with agreement type Microsoft Customer Agreement or Microsoft +// Partner Agreement. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +// billingProfileName - the ID that uniquely identifies a billing profile. +// filter - may be used to filter by product type. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. +// It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and +// value are separated by a colon (:). +func (client ProductsClient) ListByBillingProfile(ctx context.Context, billingAccountName string, billingProfileName string, filter string) (result ProductsListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProductsClient.ListByBillingProfile") + defer func() { + sc := -1 + if result.plr.Response.Response != nil { + sc = result.plr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByBillingProfileNextResults + req, err := client.ListByBillingProfilePreparer(ctx, billingAccountName, billingProfileName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.ProductsClient", "ListByBillingProfile", nil, "Failure preparing request") + return + } + + resp, err := client.ListByBillingProfileSender(req) + if err != nil { + result.plr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.ProductsClient", "ListByBillingProfile", resp, "Failure sending request") + return + } + + result.plr, err = client.ListByBillingProfileResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.ProductsClient", "ListByBillingProfile", resp, "Failure responding to request") + } + + return +} + +// ListByBillingProfilePreparer prepares the ListByBillingProfile request. +func (client ProductsClient) ListByBillingProfilePreparer(ctx context.Context, billingAccountName string, billingProfileName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountName": autorest.Encode("path", billingAccountName), + "billingProfileName": autorest.Encode("path", billingProfileName), + } + + const APIVersion = "2020-05-01" + 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("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/products", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByBillingProfileSender sends the ListByBillingProfile request. The method will close the +// http.Response Body if it receives an error. +func (client ProductsClient) ListByBillingProfileSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListByBillingProfileResponder handles the response to the ListByBillingProfile request. The method always +// closes the http.Response Body. +func (client ProductsClient) ListByBillingProfileResponder(resp *http.Response) (result ProductsListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByBillingProfileNextResults retrieves the next set of results, if any. +func (client ProductsClient) listByBillingProfileNextResults(ctx context.Context, lastResults ProductsListResult) (result ProductsListResult, err error) { + req, err := lastResults.productsListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "billing.ProductsClient", "listByBillingProfileNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByBillingProfileSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "billing.ProductsClient", "listByBillingProfileNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByBillingProfileResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.ProductsClient", "listByBillingProfileNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByBillingProfileComplete enumerates all values, automatically crossing page boundaries as required. +func (client ProductsClient) ListByBillingProfileComplete(ctx context.Context, billingAccountName string, billingProfileName string, filter string) (result ProductsListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProductsClient.ListByBillingProfile") + 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.ListByBillingProfile(ctx, billingAccountName, billingProfileName, filter) + return +} + +// ListByCustomer lists the products for a customer. These don't include products billed based on usage.The operation +// is supported only for billing accounts with agreement type Microsoft Partner Agreement. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +// customerName - the ID that uniquely identifies a customer. +func (client ProductsClient) ListByCustomer(ctx context.Context, billingAccountName string, customerName string) (result ProductsListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProductsClient.ListByCustomer") + defer func() { + sc := -1 + if result.plr.Response.Response != nil { + sc = result.plr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByCustomerNextResults + req, err := client.ListByCustomerPreparer(ctx, billingAccountName, customerName) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.ProductsClient", "ListByCustomer", nil, "Failure preparing request") + return + } + + resp, err := client.ListByCustomerSender(req) + if err != nil { + result.plr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.ProductsClient", "ListByCustomer", resp, "Failure sending request") + return + } + + result.plr, err = client.ListByCustomerResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.ProductsClient", "ListByCustomer", resp, "Failure responding to request") + } + + return +} + +// ListByCustomerPreparer prepares the ListByCustomer request. +func (client ProductsClient) ListByCustomerPreparer(ctx context.Context, billingAccountName string, customerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountName": autorest.Encode("path", billingAccountName), + "customerName": autorest.Encode("path", customerName), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}/products", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByCustomerSender sends the ListByCustomer request. The method will close the +// http.Response Body if it receives an error. +func (client ProductsClient) ListByCustomerSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListByCustomerResponder handles the response to the ListByCustomer request. The method always +// closes the http.Response Body. +func (client ProductsClient) ListByCustomerResponder(resp *http.Response) (result ProductsListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByCustomerNextResults retrieves the next set of results, if any. +func (client ProductsClient) listByCustomerNextResults(ctx context.Context, lastResults ProductsListResult) (result ProductsListResult, err error) { + req, err := lastResults.productsListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "billing.ProductsClient", "listByCustomerNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByCustomerSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "billing.ProductsClient", "listByCustomerNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByCustomerResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.ProductsClient", "listByCustomerNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByCustomerComplete enumerates all values, automatically crossing page boundaries as required. +func (client ProductsClient) ListByCustomerComplete(ctx context.Context, billingAccountName string, customerName string) (result ProductsListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProductsClient.ListByCustomer") + 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.ListByCustomer(ctx, billingAccountName, customerName) + return +} + +// ListByInvoiceSection lists the products for an invoice section. These don't include products billed based on usage. +// The operation is supported only for billing accounts with agreement type Microsoft Customer Agreement. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +// billingProfileName - the ID that uniquely identifies a billing profile. +// invoiceSectionName - the ID that uniquely identifies an invoice section. +// filter - may be used to filter by product type. The filter supports 'eq', 'lt', 'gt', 'le', 'ge', and 'and'. +// It does not currently support 'ne', 'or', or 'not'. Tag filter is a key value pair string where key and +// value are separated by a colon (:). +func (client ProductsClient) ListByInvoiceSection(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string, filter string) (result ProductsListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProductsClient.ListByInvoiceSection") + defer func() { + sc := -1 + if result.plr.Response.Response != nil { + sc = result.plr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByInvoiceSectionNextResults + req, err := client.ListByInvoiceSectionPreparer(ctx, billingAccountName, billingProfileName, invoiceSectionName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.ProductsClient", "ListByInvoiceSection", nil, "Failure preparing request") + return + } + + resp, err := client.ListByInvoiceSectionSender(req) + if err != nil { + result.plr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.ProductsClient", "ListByInvoiceSection", resp, "Failure sending request") + return + } + + result.plr, err = client.ListByInvoiceSectionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.ProductsClient", "ListByInvoiceSection", resp, "Failure responding to request") + } + + return +} + +// ListByInvoiceSectionPreparer prepares the ListByInvoiceSection request. +func (client ProductsClient) ListByInvoiceSectionPreparer(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountName": autorest.Encode("path", billingAccountName), + "billingProfileName": autorest.Encode("path", billingProfileName), + "invoiceSectionName": autorest.Encode("path", invoiceSectionName), + } + + const APIVersion = "2020-05-01" + 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("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/products", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByInvoiceSectionSender sends the ListByInvoiceSection request. The method will close the +// http.Response Body if it receives an error. +func (client ProductsClient) ListByInvoiceSectionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListByInvoiceSectionResponder handles the response to the ListByInvoiceSection request. The method always +// closes the http.Response Body. +func (client ProductsClient) ListByInvoiceSectionResponder(resp *http.Response) (result ProductsListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByInvoiceSectionNextResults retrieves the next set of results, if any. +func (client ProductsClient) listByInvoiceSectionNextResults(ctx context.Context, lastResults ProductsListResult) (result ProductsListResult, err error) { + req, err := lastResults.productsListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "billing.ProductsClient", "listByInvoiceSectionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByInvoiceSectionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "billing.ProductsClient", "listByInvoiceSectionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByInvoiceSectionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.ProductsClient", "listByInvoiceSectionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByInvoiceSectionComplete enumerates all values, automatically crossing page boundaries as required. +func (client ProductsClient) ListByInvoiceSectionComplete(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string, filter string) (result ProductsListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProductsClient.ListByInvoiceSection") + 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.ListByInvoiceSection(ctx, billingAccountName, billingProfileName, invoiceSectionName, filter) + return +} + +// Move moves a product's charges to a new invoice section. The new invoice section must belong to the same billing +// profile as the existing invoice section. This operation is supported only for products that are purchased with a +// recurring charge and for billing accounts with agreement type Microsoft Customer Agreement. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +// productName - the ID that uniquely identifies a product. +// parameters - request parameters that are provided to the move product operation. +func (client ProductsClient) Move(ctx context.Context, billingAccountName string, productName string, parameters TransferProductRequestProperties) (result Product, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProductsClient.Move") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.MovePreparer(ctx, billingAccountName, productName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.ProductsClient", "Move", nil, "Failure preparing request") + return + } + + resp, err := client.MoveSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.ProductsClient", "Move", resp, "Failure sending request") + return + } + + result, err = client.MoveResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.ProductsClient", "Move", resp, "Failure responding to request") + } + + return +} + +// MovePreparer prepares the Move request. +func (client ProductsClient) MovePreparer(ctx context.Context, billingAccountName string, productName string, parameters TransferProductRequestProperties) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountName": autorest.Encode("path", billingAccountName), + "productName": autorest.Encode("path", productName), + } + + const APIVersion = "2020-05-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("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/products/{productName}/move", pathParameters), + autorest.WithJSON(parameters), + 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 ProductsClient) MoveSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// MoveResponder handles the response to the Move request. The method always +// closes the http.Response Body. +func (client ProductsClient) MoveResponder(resp *http.Response) (result Product, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update updates the properties of a Product. Currently, auto renew can be updated. The operation is supported only +// for billing accounts with agreement type Microsoft Customer Agreement. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +// productName - the ID that uniquely identifies a product. +// parameters - request parameters that are provided to the update product operation. +func (client ProductsClient) Update(ctx context.Context, billingAccountName string, productName string, parameters Product) (result Product, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProductsClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, billingAccountName, productName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.ProductsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.ProductsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.ProductsClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ProductsClient) UpdatePreparer(ctx context.Context, billingAccountName string, productName string, parameters Product) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountName": autorest.Encode("path", billingAccountName), + "productName": autorest.Encode("path", productName), + } + + const APIVersion = "2020-05-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("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/products/{productName}", pathParameters), + autorest.WithJSON(parameters), + 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 ProductsClient) UpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ProductsClient) UpdateResponder(resp *http.Response) (result Product, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ValidateMove validates if a product's charges can be moved to a new invoice section. This operation is supported +// only for products that are purchased with a recurring charge and for billing accounts with agreement type Microsoft +// Customer Agreement. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +// productName - the ID that uniquely identifies a product. +// parameters - request parameters that are provided to the validate move eligibility operation. +func (client ProductsClient) ValidateMove(ctx context.Context, billingAccountName string, productName string, parameters TransferProductRequestProperties) (result ValidateProductTransferEligibilityResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProductsClient.ValidateMove") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ValidateMovePreparer(ctx, billingAccountName, productName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.ProductsClient", "ValidateMove", nil, "Failure preparing request") + return + } + + resp, err := client.ValidateMoveSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.ProductsClient", "ValidateMove", resp, "Failure sending request") + return + } + + result, err = client.ValidateMoveResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.ProductsClient", "ValidateMove", resp, "Failure responding to request") + } + + return +} + +// ValidateMovePreparer prepares the ValidateMove request. +func (client ProductsClient) ValidateMovePreparer(ctx context.Context, billingAccountName string, productName string, parameters TransferProductRequestProperties) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountName": autorest.Encode("path", billingAccountName), + "productName": autorest.Encode("path", productName), + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/products/{productName}/validateMoveEligibility", pathParameters), + autorest.WithJSON(parameters)) + 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 ProductsClient) ValidateMoveSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ValidateMoveResponder handles the response to the ValidateMove request. The method always +// closes the http.Response Body. +func (client ProductsClient) ValidateMoveResponder(resp *http.Response) (result ValidateProductTransferEligibilityResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/billing/mgmt/2020-05-01-preview/billing/profiles.go b/services/preview/billing/mgmt/2020-05-01-preview/billing/profiles.go new file mode 100644 index 000000000000..d840a6d95b6e --- /dev/null +++ b/services/preview/billing/mgmt/2020-05-01-preview/billing/profiles.go @@ -0,0 +1,329 @@ +package billing + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// ProfilesClient is the billing client provides access to billing resources for Azure subscriptions. +type ProfilesClient struct { + BaseClient +} + +// NewProfilesClient creates an instance of the ProfilesClient client. +func NewProfilesClient(subscriptionID string) ProfilesClient { + return NewProfilesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewProfilesClientWithBaseURI creates an instance of the ProfilesClient 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 NewProfilesClientWithBaseURI(baseURI string, subscriptionID string) ProfilesClient { + return ProfilesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a billing profile. The operation is supported for billing accounts with agreement +// type Microsoft Customer Agreement or Microsoft Partner Agreement. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +// billingProfileName - the ID that uniquely identifies a billing profile. +// parameters - the new or updated billing profile. +func (client ProfilesClient) CreateOrUpdate(ctx context.Context, billingAccountName string, billingProfileName string, parameters Profile) (result ProfilesCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProfilesClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.ProfileProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ProfileProperties.BillTo", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.ProfileProperties.BillTo.AddressLine1", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.ProfileProperties.BillTo.Country", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewError("billing.ProfilesClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, billingAccountName, billingProfileName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.ProfilesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.ProfilesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ProfilesClient) CreateOrUpdatePreparer(ctx context.Context, billingAccountName string, billingProfileName string, parameters Profile) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountName": autorest.Encode("path", billingAccountName), + "billingProfileName": autorest.Encode("path", billingProfileName), + } + + const APIVersion = "2020-05-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.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}", pathParameters), + autorest.WithJSON(parameters), + 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 ProfilesClient) CreateOrUpdateSender(req *http.Request) (future ProfilesCreateOrUpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client ProfilesClient) CreateOrUpdateResponder(resp *http.Response) (result Profile, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets a billing profile by its ID. The operation is supported for billing accounts with agreement type Microsoft +// Customer Agreement or Microsoft Partner Agreement. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +// billingProfileName - the ID that uniquely identifies a billing profile. +// expand - may be used to expand the invoice sections. +func (client ProfilesClient) Get(ctx context.Context, billingAccountName string, billingProfileName string, expand string) (result Profile, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProfilesClient.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, billingAccountName, billingProfileName, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.ProfilesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.ProfilesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.ProfilesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ProfilesClient) GetPreparer(ctx context.Context, billingAccountName string, billingProfileName string, expand string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountName": autorest.Encode("path", billingAccountName), + "billingProfileName": autorest.Encode("path", billingProfileName), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}", 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 ProfilesClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ProfilesClient) GetResponder(resp *http.Response) (result Profile, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByBillingAccount lists the billing profiles that a user has access to. The operation is supported for billing +// accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +// expand - may be used to expand the invoice sections. +func (client ProfilesClient) ListByBillingAccount(ctx context.Context, billingAccountName string, expand string) (result ProfileListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProfilesClient.ListByBillingAccount") + defer func() { + sc := -1 + if result.plr.Response.Response != nil { + sc = result.plr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByBillingAccountNextResults + req, err := client.ListByBillingAccountPreparer(ctx, billingAccountName, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.ProfilesClient", "ListByBillingAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByBillingAccountSender(req) + if err != nil { + result.plr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.ProfilesClient", "ListByBillingAccount", resp, "Failure sending request") + return + } + + result.plr, err = client.ListByBillingAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.ProfilesClient", "ListByBillingAccount", resp, "Failure responding to request") + } + + return +} + +// ListByBillingAccountPreparer prepares the ListByBillingAccount request. +func (client ProfilesClient) ListByBillingAccountPreparer(ctx context.Context, billingAccountName string, expand string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountName": autorest.Encode("path", billingAccountName), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(expand) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByBillingAccountSender sends the ListByBillingAccount request. The method will close the +// http.Response Body if it receives an error. +func (client ProfilesClient) ListByBillingAccountSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListByBillingAccountResponder handles the response to the ListByBillingAccount request. The method always +// closes the http.Response Body. +func (client ProfilesClient) ListByBillingAccountResponder(resp *http.Response) (result ProfileListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByBillingAccountNextResults retrieves the next set of results, if any. +func (client ProfilesClient) listByBillingAccountNextResults(ctx context.Context, lastResults ProfileListResult) (result ProfileListResult, err error) { + req, err := lastResults.profileListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "billing.ProfilesClient", "listByBillingAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByBillingAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "billing.ProfilesClient", "listByBillingAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByBillingAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.ProfilesClient", "listByBillingAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByBillingAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client ProfilesClient) ListByBillingAccountComplete(ctx context.Context, billingAccountName string, expand string) (result ProfileListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProfilesClient.ListByBillingAccount") + 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.ListByBillingAccount(ctx, billingAccountName, expand) + return +} diff --git a/services/preview/billing/mgmt/2020-05-01-preview/billing/property.go b/services/preview/billing/mgmt/2020-05-01-preview/billing/property.go new file mode 100644 index 000000000000..cd906a7ae954 --- /dev/null +++ b/services/preview/billing/mgmt/2020-05-01-preview/billing/property.go @@ -0,0 +1,190 @@ +package billing + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// PropertyClient is the billing client provides access to billing resources for Azure subscriptions. +type PropertyClient struct { + BaseClient +} + +// NewPropertyClient creates an instance of the PropertyClient client. +func NewPropertyClient(subscriptionID string) PropertyClient { + return NewPropertyClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPropertyClientWithBaseURI creates an instance of the PropertyClient 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 NewPropertyClientWithBaseURI(baseURI string, subscriptionID string) PropertyClient { + return PropertyClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get get the billing properties for a subscription. This operation is not supported for billing accounts with +// agreement type Enterprise Agreement. +func (client PropertyClient) Get(ctx context.Context) (result Property, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PropertyClient.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) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.PropertyClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.PropertyClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.PropertyClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client PropertyClient) GetPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Billing/billingProperty/default", 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 PropertyClient) 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 PropertyClient) GetResponder(resp *http.Response) (result Property, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update updates the billing property of a subscription. Currently, cost center can be updated. The operation is +// supported only for billing accounts with agreement type Microsoft Customer Agreement. +// Parameters: +// parameters - request parameters that are provided to the update billing property operation. +func (client PropertyClient) Update(ctx context.Context, parameters Property) (result Property, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PropertyClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.PropertyClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.PropertyClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.PropertyClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client PropertyClient) UpdatePreparer(ctx context.Context, parameters Property) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-05-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}/providers/Microsoft.Billing/billingProperty/default", pathParameters), + autorest.WithJSON(parameters), + 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 PropertyClient) 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 PropertyClient) UpdateResponder(resp *http.Response) (result Property, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/billing/mgmt/2020-05-01-preview/billing/roleassignments.go b/services/preview/billing/mgmt/2020-05-01-preview/billing/roleassignments.go new file mode 100644 index 000000000000..8758acb96dca --- /dev/null +++ b/services/preview/billing/mgmt/2020-05-01-preview/billing/roleassignments.go @@ -0,0 +1,852 @@ +package billing + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// RoleAssignmentsClient is the billing client provides access to billing resources for Azure subscriptions. +type RoleAssignmentsClient struct { + BaseClient +} + +// NewRoleAssignmentsClient creates an instance of the RoleAssignmentsClient client. +func NewRoleAssignmentsClient(subscriptionID string) RoleAssignmentsClient { + return NewRoleAssignmentsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewRoleAssignmentsClientWithBaseURI creates an instance of the RoleAssignmentsClient 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 NewRoleAssignmentsClientWithBaseURI(baseURI string, subscriptionID string) RoleAssignmentsClient { + return RoleAssignmentsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// DeleteByBillingAccount deletes a role assignment for the caller on a billing account. The operation is supported for +// billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +// billingRoleAssignmentName - the ID that uniquely identifies a role assignment. +func (client RoleAssignmentsClient) DeleteByBillingAccount(ctx context.Context, billingAccountName string, billingRoleAssignmentName string) (result RoleAssignment, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RoleAssignmentsClient.DeleteByBillingAccount") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeleteByBillingAccountPreparer(ctx, billingAccountName, billingRoleAssignmentName) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.RoleAssignmentsClient", "DeleteByBillingAccount", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteByBillingAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.RoleAssignmentsClient", "DeleteByBillingAccount", resp, "Failure sending request") + return + } + + result, err = client.DeleteByBillingAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.RoleAssignmentsClient", "DeleteByBillingAccount", resp, "Failure responding to request") + } + + return +} + +// DeleteByBillingAccountPreparer prepares the DeleteByBillingAccount request. +func (client RoleAssignmentsClient) DeleteByBillingAccountPreparer(ctx context.Context, billingAccountName string, billingRoleAssignmentName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountName": autorest.Encode("path", billingAccountName), + "billingRoleAssignmentName": autorest.Encode("path", billingRoleAssignmentName), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleAssignments/{billingRoleAssignmentName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteByBillingAccountSender sends the DeleteByBillingAccount request. The method will close the +// http.Response Body if it receives an error. +func (client RoleAssignmentsClient) DeleteByBillingAccountSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// DeleteByBillingAccountResponder handles the response to the DeleteByBillingAccount request. The method always +// closes the http.Response Body. +func (client RoleAssignmentsClient) DeleteByBillingAccountResponder(resp *http.Response) (result RoleAssignment, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// DeleteByBillingProfile deletes a role assignment for the caller on a billing profile. The operation is supported for +// billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +// billingProfileName - the ID that uniquely identifies a billing profile. +// billingRoleAssignmentName - the ID that uniquely identifies a role assignment. +func (client RoleAssignmentsClient) DeleteByBillingProfile(ctx context.Context, billingAccountName string, billingProfileName string, billingRoleAssignmentName string) (result RoleAssignment, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RoleAssignmentsClient.DeleteByBillingProfile") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeleteByBillingProfilePreparer(ctx, billingAccountName, billingProfileName, billingRoleAssignmentName) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.RoleAssignmentsClient", "DeleteByBillingProfile", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteByBillingProfileSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.RoleAssignmentsClient", "DeleteByBillingProfile", resp, "Failure sending request") + return + } + + result, err = client.DeleteByBillingProfileResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.RoleAssignmentsClient", "DeleteByBillingProfile", resp, "Failure responding to request") + } + + return +} + +// DeleteByBillingProfilePreparer prepares the DeleteByBillingProfile request. +func (client RoleAssignmentsClient) DeleteByBillingProfilePreparer(ctx context.Context, billingAccountName string, billingProfileName string, billingRoleAssignmentName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountName": autorest.Encode("path", billingAccountName), + "billingProfileName": autorest.Encode("path", billingProfileName), + "billingRoleAssignmentName": autorest.Encode("path", billingRoleAssignmentName), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleAssignments/{billingRoleAssignmentName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteByBillingProfileSender sends the DeleteByBillingProfile request. The method will close the +// http.Response Body if it receives an error. +func (client RoleAssignmentsClient) DeleteByBillingProfileSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// DeleteByBillingProfileResponder handles the response to the DeleteByBillingProfile request. The method always +// closes the http.Response Body. +func (client RoleAssignmentsClient) DeleteByBillingProfileResponder(resp *http.Response) (result RoleAssignment, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// DeleteByInvoiceSection deletes a role assignment for the caller on an invoice section. The operation is supported +// for billing accounts with agreement type Microsoft Customer Agreement. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +// billingProfileName - the ID that uniquely identifies a billing profile. +// invoiceSectionName - the ID that uniquely identifies an invoice section. +// billingRoleAssignmentName - the ID that uniquely identifies a role assignment. +func (client RoleAssignmentsClient) DeleteByInvoiceSection(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string, billingRoleAssignmentName string) (result RoleAssignment, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RoleAssignmentsClient.DeleteByInvoiceSection") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeleteByInvoiceSectionPreparer(ctx, billingAccountName, billingProfileName, invoiceSectionName, billingRoleAssignmentName) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.RoleAssignmentsClient", "DeleteByInvoiceSection", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteByInvoiceSectionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.RoleAssignmentsClient", "DeleteByInvoiceSection", resp, "Failure sending request") + return + } + + result, err = client.DeleteByInvoiceSectionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.RoleAssignmentsClient", "DeleteByInvoiceSection", resp, "Failure responding to request") + } + + return +} + +// DeleteByInvoiceSectionPreparer prepares the DeleteByInvoiceSection request. +func (client RoleAssignmentsClient) DeleteByInvoiceSectionPreparer(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string, billingRoleAssignmentName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountName": autorest.Encode("path", billingAccountName), + "billingProfileName": autorest.Encode("path", billingProfileName), + "billingRoleAssignmentName": autorest.Encode("path", billingRoleAssignmentName), + "invoiceSectionName": autorest.Encode("path", invoiceSectionName), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleAssignments/{billingRoleAssignmentName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteByInvoiceSectionSender sends the DeleteByInvoiceSection request. The method will close the +// http.Response Body if it receives an error. +func (client RoleAssignmentsClient) DeleteByInvoiceSectionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// DeleteByInvoiceSectionResponder handles the response to the DeleteByInvoiceSection request. The method always +// closes the http.Response Body. +func (client RoleAssignmentsClient) DeleteByInvoiceSectionResponder(resp *http.Response) (result RoleAssignment, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetByBillingAccount gets a role assignment for the caller on a billing account. The operation is supported for +// billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +// billingRoleAssignmentName - the ID that uniquely identifies a role assignment. +func (client RoleAssignmentsClient) GetByBillingAccount(ctx context.Context, billingAccountName string, billingRoleAssignmentName string) (result RoleAssignment, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RoleAssignmentsClient.GetByBillingAccount") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetByBillingAccountPreparer(ctx, billingAccountName, billingRoleAssignmentName) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.RoleAssignmentsClient", "GetByBillingAccount", nil, "Failure preparing request") + return + } + + resp, err := client.GetByBillingAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.RoleAssignmentsClient", "GetByBillingAccount", resp, "Failure sending request") + return + } + + result, err = client.GetByBillingAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.RoleAssignmentsClient", "GetByBillingAccount", resp, "Failure responding to request") + } + + return +} + +// GetByBillingAccountPreparer prepares the GetByBillingAccount request. +func (client RoleAssignmentsClient) GetByBillingAccountPreparer(ctx context.Context, billingAccountName string, billingRoleAssignmentName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountName": autorest.Encode("path", billingAccountName), + "billingRoleAssignmentName": autorest.Encode("path", billingRoleAssignmentName), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleAssignments/{billingRoleAssignmentName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetByBillingAccountSender sends the GetByBillingAccount request. The method will close the +// http.Response Body if it receives an error. +func (client RoleAssignmentsClient) GetByBillingAccountSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetByBillingAccountResponder handles the response to the GetByBillingAccount request. The method always +// closes the http.Response Body. +func (client RoleAssignmentsClient) GetByBillingAccountResponder(resp *http.Response) (result RoleAssignment, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetByBillingProfile gets a role assignment for the caller on a billing profile. The operation is supported for +// billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +// billingProfileName - the ID that uniquely identifies a billing profile. +// billingRoleAssignmentName - the ID that uniquely identifies a role assignment. +func (client RoleAssignmentsClient) GetByBillingProfile(ctx context.Context, billingAccountName string, billingProfileName string, billingRoleAssignmentName string) (result RoleAssignment, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RoleAssignmentsClient.GetByBillingProfile") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetByBillingProfilePreparer(ctx, billingAccountName, billingProfileName, billingRoleAssignmentName) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.RoleAssignmentsClient", "GetByBillingProfile", nil, "Failure preparing request") + return + } + + resp, err := client.GetByBillingProfileSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.RoleAssignmentsClient", "GetByBillingProfile", resp, "Failure sending request") + return + } + + result, err = client.GetByBillingProfileResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.RoleAssignmentsClient", "GetByBillingProfile", resp, "Failure responding to request") + } + + return +} + +// GetByBillingProfilePreparer prepares the GetByBillingProfile request. +func (client RoleAssignmentsClient) GetByBillingProfilePreparer(ctx context.Context, billingAccountName string, billingProfileName string, billingRoleAssignmentName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountName": autorest.Encode("path", billingAccountName), + "billingProfileName": autorest.Encode("path", billingProfileName), + "billingRoleAssignmentName": autorest.Encode("path", billingRoleAssignmentName), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleAssignments/{billingRoleAssignmentName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetByBillingProfileSender sends the GetByBillingProfile request. The method will close the +// http.Response Body if it receives an error. +func (client RoleAssignmentsClient) GetByBillingProfileSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetByBillingProfileResponder handles the response to the GetByBillingProfile request. The method always +// closes the http.Response Body. +func (client RoleAssignmentsClient) GetByBillingProfileResponder(resp *http.Response) (result RoleAssignment, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetByInvoiceSection gets a role assignment for the caller on an invoice section. The operation is supported for +// billing accounts with agreement type Microsoft Customer Agreement. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +// billingProfileName - the ID that uniquely identifies a billing profile. +// invoiceSectionName - the ID that uniquely identifies an invoice section. +// billingRoleAssignmentName - the ID that uniquely identifies a role assignment. +func (client RoleAssignmentsClient) GetByInvoiceSection(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string, billingRoleAssignmentName string) (result RoleAssignment, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RoleAssignmentsClient.GetByInvoiceSection") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetByInvoiceSectionPreparer(ctx, billingAccountName, billingProfileName, invoiceSectionName, billingRoleAssignmentName) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.RoleAssignmentsClient", "GetByInvoiceSection", nil, "Failure preparing request") + return + } + + resp, err := client.GetByInvoiceSectionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.RoleAssignmentsClient", "GetByInvoiceSection", resp, "Failure sending request") + return + } + + result, err = client.GetByInvoiceSectionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.RoleAssignmentsClient", "GetByInvoiceSection", resp, "Failure responding to request") + } + + return +} + +// GetByInvoiceSectionPreparer prepares the GetByInvoiceSection request. +func (client RoleAssignmentsClient) GetByInvoiceSectionPreparer(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string, billingRoleAssignmentName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountName": autorest.Encode("path", billingAccountName), + "billingProfileName": autorest.Encode("path", billingProfileName), + "billingRoleAssignmentName": autorest.Encode("path", billingRoleAssignmentName), + "invoiceSectionName": autorest.Encode("path", invoiceSectionName), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleAssignments/{billingRoleAssignmentName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetByInvoiceSectionSender sends the GetByInvoiceSection request. The method will close the +// http.Response Body if it receives an error. +func (client RoleAssignmentsClient) GetByInvoiceSectionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetByInvoiceSectionResponder handles the response to the GetByInvoiceSection request. The method always +// closes the http.Response Body. +func (client RoleAssignmentsClient) GetByInvoiceSectionResponder(resp *http.Response) (result RoleAssignment, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByBillingAccount lists the role assignments for the caller on a billing account. The operation is supported for +// billing accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +func (client RoleAssignmentsClient) ListByBillingAccount(ctx context.Context, billingAccountName string) (result RoleAssignmentListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RoleAssignmentsClient.ListByBillingAccount") + defer func() { + sc := -1 + if result.ralr.Response.Response != nil { + sc = result.ralr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByBillingAccountNextResults + req, err := client.ListByBillingAccountPreparer(ctx, billingAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.RoleAssignmentsClient", "ListByBillingAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByBillingAccountSender(req) + if err != nil { + result.ralr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.RoleAssignmentsClient", "ListByBillingAccount", resp, "Failure sending request") + return + } + + result.ralr, err = client.ListByBillingAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.RoleAssignmentsClient", "ListByBillingAccount", resp, "Failure responding to request") + } + + return +} + +// ListByBillingAccountPreparer prepares the ListByBillingAccount request. +func (client RoleAssignmentsClient) ListByBillingAccountPreparer(ctx context.Context, billingAccountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountName": autorest.Encode("path", billingAccountName), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleAssignments", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByBillingAccountSender sends the ListByBillingAccount request. The method will close the +// http.Response Body if it receives an error. +func (client RoleAssignmentsClient) ListByBillingAccountSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListByBillingAccountResponder handles the response to the ListByBillingAccount request. The method always +// closes the http.Response Body. +func (client RoleAssignmentsClient) ListByBillingAccountResponder(resp *http.Response) (result RoleAssignmentListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByBillingAccountNextResults retrieves the next set of results, if any. +func (client RoleAssignmentsClient) listByBillingAccountNextResults(ctx context.Context, lastResults RoleAssignmentListResult) (result RoleAssignmentListResult, err error) { + req, err := lastResults.roleAssignmentListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "billing.RoleAssignmentsClient", "listByBillingAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByBillingAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "billing.RoleAssignmentsClient", "listByBillingAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByBillingAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.RoleAssignmentsClient", "listByBillingAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByBillingAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client RoleAssignmentsClient) ListByBillingAccountComplete(ctx context.Context, billingAccountName string) (result RoleAssignmentListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RoleAssignmentsClient.ListByBillingAccount") + 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.ListByBillingAccount(ctx, billingAccountName) + return +} + +// ListByBillingProfile lists the role assignments for the caller on a billing profile. The operation is supported for +// billing accounts with agreement type Microsoft Customer Agreement. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +// billingProfileName - the ID that uniquely identifies a billing profile. +func (client RoleAssignmentsClient) ListByBillingProfile(ctx context.Context, billingAccountName string, billingProfileName string) (result RoleAssignmentListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RoleAssignmentsClient.ListByBillingProfile") + defer func() { + sc := -1 + if result.ralr.Response.Response != nil { + sc = result.ralr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByBillingProfileNextResults + req, err := client.ListByBillingProfilePreparer(ctx, billingAccountName, billingProfileName) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.RoleAssignmentsClient", "ListByBillingProfile", nil, "Failure preparing request") + return + } + + resp, err := client.ListByBillingProfileSender(req) + if err != nil { + result.ralr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.RoleAssignmentsClient", "ListByBillingProfile", resp, "Failure sending request") + return + } + + result.ralr, err = client.ListByBillingProfileResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.RoleAssignmentsClient", "ListByBillingProfile", resp, "Failure responding to request") + } + + return +} + +// ListByBillingProfilePreparer prepares the ListByBillingProfile request. +func (client RoleAssignmentsClient) ListByBillingProfilePreparer(ctx context.Context, billingAccountName string, billingProfileName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountName": autorest.Encode("path", billingAccountName), + "billingProfileName": autorest.Encode("path", billingProfileName), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleAssignments", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByBillingProfileSender sends the ListByBillingProfile request. The method will close the +// http.Response Body if it receives an error. +func (client RoleAssignmentsClient) ListByBillingProfileSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListByBillingProfileResponder handles the response to the ListByBillingProfile request. The method always +// closes the http.Response Body. +func (client RoleAssignmentsClient) ListByBillingProfileResponder(resp *http.Response) (result RoleAssignmentListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByBillingProfileNextResults retrieves the next set of results, if any. +func (client RoleAssignmentsClient) listByBillingProfileNextResults(ctx context.Context, lastResults RoleAssignmentListResult) (result RoleAssignmentListResult, err error) { + req, err := lastResults.roleAssignmentListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "billing.RoleAssignmentsClient", "listByBillingProfileNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByBillingProfileSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "billing.RoleAssignmentsClient", "listByBillingProfileNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByBillingProfileResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.RoleAssignmentsClient", "listByBillingProfileNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByBillingProfileComplete enumerates all values, automatically crossing page boundaries as required. +func (client RoleAssignmentsClient) ListByBillingProfileComplete(ctx context.Context, billingAccountName string, billingProfileName string) (result RoleAssignmentListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RoleAssignmentsClient.ListByBillingProfile") + 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.ListByBillingProfile(ctx, billingAccountName, billingProfileName) + return +} + +// ListByInvoiceSection lists the role assignments for the caller on an invoice section. The operation is supported for +// billing accounts with agreement type Microsoft Customer Agreement. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +// billingProfileName - the ID that uniquely identifies a billing profile. +// invoiceSectionName - the ID that uniquely identifies an invoice section. +func (client RoleAssignmentsClient) ListByInvoiceSection(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string) (result RoleAssignmentListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RoleAssignmentsClient.ListByInvoiceSection") + defer func() { + sc := -1 + if result.ralr.Response.Response != nil { + sc = result.ralr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByInvoiceSectionNextResults + req, err := client.ListByInvoiceSectionPreparer(ctx, billingAccountName, billingProfileName, invoiceSectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.RoleAssignmentsClient", "ListByInvoiceSection", nil, "Failure preparing request") + return + } + + resp, err := client.ListByInvoiceSectionSender(req) + if err != nil { + result.ralr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.RoleAssignmentsClient", "ListByInvoiceSection", resp, "Failure sending request") + return + } + + result.ralr, err = client.ListByInvoiceSectionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.RoleAssignmentsClient", "ListByInvoiceSection", resp, "Failure responding to request") + } + + return +} + +// ListByInvoiceSectionPreparer prepares the ListByInvoiceSection request. +func (client RoleAssignmentsClient) ListByInvoiceSectionPreparer(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountName": autorest.Encode("path", billingAccountName), + "billingProfileName": autorest.Encode("path", billingProfileName), + "invoiceSectionName": autorest.Encode("path", invoiceSectionName), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleAssignments", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByInvoiceSectionSender sends the ListByInvoiceSection request. The method will close the +// http.Response Body if it receives an error. +func (client RoleAssignmentsClient) ListByInvoiceSectionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListByInvoiceSectionResponder handles the response to the ListByInvoiceSection request. The method always +// closes the http.Response Body. +func (client RoleAssignmentsClient) ListByInvoiceSectionResponder(resp *http.Response) (result RoleAssignmentListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByInvoiceSectionNextResults retrieves the next set of results, if any. +func (client RoleAssignmentsClient) listByInvoiceSectionNextResults(ctx context.Context, lastResults RoleAssignmentListResult) (result RoleAssignmentListResult, err error) { + req, err := lastResults.roleAssignmentListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "billing.RoleAssignmentsClient", "listByInvoiceSectionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByInvoiceSectionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "billing.RoleAssignmentsClient", "listByInvoiceSectionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByInvoiceSectionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.RoleAssignmentsClient", "listByInvoiceSectionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByInvoiceSectionComplete enumerates all values, automatically crossing page boundaries as required. +func (client RoleAssignmentsClient) ListByInvoiceSectionComplete(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string) (result RoleAssignmentListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RoleAssignmentsClient.ListByInvoiceSection") + 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.ListByInvoiceSection(ctx, billingAccountName, billingProfileName, invoiceSectionName) + return +} diff --git a/services/preview/billing/mgmt/2020-05-01-preview/billing/roledefinitions.go b/services/preview/billing/mgmt/2020-05-01-preview/billing/roledefinitions.go new file mode 100644 index 000000000000..1e30e5e16946 --- /dev/null +++ b/services/preview/billing/mgmt/2020-05-01-preview/billing/roledefinitions.go @@ -0,0 +1,618 @@ +package billing + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// RoleDefinitionsClient is the billing client provides access to billing resources for Azure subscriptions. +type RoleDefinitionsClient struct { + BaseClient +} + +// NewRoleDefinitionsClient creates an instance of the RoleDefinitionsClient client. +func NewRoleDefinitionsClient(subscriptionID string) RoleDefinitionsClient { + return NewRoleDefinitionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewRoleDefinitionsClientWithBaseURI creates an instance of the RoleDefinitionsClient 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 NewRoleDefinitionsClientWithBaseURI(baseURI string, subscriptionID string) RoleDefinitionsClient { + return RoleDefinitionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// GetByBillingAccount gets the definition for a role on a billing account. The operation is supported for billing +// accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +// billingRoleDefinitionName - the ID that uniquely identifies a role definition. +func (client RoleDefinitionsClient) GetByBillingAccount(ctx context.Context, billingAccountName string, billingRoleDefinitionName string) (result RoleDefinition, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RoleDefinitionsClient.GetByBillingAccount") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetByBillingAccountPreparer(ctx, billingAccountName, billingRoleDefinitionName) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.RoleDefinitionsClient", "GetByBillingAccount", nil, "Failure preparing request") + return + } + + resp, err := client.GetByBillingAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.RoleDefinitionsClient", "GetByBillingAccount", resp, "Failure sending request") + return + } + + result, err = client.GetByBillingAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.RoleDefinitionsClient", "GetByBillingAccount", resp, "Failure responding to request") + } + + return +} + +// GetByBillingAccountPreparer prepares the GetByBillingAccount request. +func (client RoleDefinitionsClient) GetByBillingAccountPreparer(ctx context.Context, billingAccountName string, billingRoleDefinitionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountName": autorest.Encode("path", billingAccountName), + "billingRoleDefinitionName": autorest.Encode("path", billingRoleDefinitionName), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions/{billingRoleDefinitionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetByBillingAccountSender sends the GetByBillingAccount request. The method will close the +// http.Response Body if it receives an error. +func (client RoleDefinitionsClient) GetByBillingAccountSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetByBillingAccountResponder handles the response to the GetByBillingAccount request. The method always +// closes the http.Response Body. +func (client RoleDefinitionsClient) GetByBillingAccountResponder(resp *http.Response) (result RoleDefinition, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetByBillingProfile gets the definition for a role on a billing profile. The operation is supported for billing +// accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +// billingProfileName - the ID that uniquely identifies a billing profile. +// billingRoleDefinitionName - the ID that uniquely identifies a role definition. +func (client RoleDefinitionsClient) GetByBillingProfile(ctx context.Context, billingAccountName string, billingProfileName string, billingRoleDefinitionName string) (result RoleDefinition, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RoleDefinitionsClient.GetByBillingProfile") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetByBillingProfilePreparer(ctx, billingAccountName, billingProfileName, billingRoleDefinitionName) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.RoleDefinitionsClient", "GetByBillingProfile", nil, "Failure preparing request") + return + } + + resp, err := client.GetByBillingProfileSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.RoleDefinitionsClient", "GetByBillingProfile", resp, "Failure sending request") + return + } + + result, err = client.GetByBillingProfileResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.RoleDefinitionsClient", "GetByBillingProfile", resp, "Failure responding to request") + } + + return +} + +// GetByBillingProfilePreparer prepares the GetByBillingProfile request. +func (client RoleDefinitionsClient) GetByBillingProfilePreparer(ctx context.Context, billingAccountName string, billingProfileName string, billingRoleDefinitionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountName": autorest.Encode("path", billingAccountName), + "billingProfileName": autorest.Encode("path", billingProfileName), + "billingRoleDefinitionName": autorest.Encode("path", billingRoleDefinitionName), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleDefinitions/{billingRoleDefinitionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetByBillingProfileSender sends the GetByBillingProfile request. The method will close the +// http.Response Body if it receives an error. +func (client RoleDefinitionsClient) GetByBillingProfileSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetByBillingProfileResponder handles the response to the GetByBillingProfile request. The method always +// closes the http.Response Body. +func (client RoleDefinitionsClient) GetByBillingProfileResponder(resp *http.Response) (result RoleDefinition, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetByInvoiceSection gets the definition for a role on an invoice section. The operation is supported only for +// billing accounts with agreement type Microsoft Customer Agreement. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +// billingProfileName - the ID that uniquely identifies a billing profile. +// invoiceSectionName - the ID that uniquely identifies an invoice section. +// billingRoleDefinitionName - the ID that uniquely identifies a role definition. +func (client RoleDefinitionsClient) GetByInvoiceSection(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string, billingRoleDefinitionName string) (result RoleDefinition, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RoleDefinitionsClient.GetByInvoiceSection") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetByInvoiceSectionPreparer(ctx, billingAccountName, billingProfileName, invoiceSectionName, billingRoleDefinitionName) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.RoleDefinitionsClient", "GetByInvoiceSection", nil, "Failure preparing request") + return + } + + resp, err := client.GetByInvoiceSectionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.RoleDefinitionsClient", "GetByInvoiceSection", resp, "Failure sending request") + return + } + + result, err = client.GetByInvoiceSectionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.RoleDefinitionsClient", "GetByInvoiceSection", resp, "Failure responding to request") + } + + return +} + +// GetByInvoiceSectionPreparer prepares the GetByInvoiceSection request. +func (client RoleDefinitionsClient) GetByInvoiceSectionPreparer(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string, billingRoleDefinitionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountName": autorest.Encode("path", billingAccountName), + "billingProfileName": autorest.Encode("path", billingProfileName), + "billingRoleDefinitionName": autorest.Encode("path", billingRoleDefinitionName), + "invoiceSectionName": autorest.Encode("path", invoiceSectionName), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleDefinitions/{billingRoleDefinitionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetByInvoiceSectionSender sends the GetByInvoiceSection request. The method will close the +// http.Response Body if it receives an error. +func (client RoleDefinitionsClient) GetByInvoiceSectionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetByInvoiceSectionResponder handles the response to the GetByInvoiceSection request. The method always +// closes the http.Response Body. +func (client RoleDefinitionsClient) GetByInvoiceSectionResponder(resp *http.Response) (result RoleDefinition, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByBillingAccount lists the role definitions for a billing account. The operation is supported for billing +// accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +func (client RoleDefinitionsClient) ListByBillingAccount(ctx context.Context, billingAccountName string) (result RoleDefinitionListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RoleDefinitionsClient.ListByBillingAccount") + defer func() { + sc := -1 + if result.rdlr.Response.Response != nil { + sc = result.rdlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByBillingAccountNextResults + req, err := client.ListByBillingAccountPreparer(ctx, billingAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.RoleDefinitionsClient", "ListByBillingAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByBillingAccountSender(req) + if err != nil { + result.rdlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.RoleDefinitionsClient", "ListByBillingAccount", resp, "Failure sending request") + return + } + + result.rdlr, err = client.ListByBillingAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.RoleDefinitionsClient", "ListByBillingAccount", resp, "Failure responding to request") + } + + return +} + +// ListByBillingAccountPreparer prepares the ListByBillingAccount request. +func (client RoleDefinitionsClient) ListByBillingAccountPreparer(ctx context.Context, billingAccountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountName": autorest.Encode("path", billingAccountName), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingRoleDefinitions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByBillingAccountSender sends the ListByBillingAccount request. The method will close the +// http.Response Body if it receives an error. +func (client RoleDefinitionsClient) ListByBillingAccountSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListByBillingAccountResponder handles the response to the ListByBillingAccount request. The method always +// closes the http.Response Body. +func (client RoleDefinitionsClient) ListByBillingAccountResponder(resp *http.Response) (result RoleDefinitionListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByBillingAccountNextResults retrieves the next set of results, if any. +func (client RoleDefinitionsClient) listByBillingAccountNextResults(ctx context.Context, lastResults RoleDefinitionListResult) (result RoleDefinitionListResult, err error) { + req, err := lastResults.roleDefinitionListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "billing.RoleDefinitionsClient", "listByBillingAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByBillingAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "billing.RoleDefinitionsClient", "listByBillingAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByBillingAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.RoleDefinitionsClient", "listByBillingAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByBillingAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client RoleDefinitionsClient) ListByBillingAccountComplete(ctx context.Context, billingAccountName string) (result RoleDefinitionListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RoleDefinitionsClient.ListByBillingAccount") + 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.ListByBillingAccount(ctx, billingAccountName) + return +} + +// ListByBillingProfile lists the role definitions for a billing profile. The operation is supported for billing +// accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +// billingProfileName - the ID that uniquely identifies a billing profile. +func (client RoleDefinitionsClient) ListByBillingProfile(ctx context.Context, billingAccountName string, billingProfileName string) (result RoleDefinitionListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RoleDefinitionsClient.ListByBillingProfile") + defer func() { + sc := -1 + if result.rdlr.Response.Response != nil { + sc = result.rdlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByBillingProfileNextResults + req, err := client.ListByBillingProfilePreparer(ctx, billingAccountName, billingProfileName) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.RoleDefinitionsClient", "ListByBillingProfile", nil, "Failure preparing request") + return + } + + resp, err := client.ListByBillingProfileSender(req) + if err != nil { + result.rdlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.RoleDefinitionsClient", "ListByBillingProfile", resp, "Failure sending request") + return + } + + result.rdlr, err = client.ListByBillingProfileResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.RoleDefinitionsClient", "ListByBillingProfile", resp, "Failure responding to request") + } + + return +} + +// ListByBillingProfilePreparer prepares the ListByBillingProfile request. +func (client RoleDefinitionsClient) ListByBillingProfilePreparer(ctx context.Context, billingAccountName string, billingProfileName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountName": autorest.Encode("path", billingAccountName), + "billingProfileName": autorest.Encode("path", billingProfileName), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingRoleDefinitions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByBillingProfileSender sends the ListByBillingProfile request. The method will close the +// http.Response Body if it receives an error. +func (client RoleDefinitionsClient) ListByBillingProfileSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListByBillingProfileResponder handles the response to the ListByBillingProfile request. The method always +// closes the http.Response Body. +func (client RoleDefinitionsClient) ListByBillingProfileResponder(resp *http.Response) (result RoleDefinitionListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByBillingProfileNextResults retrieves the next set of results, if any. +func (client RoleDefinitionsClient) listByBillingProfileNextResults(ctx context.Context, lastResults RoleDefinitionListResult) (result RoleDefinitionListResult, err error) { + req, err := lastResults.roleDefinitionListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "billing.RoleDefinitionsClient", "listByBillingProfileNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByBillingProfileSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "billing.RoleDefinitionsClient", "listByBillingProfileNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByBillingProfileResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.RoleDefinitionsClient", "listByBillingProfileNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByBillingProfileComplete enumerates all values, automatically crossing page boundaries as required. +func (client RoleDefinitionsClient) ListByBillingProfileComplete(ctx context.Context, billingAccountName string, billingProfileName string) (result RoleDefinitionListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RoleDefinitionsClient.ListByBillingProfile") + 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.ListByBillingProfile(ctx, billingAccountName, billingProfileName) + return +} + +// ListByInvoiceSection lists the role definitions for an invoice section. The operation is supported for billing +// accounts with agreement type Microsoft Partner Agreement or Microsoft Customer Agreement. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +// billingProfileName - the ID that uniquely identifies a billing profile. +// invoiceSectionName - the ID that uniquely identifies an invoice section. +func (client RoleDefinitionsClient) ListByInvoiceSection(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string) (result RoleDefinitionListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RoleDefinitionsClient.ListByInvoiceSection") + defer func() { + sc := -1 + if result.rdlr.Response.Response != nil { + sc = result.rdlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByInvoiceSectionNextResults + req, err := client.ListByInvoiceSectionPreparer(ctx, billingAccountName, billingProfileName, invoiceSectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.RoleDefinitionsClient", "ListByInvoiceSection", nil, "Failure preparing request") + return + } + + resp, err := client.ListByInvoiceSectionSender(req) + if err != nil { + result.rdlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.RoleDefinitionsClient", "ListByInvoiceSection", resp, "Failure sending request") + return + } + + result.rdlr, err = client.ListByInvoiceSectionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.RoleDefinitionsClient", "ListByInvoiceSection", resp, "Failure responding to request") + } + + return +} + +// ListByInvoiceSectionPreparer prepares the ListByInvoiceSection request. +func (client RoleDefinitionsClient) ListByInvoiceSectionPreparer(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountName": autorest.Encode("path", billingAccountName), + "billingProfileName": autorest.Encode("path", billingProfileName), + "invoiceSectionName": autorest.Encode("path", invoiceSectionName), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingRoleDefinitions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByInvoiceSectionSender sends the ListByInvoiceSection request. The method will close the +// http.Response Body if it receives an error. +func (client RoleDefinitionsClient) ListByInvoiceSectionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListByInvoiceSectionResponder handles the response to the ListByInvoiceSection request. The method always +// closes the http.Response Body. +func (client RoleDefinitionsClient) ListByInvoiceSectionResponder(resp *http.Response) (result RoleDefinitionListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByInvoiceSectionNextResults retrieves the next set of results, if any. +func (client RoleDefinitionsClient) listByInvoiceSectionNextResults(ctx context.Context, lastResults RoleDefinitionListResult) (result RoleDefinitionListResult, err error) { + req, err := lastResults.roleDefinitionListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "billing.RoleDefinitionsClient", "listByInvoiceSectionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByInvoiceSectionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "billing.RoleDefinitionsClient", "listByInvoiceSectionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByInvoiceSectionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.RoleDefinitionsClient", "listByInvoiceSectionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByInvoiceSectionComplete enumerates all values, automatically crossing page boundaries as required. +func (client RoleDefinitionsClient) ListByInvoiceSectionComplete(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string) (result RoleDefinitionListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RoleDefinitionsClient.ListByInvoiceSection") + 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.ListByInvoiceSection(ctx, billingAccountName, billingProfileName, invoiceSectionName) + return +} diff --git a/services/preview/billing/mgmt/2020-05-01-preview/billing/subscriptions.go b/services/preview/billing/mgmt/2020-05-01-preview/billing/subscriptions.go new file mode 100644 index 000000000000..aff3bdcfeea0 --- /dev/null +++ b/services/preview/billing/mgmt/2020-05-01-preview/billing/subscriptions.go @@ -0,0 +1,809 @@ +package billing + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// SubscriptionsClient is the billing client provides access to billing resources for Azure subscriptions. +type SubscriptionsClient struct { + BaseClient +} + +// NewSubscriptionsClient creates an instance of the SubscriptionsClient client. +func NewSubscriptionsClient(subscriptionID string) SubscriptionsClient { + return NewSubscriptionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewSubscriptionsClientWithBaseURI creates an instance of the SubscriptionsClient 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 NewSubscriptionsClientWithBaseURI(baseURI string, subscriptionID string) SubscriptionsClient { + return SubscriptionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get gets a subscription by its ID. The operation is supported for billing accounts with agreement type Microsoft +// Customer Agreement and Microsoft Partner Agreement. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +func (client SubscriptionsClient) Get(ctx context.Context, billingAccountName string) (result Subscription, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionsClient.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, billingAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.SubscriptionsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.SubscriptionsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.SubscriptionsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client SubscriptionsClient) GetPreparer(ctx context.Context, billingAccountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountName": autorest.Encode("path", billingAccountName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptions/{subscriptionId}", 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 SubscriptionsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client SubscriptionsClient) GetResponder(resp *http.Response) (result Subscription, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByBillingAccount lists the subscriptions for a billing account. The operation is supported for billing accounts +// with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +func (client SubscriptionsClient) ListByBillingAccount(ctx context.Context, billingAccountName string) (result SubscriptionsListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionsClient.ListByBillingAccount") + defer func() { + sc := -1 + if result.slr.Response.Response != nil { + sc = result.slr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByBillingAccountNextResults + req, err := client.ListByBillingAccountPreparer(ctx, billingAccountName) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.SubscriptionsClient", "ListByBillingAccount", nil, "Failure preparing request") + return + } + + resp, err := client.ListByBillingAccountSender(req) + if err != nil { + result.slr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.SubscriptionsClient", "ListByBillingAccount", resp, "Failure sending request") + return + } + + result.slr, err = client.ListByBillingAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.SubscriptionsClient", "ListByBillingAccount", resp, "Failure responding to request") + } + + return +} + +// ListByBillingAccountPreparer prepares the ListByBillingAccount request. +func (client SubscriptionsClient) ListByBillingAccountPreparer(ctx context.Context, billingAccountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountName": autorest.Encode("path", billingAccountName), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByBillingAccountSender sends the ListByBillingAccount request. The method will close the +// http.Response Body if it receives an error. +func (client SubscriptionsClient) ListByBillingAccountSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListByBillingAccountResponder handles the response to the ListByBillingAccount request. The method always +// closes the http.Response Body. +func (client SubscriptionsClient) ListByBillingAccountResponder(resp *http.Response) (result SubscriptionsListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByBillingAccountNextResults retrieves the next set of results, if any. +func (client SubscriptionsClient) listByBillingAccountNextResults(ctx context.Context, lastResults SubscriptionsListResult) (result SubscriptionsListResult, err error) { + req, err := lastResults.subscriptionsListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "billing.SubscriptionsClient", "listByBillingAccountNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByBillingAccountSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "billing.SubscriptionsClient", "listByBillingAccountNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByBillingAccountResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.SubscriptionsClient", "listByBillingAccountNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByBillingAccountComplete enumerates all values, automatically crossing page boundaries as required. +func (client SubscriptionsClient) ListByBillingAccountComplete(ctx context.Context, billingAccountName string) (result SubscriptionsListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionsClient.ListByBillingAccount") + 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.ListByBillingAccount(ctx, billingAccountName) + return +} + +// ListByBillingProfile lists the subscriptions that are billed to a billing profile. The operation is supported for +// billing accounts with agreement type Microsoft Customer Agreement or Microsoft Partner Agreement. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +// billingProfileName - the ID that uniquely identifies a billing profile. +func (client SubscriptionsClient) ListByBillingProfile(ctx context.Context, billingAccountName string, billingProfileName string) (result SubscriptionsListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionsClient.ListByBillingProfile") + defer func() { + sc := -1 + if result.slr.Response.Response != nil { + sc = result.slr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByBillingProfileNextResults + req, err := client.ListByBillingProfilePreparer(ctx, billingAccountName, billingProfileName) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.SubscriptionsClient", "ListByBillingProfile", nil, "Failure preparing request") + return + } + + resp, err := client.ListByBillingProfileSender(req) + if err != nil { + result.slr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.SubscriptionsClient", "ListByBillingProfile", resp, "Failure sending request") + return + } + + result.slr, err = client.ListByBillingProfileResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.SubscriptionsClient", "ListByBillingProfile", resp, "Failure responding to request") + } + + return +} + +// ListByBillingProfilePreparer prepares the ListByBillingProfile request. +func (client SubscriptionsClient) ListByBillingProfilePreparer(ctx context.Context, billingAccountName string, billingProfileName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountName": autorest.Encode("path", billingAccountName), + "billingProfileName": autorest.Encode("path", billingProfileName), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/billingSubscriptions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByBillingProfileSender sends the ListByBillingProfile request. The method will close the +// http.Response Body if it receives an error. +func (client SubscriptionsClient) ListByBillingProfileSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListByBillingProfileResponder handles the response to the ListByBillingProfile request. The method always +// closes the http.Response Body. +func (client SubscriptionsClient) ListByBillingProfileResponder(resp *http.Response) (result SubscriptionsListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByBillingProfileNextResults retrieves the next set of results, if any. +func (client SubscriptionsClient) listByBillingProfileNextResults(ctx context.Context, lastResults SubscriptionsListResult) (result SubscriptionsListResult, err error) { + req, err := lastResults.subscriptionsListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "billing.SubscriptionsClient", "listByBillingProfileNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByBillingProfileSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "billing.SubscriptionsClient", "listByBillingProfileNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByBillingProfileResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.SubscriptionsClient", "listByBillingProfileNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByBillingProfileComplete enumerates all values, automatically crossing page boundaries as required. +func (client SubscriptionsClient) ListByBillingProfileComplete(ctx context.Context, billingAccountName string, billingProfileName string) (result SubscriptionsListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionsClient.ListByBillingProfile") + 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.ListByBillingProfile(ctx, billingAccountName, billingProfileName) + return +} + +// ListByCustomer lists the subscriptions for a customer. The operation is supported only for billing accounts with +// agreement type Microsoft Partner Agreement. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +// customerName - the ID that uniquely identifies a customer. +func (client SubscriptionsClient) ListByCustomer(ctx context.Context, billingAccountName string, customerName string) (result SubscriptionsListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionsClient.ListByCustomer") + defer func() { + sc := -1 + if result.slr.Response.Response != nil { + sc = result.slr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByCustomerNextResults + req, err := client.ListByCustomerPreparer(ctx, billingAccountName, customerName) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.SubscriptionsClient", "ListByCustomer", nil, "Failure preparing request") + return + } + + resp, err := client.ListByCustomerSender(req) + if err != nil { + result.slr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.SubscriptionsClient", "ListByCustomer", resp, "Failure sending request") + return + } + + result.slr, err = client.ListByCustomerResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.SubscriptionsClient", "ListByCustomer", resp, "Failure responding to request") + } + + return +} + +// ListByCustomerPreparer prepares the ListByCustomer request. +func (client SubscriptionsClient) ListByCustomerPreparer(ctx context.Context, billingAccountName string, customerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountName": autorest.Encode("path", billingAccountName), + "customerName": autorest.Encode("path", customerName), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/customers/{customerName}/billingSubscriptions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByCustomerSender sends the ListByCustomer request. The method will close the +// http.Response Body if it receives an error. +func (client SubscriptionsClient) ListByCustomerSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListByCustomerResponder handles the response to the ListByCustomer request. The method always +// closes the http.Response Body. +func (client SubscriptionsClient) ListByCustomerResponder(resp *http.Response) (result SubscriptionsListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByCustomerNextResults retrieves the next set of results, if any. +func (client SubscriptionsClient) listByCustomerNextResults(ctx context.Context, lastResults SubscriptionsListResult) (result SubscriptionsListResult, err error) { + req, err := lastResults.subscriptionsListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "billing.SubscriptionsClient", "listByCustomerNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByCustomerSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "billing.SubscriptionsClient", "listByCustomerNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByCustomerResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.SubscriptionsClient", "listByCustomerNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByCustomerComplete enumerates all values, automatically crossing page boundaries as required. +func (client SubscriptionsClient) ListByCustomerComplete(ctx context.Context, billingAccountName string, customerName string) (result SubscriptionsListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionsClient.ListByCustomer") + 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.ListByCustomer(ctx, billingAccountName, customerName) + return +} + +// ListByInvoiceSection lists the subscriptions that are billed to an invoice section. The operation is supported only +// for billing accounts with agreement type Microsoft Customer Agreement. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +// billingProfileName - the ID that uniquely identifies a billing profile. +// invoiceSectionName - the ID that uniquely identifies an invoice section. +func (client SubscriptionsClient) ListByInvoiceSection(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string) (result SubscriptionsListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionsClient.ListByInvoiceSection") + defer func() { + sc := -1 + if result.slr.Response.Response != nil { + sc = result.slr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByInvoiceSectionNextResults + req, err := client.ListByInvoiceSectionPreparer(ctx, billingAccountName, billingProfileName, invoiceSectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.SubscriptionsClient", "ListByInvoiceSection", nil, "Failure preparing request") + return + } + + resp, err := client.ListByInvoiceSectionSender(req) + if err != nil { + result.slr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.SubscriptionsClient", "ListByInvoiceSection", resp, "Failure sending request") + return + } + + result.slr, err = client.ListByInvoiceSectionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.SubscriptionsClient", "ListByInvoiceSection", resp, "Failure responding to request") + } + + return +} + +// ListByInvoiceSectionPreparer prepares the ListByInvoiceSection request. +func (client SubscriptionsClient) ListByInvoiceSectionPreparer(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountName": autorest.Encode("path", billingAccountName), + "billingProfileName": autorest.Encode("path", billingProfileName), + "invoiceSectionName": autorest.Encode("path", invoiceSectionName), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingProfiles/{billingProfileName}/invoiceSections/{invoiceSectionName}/billingSubscriptions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByInvoiceSectionSender sends the ListByInvoiceSection request. The method will close the +// http.Response Body if it receives an error. +func (client SubscriptionsClient) ListByInvoiceSectionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListByInvoiceSectionResponder handles the response to the ListByInvoiceSection request. The method always +// closes the http.Response Body. +func (client SubscriptionsClient) ListByInvoiceSectionResponder(resp *http.Response) (result SubscriptionsListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByInvoiceSectionNextResults retrieves the next set of results, if any. +func (client SubscriptionsClient) listByInvoiceSectionNextResults(ctx context.Context, lastResults SubscriptionsListResult) (result SubscriptionsListResult, err error) { + req, err := lastResults.subscriptionsListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "billing.SubscriptionsClient", "listByInvoiceSectionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByInvoiceSectionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "billing.SubscriptionsClient", "listByInvoiceSectionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByInvoiceSectionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.SubscriptionsClient", "listByInvoiceSectionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByInvoiceSectionComplete enumerates all values, automatically crossing page boundaries as required. +func (client SubscriptionsClient) ListByInvoiceSectionComplete(ctx context.Context, billingAccountName string, billingProfileName string, invoiceSectionName string) (result SubscriptionsListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionsClient.ListByInvoiceSection") + 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.ListByInvoiceSection(ctx, billingAccountName, billingProfileName, invoiceSectionName) + return +} + +// Move moves a subscription's charges to a new invoice section. The new invoice section must belong to the same +// billing profile as the existing invoice section. This operation is supported for billing accounts with agreement +// type Microsoft Customer Agreement. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +// parameters - request parameters that are provided to the move subscription operation. +func (client SubscriptionsClient) Move(ctx context.Context, billingAccountName string, parameters TransferBillingSubscriptionRequestProperties) (result SubscriptionsMoveFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionsClient.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: parameters, + Constraints: []validation.Constraint{{Target: "parameters.DestinationInvoiceSectionID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("billing.SubscriptionsClient", "Move", err.Error()) + } + + req, err := client.MovePreparer(ctx, billingAccountName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.SubscriptionsClient", "Move", nil, "Failure preparing request") + return + } + + result, err = client.MoveSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.SubscriptionsClient", "Move", result.Response(), "Failure sending request") + return + } + + return +} + +// MovePreparer prepares the Move request. +func (client SubscriptionsClient) MovePreparer(ctx context.Context, billingAccountName string, parameters TransferBillingSubscriptionRequestProperties) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountName": autorest.Encode("path", billingAccountName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptions/{subscriptionId}/move", pathParameters), + autorest.WithJSON(parameters)) + 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 SubscriptionsClient) MoveSender(req *http.Request) (future SubscriptionsMoveFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// MoveResponder handles the response to the Move request. The method always +// closes the http.Response Body. +func (client SubscriptionsClient) MoveResponder(resp *http.Response) (result Subscription, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update updates the properties of a billing subscription. Currently, cost center can be updated. The operation is +// supported only for billing accounts with agreement type Microsoft Customer Agreement. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +// parameters - request parameters that are provided to the update billing subscription operation. +func (client SubscriptionsClient) Update(ctx context.Context, billingAccountName string, parameters Subscription) (result Subscription, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionsClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, billingAccountName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.SubscriptionsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.SubscriptionsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.SubscriptionsClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client SubscriptionsClient) UpdatePreparer(ctx context.Context, billingAccountName string, parameters Subscription) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountName": autorest.Encode("path", billingAccountName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-05-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("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptions/{subscriptionId}", pathParameters), + autorest.WithJSON(parameters), + 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 SubscriptionsClient) UpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client SubscriptionsClient) UpdateResponder(resp *http.Response) (result Subscription, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ValidateMove validates if a subscription's charges can be moved to a new invoice section. This operation is +// supported for billing accounts with agreement type Microsoft Customer Agreement. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +// parameters - request parameters that are provided to the validate move eligibility operation. +func (client SubscriptionsClient) ValidateMove(ctx context.Context, billingAccountName string, parameters TransferBillingSubscriptionRequestProperties) (result ValidateSubscriptionTransferEligibilityResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SubscriptionsClient.ValidateMove") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.DestinationInvoiceSectionID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("billing.SubscriptionsClient", "ValidateMove", err.Error()) + } + + req, err := client.ValidateMovePreparer(ctx, billingAccountName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.SubscriptionsClient", "ValidateMove", nil, "Failure preparing request") + return + } + + resp, err := client.ValidateMoveSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.SubscriptionsClient", "ValidateMove", resp, "Failure sending request") + return + } + + result, err = client.ValidateMoveResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.SubscriptionsClient", "ValidateMove", resp, "Failure responding to request") + } + + return +} + +// ValidateMovePreparer prepares the ValidateMove request. +func (client SubscriptionsClient) ValidateMovePreparer(ctx context.Context, billingAccountName string, parameters TransferBillingSubscriptionRequestProperties) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountName": autorest.Encode("path", billingAccountName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/billingSubscriptions/{subscriptionId}/validateMoveEligibility", pathParameters), + autorest.WithJSON(parameters)) + 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 SubscriptionsClient) ValidateMoveSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ValidateMoveResponder handles the response to the ValidateMove request. The method always +// closes the http.Response Body. +func (client SubscriptionsClient) ValidateMoveResponder(resp *http.Response) (result ValidateSubscriptionTransferEligibilityResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/billing/mgmt/2020-05-01-preview/billing/transactions.go b/services/preview/billing/mgmt/2020-05-01-preview/billing/transactions.go new file mode 100644 index 000000000000..dbe48dfa392d --- /dev/null +++ b/services/preview/billing/mgmt/2020-05-01-preview/billing/transactions.go @@ -0,0 +1,156 @@ +package billing + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// TransactionsClient is the billing client provides access to billing resources for Azure subscriptions. +type TransactionsClient struct { + BaseClient +} + +// NewTransactionsClient creates an instance of the TransactionsClient client. +func NewTransactionsClient(subscriptionID string) TransactionsClient { + return NewTransactionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewTransactionsClientWithBaseURI creates an instance of the TransactionsClient 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 NewTransactionsClientWithBaseURI(baseURI string, subscriptionID string) TransactionsClient { + return TransactionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListByInvoice lists the transactions for an invoice. Transactions include purchases, refunds and Azure usage +// charges. +// Parameters: +// billingAccountName - the ID that uniquely identifies a billing account. +// invoiceName - the ID that uniquely identifies an invoice. +func (client TransactionsClient) ListByInvoice(ctx context.Context, billingAccountName string, invoiceName string) (result TransactionListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TransactionsClient.ListByInvoice") + defer func() { + sc := -1 + if result.tlr.Response.Response != nil { + sc = result.tlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByInvoiceNextResults + req, err := client.ListByInvoicePreparer(ctx, billingAccountName, invoiceName) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.TransactionsClient", "ListByInvoice", nil, "Failure preparing request") + return + } + + resp, err := client.ListByInvoiceSender(req) + if err != nil { + result.tlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "billing.TransactionsClient", "ListByInvoice", resp, "Failure sending request") + return + } + + result.tlr, err = client.ListByInvoiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.TransactionsClient", "ListByInvoice", resp, "Failure responding to request") + } + + return +} + +// ListByInvoicePreparer prepares the ListByInvoice request. +func (client TransactionsClient) ListByInvoicePreparer(ctx context.Context, billingAccountName string, invoiceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "billingAccountName": autorest.Encode("path", billingAccountName), + "invoiceName": autorest.Encode("path", invoiceName), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Billing/billingAccounts/{billingAccountName}/invoices/{invoiceName}/transactions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByInvoiceSender sends the ListByInvoice request. The method will close the +// http.Response Body if it receives an error. +func (client TransactionsClient) ListByInvoiceSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListByInvoiceResponder handles the response to the ListByInvoice request. The method always +// closes the http.Response Body. +func (client TransactionsClient) ListByInvoiceResponder(resp *http.Response) (result TransactionListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByInvoiceNextResults retrieves the next set of results, if any. +func (client TransactionsClient) listByInvoiceNextResults(ctx context.Context, lastResults TransactionListResult) (result TransactionListResult, err error) { + req, err := lastResults.transactionListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "billing.TransactionsClient", "listByInvoiceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByInvoiceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "billing.TransactionsClient", "listByInvoiceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByInvoiceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "billing.TransactionsClient", "listByInvoiceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByInvoiceComplete enumerates all values, automatically crossing page boundaries as required. +func (client TransactionsClient) ListByInvoiceComplete(ctx context.Context, billingAccountName string, invoiceName string) (result TransactionListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TransactionsClient.ListByInvoice") + 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.ListByInvoice(ctx, billingAccountName, invoiceName) + return +} diff --git a/services/preview/billing/mgmt/2020-05-01-preview/billing/version.go b/services/preview/billing/mgmt/2020-05-01-preview/billing/version.go new file mode 100644 index 000000000000..4e7c9c5d7fad --- /dev/null +++ b/services/preview/billing/mgmt/2020-05-01-preview/billing/version.go @@ -0,0 +1,30 @@ +package billing + +import "github.com/Azure/azure-sdk-for-go/version" + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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() + " billing/2020-05-01" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/services/preview/cdn/mgmt/2020-04-15/cdn/cdnapi/interfaces.go b/services/preview/cdn/mgmt/2020-04-15/cdn/cdnapi/interfaces.go new file mode 100644 index 000000000000..cb32ff5c6999 --- /dev/null +++ b/services/preview/cdn/mgmt/2020-04-15/cdn/cdnapi/interfaces.go @@ -0,0 +1,151 @@ +package cdnapi + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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/cdn/mgmt/2020-04-15/cdn" + "github.com/Azure/go-autorest/autorest" +) + +// BaseClientAPI contains the set of methods on the BaseClient type. +type BaseClientAPI interface { + CheckNameAvailability(ctx context.Context, checkNameAvailabilityInput cdn.CheckNameAvailabilityInput) (result cdn.CheckNameAvailabilityOutput, err error) + CheckNameAvailabilityWithSubscription(ctx context.Context, checkNameAvailabilityInput cdn.CheckNameAvailabilityInput) (result cdn.CheckNameAvailabilityOutput, err error) + ValidateProbe(ctx context.Context, validateProbeInput cdn.ValidateProbeInput) (result cdn.ValidateProbeOutput, err error) +} + +var _ BaseClientAPI = (*cdn.BaseClient)(nil) + +// ProfilesClientAPI contains the set of methods on the ProfilesClient type. +type ProfilesClientAPI interface { + Create(ctx context.Context, resourceGroupName string, profileName string, profile cdn.Profile) (result cdn.ProfilesCreateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, profileName string) (result cdn.ProfilesDeleteFuture, err error) + GenerateSsoURI(ctx context.Context, resourceGroupName string, profileName string) (result cdn.SsoURI, err error) + Get(ctx context.Context, resourceGroupName string, profileName string) (result cdn.Profile, err error) + List(ctx context.Context) (result cdn.ProfileListResultPage, err error) + ListComplete(ctx context.Context) (result cdn.ProfileListResultIterator, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result cdn.ProfileListResultPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result cdn.ProfileListResultIterator, err error) + ListResourceUsage(ctx context.Context, resourceGroupName string, profileName string) (result cdn.ResourceUsageListResultPage, err error) + ListResourceUsageComplete(ctx context.Context, resourceGroupName string, profileName string) (result cdn.ResourceUsageListResultIterator, err error) + ListSupportedOptimizationTypes(ctx context.Context, resourceGroupName string, profileName string) (result cdn.SupportedOptimizationTypesListResult, err error) + Update(ctx context.Context, resourceGroupName string, profileName string, profileUpdateParameters cdn.ProfileUpdateParameters) (result cdn.ProfilesUpdateFuture, err error) +} + +var _ ProfilesClientAPI = (*cdn.ProfilesClient)(nil) + +// EndpointsClientAPI contains the set of methods on the EndpointsClient type. +type EndpointsClientAPI interface { + Create(ctx context.Context, resourceGroupName string, profileName string, endpointName string, endpoint cdn.Endpoint) (result cdn.EndpointsCreateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, profileName string, endpointName string) (result cdn.EndpointsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, profileName string, endpointName string) (result cdn.Endpoint, err error) + ListByProfile(ctx context.Context, resourceGroupName string, profileName string) (result cdn.EndpointListResultPage, err error) + ListByProfileComplete(ctx context.Context, resourceGroupName string, profileName string) (result cdn.EndpointListResultIterator, err error) + ListResourceUsage(ctx context.Context, resourceGroupName string, profileName string, endpointName string) (result cdn.ResourceUsageListResultPage, err error) + ListResourceUsageComplete(ctx context.Context, resourceGroupName string, profileName string, endpointName string) (result cdn.ResourceUsageListResultIterator, err error) + LoadContent(ctx context.Context, resourceGroupName string, profileName string, endpointName string, contentFilePaths cdn.LoadParameters) (result cdn.EndpointsLoadContentFuture, err error) + PurgeContent(ctx context.Context, resourceGroupName string, profileName string, endpointName string, contentFilePaths cdn.PurgeParameters) (result cdn.EndpointsPurgeContentFuture, err error) + Start(ctx context.Context, resourceGroupName string, profileName string, endpointName string) (result cdn.EndpointsStartFuture, err error) + Stop(ctx context.Context, resourceGroupName string, profileName string, endpointName string) (result cdn.EndpointsStopFuture, err error) + Update(ctx context.Context, resourceGroupName string, profileName string, endpointName string, endpointUpdateProperties cdn.EndpointUpdateParameters) (result cdn.EndpointsUpdateFuture, err error) + ValidateCustomDomain(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainProperties cdn.ValidateCustomDomainInput) (result cdn.ValidateCustomDomainOutput, err error) +} + +var _ EndpointsClientAPI = (*cdn.EndpointsClient)(nil) + +// OriginsClientAPI contains the set of methods on the OriginsClient type. +type OriginsClientAPI interface { + Create(ctx context.Context, resourceGroupName string, profileName string, endpointName string, originName string, origin cdn.Origin) (result cdn.OriginsCreateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, profileName string, endpointName string, originName string) (result cdn.OriginsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, profileName string, endpointName string, originName string) (result cdn.Origin, err error) + ListByEndpoint(ctx context.Context, resourceGroupName string, profileName string, endpointName string) (result cdn.OriginListResultPage, err error) + ListByEndpointComplete(ctx context.Context, resourceGroupName string, profileName string, endpointName string) (result cdn.OriginListResultIterator, err error) + Update(ctx context.Context, resourceGroupName string, profileName string, endpointName string, originName string, originUpdateProperties cdn.OriginUpdateParameters) (result cdn.OriginsUpdateFuture, err error) +} + +var _ OriginsClientAPI = (*cdn.OriginsClient)(nil) + +// OriginGroupsClientAPI contains the set of methods on the OriginGroupsClient type. +type OriginGroupsClientAPI interface { + Create(ctx context.Context, resourceGroupName string, profileName string, endpointName string, originGroupName string, originGroup cdn.OriginGroup) (result cdn.OriginGroupsCreateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, profileName string, endpointName string, originGroupName string) (result cdn.OriginGroupsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, profileName string, endpointName string, originGroupName string) (result cdn.OriginGroup, err error) + ListByEndpoint(ctx context.Context, resourceGroupName string, profileName string, endpointName string) (result cdn.OriginGroupListResultPage, err error) + ListByEndpointComplete(ctx context.Context, resourceGroupName string, profileName string, endpointName string) (result cdn.OriginGroupListResultIterator, err error) + Update(ctx context.Context, resourceGroupName string, profileName string, endpointName string, originGroupName string, originGroupUpdateProperties cdn.OriginGroupUpdateParameters) (result cdn.OriginGroupsUpdateFuture, err error) +} + +var _ OriginGroupsClientAPI = (*cdn.OriginGroupsClient)(nil) + +// CustomDomainsClientAPI contains the set of methods on the CustomDomainsClient type. +type CustomDomainsClientAPI interface { + Create(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string, customDomainProperties cdn.CustomDomainParameters) (result cdn.CustomDomainsCreateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string) (result cdn.CustomDomainsDeleteFuture, err error) + DisableCustomHTTPS(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string) (result cdn.CustomDomain, err error) + EnableCustomHTTPS(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string, customDomainHTTPSParameters *cdn.BasicCustomDomainHTTPSParameters) (result cdn.CustomDomain, err error) + Get(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string) (result cdn.CustomDomain, err error) + ListByEndpoint(ctx context.Context, resourceGroupName string, profileName string, endpointName string) (result cdn.CustomDomainListResultPage, err error) + ListByEndpointComplete(ctx context.Context, resourceGroupName string, profileName string, endpointName string) (result cdn.CustomDomainListResultIterator, err error) +} + +var _ CustomDomainsClientAPI = (*cdn.CustomDomainsClient)(nil) + +// ResourceUsageClientAPI contains the set of methods on the ResourceUsageClient type. +type ResourceUsageClientAPI interface { + List(ctx context.Context) (result cdn.ResourceUsageListResultPage, err error) + ListComplete(ctx context.Context) (result cdn.ResourceUsageListResultIterator, err error) +} + +var _ ResourceUsageClientAPI = (*cdn.ResourceUsageClient)(nil) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result cdn.OperationsListResultPage, err error) + ListComplete(ctx context.Context) (result cdn.OperationsListResultIterator, err error) +} + +var _ OperationsClientAPI = (*cdn.OperationsClient)(nil) + +// EdgeNodesClientAPI contains the set of methods on the EdgeNodesClient type. +type EdgeNodesClientAPI interface { + List(ctx context.Context) (result cdn.EdgenodeResultPage, err error) + ListComplete(ctx context.Context) (result cdn.EdgenodeResultIterator, err error) +} + +var _ EdgeNodesClientAPI = (*cdn.EdgeNodesClient)(nil) + +// PoliciesClientAPI contains the set of methods on the PoliciesClient type. +type PoliciesClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, policyName string, cdnWebApplicationFirewallPolicy cdn.WebApplicationFirewallPolicy) (result cdn.PoliciesCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, policyName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, policyName string) (result cdn.WebApplicationFirewallPolicy, err error) + List(ctx context.Context, resourceGroupName string) (result cdn.WebApplicationFirewallPolicyListPage, err error) + ListComplete(ctx context.Context, resourceGroupName string) (result cdn.WebApplicationFirewallPolicyListIterator, err error) + Update(ctx context.Context, resourceGroupName string, policyName string, cdnWebApplicationFirewallPolicyPatchParameters cdn.WebApplicationFirewallPolicyPatchParameters) (result cdn.PoliciesUpdateFuture, err error) +} + +var _ PoliciesClientAPI = (*cdn.PoliciesClient)(nil) + +// ManagedRuleSetsClientAPI contains the set of methods on the ManagedRuleSetsClient type. +type ManagedRuleSetsClientAPI interface { + List(ctx context.Context) (result cdn.ManagedRuleSetDefinitionListPage, err error) + ListComplete(ctx context.Context) (result cdn.ManagedRuleSetDefinitionListIterator, err error) +} + +var _ ManagedRuleSetsClientAPI = (*cdn.ManagedRuleSetsClient)(nil) diff --git a/services/preview/cdn/mgmt/2020-04-15/cdn/client.go b/services/preview/cdn/mgmt/2020-04-15/cdn/client.go new file mode 100644 index 000000000000..eab5bc8560b8 --- /dev/null +++ b/services/preview/cdn/mgmt/2020-04-15/cdn/client.go @@ -0,0 +1,304 @@ +// Package cdn implements the Azure ARM Cdn service API version 2020-04-15. +// +// Cdn Management Client +package cdn + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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 Cdn + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Cdn. +type BaseClient struct { + autorest.Client + BaseURI string + SubscriptionID string + SubscriptionID1 string +} + +// New creates an instance of the BaseClient client. +func New(subscriptionID string, subscriptionID1 string) BaseClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) +} + +// 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, subscriptionID1 string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + SubscriptionID: subscriptionID, + SubscriptionID1: subscriptionID1, + } +} + +// CheckNameAvailability check the availability of a resource name. This is needed for resources where name is globally +// unique, such as a CDN endpoint. +// Parameters: +// checkNameAvailabilityInput - input to check. +func (client BaseClient) CheckNameAvailability(ctx context.Context, checkNameAvailabilityInput CheckNameAvailabilityInput) (result CheckNameAvailabilityOutput, 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: checkNameAvailabilityInput, + Constraints: []validation.Constraint{{Target: "checkNameAvailabilityInput.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "checkNameAvailabilityInput.Type", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("cdn.BaseClient", "CheckNameAvailability", err.Error()) + } + + req, err := client.CheckNameAvailabilityPreparer(ctx, checkNameAvailabilityInput) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.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, "cdn.BaseClient", "CheckNameAvailability", resp, "Failure sending request") + return + } + + result, err = client.CheckNameAvailabilityResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.BaseClient", "CheckNameAvailability", resp, "Failure responding to request") + } + + return +} + +// CheckNameAvailabilityPreparer prepares the CheckNameAvailability request. +func (client BaseClient) CheckNameAvailabilityPreparer(ctx context.Context, checkNameAvailabilityInput CheckNameAvailabilityInput) (*http.Request, error) { + const APIVersion = "2020-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.Cdn/checkNameAvailability"), + autorest.WithJSON(checkNameAvailabilityInput), + 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, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// CheckNameAvailabilityResponder handles the response to the CheckNameAvailability request. The method always +// closes the http.Response Body. +func (client BaseClient) CheckNameAvailabilityResponder(resp *http.Response) (result CheckNameAvailabilityOutput, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CheckNameAvailabilityWithSubscription check the availability of a resource name. This is needed for resources where +// name is globally unique, such as a CDN endpoint. +// Parameters: +// checkNameAvailabilityInput - input to check. +func (client BaseClient) CheckNameAvailabilityWithSubscription(ctx context.Context, checkNameAvailabilityInput CheckNameAvailabilityInput) (result CheckNameAvailabilityOutput, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CheckNameAvailabilityWithSubscription") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: checkNameAvailabilityInput, + Constraints: []validation.Constraint{{Target: "checkNameAvailabilityInput.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "checkNameAvailabilityInput.Type", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("cdn.BaseClient", "CheckNameAvailabilityWithSubscription", err.Error()) + } + + req, err := client.CheckNameAvailabilityWithSubscriptionPreparer(ctx, checkNameAvailabilityInput) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.BaseClient", "CheckNameAvailabilityWithSubscription", nil, "Failure preparing request") + return + } + + resp, err := client.CheckNameAvailabilityWithSubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "cdn.BaseClient", "CheckNameAvailabilityWithSubscription", resp, "Failure sending request") + return + } + + result, err = client.CheckNameAvailabilityWithSubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.BaseClient", "CheckNameAvailabilityWithSubscription", resp, "Failure responding to request") + } + + return +} + +// CheckNameAvailabilityWithSubscriptionPreparer prepares the CheckNameAvailabilityWithSubscription request. +func (client BaseClient) CheckNameAvailabilityWithSubscriptionPreparer(ctx context.Context, checkNameAvailabilityInput CheckNameAvailabilityInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-15" + 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.Cdn/checkNameAvailability", pathParameters), + autorest.WithJSON(checkNameAvailabilityInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CheckNameAvailabilityWithSubscriptionSender sends the CheckNameAvailabilityWithSubscription request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) CheckNameAvailabilityWithSubscriptionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CheckNameAvailabilityWithSubscriptionResponder handles the response to the CheckNameAvailabilityWithSubscription request. The method always +// closes the http.Response Body. +func (client BaseClient) CheckNameAvailabilityWithSubscriptionResponder(resp *http.Response) (result CheckNameAvailabilityOutput, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ValidateProbe check if the probe path is a valid path and the file can be accessed. Probe path is the path to a file +// hosted on the origin server to help accelerate the delivery of dynamic content via the CDN endpoint. This path is +// relative to the origin path specified in the endpoint configuration. +// Parameters: +// validateProbeInput - input to check. +func (client BaseClient) ValidateProbe(ctx context.Context, validateProbeInput ValidateProbeInput) (result ValidateProbeOutput, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ValidateProbe") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: validateProbeInput, + Constraints: []validation.Constraint{{Target: "validateProbeInput.ProbeURL", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("cdn.BaseClient", "ValidateProbe", err.Error()) + } + + req, err := client.ValidateProbePreparer(ctx, validateProbeInput) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.BaseClient", "ValidateProbe", nil, "Failure preparing request") + return + } + + resp, err := client.ValidateProbeSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "cdn.BaseClient", "ValidateProbe", resp, "Failure sending request") + return + } + + result, err = client.ValidateProbeResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.BaseClient", "ValidateProbe", resp, "Failure responding to request") + } + + return +} + +// ValidateProbePreparer prepares the ValidateProbe request. +func (client BaseClient) ValidateProbePreparer(ctx context.Context, validateProbeInput ValidateProbeInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-15" + 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.Cdn/validateProbe", pathParameters), + autorest.WithJSON(validateProbeInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ValidateProbeSender sends the ValidateProbe request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) ValidateProbeSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ValidateProbeResponder handles the response to the ValidateProbe request. The method always +// closes the http.Response Body. +func (client BaseClient) ValidateProbeResponder(resp *http.Response) (result ValidateProbeOutput, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/cdn/mgmt/2020-04-15/cdn/customdomains.go b/services/preview/cdn/mgmt/2020-04-15/cdn/customdomains.go new file mode 100644 index 000000000000..dafca608c1b2 --- /dev/null +++ b/services/preview/cdn/mgmt/2020-04-15/cdn/customdomains.go @@ -0,0 +1,621 @@ +package cdn + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// CustomDomainsClient is the cdn Management Client +type CustomDomainsClient struct { + BaseClient +} + +// NewCustomDomainsClient creates an instance of the CustomDomainsClient client. +func NewCustomDomainsClient(subscriptionID string, subscriptionID1 string) CustomDomainsClient { + return NewCustomDomainsClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) +} + +// NewCustomDomainsClientWithBaseURI creates an instance of the CustomDomainsClient 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 NewCustomDomainsClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) CustomDomainsClient { + return CustomDomainsClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} +} + +// Create creates a new custom domain within an endpoint. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - name of the CDN profile which is unique within the resource group. +// endpointName - name of the endpoint under the profile which is unique globally. +// customDomainName - name of the custom domain within an endpoint. +// customDomainProperties - properties required to create a new custom domain. +func (client CustomDomainsClient) Create(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string, customDomainProperties CustomDomainParameters) (result CustomDomainsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomDomainsClient.Create") + 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: customDomainProperties, + Constraints: []validation.Constraint{{Target: "customDomainProperties.CustomDomainPropertiesParameters", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "customDomainProperties.CustomDomainPropertiesParameters.HostName", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("cdn.CustomDomainsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, profileName, endpointName, customDomainName, customDomainProperties) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client CustomDomainsClient) CreatePreparer(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string, customDomainProperties CustomDomainParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "customDomainName": autorest.Encode("path", customDomainName), + "endpointName": autorest.Encode("path", endpointName), + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-15" + 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.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}", pathParameters), + autorest.WithJSON(customDomainProperties), + 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 CustomDomainsClient) CreateSender(req *http.Request) (future CustomDomainsCreateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client CustomDomainsClient) CreateResponder(resp *http.Response) (result CustomDomain, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes an existing custom domain within an endpoint. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - name of the CDN profile which is unique within the resource group. +// endpointName - name of the endpoint under the profile which is unique globally. +// customDomainName - name of the custom domain within an endpoint. +func (client CustomDomainsClient) Delete(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string) (result CustomDomainsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomDomainsClient.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("cdn.CustomDomainsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, profileName, endpointName, customDomainName) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client CustomDomainsClient) DeletePreparer(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "customDomainName": autorest.Encode("path", customDomainName), + "endpointName": autorest.Encode("path", endpointName), + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}", 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 CustomDomainsClient) DeleteSender(req *http.Request) (future CustomDomainsDeleteFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client CustomDomainsClient) DeleteResponder(resp *http.Response) (result CustomDomain, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// DisableCustomHTTPS disable https delivery of the custom domain. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - name of the CDN profile which is unique within the resource group. +// endpointName - name of the endpoint under the profile which is unique globally. +// customDomainName - name of the custom domain within an endpoint. +func (client CustomDomainsClient) DisableCustomHTTPS(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string) (result CustomDomain, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomDomainsClient.DisableCustomHTTPS") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("cdn.CustomDomainsClient", "DisableCustomHTTPS", err.Error()) + } + + req, err := client.DisableCustomHTTPSPreparer(ctx, resourceGroupName, profileName, endpointName, customDomainName) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "DisableCustomHTTPS", nil, "Failure preparing request") + return + } + + resp, err := client.DisableCustomHTTPSSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "DisableCustomHTTPS", resp, "Failure sending request") + return + } + + result, err = client.DisableCustomHTTPSResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "DisableCustomHTTPS", resp, "Failure responding to request") + } + + return +} + +// DisableCustomHTTPSPreparer prepares the DisableCustomHTTPS request. +func (client CustomDomainsClient) DisableCustomHTTPSPreparer(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "customDomainName": autorest.Encode("path", customDomainName), + "endpointName": autorest.Encode("path", endpointName), + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}/disableCustomHttps", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DisableCustomHTTPSSender sends the DisableCustomHTTPS request. The method will close the +// http.Response Body if it receives an error. +func (client CustomDomainsClient) DisableCustomHTTPSSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DisableCustomHTTPSResponder handles the response to the DisableCustomHTTPS request. The method always +// closes the http.Response Body. +func (client CustomDomainsClient) DisableCustomHTTPSResponder(resp *http.Response) (result CustomDomain, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// EnableCustomHTTPS enable https delivery of the custom domain. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - name of the CDN profile which is unique within the resource group. +// endpointName - name of the endpoint under the profile which is unique globally. +// customDomainName - name of the custom domain within an endpoint. +// customDomainHTTPSParameters - the configuration specifying how to enable HTTPS for the custom domain - using +// CDN managed certificate or user's own certificate. If not specified, enabling ssl uses CDN managed +// certificate by default. +func (client CustomDomainsClient) EnableCustomHTTPS(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string, customDomainHTTPSParameters *BasicCustomDomainHTTPSParameters) (result CustomDomain, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomDomainsClient.EnableCustomHTTPS") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("cdn.CustomDomainsClient", "EnableCustomHTTPS", err.Error()) + } + + req, err := client.EnableCustomHTTPSPreparer(ctx, resourceGroupName, profileName, endpointName, customDomainName, customDomainHTTPSParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "EnableCustomHTTPS", nil, "Failure preparing request") + return + } + + resp, err := client.EnableCustomHTTPSSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "EnableCustomHTTPS", resp, "Failure sending request") + return + } + + result, err = client.EnableCustomHTTPSResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "EnableCustomHTTPS", resp, "Failure responding to request") + } + + return +} + +// EnableCustomHTTPSPreparer prepares the EnableCustomHTTPS request. +func (client CustomDomainsClient) EnableCustomHTTPSPreparer(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string, customDomainHTTPSParameters *BasicCustomDomainHTTPSParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "customDomainName": autorest.Encode("path", customDomainName), + "endpointName": autorest.Encode("path", endpointName), + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-15" + 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.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}/enableCustomHttps", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if customDomainHTTPSParameters != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(customDomainHTTPSParameters)) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// EnableCustomHTTPSSender sends the EnableCustomHTTPS request. The method will close the +// http.Response Body if it receives an error. +func (client CustomDomainsClient) EnableCustomHTTPSSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// EnableCustomHTTPSResponder handles the response to the EnableCustomHTTPS request. The method always +// closes the http.Response Body. +func (client CustomDomainsClient) EnableCustomHTTPSResponder(resp *http.Response) (result CustomDomain, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets an existing custom domain within an endpoint. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - name of the CDN profile which is unique within the resource group. +// endpointName - name of the endpoint under the profile which is unique globally. +// customDomainName - name of the custom domain within an endpoint. +func (client CustomDomainsClient) Get(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string) (result CustomDomain, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomDomainsClient.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("cdn.CustomDomainsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, profileName, endpointName, customDomainName) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client CustomDomainsClient) GetPreparer(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "customDomainName": autorest.Encode("path", customDomainName), + "endpointName": autorest.Encode("path", endpointName), + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains/{customDomainName}", 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 CustomDomainsClient) 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 CustomDomainsClient) GetResponder(resp *http.Response) (result CustomDomain, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByEndpoint lists all of the existing custom domains within an endpoint. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - name of the CDN profile which is unique within the resource group. +// endpointName - name of the endpoint under the profile which is unique globally. +func (client CustomDomainsClient) ListByEndpoint(ctx context.Context, resourceGroupName string, profileName string, endpointName string) (result CustomDomainListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomDomainsClient.ListByEndpoint") + defer func() { + sc := -1 + if result.cdlr.Response.Response != nil { + sc = result.cdlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("cdn.CustomDomainsClient", "ListByEndpoint", err.Error()) + } + + result.fn = client.listByEndpointNextResults + req, err := client.ListByEndpointPreparer(ctx, resourceGroupName, profileName, endpointName) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "ListByEndpoint", nil, "Failure preparing request") + return + } + + resp, err := client.ListByEndpointSender(req) + if err != nil { + result.cdlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "ListByEndpoint", resp, "Failure sending request") + return + } + + result.cdlr, err = client.ListByEndpointResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "ListByEndpoint", resp, "Failure responding to request") + } + + return +} + +// ListByEndpointPreparer prepares the ListByEndpoint request. +func (client CustomDomainsClient) ListByEndpointPreparer(ctx context.Context, resourceGroupName string, profileName string, endpointName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "endpointName": autorest.Encode("path", endpointName), + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/customDomains", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByEndpointSender sends the ListByEndpoint request. The method will close the +// http.Response Body if it receives an error. +func (client CustomDomainsClient) ListByEndpointSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByEndpointResponder handles the response to the ListByEndpoint request. The method always +// closes the http.Response Body. +func (client CustomDomainsClient) ListByEndpointResponder(resp *http.Response) (result CustomDomainListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByEndpointNextResults retrieves the next set of results, if any. +func (client CustomDomainsClient) listByEndpointNextResults(ctx context.Context, lastResults CustomDomainListResult) (result CustomDomainListResult, err error) { + req, err := lastResults.customDomainListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "listByEndpointNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByEndpointSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "listByEndpointNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByEndpointResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.CustomDomainsClient", "listByEndpointNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByEndpointComplete enumerates all values, automatically crossing page boundaries as required. +func (client CustomDomainsClient) ListByEndpointComplete(ctx context.Context, resourceGroupName string, profileName string, endpointName string) (result CustomDomainListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomDomainsClient.ListByEndpoint") + 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.ListByEndpoint(ctx, resourceGroupName, profileName, endpointName) + return +} diff --git a/services/preview/cdn/mgmt/2020-04-15/cdn/edgenodes.go b/services/preview/cdn/mgmt/2020-04-15/cdn/edgenodes.go new file mode 100644 index 000000000000..bdc09efc16dc --- /dev/null +++ b/services/preview/cdn/mgmt/2020-04-15/cdn/edgenodes.go @@ -0,0 +1,147 @@ +package cdn + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// EdgeNodesClient is the cdn Management Client +type EdgeNodesClient struct { + BaseClient +} + +// NewEdgeNodesClient creates an instance of the EdgeNodesClient client. +func NewEdgeNodesClient(subscriptionID string, subscriptionID1 string) EdgeNodesClient { + return NewEdgeNodesClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) +} + +// NewEdgeNodesClientWithBaseURI creates an instance of the EdgeNodesClient 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 NewEdgeNodesClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) EdgeNodesClient { + return EdgeNodesClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} +} + +// List edgenodes are the global Point of Presence (POP) locations used to deliver CDN content to end users. +func (client EdgeNodesClient) List(ctx context.Context) (result EdgenodeResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EdgeNodesClient.List") + defer func() { + sc := -1 + if result.er.Response.Response != nil { + sc = result.er.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EdgeNodesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.er.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "cdn.EdgeNodesClient", "List", resp, "Failure sending request") + return + } + + result.er, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EdgeNodesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client EdgeNodesClient) ListPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2020-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.Cdn/edgenodes"), + 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 EdgeNodesClient) 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 EdgeNodesClient) ListResponder(resp *http.Response) (result EdgenodeResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 EdgeNodesClient) listNextResults(ctx context.Context, lastResults EdgenodeResult) (result EdgenodeResult, err error) { + req, err := lastResults.edgenodeResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "cdn.EdgeNodesClient", "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, "cdn.EdgeNodesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EdgeNodesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client EdgeNodesClient) ListComplete(ctx context.Context) (result EdgenodeResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EdgeNodesClient.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/cdn/mgmt/2020-04-15/cdn/endpoints.go b/services/preview/cdn/mgmt/2020-04-15/cdn/endpoints.go new file mode 100644 index 000000000000..880167d02727 --- /dev/null +++ b/services/preview/cdn/mgmt/2020-04-15/cdn/endpoints.go @@ -0,0 +1,1093 @@ +package cdn + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// EndpointsClient is the cdn Management Client +type EndpointsClient struct { + BaseClient +} + +// NewEndpointsClient creates an instance of the EndpointsClient client. +func NewEndpointsClient(subscriptionID string, subscriptionID1 string) EndpointsClient { + return NewEndpointsClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) +} + +// NewEndpointsClientWithBaseURI creates an instance of the EndpointsClient 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 NewEndpointsClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) EndpointsClient { + return EndpointsClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} +} + +// Create creates a new CDN endpoint with the specified endpoint name under the specified subscription, resource group +// and profile. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - name of the CDN profile which is unique within the resource group. +// endpointName - name of the endpoint under the profile which is unique globally. +// endpoint - endpoint properties +func (client EndpointsClient) Create(ctx context.Context, resourceGroupName string, profileName string, endpointName string, endpoint Endpoint) (result EndpointsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EndpointsClient.Create") + 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: endpoint, + Constraints: []validation.Constraint{{Target: "endpoint.EndpointProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "endpoint.EndpointProperties.Origins", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("cdn.EndpointsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, profileName, endpointName, endpoint) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client EndpointsClient) CreatePreparer(ctx context.Context, resourceGroupName string, profileName string, endpointName string, endpoint Endpoint) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "endpointName": autorest.Encode("path", endpointName), + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-15" + 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.Cdn/profiles/{profileName}/endpoints/{endpointName}", pathParameters), + autorest.WithJSON(endpoint), + 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 EndpointsClient) CreateSender(req *http.Request) (future EndpointsCreateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client EndpointsClient) CreateResponder(resp *http.Response) (result Endpoint, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes an existing CDN endpoint with the specified endpoint name under the specified subscription, resource +// group and profile. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - name of the CDN profile which is unique within the resource group. +// endpointName - name of the endpoint under the profile which is unique globally. +func (client EndpointsClient) Delete(ctx context.Context, resourceGroupName string, profileName string, endpointName string) (result EndpointsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EndpointsClient.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("cdn.EndpointsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, profileName, endpointName) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client EndpointsClient) DeletePreparer(ctx context.Context, resourceGroupName string, profileName string, endpointName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "endpointName": autorest.Encode("path", endpointName), + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}", 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 EndpointsClient) DeleteSender(req *http.Request) (future EndpointsDeleteFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client EndpointsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets an existing CDN endpoint with the specified endpoint name under the specified subscription, resource group +// and profile. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - name of the CDN profile which is unique within the resource group. +// endpointName - name of the endpoint under the profile which is unique globally. +func (client EndpointsClient) Get(ctx context.Context, resourceGroupName string, profileName string, endpointName string) (result Endpoint, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EndpointsClient.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("cdn.EndpointsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, profileName, endpointName) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "cdn.EndpointsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client EndpointsClient) GetPreparer(ctx context.Context, resourceGroupName string, profileName string, endpointName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "endpointName": autorest.Encode("path", endpointName), + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}", 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 EndpointsClient) 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 EndpointsClient) GetResponder(resp *http.Response) (result Endpoint, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByProfile lists existing CDN endpoints. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - name of the CDN profile which is unique within the resource group. +func (client EndpointsClient) ListByProfile(ctx context.Context, resourceGroupName string, profileName string) (result EndpointListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EndpointsClient.ListByProfile") + 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.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("cdn.EndpointsClient", "ListByProfile", err.Error()) + } + + result.fn = client.listByProfileNextResults + req, err := client.ListByProfilePreparer(ctx, resourceGroupName, profileName) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsClient", "ListByProfile", nil, "Failure preparing request") + return + } + + resp, err := client.ListByProfileSender(req) + if err != nil { + result.elr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "cdn.EndpointsClient", "ListByProfile", resp, "Failure sending request") + return + } + + result.elr, err = client.ListByProfileResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsClient", "ListByProfile", resp, "Failure responding to request") + } + + return +} + +// ListByProfilePreparer prepares the ListByProfile request. +func (client EndpointsClient) ListByProfilePreparer(ctx context.Context, resourceGroupName string, profileName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByProfileSender sends the ListByProfile request. The method will close the +// http.Response Body if it receives an error. +func (client EndpointsClient) ListByProfileSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByProfileResponder handles the response to the ListByProfile request. The method always +// closes the http.Response Body. +func (client EndpointsClient) ListByProfileResponder(resp *http.Response) (result EndpointListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByProfileNextResults retrieves the next set of results, if any. +func (client EndpointsClient) listByProfileNextResults(ctx context.Context, lastResults EndpointListResult) (result EndpointListResult, err error) { + req, err := lastResults.endpointListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "cdn.EndpointsClient", "listByProfileNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByProfileSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "cdn.EndpointsClient", "listByProfileNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByProfileResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsClient", "listByProfileNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByProfileComplete enumerates all values, automatically crossing page boundaries as required. +func (client EndpointsClient) ListByProfileComplete(ctx context.Context, resourceGroupName string, profileName string) (result EndpointListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EndpointsClient.ListByProfile") + 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.ListByProfile(ctx, resourceGroupName, profileName) + return +} + +// ListResourceUsage checks the quota and usage of geo filters and custom domains under the given endpoint. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - name of the CDN profile which is unique within the resource group. +// endpointName - name of the endpoint under the profile which is unique globally. +func (client EndpointsClient) ListResourceUsage(ctx context.Context, resourceGroupName string, profileName string, endpointName string) (result ResourceUsageListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EndpointsClient.ListResourceUsage") + defer func() { + sc := -1 + if result.rulr.Response.Response != nil { + sc = result.rulr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("cdn.EndpointsClient", "ListResourceUsage", err.Error()) + } + + result.fn = client.listResourceUsageNextResults + req, err := client.ListResourceUsagePreparer(ctx, resourceGroupName, profileName, endpointName) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsClient", "ListResourceUsage", nil, "Failure preparing request") + return + } + + resp, err := client.ListResourceUsageSender(req) + if err != nil { + result.rulr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "cdn.EndpointsClient", "ListResourceUsage", resp, "Failure sending request") + return + } + + result.rulr, err = client.ListResourceUsageResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsClient", "ListResourceUsage", resp, "Failure responding to request") + } + + return +} + +// ListResourceUsagePreparer prepares the ListResourceUsage request. +func (client EndpointsClient) ListResourceUsagePreparer(ctx context.Context, resourceGroupName string, profileName string, endpointName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "endpointName": autorest.Encode("path", endpointName), + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/checkResourceUsage", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListResourceUsageSender sends the ListResourceUsage request. The method will close the +// http.Response Body if it receives an error. +func (client EndpointsClient) ListResourceUsageSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResourceUsageResponder handles the response to the ListResourceUsage request. The method always +// closes the http.Response Body. +func (client EndpointsClient) ListResourceUsageResponder(resp *http.Response) (result ResourceUsageListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listResourceUsageNextResults retrieves the next set of results, if any. +func (client EndpointsClient) listResourceUsageNextResults(ctx context.Context, lastResults ResourceUsageListResult) (result ResourceUsageListResult, err error) { + req, err := lastResults.resourceUsageListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "cdn.EndpointsClient", "listResourceUsageNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListResourceUsageSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "cdn.EndpointsClient", "listResourceUsageNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResourceUsageResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsClient", "listResourceUsageNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListResourceUsageComplete enumerates all values, automatically crossing page boundaries as required. +func (client EndpointsClient) ListResourceUsageComplete(ctx context.Context, resourceGroupName string, profileName string, endpointName string) (result ResourceUsageListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EndpointsClient.ListResourceUsage") + 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.ListResourceUsage(ctx, resourceGroupName, profileName, endpointName) + return +} + +// LoadContent pre-loads a content to CDN. Available for Verizon Profiles. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - name of the CDN profile which is unique within the resource group. +// endpointName - name of the endpoint under the profile which is unique globally. +// contentFilePaths - the path to the content to be loaded. Path should be a full URL, e.g. +// ‘/pictures/city.png' which loads a single file +func (client EndpointsClient) LoadContent(ctx context.Context, resourceGroupName string, profileName string, endpointName string, contentFilePaths LoadParameters) (result EndpointsLoadContentFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EndpointsClient.LoadContent") + 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: contentFilePaths, + Constraints: []validation.Constraint{{Target: "contentFilePaths.ContentPaths", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("cdn.EndpointsClient", "LoadContent", err.Error()) + } + + req, err := client.LoadContentPreparer(ctx, resourceGroupName, profileName, endpointName, contentFilePaths) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsClient", "LoadContent", nil, "Failure preparing request") + return + } + + result, err = client.LoadContentSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsClient", "LoadContent", result.Response(), "Failure sending request") + return + } + + return +} + +// LoadContentPreparer prepares the LoadContent request. +func (client EndpointsClient) LoadContentPreparer(ctx context.Context, resourceGroupName string, profileName string, endpointName string, contentFilePaths LoadParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "endpointName": autorest.Encode("path", endpointName), + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-15" + 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.Cdn/profiles/{profileName}/endpoints/{endpointName}/load", pathParameters), + autorest.WithJSON(contentFilePaths), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// LoadContentSender sends the LoadContent request. The method will close the +// http.Response Body if it receives an error. +func (client EndpointsClient) LoadContentSender(req *http.Request) (future EndpointsLoadContentFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// LoadContentResponder handles the response to the LoadContent request. The method always +// closes the http.Response Body. +func (client EndpointsClient) LoadContentResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// PurgeContent removes a content from CDN. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - name of the CDN profile which is unique within the resource group. +// endpointName - name of the endpoint under the profile which is unique globally. +// contentFilePaths - the path to the content to be purged. Path can be a full URL, e.g. '/pictures/city.png' +// which removes a single file, or a directory with a wildcard, e.g. '/pictures/*' which removes all folders +// and files in the directory. +func (client EndpointsClient) PurgeContent(ctx context.Context, resourceGroupName string, profileName string, endpointName string, contentFilePaths PurgeParameters) (result EndpointsPurgeContentFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EndpointsClient.PurgeContent") + 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: contentFilePaths, + Constraints: []validation.Constraint{{Target: "contentFilePaths.ContentPaths", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("cdn.EndpointsClient", "PurgeContent", err.Error()) + } + + req, err := client.PurgeContentPreparer(ctx, resourceGroupName, profileName, endpointName, contentFilePaths) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsClient", "PurgeContent", nil, "Failure preparing request") + return + } + + result, err = client.PurgeContentSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsClient", "PurgeContent", result.Response(), "Failure sending request") + return + } + + return +} + +// PurgeContentPreparer prepares the PurgeContent request. +func (client EndpointsClient) PurgeContentPreparer(ctx context.Context, resourceGroupName string, profileName string, endpointName string, contentFilePaths PurgeParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "endpointName": autorest.Encode("path", endpointName), + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-15" + 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.Cdn/profiles/{profileName}/endpoints/{endpointName}/purge", pathParameters), + autorest.WithJSON(contentFilePaths), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PurgeContentSender sends the PurgeContent request. The method will close the +// http.Response Body if it receives an error. +func (client EndpointsClient) PurgeContentSender(req *http.Request) (future EndpointsPurgeContentFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// PurgeContentResponder handles the response to the PurgeContent request. The method always +// closes the http.Response Body. +func (client EndpointsClient) PurgeContentResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Start starts an existing CDN endpoint that is on a stopped state. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - name of the CDN profile which is unique within the resource group. +// endpointName - name of the endpoint under the profile which is unique globally. +func (client EndpointsClient) Start(ctx context.Context, resourceGroupName string, profileName string, endpointName string) (result EndpointsStartFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EndpointsClient.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("cdn.EndpointsClient", "Start", err.Error()) + } + + req, err := client.StartPreparer(ctx, resourceGroupName, profileName, endpointName) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsClient", "Start", nil, "Failure preparing request") + return + } + + result, err = client.StartSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsClient", "Start", result.Response(), "Failure sending request") + return + } + + return +} + +// StartPreparer prepares the Start request. +func (client EndpointsClient) StartPreparer(ctx context.Context, resourceGroupName string, profileName string, endpointName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "endpointName": autorest.Encode("path", endpointName), + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/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 EndpointsClient) StartSender(req *http.Request) (future EndpointsStartFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// StartResponder handles the response to the Start request. The method always +// closes the http.Response Body. +func (client EndpointsClient) StartResponder(resp *http.Response) (result Endpoint, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Stop stops an existing running CDN endpoint. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - name of the CDN profile which is unique within the resource group. +// endpointName - name of the endpoint under the profile which is unique globally. +func (client EndpointsClient) Stop(ctx context.Context, resourceGroupName string, profileName string, endpointName string) (result EndpointsStopFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EndpointsClient.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("cdn.EndpointsClient", "Stop", err.Error()) + } + + req, err := client.StopPreparer(ctx, resourceGroupName, profileName, endpointName) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsClient", "Stop", nil, "Failure preparing request") + return + } + + result, err = client.StopSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsClient", "Stop", result.Response(), "Failure sending request") + return + } + + return +} + +// StopPreparer prepares the Stop request. +func (client EndpointsClient) StopPreparer(ctx context.Context, resourceGroupName string, profileName string, endpointName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "endpointName": autorest.Encode("path", endpointName), + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/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 EndpointsClient) StopSender(req *http.Request) (future EndpointsStopFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// StopResponder handles the response to the Stop request. The method always +// closes the http.Response Body. +func (client EndpointsClient) StopResponder(resp *http.Response) (result Endpoint, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update updates an existing CDN endpoint with the specified endpoint name under the specified subscription, resource +// group and profile. Only tags can be updated after creating an endpoint. To update origins, use the Update Origin +// operation. To update origin groups, use the Update Origin group operation. To update custom domains, use the Update +// Custom Domain operation. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - name of the CDN profile which is unique within the resource group. +// endpointName - name of the endpoint under the profile which is unique globally. +// endpointUpdateProperties - endpoint update properties +func (client EndpointsClient) Update(ctx context.Context, resourceGroupName string, profileName string, endpointName string, endpointUpdateProperties EndpointUpdateParameters) (result EndpointsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EndpointsClient.Update") + 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("cdn.EndpointsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, profileName, endpointName, endpointUpdateProperties) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client EndpointsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, profileName string, endpointName string, endpointUpdateProperties EndpointUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "endpointName": autorest.Encode("path", endpointName), + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-15" + 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.Cdn/profiles/{profileName}/endpoints/{endpointName}", pathParameters), + autorest.WithJSON(endpointUpdateProperties), + 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 EndpointsClient) UpdateSender(req *http.Request) (future EndpointsUpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client EndpointsClient) UpdateResponder(resp *http.Response) (result Endpoint, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ValidateCustomDomain validates the custom domain mapping to ensure it maps to the correct CDN endpoint in DNS. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - name of the CDN profile which is unique within the resource group. +// endpointName - name of the endpoint under the profile which is unique globally. +// customDomainProperties - custom domain to be validated. +func (client EndpointsClient) ValidateCustomDomain(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainProperties ValidateCustomDomainInput) (result ValidateCustomDomainOutput, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EndpointsClient.ValidateCustomDomain") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: 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: customDomainProperties, + Constraints: []validation.Constraint{{Target: "customDomainProperties.HostName", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("cdn.EndpointsClient", "ValidateCustomDomain", err.Error()) + } + + req, err := client.ValidateCustomDomainPreparer(ctx, resourceGroupName, profileName, endpointName, customDomainProperties) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsClient", "ValidateCustomDomain", nil, "Failure preparing request") + return + } + + resp, err := client.ValidateCustomDomainSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "cdn.EndpointsClient", "ValidateCustomDomain", resp, "Failure sending request") + return + } + + result, err = client.ValidateCustomDomainResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsClient", "ValidateCustomDomain", resp, "Failure responding to request") + } + + return +} + +// ValidateCustomDomainPreparer prepares the ValidateCustomDomain request. +func (client EndpointsClient) ValidateCustomDomainPreparer(ctx context.Context, resourceGroupName string, profileName string, endpointName string, customDomainProperties ValidateCustomDomainInput) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "endpointName": autorest.Encode("path", endpointName), + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-15" + 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.Cdn/profiles/{profileName}/endpoints/{endpointName}/validateCustomDomain", pathParameters), + autorest.WithJSON(customDomainProperties), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ValidateCustomDomainSender sends the ValidateCustomDomain request. The method will close the +// http.Response Body if it receives an error. +func (client EndpointsClient) ValidateCustomDomainSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ValidateCustomDomainResponder handles the response to the ValidateCustomDomain request. The method always +// closes the http.Response Body. +func (client EndpointsClient) ValidateCustomDomainResponder(resp *http.Response) (result ValidateCustomDomainOutput, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/cdn/mgmt/2020-04-15/cdn/managedrulesets.go b/services/preview/cdn/mgmt/2020-04-15/cdn/managedrulesets.go new file mode 100644 index 000000000000..5efa43dae26b --- /dev/null +++ b/services/preview/cdn/mgmt/2020-04-15/cdn/managedrulesets.go @@ -0,0 +1,151 @@ +package cdn + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// ManagedRuleSetsClient is the cdn Management Client +type ManagedRuleSetsClient struct { + BaseClient +} + +// NewManagedRuleSetsClient creates an instance of the ManagedRuleSetsClient client. +func NewManagedRuleSetsClient(subscriptionID string, subscriptionID1 string) ManagedRuleSetsClient { + return NewManagedRuleSetsClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) +} + +// NewManagedRuleSetsClientWithBaseURI creates an instance of the ManagedRuleSetsClient 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 NewManagedRuleSetsClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) ManagedRuleSetsClient { + return ManagedRuleSetsClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} +} + +// List lists all available managed rule sets. +func (client ManagedRuleSetsClient) List(ctx context.Context) (result ManagedRuleSetDefinitionListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedRuleSetsClient.List") + defer func() { + sc := -1 + if result.mrsdl.Response.Response != nil { + sc = result.mrsdl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.ManagedRuleSetsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.mrsdl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "cdn.ManagedRuleSetsClient", "List", resp, "Failure sending request") + return + } + + result.mrsdl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.ManagedRuleSetsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client ManagedRuleSetsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Cdn/CdnWebApplicationFirewallManagedRuleSets", 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 ManagedRuleSetsClient) 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 ManagedRuleSetsClient) ListResponder(resp *http.Response) (result ManagedRuleSetDefinitionList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 ManagedRuleSetsClient) listNextResults(ctx context.Context, lastResults ManagedRuleSetDefinitionList) (result ManagedRuleSetDefinitionList, err error) { + req, err := lastResults.managedRuleSetDefinitionListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "cdn.ManagedRuleSetsClient", "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, "cdn.ManagedRuleSetsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.ManagedRuleSetsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ManagedRuleSetsClient) ListComplete(ctx context.Context) (result ManagedRuleSetDefinitionListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedRuleSetsClient.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/cdn/mgmt/2020-04-15/cdn/models.go b/services/preview/cdn/mgmt/2020-04-15/cdn/models.go new file mode 100644 index 000000000000..b53adcb48ad3 --- /dev/null +++ b/services/preview/cdn/mgmt/2020-04-15/cdn/models.go @@ -0,0 +1,7494 @@ +package cdn + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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/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/cdn/mgmt/2020-04-15/cdn" + +// ActionType enumerates the values for action type. +type ActionType string + +const ( + // Allow ... + Allow ActionType = "Allow" + // Block ... + Block ActionType = "Block" + // Log ... + Log ActionType = "Log" + // Redirect ... + Redirect ActionType = "Redirect" +) + +// PossibleActionTypeValues returns an array of possible values for the ActionType const type. +func PossibleActionTypeValues() []ActionType { + return []ActionType{Allow, Block, Log, Redirect} +} + +// Algorithm enumerates the values for algorithm. +type Algorithm string + +const ( + // SHA256 ... + SHA256 Algorithm = "SHA256" +) + +// PossibleAlgorithmValues returns an array of possible values for the Algorithm const type. +func PossibleAlgorithmValues() []Algorithm { + return []Algorithm{SHA256} +} + +// CacheBehavior enumerates the values for cache behavior. +type CacheBehavior string + +const ( + // BypassCache ... + BypassCache CacheBehavior = "BypassCache" + // Override ... + Override CacheBehavior = "Override" + // SetIfMissing ... + SetIfMissing CacheBehavior = "SetIfMissing" +) + +// PossibleCacheBehaviorValues returns an array of possible values for the CacheBehavior const type. +func PossibleCacheBehaviorValues() []CacheBehavior { + return []CacheBehavior{BypassCache, Override, SetIfMissing} +} + +// CertificateSource enumerates the values for certificate source. +type CertificateSource string + +const ( + // CertificateSourceAzureKeyVault ... + CertificateSourceAzureKeyVault CertificateSource = "AzureKeyVault" + // CertificateSourceCdn ... + CertificateSourceCdn CertificateSource = "Cdn" + // CertificateSourceCustomDomainHTTPSParameters ... + CertificateSourceCustomDomainHTTPSParameters CertificateSource = "CustomDomainHttpsParameters" +) + +// PossibleCertificateSourceValues returns an array of possible values for the CertificateSource const type. +func PossibleCertificateSourceValues() []CertificateSource { + return []CertificateSource{CertificateSourceAzureKeyVault, CertificateSourceCdn, CertificateSourceCustomDomainHTTPSParameters} +} + +// CertificateType enumerates the values for certificate type. +type CertificateType string + +const ( + // Dedicated ... + Dedicated CertificateType = "Dedicated" + // Shared ... + Shared CertificateType = "Shared" +) + +// PossibleCertificateTypeValues returns an array of possible values for the CertificateType const type. +func PossibleCertificateTypeValues() []CertificateType { + return []CertificateType{Dedicated, Shared} +} + +// CookiesOperator enumerates the values for cookies operator. +type CookiesOperator string + +const ( + // Any ... + Any CookiesOperator = "Any" + // BeginsWith ... + BeginsWith CookiesOperator = "BeginsWith" + // Contains ... + Contains CookiesOperator = "Contains" + // EndsWith ... + EndsWith CookiesOperator = "EndsWith" + // Equal ... + Equal CookiesOperator = "Equal" + // GreaterThan ... + GreaterThan CookiesOperator = "GreaterThan" + // GreaterThanOrEqual ... + GreaterThanOrEqual CookiesOperator = "GreaterThanOrEqual" + // LessThan ... + LessThan CookiesOperator = "LessThan" + // LessThanOrEqual ... + LessThanOrEqual CookiesOperator = "LessThanOrEqual" +) + +// PossibleCookiesOperatorValues returns an array of possible values for the CookiesOperator const type. +func PossibleCookiesOperatorValues() []CookiesOperator { + return []CookiesOperator{Any, BeginsWith, Contains, EndsWith, Equal, GreaterThan, GreaterThanOrEqual, LessThan, LessThanOrEqual} +} + +// CustomDomainResourceState enumerates the values for custom domain resource state. +type CustomDomainResourceState string + +const ( + // Active ... + Active CustomDomainResourceState = "Active" + // Creating ... + Creating CustomDomainResourceState = "Creating" + // Deleting ... + Deleting CustomDomainResourceState = "Deleting" +) + +// PossibleCustomDomainResourceStateValues returns an array of possible values for the CustomDomainResourceState const type. +func PossibleCustomDomainResourceStateValues() []CustomDomainResourceState { + return []CustomDomainResourceState{Active, Creating, Deleting} +} + +// CustomHTTPSProvisioningState enumerates the values for custom https provisioning state. +type CustomHTTPSProvisioningState string + +const ( + // Disabled ... + Disabled CustomHTTPSProvisioningState = "Disabled" + // Disabling ... + Disabling CustomHTTPSProvisioningState = "Disabling" + // Enabled ... + Enabled CustomHTTPSProvisioningState = "Enabled" + // Enabling ... + Enabling CustomHTTPSProvisioningState = "Enabling" + // Failed ... + Failed CustomHTTPSProvisioningState = "Failed" +) + +// PossibleCustomHTTPSProvisioningStateValues returns an array of possible values for the CustomHTTPSProvisioningState const type. +func PossibleCustomHTTPSProvisioningStateValues() []CustomHTTPSProvisioningState { + return []CustomHTTPSProvisioningState{Disabled, Disabling, Enabled, Enabling, Failed} +} + +// CustomHTTPSProvisioningSubstate enumerates the values for custom https provisioning substate. +type CustomHTTPSProvisioningSubstate string + +const ( + // CertificateDeleted ... + CertificateDeleted CustomHTTPSProvisioningSubstate = "CertificateDeleted" + // CertificateDeployed ... + CertificateDeployed CustomHTTPSProvisioningSubstate = "CertificateDeployed" + // DeletingCertificate ... + DeletingCertificate CustomHTTPSProvisioningSubstate = "DeletingCertificate" + // DeployingCertificate ... + DeployingCertificate CustomHTTPSProvisioningSubstate = "DeployingCertificate" + // DomainControlValidationRequestApproved ... + DomainControlValidationRequestApproved CustomHTTPSProvisioningSubstate = "DomainControlValidationRequestApproved" + // DomainControlValidationRequestRejected ... + DomainControlValidationRequestRejected CustomHTTPSProvisioningSubstate = "DomainControlValidationRequestRejected" + // DomainControlValidationRequestTimedOut ... + DomainControlValidationRequestTimedOut CustomHTTPSProvisioningSubstate = "DomainControlValidationRequestTimedOut" + // IssuingCertificate ... + IssuingCertificate CustomHTTPSProvisioningSubstate = "IssuingCertificate" + // PendingDomainControlValidationREquestApproval ... + PendingDomainControlValidationREquestApproval CustomHTTPSProvisioningSubstate = "PendingDomainControlValidationREquestApproval" + // SubmittingDomainControlValidationRequest ... + SubmittingDomainControlValidationRequest CustomHTTPSProvisioningSubstate = "SubmittingDomainControlValidationRequest" +) + +// PossibleCustomHTTPSProvisioningSubstateValues returns an array of possible values for the CustomHTTPSProvisioningSubstate const type. +func PossibleCustomHTTPSProvisioningSubstateValues() []CustomHTTPSProvisioningSubstate { + return []CustomHTTPSProvisioningSubstate{CertificateDeleted, CertificateDeployed, DeletingCertificate, DeployingCertificate, DomainControlValidationRequestApproved, DomainControlValidationRequestRejected, DomainControlValidationRequestTimedOut, IssuingCertificate, PendingDomainControlValidationREquestApproval, SubmittingDomainControlValidationRequest} +} + +// CustomRuleEnabledState enumerates the values for custom rule enabled state. +type CustomRuleEnabledState string + +const ( + // CustomRuleEnabledStateDisabled ... + CustomRuleEnabledStateDisabled CustomRuleEnabledState = "Disabled" + // CustomRuleEnabledStateEnabled ... + CustomRuleEnabledStateEnabled CustomRuleEnabledState = "Enabled" +) + +// PossibleCustomRuleEnabledStateValues returns an array of possible values for the CustomRuleEnabledState const type. +func PossibleCustomRuleEnabledStateValues() []CustomRuleEnabledState { + return []CustomRuleEnabledState{CustomRuleEnabledStateDisabled, CustomRuleEnabledStateEnabled} +} + +// DestinationProtocol enumerates the values for destination protocol. +type DestinationProtocol string + +const ( + // HTTP ... + HTTP DestinationProtocol = "Http" + // HTTPS ... + HTTPS DestinationProtocol = "Https" + // MatchRequest ... + MatchRequest DestinationProtocol = "MatchRequest" +) + +// PossibleDestinationProtocolValues returns an array of possible values for the DestinationProtocol const type. +func PossibleDestinationProtocolValues() []DestinationProtocol { + return []DestinationProtocol{HTTP, HTTPS, MatchRequest} +} + +// EndpointResourceState enumerates the values for endpoint resource state. +type EndpointResourceState string + +const ( + // EndpointResourceStateCreating ... + EndpointResourceStateCreating EndpointResourceState = "Creating" + // EndpointResourceStateDeleting ... + EndpointResourceStateDeleting EndpointResourceState = "Deleting" + // EndpointResourceStateRunning ... + EndpointResourceStateRunning EndpointResourceState = "Running" + // EndpointResourceStateStarting ... + EndpointResourceStateStarting EndpointResourceState = "Starting" + // EndpointResourceStateStopped ... + EndpointResourceStateStopped EndpointResourceState = "Stopped" + // EndpointResourceStateStopping ... + EndpointResourceStateStopping EndpointResourceState = "Stopping" +) + +// PossibleEndpointResourceStateValues returns an array of possible values for the EndpointResourceState const type. +func PossibleEndpointResourceStateValues() []EndpointResourceState { + return []EndpointResourceState{EndpointResourceStateCreating, EndpointResourceStateDeleting, EndpointResourceStateRunning, EndpointResourceStateStarting, EndpointResourceStateStopped, EndpointResourceStateStopping} +} + +// GeoFilterActions enumerates the values for geo filter actions. +type GeoFilterActions string + +const ( + // GeoFilterActionsAllow ... + GeoFilterActionsAllow GeoFilterActions = "Allow" + // GeoFilterActionsBlock ... + GeoFilterActionsBlock GeoFilterActions = "Block" +) + +// PossibleGeoFilterActionsValues returns an array of possible values for the GeoFilterActions const type. +func PossibleGeoFilterActionsValues() []GeoFilterActions { + return []GeoFilterActions{GeoFilterActionsAllow, GeoFilterActionsBlock} +} + +// HeaderAction enumerates the values for header action. +type HeaderAction string + +const ( + // Append ... + Append HeaderAction = "Append" + // Delete ... + Delete HeaderAction = "Delete" + // Overwrite ... + Overwrite HeaderAction = "Overwrite" +) + +// PossibleHeaderActionValues returns an array of possible values for the HeaderAction const type. +func PossibleHeaderActionValues() []HeaderAction { + return []HeaderAction{Append, Delete, Overwrite} +} + +// HealthProbeRequestType enumerates the values for health probe request type. +type HealthProbeRequestType string + +const ( + // GET ... + GET HealthProbeRequestType = "GET" + // HEAD ... + HEAD HealthProbeRequestType = "HEAD" + // NotSet ... + NotSet HealthProbeRequestType = "NotSet" +) + +// PossibleHealthProbeRequestTypeValues returns an array of possible values for the HealthProbeRequestType const type. +func PossibleHealthProbeRequestTypeValues() []HealthProbeRequestType { + return []HealthProbeRequestType{GET, HEAD, NotSet} +} + +// ManagedRuleEnabledState enumerates the values for managed rule enabled state. +type ManagedRuleEnabledState string + +const ( + // ManagedRuleEnabledStateDisabled ... + ManagedRuleEnabledStateDisabled ManagedRuleEnabledState = "Disabled" + // ManagedRuleEnabledStateEnabled ... + ManagedRuleEnabledStateEnabled ManagedRuleEnabledState = "Enabled" +) + +// PossibleManagedRuleEnabledStateValues returns an array of possible values for the ManagedRuleEnabledState const type. +func PossibleManagedRuleEnabledStateValues() []ManagedRuleEnabledState { + return []ManagedRuleEnabledState{ManagedRuleEnabledStateDisabled, ManagedRuleEnabledStateEnabled} +} + +// MatchVariable enumerates the values for match variable. +type MatchVariable string + +const ( + // Cookies ... + Cookies MatchVariable = "Cookies" + // PostArgs ... + PostArgs MatchVariable = "PostArgs" + // QueryString ... + QueryString MatchVariable = "QueryString" + // RemoteAddr ... + RemoteAddr MatchVariable = "RemoteAddr" + // RequestBody ... + RequestBody MatchVariable = "RequestBody" + // RequestHeader ... + RequestHeader MatchVariable = "RequestHeader" + // RequestMethod ... + RequestMethod MatchVariable = "RequestMethod" + // RequestURI ... + RequestURI MatchVariable = "RequestUri" + // SocketAddr ... + SocketAddr MatchVariable = "SocketAddr" +) + +// PossibleMatchVariableValues returns an array of possible values for the MatchVariable const type. +func PossibleMatchVariableValues() []MatchVariable { + return []MatchVariable{Cookies, PostArgs, QueryString, RemoteAddr, RequestBody, RequestHeader, RequestMethod, RequestURI, SocketAddr} +} + +// MinimumTLSVersion enumerates the values for minimum tls version. +type MinimumTLSVersion string + +const ( + // None ... + None MinimumTLSVersion = "None" + // TLS10 ... + TLS10 MinimumTLSVersion = "TLS10" + // TLS12 ... + TLS12 MinimumTLSVersion = "TLS12" +) + +// PossibleMinimumTLSVersionValues returns an array of possible values for the MinimumTLSVersion const type. +func PossibleMinimumTLSVersionValues() []MinimumTLSVersion { + return []MinimumTLSVersion{None, TLS10, TLS12} +} + +// Name enumerates the values for name. +type Name string + +const ( + // NameCookies ... + NameCookies Name = "Cookies" + // NameDeliveryRuleCondition ... + NameDeliveryRuleCondition Name = "DeliveryRuleCondition" + // NameHTTPVersion ... + NameHTTPVersion Name = "HttpVersion" + // NameIsDevice ... + NameIsDevice Name = "IsDevice" + // NamePostArgs ... + NamePostArgs Name = "PostArgs" + // NameQueryString ... + NameQueryString Name = "QueryString" + // NameRemoteAddress ... + NameRemoteAddress Name = "RemoteAddress" + // NameRequestBody ... + NameRequestBody Name = "RequestBody" + // NameRequestHeader ... + NameRequestHeader Name = "RequestHeader" + // NameRequestMethod ... + NameRequestMethod Name = "RequestMethod" + // NameRequestScheme ... + NameRequestScheme Name = "RequestScheme" + // NameRequestURI ... + NameRequestURI Name = "RequestUri" + // NameURLFileExtension ... + NameURLFileExtension Name = "UrlFileExtension" + // NameURLFileName ... + NameURLFileName Name = "UrlFileName" + // NameURLPath ... + NameURLPath Name = "UrlPath" +) + +// PossibleNameValues returns an array of possible values for the Name const type. +func PossibleNameValues() []Name { + return []Name{NameCookies, NameDeliveryRuleCondition, NameHTTPVersion, NameIsDevice, NamePostArgs, NameQueryString, NameRemoteAddress, NameRequestBody, NameRequestHeader, NameRequestMethod, NameRequestScheme, NameRequestURI, NameURLFileExtension, NameURLFileName, NameURLPath} +} + +// NameBasicDeliveryRuleAction enumerates the values for name basic delivery rule action. +type NameBasicDeliveryRuleAction string + +const ( + // NameCacheExpiration ... + NameCacheExpiration NameBasicDeliveryRuleAction = "CacheExpiration" + // NameCacheKeyQueryString ... + NameCacheKeyQueryString NameBasicDeliveryRuleAction = "CacheKeyQueryString" + // NameDeliveryRuleAction ... + NameDeliveryRuleAction NameBasicDeliveryRuleAction = "DeliveryRuleAction" + // NameModifyRequestHeader ... + NameModifyRequestHeader NameBasicDeliveryRuleAction = "ModifyRequestHeader" + // NameModifyResponseHeader ... + NameModifyResponseHeader NameBasicDeliveryRuleAction = "ModifyResponseHeader" + // NameURLRedirect ... + NameURLRedirect NameBasicDeliveryRuleAction = "UrlRedirect" + // NameURLRewrite ... + NameURLRewrite NameBasicDeliveryRuleAction = "UrlRewrite" +) + +// PossibleNameBasicDeliveryRuleActionValues returns an array of possible values for the NameBasicDeliveryRuleAction const type. +func PossibleNameBasicDeliveryRuleActionValues() []NameBasicDeliveryRuleAction { + return []NameBasicDeliveryRuleAction{NameCacheExpiration, NameCacheKeyQueryString, NameDeliveryRuleAction, NameModifyRequestHeader, NameModifyResponseHeader, NameURLRedirect, NameURLRewrite} +} + +// Operator enumerates the values for operator. +type Operator string + +const ( + // OperatorAny ... + OperatorAny Operator = "Any" + // OperatorBeginsWith ... + OperatorBeginsWith Operator = "BeginsWith" + // OperatorContains ... + OperatorContains Operator = "Contains" + // OperatorEndsWith ... + OperatorEndsWith Operator = "EndsWith" + // OperatorEqual ... + OperatorEqual Operator = "Equal" + // OperatorGeoMatch ... + OperatorGeoMatch Operator = "GeoMatch" + // OperatorGreaterThan ... + OperatorGreaterThan Operator = "GreaterThan" + // OperatorGreaterThanOrEqual ... + OperatorGreaterThanOrEqual Operator = "GreaterThanOrEqual" + // OperatorIPMatch ... + OperatorIPMatch Operator = "IPMatch" + // OperatorLessThan ... + OperatorLessThan Operator = "LessThan" + // OperatorLessThanOrEqual ... + OperatorLessThanOrEqual Operator = "LessThanOrEqual" + // OperatorRegEx ... + OperatorRegEx Operator = "RegEx" +) + +// PossibleOperatorValues returns an array of possible values for the Operator const type. +func PossibleOperatorValues() []Operator { + return []Operator{OperatorAny, OperatorBeginsWith, OperatorContains, OperatorEndsWith, OperatorEqual, OperatorGeoMatch, OperatorGreaterThan, OperatorGreaterThanOrEqual, OperatorIPMatch, OperatorLessThan, OperatorLessThanOrEqual, OperatorRegEx} +} + +// OptimizationType enumerates the values for optimization type. +type OptimizationType string + +const ( + // DynamicSiteAcceleration ... + DynamicSiteAcceleration OptimizationType = "DynamicSiteAcceleration" + // GeneralMediaStreaming ... + GeneralMediaStreaming OptimizationType = "GeneralMediaStreaming" + // GeneralWebDelivery ... + GeneralWebDelivery OptimizationType = "GeneralWebDelivery" + // LargeFileDownload ... + LargeFileDownload OptimizationType = "LargeFileDownload" + // VideoOnDemandMediaStreaming ... + VideoOnDemandMediaStreaming OptimizationType = "VideoOnDemandMediaStreaming" +) + +// PossibleOptimizationTypeValues returns an array of possible values for the OptimizationType const type. +func PossibleOptimizationTypeValues() []OptimizationType { + return []OptimizationType{DynamicSiteAcceleration, GeneralMediaStreaming, GeneralWebDelivery, LargeFileDownload, VideoOnDemandMediaStreaming} +} + +// OriginGroupResourceState enumerates the values for origin group resource state. +type OriginGroupResourceState string + +const ( + // OriginGroupResourceStateActive ... + OriginGroupResourceStateActive OriginGroupResourceState = "Active" + // OriginGroupResourceStateCreating ... + OriginGroupResourceStateCreating OriginGroupResourceState = "Creating" + // OriginGroupResourceStateDeleting ... + OriginGroupResourceStateDeleting OriginGroupResourceState = "Deleting" +) + +// PossibleOriginGroupResourceStateValues returns an array of possible values for the OriginGroupResourceState const type. +func PossibleOriginGroupResourceStateValues() []OriginGroupResourceState { + return []OriginGroupResourceState{OriginGroupResourceStateActive, OriginGroupResourceStateCreating, OriginGroupResourceStateDeleting} +} + +// OriginResourceState enumerates the values for origin resource state. +type OriginResourceState string + +const ( + // OriginResourceStateActive ... + OriginResourceStateActive OriginResourceState = "Active" + // OriginResourceStateCreating ... + OriginResourceStateCreating OriginResourceState = "Creating" + // OriginResourceStateDeleting ... + OriginResourceStateDeleting OriginResourceState = "Deleting" +) + +// PossibleOriginResourceStateValues returns an array of possible values for the OriginResourceState const type. +func PossibleOriginResourceStateValues() []OriginResourceState { + return []OriginResourceState{OriginResourceStateActive, OriginResourceStateCreating, OriginResourceStateDeleting} +} + +// ParamIndicator enumerates the values for param indicator. +type ParamIndicator string + +const ( + // Expires ... + Expires ParamIndicator = "expires" + // KeyID ... + KeyID ParamIndicator = "keyId" + // Signature ... + Signature ParamIndicator = "signature" +) + +// PossibleParamIndicatorValues returns an array of possible values for the ParamIndicator const type. +func PossibleParamIndicatorValues() []ParamIndicator { + return []ParamIndicator{Expires, KeyID, Signature} +} + +// PolicyEnabledState enumerates the values for policy enabled state. +type PolicyEnabledState string + +const ( + // PolicyEnabledStateDisabled ... + PolicyEnabledStateDisabled PolicyEnabledState = "Disabled" + // PolicyEnabledStateEnabled ... + PolicyEnabledStateEnabled PolicyEnabledState = "Enabled" +) + +// PossiblePolicyEnabledStateValues returns an array of possible values for the PolicyEnabledState const type. +func PossiblePolicyEnabledStateValues() []PolicyEnabledState { + return []PolicyEnabledState{PolicyEnabledStateDisabled, PolicyEnabledStateEnabled} +} + +// PolicyMode enumerates the values for policy mode. +type PolicyMode string + +const ( + // Detection ... + Detection PolicyMode = "Detection" + // Prevention ... + Prevention PolicyMode = "Prevention" +) + +// PossiblePolicyModeValues returns an array of possible values for the PolicyMode const type. +func PossiblePolicyModeValues() []PolicyMode { + return []PolicyMode{Detection, Prevention} +} + +// PolicyResourceState enumerates the values for policy resource state. +type PolicyResourceState string + +const ( + // PolicyResourceStateCreating ... + PolicyResourceStateCreating PolicyResourceState = "Creating" + // PolicyResourceStateDeleting ... + PolicyResourceStateDeleting PolicyResourceState = "Deleting" + // PolicyResourceStateDisabled ... + PolicyResourceStateDisabled PolicyResourceState = "Disabled" + // PolicyResourceStateDisabling ... + PolicyResourceStateDisabling PolicyResourceState = "Disabling" + // PolicyResourceStateEnabled ... + PolicyResourceStateEnabled PolicyResourceState = "Enabled" + // PolicyResourceStateEnabling ... + PolicyResourceStateEnabling PolicyResourceState = "Enabling" +) + +// PossiblePolicyResourceStateValues returns an array of possible values for the PolicyResourceState const type. +func PossiblePolicyResourceStateValues() []PolicyResourceState { + return []PolicyResourceState{PolicyResourceStateCreating, PolicyResourceStateDeleting, PolicyResourceStateDisabled, PolicyResourceStateDisabling, PolicyResourceStateEnabled, PolicyResourceStateEnabling} +} + +// PostArgsOperator enumerates the values for post args operator. +type PostArgsOperator string + +const ( + // PostArgsOperatorAny ... + PostArgsOperatorAny PostArgsOperator = "Any" + // PostArgsOperatorBeginsWith ... + PostArgsOperatorBeginsWith PostArgsOperator = "BeginsWith" + // PostArgsOperatorContains ... + PostArgsOperatorContains PostArgsOperator = "Contains" + // PostArgsOperatorEndsWith ... + PostArgsOperatorEndsWith PostArgsOperator = "EndsWith" + // PostArgsOperatorEqual ... + PostArgsOperatorEqual PostArgsOperator = "Equal" + // PostArgsOperatorGreaterThan ... + PostArgsOperatorGreaterThan PostArgsOperator = "GreaterThan" + // PostArgsOperatorGreaterThanOrEqual ... + PostArgsOperatorGreaterThanOrEqual PostArgsOperator = "GreaterThanOrEqual" + // PostArgsOperatorLessThan ... + PostArgsOperatorLessThan PostArgsOperator = "LessThan" + // PostArgsOperatorLessThanOrEqual ... + PostArgsOperatorLessThanOrEqual PostArgsOperator = "LessThanOrEqual" +) + +// PossiblePostArgsOperatorValues returns an array of possible values for the PostArgsOperator const type. +func PossiblePostArgsOperatorValues() []PostArgsOperator { + return []PostArgsOperator{PostArgsOperatorAny, PostArgsOperatorBeginsWith, PostArgsOperatorContains, PostArgsOperatorEndsWith, PostArgsOperatorEqual, PostArgsOperatorGreaterThan, PostArgsOperatorGreaterThanOrEqual, PostArgsOperatorLessThan, PostArgsOperatorLessThanOrEqual} +} + +// PrivateEndpointStatus enumerates the values for private endpoint status. +type PrivateEndpointStatus string + +const ( + // Approved ... + Approved PrivateEndpointStatus = "Approved" + // Disconnected ... + Disconnected PrivateEndpointStatus = "Disconnected" + // Pending ... + Pending PrivateEndpointStatus = "Pending" + // Rejected ... + Rejected PrivateEndpointStatus = "Rejected" + // Timeout ... + Timeout PrivateEndpointStatus = "Timeout" +) + +// PossiblePrivateEndpointStatusValues returns an array of possible values for the PrivateEndpointStatus const type. +func PossiblePrivateEndpointStatusValues() []PrivateEndpointStatus { + return []PrivateEndpointStatus{Approved, Disconnected, Pending, Rejected, Timeout} +} + +// ProbeProtocol enumerates the values for probe protocol. +type ProbeProtocol string + +const ( + // ProbeProtocolHTTP ... + ProbeProtocolHTTP ProbeProtocol = "Http" + // ProbeProtocolHTTPS ... + ProbeProtocolHTTPS ProbeProtocol = "Https" + // ProbeProtocolNotSet ... + ProbeProtocolNotSet ProbeProtocol = "NotSet" +) + +// PossibleProbeProtocolValues returns an array of possible values for the ProbeProtocol const type. +func PossibleProbeProtocolValues() []ProbeProtocol { + return []ProbeProtocol{ProbeProtocolHTTP, ProbeProtocolHTTPS, ProbeProtocolNotSet} +} + +// ProfileResourceState enumerates the values for profile resource state. +type ProfileResourceState string + +const ( + // ProfileResourceStateActive ... + ProfileResourceStateActive ProfileResourceState = "Active" + // ProfileResourceStateCreating ... + ProfileResourceStateCreating ProfileResourceState = "Creating" + // ProfileResourceStateDeleting ... + ProfileResourceStateDeleting ProfileResourceState = "Deleting" + // ProfileResourceStateDisabled ... + ProfileResourceStateDisabled ProfileResourceState = "Disabled" +) + +// PossibleProfileResourceStateValues returns an array of possible values for the ProfileResourceState const type. +func PossibleProfileResourceStateValues() []ProfileResourceState { + return []ProfileResourceState{ProfileResourceStateActive, ProfileResourceStateCreating, ProfileResourceStateDeleting, ProfileResourceStateDisabled} +} + +// ProtocolType enumerates the values for protocol type. +type ProtocolType string + +const ( + // IPBased ... + IPBased ProtocolType = "IPBased" + // ServerNameIndication ... + ServerNameIndication ProtocolType = "ServerNameIndication" +) + +// PossibleProtocolTypeValues returns an array of possible values for the ProtocolType const type. +func PossibleProtocolTypeValues() []ProtocolType { + return []ProtocolType{IPBased, ServerNameIndication} +} + +// ProvisioningState enumerates the values for provisioning state. +type ProvisioningState string + +const ( + // ProvisioningStateCreating ... + ProvisioningStateCreating ProvisioningState = "Creating" + // ProvisioningStateFailed ... + ProvisioningStateFailed ProvisioningState = "Failed" + // ProvisioningStateSucceeded ... + ProvisioningStateSucceeded ProvisioningState = "Succeeded" +) + +// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. +func PossibleProvisioningStateValues() []ProvisioningState { + return []ProvisioningState{ProvisioningStateCreating, ProvisioningStateFailed, ProvisioningStateSucceeded} +} + +// QueryStringBehavior enumerates the values for query string behavior. +type QueryStringBehavior string + +const ( + // Exclude ... + Exclude QueryStringBehavior = "Exclude" + // ExcludeAll ... + ExcludeAll QueryStringBehavior = "ExcludeAll" + // Include ... + Include QueryStringBehavior = "Include" + // IncludeAll ... + IncludeAll QueryStringBehavior = "IncludeAll" +) + +// PossibleQueryStringBehaviorValues returns an array of possible values for the QueryStringBehavior const type. +func PossibleQueryStringBehaviorValues() []QueryStringBehavior { + return []QueryStringBehavior{Exclude, ExcludeAll, Include, IncludeAll} +} + +// QueryStringCachingBehavior enumerates the values for query string caching behavior. +type QueryStringCachingBehavior string + +const ( + // QueryStringCachingBehaviorBypassCaching ... + QueryStringCachingBehaviorBypassCaching QueryStringCachingBehavior = "BypassCaching" + // QueryStringCachingBehaviorIgnoreQueryString ... + QueryStringCachingBehaviorIgnoreQueryString QueryStringCachingBehavior = "IgnoreQueryString" + // QueryStringCachingBehaviorNotSet ... + QueryStringCachingBehaviorNotSet QueryStringCachingBehavior = "NotSet" + // QueryStringCachingBehaviorUseQueryString ... + QueryStringCachingBehaviorUseQueryString QueryStringCachingBehavior = "UseQueryString" +) + +// PossibleQueryStringCachingBehaviorValues returns an array of possible values for the QueryStringCachingBehavior const type. +func PossibleQueryStringCachingBehaviorValues() []QueryStringCachingBehavior { + return []QueryStringCachingBehavior{QueryStringCachingBehaviorBypassCaching, QueryStringCachingBehaviorIgnoreQueryString, QueryStringCachingBehaviorNotSet, QueryStringCachingBehaviorUseQueryString} +} + +// QueryStringOperator enumerates the values for query string operator. +type QueryStringOperator string + +const ( + // QueryStringOperatorAny ... + QueryStringOperatorAny QueryStringOperator = "Any" + // QueryStringOperatorBeginsWith ... + QueryStringOperatorBeginsWith QueryStringOperator = "BeginsWith" + // QueryStringOperatorContains ... + QueryStringOperatorContains QueryStringOperator = "Contains" + // QueryStringOperatorEndsWith ... + QueryStringOperatorEndsWith QueryStringOperator = "EndsWith" + // QueryStringOperatorEqual ... + QueryStringOperatorEqual QueryStringOperator = "Equal" + // QueryStringOperatorGreaterThan ... + QueryStringOperatorGreaterThan QueryStringOperator = "GreaterThan" + // QueryStringOperatorGreaterThanOrEqual ... + QueryStringOperatorGreaterThanOrEqual QueryStringOperator = "GreaterThanOrEqual" + // QueryStringOperatorLessThan ... + QueryStringOperatorLessThan QueryStringOperator = "LessThan" + // QueryStringOperatorLessThanOrEqual ... + QueryStringOperatorLessThanOrEqual QueryStringOperator = "LessThanOrEqual" +) + +// PossibleQueryStringOperatorValues returns an array of possible values for the QueryStringOperator const type. +func PossibleQueryStringOperatorValues() []QueryStringOperator { + return []QueryStringOperator{QueryStringOperatorAny, QueryStringOperatorBeginsWith, QueryStringOperatorContains, QueryStringOperatorEndsWith, QueryStringOperatorEqual, QueryStringOperatorGreaterThan, QueryStringOperatorGreaterThanOrEqual, QueryStringOperatorLessThan, QueryStringOperatorLessThanOrEqual} +} + +// RedirectType enumerates the values for redirect type. +type RedirectType string + +const ( + // Found ... + Found RedirectType = "Found" + // Moved ... + Moved RedirectType = "Moved" + // PermanentRedirect ... + PermanentRedirect RedirectType = "PermanentRedirect" + // TemporaryRedirect ... + TemporaryRedirect RedirectType = "TemporaryRedirect" +) + +// PossibleRedirectTypeValues returns an array of possible values for the RedirectType const type. +func PossibleRedirectTypeValues() []RedirectType { + return []RedirectType{Found, Moved, PermanentRedirect, TemporaryRedirect} +} + +// RemoteAddressOperator enumerates the values for remote address operator. +type RemoteAddressOperator string + +const ( + // RemoteAddressOperatorAny ... + RemoteAddressOperatorAny RemoteAddressOperator = "Any" + // RemoteAddressOperatorGeoMatch ... + RemoteAddressOperatorGeoMatch RemoteAddressOperator = "GeoMatch" + // RemoteAddressOperatorIPMatch ... + RemoteAddressOperatorIPMatch RemoteAddressOperator = "IPMatch" +) + +// PossibleRemoteAddressOperatorValues returns an array of possible values for the RemoteAddressOperator const type. +func PossibleRemoteAddressOperatorValues() []RemoteAddressOperator { + return []RemoteAddressOperator{RemoteAddressOperatorAny, RemoteAddressOperatorGeoMatch, RemoteAddressOperatorIPMatch} +} + +// RequestBodyOperator enumerates the values for request body operator. +type RequestBodyOperator string + +const ( + // RequestBodyOperatorAny ... + RequestBodyOperatorAny RequestBodyOperator = "Any" + // RequestBodyOperatorBeginsWith ... + RequestBodyOperatorBeginsWith RequestBodyOperator = "BeginsWith" + // RequestBodyOperatorContains ... + RequestBodyOperatorContains RequestBodyOperator = "Contains" + // RequestBodyOperatorEndsWith ... + RequestBodyOperatorEndsWith RequestBodyOperator = "EndsWith" + // RequestBodyOperatorEqual ... + RequestBodyOperatorEqual RequestBodyOperator = "Equal" + // RequestBodyOperatorGreaterThan ... + RequestBodyOperatorGreaterThan RequestBodyOperator = "GreaterThan" + // RequestBodyOperatorGreaterThanOrEqual ... + RequestBodyOperatorGreaterThanOrEqual RequestBodyOperator = "GreaterThanOrEqual" + // RequestBodyOperatorLessThan ... + RequestBodyOperatorLessThan RequestBodyOperator = "LessThan" + // RequestBodyOperatorLessThanOrEqual ... + RequestBodyOperatorLessThanOrEqual RequestBodyOperator = "LessThanOrEqual" +) + +// PossibleRequestBodyOperatorValues returns an array of possible values for the RequestBodyOperator const type. +func PossibleRequestBodyOperatorValues() []RequestBodyOperator { + return []RequestBodyOperator{RequestBodyOperatorAny, RequestBodyOperatorBeginsWith, RequestBodyOperatorContains, RequestBodyOperatorEndsWith, RequestBodyOperatorEqual, RequestBodyOperatorGreaterThan, RequestBodyOperatorGreaterThanOrEqual, RequestBodyOperatorLessThan, RequestBodyOperatorLessThanOrEqual} +} + +// RequestHeaderOperator enumerates the values for request header operator. +type RequestHeaderOperator string + +const ( + // RequestHeaderOperatorAny ... + RequestHeaderOperatorAny RequestHeaderOperator = "Any" + // RequestHeaderOperatorBeginsWith ... + RequestHeaderOperatorBeginsWith RequestHeaderOperator = "BeginsWith" + // RequestHeaderOperatorContains ... + RequestHeaderOperatorContains RequestHeaderOperator = "Contains" + // RequestHeaderOperatorEndsWith ... + RequestHeaderOperatorEndsWith RequestHeaderOperator = "EndsWith" + // RequestHeaderOperatorEqual ... + RequestHeaderOperatorEqual RequestHeaderOperator = "Equal" + // RequestHeaderOperatorGreaterThan ... + RequestHeaderOperatorGreaterThan RequestHeaderOperator = "GreaterThan" + // RequestHeaderOperatorGreaterThanOrEqual ... + RequestHeaderOperatorGreaterThanOrEqual RequestHeaderOperator = "GreaterThanOrEqual" + // RequestHeaderOperatorLessThan ... + RequestHeaderOperatorLessThan RequestHeaderOperator = "LessThan" + // RequestHeaderOperatorLessThanOrEqual ... + RequestHeaderOperatorLessThanOrEqual RequestHeaderOperator = "LessThanOrEqual" +) + +// PossibleRequestHeaderOperatorValues returns an array of possible values for the RequestHeaderOperator const type. +func PossibleRequestHeaderOperatorValues() []RequestHeaderOperator { + return []RequestHeaderOperator{RequestHeaderOperatorAny, RequestHeaderOperatorBeginsWith, RequestHeaderOperatorContains, RequestHeaderOperatorEndsWith, RequestHeaderOperatorEqual, RequestHeaderOperatorGreaterThan, RequestHeaderOperatorGreaterThanOrEqual, RequestHeaderOperatorLessThan, RequestHeaderOperatorLessThanOrEqual} +} + +// RequestURIOperator enumerates the values for request uri operator. +type RequestURIOperator string + +const ( + // RequestURIOperatorAny ... + RequestURIOperatorAny RequestURIOperator = "Any" + // RequestURIOperatorBeginsWith ... + RequestURIOperatorBeginsWith RequestURIOperator = "BeginsWith" + // RequestURIOperatorContains ... + RequestURIOperatorContains RequestURIOperator = "Contains" + // RequestURIOperatorEndsWith ... + RequestURIOperatorEndsWith RequestURIOperator = "EndsWith" + // RequestURIOperatorEqual ... + RequestURIOperatorEqual RequestURIOperator = "Equal" + // RequestURIOperatorGreaterThan ... + RequestURIOperatorGreaterThan RequestURIOperator = "GreaterThan" + // RequestURIOperatorGreaterThanOrEqual ... + RequestURIOperatorGreaterThanOrEqual RequestURIOperator = "GreaterThanOrEqual" + // RequestURIOperatorLessThan ... + RequestURIOperatorLessThan RequestURIOperator = "LessThan" + // RequestURIOperatorLessThanOrEqual ... + RequestURIOperatorLessThanOrEqual RequestURIOperator = "LessThanOrEqual" +) + +// PossibleRequestURIOperatorValues returns an array of possible values for the RequestURIOperator const type. +func PossibleRequestURIOperatorValues() []RequestURIOperator { + return []RequestURIOperator{RequestURIOperatorAny, RequestURIOperatorBeginsWith, RequestURIOperatorContains, RequestURIOperatorEndsWith, RequestURIOperatorEqual, RequestURIOperatorGreaterThan, RequestURIOperatorGreaterThanOrEqual, RequestURIOperatorLessThan, RequestURIOperatorLessThanOrEqual} +} + +// ResourceType enumerates the values for resource type. +type ResourceType string + +const ( + // MicrosoftCdnProfilesEndpoints ... + MicrosoftCdnProfilesEndpoints ResourceType = "Microsoft.Cdn/Profiles/Endpoints" +) + +// PossibleResourceTypeValues returns an array of possible values for the ResourceType const type. +func PossibleResourceTypeValues() []ResourceType { + return []ResourceType{MicrosoftCdnProfilesEndpoints} +} + +// ResponseBasedDetectedErrorTypes enumerates the values for response based detected error types. +type ResponseBasedDetectedErrorTypes string + +const ( + // ResponseBasedDetectedErrorTypesNone ... + ResponseBasedDetectedErrorTypesNone ResponseBasedDetectedErrorTypes = "None" + // ResponseBasedDetectedErrorTypesTCPAndHTTPErrors ... + ResponseBasedDetectedErrorTypesTCPAndHTTPErrors ResponseBasedDetectedErrorTypes = "TcpAndHttpErrors" + // ResponseBasedDetectedErrorTypesTCPErrorsOnly ... + ResponseBasedDetectedErrorTypesTCPErrorsOnly ResponseBasedDetectedErrorTypes = "TcpErrorsOnly" +) + +// PossibleResponseBasedDetectedErrorTypesValues returns an array of possible values for the ResponseBasedDetectedErrorTypes const type. +func PossibleResponseBasedDetectedErrorTypesValues() []ResponseBasedDetectedErrorTypes { + return []ResponseBasedDetectedErrorTypes{ResponseBasedDetectedErrorTypesNone, ResponseBasedDetectedErrorTypesTCPAndHTTPErrors, ResponseBasedDetectedErrorTypesTCPErrorsOnly} +} + +// SkuName enumerates the values for sku name. +type SkuName string + +const ( + // CustomVerizon ... + CustomVerizon SkuName = "Custom_Verizon" + // PremiumChinaCdn ... + PremiumChinaCdn SkuName = "Premium_ChinaCdn" + // PremiumVerizon ... + PremiumVerizon SkuName = "Premium_Verizon" + // StandardAkamai ... + StandardAkamai SkuName = "Standard_Akamai" + // StandardChinaCdn ... + StandardChinaCdn SkuName = "Standard_ChinaCdn" + // StandardMicrosoft ... + StandardMicrosoft SkuName = "Standard_Microsoft" + // StandardVerizon ... + StandardVerizon SkuName = "Standard_Verizon" +) + +// PossibleSkuNameValues returns an array of possible values for the SkuName const type. +func PossibleSkuNameValues() []SkuName { + return []SkuName{CustomVerizon, PremiumChinaCdn, PremiumVerizon, StandardAkamai, StandardChinaCdn, StandardMicrosoft, StandardVerizon} +} + +// Transform enumerates the values for transform. +type Transform string + +const ( + // Lowercase ... + Lowercase Transform = "Lowercase" + // Uppercase ... + Uppercase Transform = "Uppercase" +) + +// PossibleTransformValues returns an array of possible values for the Transform const type. +func PossibleTransformValues() []Transform { + return []Transform{Lowercase, Uppercase} +} + +// TransformType enumerates the values for transform type. +type TransformType string + +const ( + // TransformTypeLowercase ... + TransformTypeLowercase TransformType = "Lowercase" + // TransformTypeRemoveNulls ... + TransformTypeRemoveNulls TransformType = "RemoveNulls" + // TransformTypeTrim ... + TransformTypeTrim TransformType = "Trim" + // TransformTypeUppercase ... + TransformTypeUppercase TransformType = "Uppercase" + // TransformTypeURLDecode ... + TransformTypeURLDecode TransformType = "UrlDecode" + // TransformTypeURLEncode ... + TransformTypeURLEncode TransformType = "UrlEncode" +) + +// PossibleTransformTypeValues returns an array of possible values for the TransformType const type. +func PossibleTransformTypeValues() []TransformType { + return []TransformType{TransformTypeLowercase, TransformTypeRemoveNulls, TransformTypeTrim, TransformTypeUppercase, TransformTypeURLDecode, TransformTypeURLEncode} +} + +// URLFileExtensionOperator enumerates the values for url file extension operator. +type URLFileExtensionOperator string + +const ( + // URLFileExtensionOperatorAny ... + URLFileExtensionOperatorAny URLFileExtensionOperator = "Any" + // URLFileExtensionOperatorBeginsWith ... + URLFileExtensionOperatorBeginsWith URLFileExtensionOperator = "BeginsWith" + // URLFileExtensionOperatorContains ... + URLFileExtensionOperatorContains URLFileExtensionOperator = "Contains" + // URLFileExtensionOperatorEndsWith ... + URLFileExtensionOperatorEndsWith URLFileExtensionOperator = "EndsWith" + // URLFileExtensionOperatorEqual ... + URLFileExtensionOperatorEqual URLFileExtensionOperator = "Equal" + // URLFileExtensionOperatorGreaterThan ... + URLFileExtensionOperatorGreaterThan URLFileExtensionOperator = "GreaterThan" + // URLFileExtensionOperatorGreaterThanOrEqual ... + URLFileExtensionOperatorGreaterThanOrEqual URLFileExtensionOperator = "GreaterThanOrEqual" + // URLFileExtensionOperatorLessThan ... + URLFileExtensionOperatorLessThan URLFileExtensionOperator = "LessThan" + // URLFileExtensionOperatorLessThanOrEqual ... + URLFileExtensionOperatorLessThanOrEqual URLFileExtensionOperator = "LessThanOrEqual" +) + +// PossibleURLFileExtensionOperatorValues returns an array of possible values for the URLFileExtensionOperator const type. +func PossibleURLFileExtensionOperatorValues() []URLFileExtensionOperator { + return []URLFileExtensionOperator{URLFileExtensionOperatorAny, URLFileExtensionOperatorBeginsWith, URLFileExtensionOperatorContains, URLFileExtensionOperatorEndsWith, URLFileExtensionOperatorEqual, URLFileExtensionOperatorGreaterThan, URLFileExtensionOperatorGreaterThanOrEqual, URLFileExtensionOperatorLessThan, URLFileExtensionOperatorLessThanOrEqual} +} + +// URLFileNameOperator enumerates the values for url file name operator. +type URLFileNameOperator string + +const ( + // URLFileNameOperatorAny ... + URLFileNameOperatorAny URLFileNameOperator = "Any" + // URLFileNameOperatorBeginsWith ... + URLFileNameOperatorBeginsWith URLFileNameOperator = "BeginsWith" + // URLFileNameOperatorContains ... + URLFileNameOperatorContains URLFileNameOperator = "Contains" + // URLFileNameOperatorEndsWith ... + URLFileNameOperatorEndsWith URLFileNameOperator = "EndsWith" + // URLFileNameOperatorEqual ... + URLFileNameOperatorEqual URLFileNameOperator = "Equal" + // URLFileNameOperatorGreaterThan ... + URLFileNameOperatorGreaterThan URLFileNameOperator = "GreaterThan" + // URLFileNameOperatorGreaterThanOrEqual ... + URLFileNameOperatorGreaterThanOrEqual URLFileNameOperator = "GreaterThanOrEqual" + // URLFileNameOperatorLessThan ... + URLFileNameOperatorLessThan URLFileNameOperator = "LessThan" + // URLFileNameOperatorLessThanOrEqual ... + URLFileNameOperatorLessThanOrEqual URLFileNameOperator = "LessThanOrEqual" +) + +// PossibleURLFileNameOperatorValues returns an array of possible values for the URLFileNameOperator const type. +func PossibleURLFileNameOperatorValues() []URLFileNameOperator { + return []URLFileNameOperator{URLFileNameOperatorAny, URLFileNameOperatorBeginsWith, URLFileNameOperatorContains, URLFileNameOperatorEndsWith, URLFileNameOperatorEqual, URLFileNameOperatorGreaterThan, URLFileNameOperatorGreaterThanOrEqual, URLFileNameOperatorLessThan, URLFileNameOperatorLessThanOrEqual} +} + +// URLPathOperator enumerates the values for url path operator. +type URLPathOperator string + +const ( + // URLPathOperatorAny ... + URLPathOperatorAny URLPathOperator = "Any" + // URLPathOperatorBeginsWith ... + URLPathOperatorBeginsWith URLPathOperator = "BeginsWith" + // URLPathOperatorContains ... + URLPathOperatorContains URLPathOperator = "Contains" + // URLPathOperatorEndsWith ... + URLPathOperatorEndsWith URLPathOperator = "EndsWith" + // URLPathOperatorEqual ... + URLPathOperatorEqual URLPathOperator = "Equal" + // URLPathOperatorGreaterThan ... + URLPathOperatorGreaterThan URLPathOperator = "GreaterThan" + // URLPathOperatorGreaterThanOrEqual ... + URLPathOperatorGreaterThanOrEqual URLPathOperator = "GreaterThanOrEqual" + // URLPathOperatorLessThan ... + URLPathOperatorLessThan URLPathOperator = "LessThan" + // URLPathOperatorLessThanOrEqual ... + URLPathOperatorLessThanOrEqual URLPathOperator = "LessThanOrEqual" + // URLPathOperatorWildcard ... + URLPathOperatorWildcard URLPathOperator = "Wildcard" +) + +// PossibleURLPathOperatorValues returns an array of possible values for the URLPathOperator const type. +func PossibleURLPathOperatorValues() []URLPathOperator { + return []URLPathOperator{URLPathOperatorAny, URLPathOperatorBeginsWith, URLPathOperatorContains, URLPathOperatorEndsWith, URLPathOperatorEqual, URLPathOperatorGreaterThan, URLPathOperatorGreaterThanOrEqual, URLPathOperatorLessThan, URLPathOperatorLessThanOrEqual, URLPathOperatorWildcard} +} + +// CacheExpirationActionParameters defines the parameters for the cache expiration action. +type CacheExpirationActionParameters struct { + OdataType *string `json:"@odata.type,omitempty"` + // CacheBehavior - Caching behavior for the requests. Possible values include: 'BypassCache', 'Override', 'SetIfMissing' + CacheBehavior CacheBehavior `json:"cacheBehavior,omitempty"` + // CacheType - The level at which the content needs to be cached. + CacheType *string `json:"cacheType,omitempty"` + // CacheDuration - The duration for which the content needs to be cached. Allowed format is [d.]hh:mm:ss + CacheDuration *string `json:"cacheDuration,omitempty"` +} + +// CacheKeyQueryStringActionParameters defines the parameters for the cache-key query string action. +type CacheKeyQueryStringActionParameters struct { + OdataType *string `json:"@odata.type,omitempty"` + // QueryStringBehavior - Caching behavior for the requests. Possible values include: 'Include', 'IncludeAll', 'Exclude', 'ExcludeAll' + QueryStringBehavior QueryStringBehavior `json:"queryStringBehavior,omitempty"` + // QueryParameters - query parameters to include or exclude (comma separated). + QueryParameters *string `json:"queryParameters,omitempty"` +} + +// CertificateSourceParameters defines the parameters for using CDN managed certificate for securing custom +// domain. +type CertificateSourceParameters struct { + OdataType *string `json:"@odata.type,omitempty"` + // CertificateType - Type of certificate used. Possible values include: 'Shared', 'Dedicated' + CertificateType CertificateType `json:"certificateType,omitempty"` +} + +// CheckNameAvailabilityInput input of CheckNameAvailability API. +type CheckNameAvailabilityInput struct { + // Name - The resource name to validate. + Name *string `json:"name,omitempty"` + // Type - The type of the resource whose name is to be validated. + Type *string `json:"type,omitempty"` +} + +// CheckNameAvailabilityOutput output of check name availability API. +type CheckNameAvailabilityOutput struct { + autorest.Response `json:"-"` + // NameAvailable - READ-ONLY; Indicates whether the name is available. + NameAvailable *bool `json:"nameAvailable,omitempty"` + // Reason - READ-ONLY; The reason why the name is not available. + Reason *string `json:"reason,omitempty"` + // Message - READ-ONLY; The detailed error message describing why the name is not available. + Message *string `json:"message,omitempty"` +} + +// CidrIPAddress CIDR Ip address +type CidrIPAddress struct { + // BaseIPAddress - Ip address itself. + BaseIPAddress *string `json:"baseIpAddress,omitempty"` + // PrefixLength - The length of the prefix of the ip address. + PrefixLength *int32 `json:"prefixLength,omitempty"` +} + +// CookiesMatchConditionParameters defines the parameters for Cookies match conditions +type CookiesMatchConditionParameters struct { + OdataType *string `json:"@odata.type,omitempty"` + // Selector - Name of Cookies to be matched + Selector *string `json:"selector,omitempty"` + // Operator - Describes operator to be matched. Possible values include: 'Any', 'Equal', 'Contains', 'BeginsWith', 'EndsWith', 'LessThan', 'LessThanOrEqual', 'GreaterThan', 'GreaterThanOrEqual' + Operator CookiesOperator `json:"operator,omitempty"` + // NegateCondition - Describes if this is negate condition or not + NegateCondition *bool `json:"negateCondition,omitempty"` + // MatchValues - The match value for the condition of the delivery rule + MatchValues *[]string `json:"matchValues,omitempty"` + // Transforms - List of transforms + Transforms *[]Transform `json:"transforms,omitempty"` +} + +// CustomDomain friendly domain name mapping to the endpoint hostname that the customer provides for +// branding purposes, e.g. www.contoso.com. +type CustomDomain struct { + autorest.Response `json:"-"` + *CustomDomainProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for CustomDomain. +func (cd CustomDomain) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cd.CustomDomainProperties != nil { + objectMap["properties"] = cd.CustomDomainProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CustomDomain struct. +func (cd *CustomDomain) 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 customDomainProperties CustomDomainProperties + err = json.Unmarshal(*v, &customDomainProperties) + if err != nil { + return err + } + cd.CustomDomainProperties = &customDomainProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + cd.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + cd.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + cd.Type = &typeVar + } + } + } + + return nil +} + +// BasicCustomDomainHTTPSParameters the JSON object that contains the properties to secure a custom domain. +type BasicCustomDomainHTTPSParameters interface { + AsManagedHTTPSParameters() (*ManagedHTTPSParameters, bool) + AsUserManagedHTTPSParameters() (*UserManagedHTTPSParameters, bool) + AsCustomDomainHTTPSParameters() (*CustomDomainHTTPSParameters, bool) +} + +// CustomDomainHTTPSParameters the JSON object that contains the properties to secure a custom domain. +type CustomDomainHTTPSParameters struct { + // ProtocolType - Defines the TLS extension protocol that is used for secure delivery. Possible values include: 'ServerNameIndication', 'IPBased' + ProtocolType ProtocolType `json:"protocolType,omitempty"` + // MinimumTLSVersion - TLS protocol version that will be used for Https. Possible values include: 'None', 'TLS10', 'TLS12' + MinimumTLSVersion MinimumTLSVersion `json:"minimumTlsVersion,omitempty"` + // CertificateSource - Possible values include: 'CertificateSourceCustomDomainHTTPSParameters', 'CertificateSourceCdn', 'CertificateSourceAzureKeyVault' + CertificateSource CertificateSource `json:"certificateSource,omitempty"` +} + +func unmarshalBasicCustomDomainHTTPSParameters(body []byte) (BasicCustomDomainHTTPSParameters, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["certificateSource"] { + case string(CertificateSourceCdn): + var mhp ManagedHTTPSParameters + err := json.Unmarshal(body, &mhp) + return mhp, err + case string(CertificateSourceAzureKeyVault): + var umhp UserManagedHTTPSParameters + err := json.Unmarshal(body, &umhp) + return umhp, err + default: + var cdhp CustomDomainHTTPSParameters + err := json.Unmarshal(body, &cdhp) + return cdhp, err + } +} +func unmarshalBasicCustomDomainHTTPSParametersArray(body []byte) ([]BasicCustomDomainHTTPSParameters, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + cdhpArray := make([]BasicCustomDomainHTTPSParameters, len(rawMessages)) + + for index, rawMessage := range rawMessages { + cdhp, err := unmarshalBasicCustomDomainHTTPSParameters(*rawMessage) + if err != nil { + return nil, err + } + cdhpArray[index] = cdhp + } + return cdhpArray, nil +} + +// MarshalJSON is the custom marshaler for CustomDomainHTTPSParameters. +func (cdhp CustomDomainHTTPSParameters) MarshalJSON() ([]byte, error) { + cdhp.CertificateSource = CertificateSourceCustomDomainHTTPSParameters + objectMap := make(map[string]interface{}) + if cdhp.ProtocolType != "" { + objectMap["protocolType"] = cdhp.ProtocolType + } + if cdhp.MinimumTLSVersion != "" { + objectMap["minimumTlsVersion"] = cdhp.MinimumTLSVersion + } + if cdhp.CertificateSource != "" { + objectMap["certificateSource"] = cdhp.CertificateSource + } + return json.Marshal(objectMap) +} + +// AsManagedHTTPSParameters is the BasicCustomDomainHTTPSParameters implementation for CustomDomainHTTPSParameters. +func (cdhp CustomDomainHTTPSParameters) AsManagedHTTPSParameters() (*ManagedHTTPSParameters, bool) { + return nil, false +} + +// AsUserManagedHTTPSParameters is the BasicCustomDomainHTTPSParameters implementation for CustomDomainHTTPSParameters. +func (cdhp CustomDomainHTTPSParameters) AsUserManagedHTTPSParameters() (*UserManagedHTTPSParameters, bool) { + return nil, false +} + +// AsCustomDomainHTTPSParameters is the BasicCustomDomainHTTPSParameters implementation for CustomDomainHTTPSParameters. +func (cdhp CustomDomainHTTPSParameters) AsCustomDomainHTTPSParameters() (*CustomDomainHTTPSParameters, bool) { + return &cdhp, true +} + +// AsBasicCustomDomainHTTPSParameters is the BasicCustomDomainHTTPSParameters implementation for CustomDomainHTTPSParameters. +func (cdhp CustomDomainHTTPSParameters) AsBasicCustomDomainHTTPSParameters() (BasicCustomDomainHTTPSParameters, bool) { + return &cdhp, true +} + +// CustomDomainListResult result of the request to list custom domains. It contains a list of custom domain +// objects and a URL link to get the next set of results. +type CustomDomainListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of CDN CustomDomains within an endpoint. + Value *[]CustomDomain `json:"value,omitempty"` + // NextLink - URL to get the next set of custom domain objects if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// CustomDomainListResultIterator provides access to a complete listing of CustomDomain values. +type CustomDomainListResultIterator struct { + i int + page CustomDomainListResultPage +} + +// 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 *CustomDomainListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomDomainListResultIterator.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 *CustomDomainListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter CustomDomainListResultIterator) 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 CustomDomainListResultIterator) Response() CustomDomainListResult { + 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 CustomDomainListResultIterator) Value() CustomDomain { + if !iter.page.NotDone() { + return CustomDomain{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the CustomDomainListResultIterator type. +func NewCustomDomainListResultIterator(page CustomDomainListResultPage) CustomDomainListResultIterator { + return CustomDomainListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (cdlr CustomDomainListResult) IsEmpty() bool { + return cdlr.Value == nil || len(*cdlr.Value) == 0 +} + +// customDomainListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (cdlr CustomDomainListResult) customDomainListResultPreparer(ctx context.Context) (*http.Request, error) { + if cdlr.NextLink == nil || len(to.String(cdlr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(cdlr.NextLink))) +} + +// CustomDomainListResultPage contains a page of CustomDomain values. +type CustomDomainListResultPage struct { + fn func(context.Context, CustomDomainListResult) (CustomDomainListResult, error) + cdlr CustomDomainListResult +} + +// 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 *CustomDomainListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomDomainListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.cdlr) + if err != nil { + return err + } + page.cdlr = next + 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 *CustomDomainListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page CustomDomainListResultPage) NotDone() bool { + return !page.cdlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page CustomDomainListResultPage) Response() CustomDomainListResult { + return page.cdlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page CustomDomainListResultPage) Values() []CustomDomain { + if page.cdlr.IsEmpty() { + return nil + } + return *page.cdlr.Value +} + +// Creates a new instance of the CustomDomainListResultPage type. +func NewCustomDomainListResultPage(getNextPage func(context.Context, CustomDomainListResult) (CustomDomainListResult, error)) CustomDomainListResultPage { + return CustomDomainListResultPage{fn: getNextPage} +} + +// CustomDomainParameters the customDomain JSON object required for custom domain creation or update. +type CustomDomainParameters struct { + *CustomDomainPropertiesParameters `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for CustomDomainParameters. +func (cdp CustomDomainParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cdp.CustomDomainPropertiesParameters != nil { + objectMap["properties"] = cdp.CustomDomainPropertiesParameters + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CustomDomainParameters struct. +func (cdp *CustomDomainParameters) 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 customDomainPropertiesParameters CustomDomainPropertiesParameters + err = json.Unmarshal(*v, &customDomainPropertiesParameters) + if err != nil { + return err + } + cdp.CustomDomainPropertiesParameters = &customDomainPropertiesParameters + } + } + } + + return nil +} + +// CustomDomainProperties the JSON object that contains the properties of the custom domain to create. +type CustomDomainProperties struct { + // HostName - The host name of the custom domain. Must be a domain name. + HostName *string `json:"hostName,omitempty"` + // ResourceState - READ-ONLY; Resource status of the custom domain. Possible values include: 'Creating', 'Active', 'Deleting' + ResourceState CustomDomainResourceState `json:"resourceState,omitempty"` + // CustomHTTPSProvisioningState - READ-ONLY; Provisioning status of Custom Https of the custom domain. Possible values include: 'Enabling', 'Enabled', 'Disabling', 'Disabled', 'Failed' + CustomHTTPSProvisioningState CustomHTTPSProvisioningState `json:"customHttpsProvisioningState,omitempty"` + // CustomHTTPSProvisioningSubstate - READ-ONLY; Provisioning substate shows the progress of custom HTTPS enabling/disabling process step by step. Possible values include: 'SubmittingDomainControlValidationRequest', 'PendingDomainControlValidationREquestApproval', 'DomainControlValidationRequestApproved', 'DomainControlValidationRequestRejected', 'DomainControlValidationRequestTimedOut', 'IssuingCertificate', 'DeployingCertificate', 'CertificateDeployed', 'DeletingCertificate', 'CertificateDeleted' + CustomHTTPSProvisioningSubstate CustomHTTPSProvisioningSubstate `json:"customHttpsProvisioningSubstate,omitempty"` + // ValidationData - Special validation or data may be required when delivering CDN to some regions due to local compliance reasons. E.g. ICP license number of a custom domain is required to deliver content in China. + ValidationData *string `json:"validationData,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning status of the custom domain. + ProvisioningState *string `json:"provisioningState,omitempty"` +} + +// CustomDomainPropertiesParameters the JSON object that contains the properties of the custom domain to +// create. +type CustomDomainPropertiesParameters struct { + // HostName - The host name of the custom domain. Must be a domain name. + HostName *string `json:"hostName,omitempty"` +} + +// CustomDomainsCreateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type CustomDomainsCreateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *CustomDomainsCreateFuture) Result(client CustomDomainsClient) (cd CustomDomain, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.CustomDomainsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("cdn.CustomDomainsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if cd.Response.Response, err = future.GetResult(sender); err == nil && cd.Response.Response.StatusCode != http.StatusNoContent { + cd, err = client.CreateResponder(cd.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.CustomDomainsCreateFuture", "Result", cd.Response.Response, "Failure responding to request") + } + } + return +} + +// CustomDomainsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type CustomDomainsDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *CustomDomainsDeleteFuture) Result(client CustomDomainsClient) (cd CustomDomain, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.CustomDomainsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("cdn.CustomDomainsDeleteFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if cd.Response.Response, err = future.GetResult(sender); err == nil && cd.Response.Response.StatusCode != http.StatusNoContent { + cd, err = client.DeleteResponder(cd.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.CustomDomainsDeleteFuture", "Result", cd.Response.Response, "Failure responding to request") + } + } + return +} + +// CustomRule defines the common attributes for a custom rule that can be included in a waf policy +type CustomRule struct { + // Name - Defines the name of the custom rule + Name *string `json:"name,omitempty"` + // EnabledState - Describes if the custom rule is in enabled or disabled state. Defaults to Enabled if not specified. Possible values include: 'CustomRuleEnabledStateDisabled', 'CustomRuleEnabledStateEnabled' + EnabledState CustomRuleEnabledState `json:"enabledState,omitempty"` + // Priority - Defines in what order this rule be evaluated in the overall list of custom rules + Priority *int32 `json:"priority,omitempty"` + // MatchConditions - List of match conditions. + MatchConditions *[]MatchCondition `json:"matchConditions,omitempty"` + // Action - Describes what action to be applied when rule matches. Possible values include: 'Allow', 'Block', 'Log', 'Redirect' + Action ActionType `json:"action,omitempty"` +} + +// CustomRuleList defines contents of custom rules +type CustomRuleList struct { + // Rules - List of rules + Rules *[]CustomRule `json:"rules,omitempty"` +} + +// DeepCreatedOrigin the main origin of CDN content which is added when creating a CDN endpoint. +type DeepCreatedOrigin struct { + // Name - Origin name which must be unique within the endpoint. + Name *string `json:"name,omitempty"` + *DeepCreatedOriginProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for DeepCreatedOrigin. +func (dco DeepCreatedOrigin) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dco.Name != nil { + objectMap["name"] = dco.Name + } + if dco.DeepCreatedOriginProperties != nil { + objectMap["properties"] = dco.DeepCreatedOriginProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DeepCreatedOrigin struct. +func (dco *DeepCreatedOrigin) 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 + } + dco.Name = &name + } + case "properties": + if v != nil { + var deepCreatedOriginProperties DeepCreatedOriginProperties + err = json.Unmarshal(*v, &deepCreatedOriginProperties) + if err != nil { + return err + } + dco.DeepCreatedOriginProperties = &deepCreatedOriginProperties + } + } + } + + return nil +} + +// DeepCreatedOriginGroup the origin group for CDN content which is added when creating a CDN endpoint. +// Traffic is sent to the origins within the origin group based on origin health. +type DeepCreatedOriginGroup struct { + // Name - Origin group name which must be unique within the endpoint. + Name *string `json:"name,omitempty"` + *DeepCreatedOriginGroupProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for DeepCreatedOriginGroup. +func (dcog DeepCreatedOriginGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dcog.Name != nil { + objectMap["name"] = dcog.Name + } + if dcog.DeepCreatedOriginGroupProperties != nil { + objectMap["properties"] = dcog.DeepCreatedOriginGroupProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DeepCreatedOriginGroup struct. +func (dcog *DeepCreatedOriginGroup) 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 + } + dcog.Name = &name + } + case "properties": + if v != nil { + var deepCreatedOriginGroupProperties DeepCreatedOriginGroupProperties + err = json.Unmarshal(*v, &deepCreatedOriginGroupProperties) + if err != nil { + return err + } + dcog.DeepCreatedOriginGroupProperties = &deepCreatedOriginGroupProperties + } + } + } + + return nil +} + +// DeepCreatedOriginGroupProperties properties of the origin group created on the CDN endpoint. +type DeepCreatedOriginGroupProperties struct { + // HealthProbeSettings - Health probe settings to the origin that is used to determine the health of the origin. + HealthProbeSettings *HealthProbeParameters `json:"healthProbeSettings,omitempty"` + // Origins - The source of the content being delivered via CDN within given origin group. + Origins *[]ResourceReference `json:"origins,omitempty"` + // TrafficRestorationTimeToHealedOrNewEndpointsInMinutes - Time in minutes to shift the traffic to the endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is added. Default is 10 mins. This property is currently not supported. + TrafficRestorationTimeToHealedOrNewEndpointsInMinutes *int32 `json:"trafficRestorationTimeToHealedOrNewEndpointsInMinutes,omitempty"` + // ResponseBasedOriginErrorDetectionSettings - The JSON object that contains the properties to determine origin health using real requests/responses.This property is currently not supported. + ResponseBasedOriginErrorDetectionSettings *ResponseBasedOriginErrorDetectionParameters `json:"responseBasedOriginErrorDetectionSettings,omitempty"` +} + +// DeepCreatedOriginProperties properties of the origin created on the CDN endpoint. +type DeepCreatedOriginProperties struct { + // HostName - The address of the origin. It can be a domain name, IPv4 address, or IPv6 address. This should be unique across all origins in an endpoint. + HostName *string `json:"hostName,omitempty"` + // HTTPPort - The value of the HTTP port. Must be between 1 and 65535. + HTTPPort *int32 `json:"httpPort,omitempty"` + // HTTPSPort - The value of the HTTPS port. Must be between 1 and 65535. + HTTPSPort *int32 `json:"httpsPort,omitempty"` + // OriginHostHeader - The host header value sent to the origin with each request. If you leave this blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud Services require this host header value to match the origin hostname by default. + OriginHostHeader *string `json:"originHostHeader,omitempty"` + // Priority - Priority of origin in given origin group for load balancing. Higher priorities will not be used for load balancing if any lower priority origin is healthy.Must be between 1 and 5. + Priority *int32 `json:"priority,omitempty"` + // Weight - Weight of the origin in given origin group for load balancing. Must be between 1 and 1000 + Weight *int32 `json:"weight,omitempty"` + // Enabled - Origin is enabled for load balancing or not. By default, origin is always enabled. + Enabled *bool `json:"enabled,omitempty"` +} + +// DeliveryRule a rule that specifies a set of actions and conditions +type DeliveryRule struct { + // Name - Name of the rule + Name *string `json:"name,omitempty"` + // Order - The order in which the rules are applied for the endpoint. Possible values {0,1,2,3,………}. A rule with a lesser order will be applied before a rule with a greater order. Rule with order 0 is a special rule. It does not require any condition and actions listed in it will always be applied. + Order *int32 `json:"order,omitempty"` + // Conditions - A list of conditions that must be matched for the actions to be executed + Conditions *[]BasicDeliveryRuleCondition `json:"conditions,omitempty"` + // Actions - A list of actions that are executed when all the conditions of a rule are satisfied. + Actions *[]BasicDeliveryRuleAction `json:"actions,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for DeliveryRule struct. +func (dr *DeliveryRule) 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 + } + dr.Name = &name + } + case "order": + if v != nil { + var order int32 + err = json.Unmarshal(*v, &order) + if err != nil { + return err + } + dr.Order = &order + } + case "conditions": + if v != nil { + conditions, err := unmarshalBasicDeliveryRuleConditionArray(*v) + if err != nil { + return err + } + dr.Conditions = &conditions + } + case "actions": + if v != nil { + actions, err := unmarshalBasicDeliveryRuleActionArray(*v) + if err != nil { + return err + } + dr.Actions = &actions + } + } + } + + return nil +} + +// BasicDeliveryRuleAction an action for the delivery rule. +type BasicDeliveryRuleAction interface { + AsURLRedirectAction() (*URLRedirectAction, bool) + AsURLRewriteAction() (*URLRewriteAction, bool) + AsDeliveryRuleRequestHeaderAction() (*DeliveryRuleRequestHeaderAction, bool) + AsDeliveryRuleResponseHeaderAction() (*DeliveryRuleResponseHeaderAction, bool) + AsDeliveryRuleCacheExpirationAction() (*DeliveryRuleCacheExpirationAction, bool) + AsDeliveryRuleCacheKeyQueryStringAction() (*DeliveryRuleCacheKeyQueryStringAction, bool) + AsDeliveryRuleAction() (*DeliveryRuleAction, bool) +} + +// DeliveryRuleAction an action for the delivery rule. +type DeliveryRuleAction struct { + // Name - Possible values include: 'NameDeliveryRuleAction', 'NameURLRedirect', 'NameURLRewrite', 'NameModifyRequestHeader', 'NameModifyResponseHeader', 'NameCacheExpiration', 'NameCacheKeyQueryString' + Name NameBasicDeliveryRuleAction `json:"name,omitempty"` +} + +func unmarshalBasicDeliveryRuleAction(body []byte) (BasicDeliveryRuleAction, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["name"] { + case string(NameURLRedirect): + var ura URLRedirectAction + err := json.Unmarshal(body, &ura) + return ura, err + case string(NameURLRewrite): + var ura URLRewriteAction + err := json.Unmarshal(body, &ura) + return ura, err + case string(NameModifyRequestHeader): + var drrha DeliveryRuleRequestHeaderAction + err := json.Unmarshal(body, &drrha) + return drrha, err + case string(NameModifyResponseHeader): + var drrha DeliveryRuleResponseHeaderAction + err := json.Unmarshal(body, &drrha) + return drrha, err + case string(NameCacheExpiration): + var drcea DeliveryRuleCacheExpirationAction + err := json.Unmarshal(body, &drcea) + return drcea, err + case string(NameCacheKeyQueryString): + var drckqsa DeliveryRuleCacheKeyQueryStringAction + err := json.Unmarshal(body, &drckqsa) + return drckqsa, err + default: + var dra DeliveryRuleAction + err := json.Unmarshal(body, &dra) + return dra, err + } +} +func unmarshalBasicDeliveryRuleActionArray(body []byte) ([]BasicDeliveryRuleAction, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + draArray := make([]BasicDeliveryRuleAction, len(rawMessages)) + + for index, rawMessage := range rawMessages { + dra, err := unmarshalBasicDeliveryRuleAction(*rawMessage) + if err != nil { + return nil, err + } + draArray[index] = dra + } + return draArray, nil +} + +// MarshalJSON is the custom marshaler for DeliveryRuleAction. +func (dra DeliveryRuleAction) MarshalJSON() ([]byte, error) { + dra.Name = NameDeliveryRuleAction + objectMap := make(map[string]interface{}) + if dra.Name != "" { + objectMap["name"] = dra.Name + } + return json.Marshal(objectMap) +} + +// AsURLRedirectAction is the BasicDeliveryRuleAction implementation for DeliveryRuleAction. +func (dra DeliveryRuleAction) AsURLRedirectAction() (*URLRedirectAction, bool) { + return nil, false +} + +// AsURLRewriteAction is the BasicDeliveryRuleAction implementation for DeliveryRuleAction. +func (dra DeliveryRuleAction) AsURLRewriteAction() (*URLRewriteAction, bool) { + return nil, false +} + +// AsDeliveryRuleRequestHeaderAction is the BasicDeliveryRuleAction implementation for DeliveryRuleAction. +func (dra DeliveryRuleAction) AsDeliveryRuleRequestHeaderAction() (*DeliveryRuleRequestHeaderAction, bool) { + return nil, false +} + +// AsDeliveryRuleResponseHeaderAction is the BasicDeliveryRuleAction implementation for DeliveryRuleAction. +func (dra DeliveryRuleAction) AsDeliveryRuleResponseHeaderAction() (*DeliveryRuleResponseHeaderAction, bool) { + return nil, false +} + +// AsDeliveryRuleCacheExpirationAction is the BasicDeliveryRuleAction implementation for DeliveryRuleAction. +func (dra DeliveryRuleAction) AsDeliveryRuleCacheExpirationAction() (*DeliveryRuleCacheExpirationAction, bool) { + return nil, false +} + +// AsDeliveryRuleCacheKeyQueryStringAction is the BasicDeliveryRuleAction implementation for DeliveryRuleAction. +func (dra DeliveryRuleAction) AsDeliveryRuleCacheKeyQueryStringAction() (*DeliveryRuleCacheKeyQueryStringAction, bool) { + return nil, false +} + +// AsDeliveryRuleAction is the BasicDeliveryRuleAction implementation for DeliveryRuleAction. +func (dra DeliveryRuleAction) AsDeliveryRuleAction() (*DeliveryRuleAction, bool) { + return &dra, true +} + +// AsBasicDeliveryRuleAction is the BasicDeliveryRuleAction implementation for DeliveryRuleAction. +func (dra DeliveryRuleAction) AsBasicDeliveryRuleAction() (BasicDeliveryRuleAction, bool) { + return &dra, true +} + +// DeliveryRuleCacheExpirationAction defines the cache expiration action for the delivery rule. +type DeliveryRuleCacheExpirationAction struct { + // Parameters - Defines the parameters for the action. + Parameters *CacheExpirationActionParameters `json:"parameters,omitempty"` + // Name - Possible values include: 'NameDeliveryRuleAction', 'NameURLRedirect', 'NameURLRewrite', 'NameModifyRequestHeader', 'NameModifyResponseHeader', 'NameCacheExpiration', 'NameCacheKeyQueryString' + Name NameBasicDeliveryRuleAction `json:"name,omitempty"` +} + +// MarshalJSON is the custom marshaler for DeliveryRuleCacheExpirationAction. +func (drcea DeliveryRuleCacheExpirationAction) MarshalJSON() ([]byte, error) { + drcea.Name = NameCacheExpiration + objectMap := make(map[string]interface{}) + if drcea.Parameters != nil { + objectMap["parameters"] = drcea.Parameters + } + if drcea.Name != "" { + objectMap["name"] = drcea.Name + } + return json.Marshal(objectMap) +} + +// AsURLRedirectAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheExpirationAction. +func (drcea DeliveryRuleCacheExpirationAction) AsURLRedirectAction() (*URLRedirectAction, bool) { + return nil, false +} + +// AsURLRewriteAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheExpirationAction. +func (drcea DeliveryRuleCacheExpirationAction) AsURLRewriteAction() (*URLRewriteAction, bool) { + return nil, false +} + +// AsDeliveryRuleRequestHeaderAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheExpirationAction. +func (drcea DeliveryRuleCacheExpirationAction) AsDeliveryRuleRequestHeaderAction() (*DeliveryRuleRequestHeaderAction, bool) { + return nil, false +} + +// AsDeliveryRuleResponseHeaderAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheExpirationAction. +func (drcea DeliveryRuleCacheExpirationAction) AsDeliveryRuleResponseHeaderAction() (*DeliveryRuleResponseHeaderAction, bool) { + return nil, false +} + +// AsDeliveryRuleCacheExpirationAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheExpirationAction. +func (drcea DeliveryRuleCacheExpirationAction) AsDeliveryRuleCacheExpirationAction() (*DeliveryRuleCacheExpirationAction, bool) { + return &drcea, true +} + +// AsDeliveryRuleCacheKeyQueryStringAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheExpirationAction. +func (drcea DeliveryRuleCacheExpirationAction) AsDeliveryRuleCacheKeyQueryStringAction() (*DeliveryRuleCacheKeyQueryStringAction, bool) { + return nil, false +} + +// AsDeliveryRuleAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheExpirationAction. +func (drcea DeliveryRuleCacheExpirationAction) AsDeliveryRuleAction() (*DeliveryRuleAction, bool) { + return nil, false +} + +// AsBasicDeliveryRuleAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheExpirationAction. +func (drcea DeliveryRuleCacheExpirationAction) AsBasicDeliveryRuleAction() (BasicDeliveryRuleAction, bool) { + return &drcea, true +} + +// DeliveryRuleCacheKeyQueryStringAction defines the cache-key query string action for the delivery rule. +type DeliveryRuleCacheKeyQueryStringAction struct { + // Parameters - Defines the parameters for the action. + Parameters *CacheKeyQueryStringActionParameters `json:"parameters,omitempty"` + // Name - Possible values include: 'NameDeliveryRuleAction', 'NameURLRedirect', 'NameURLRewrite', 'NameModifyRequestHeader', 'NameModifyResponseHeader', 'NameCacheExpiration', 'NameCacheKeyQueryString' + Name NameBasicDeliveryRuleAction `json:"name,omitempty"` +} + +// MarshalJSON is the custom marshaler for DeliveryRuleCacheKeyQueryStringAction. +func (drckqsa DeliveryRuleCacheKeyQueryStringAction) MarshalJSON() ([]byte, error) { + drckqsa.Name = NameCacheKeyQueryString + objectMap := make(map[string]interface{}) + if drckqsa.Parameters != nil { + objectMap["parameters"] = drckqsa.Parameters + } + if drckqsa.Name != "" { + objectMap["name"] = drckqsa.Name + } + return json.Marshal(objectMap) +} + +// AsURLRedirectAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheKeyQueryStringAction. +func (drckqsa DeliveryRuleCacheKeyQueryStringAction) AsURLRedirectAction() (*URLRedirectAction, bool) { + return nil, false +} + +// AsURLRewriteAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheKeyQueryStringAction. +func (drckqsa DeliveryRuleCacheKeyQueryStringAction) AsURLRewriteAction() (*URLRewriteAction, bool) { + return nil, false +} + +// AsDeliveryRuleRequestHeaderAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheKeyQueryStringAction. +func (drckqsa DeliveryRuleCacheKeyQueryStringAction) AsDeliveryRuleRequestHeaderAction() (*DeliveryRuleRequestHeaderAction, bool) { + return nil, false +} + +// AsDeliveryRuleResponseHeaderAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheKeyQueryStringAction. +func (drckqsa DeliveryRuleCacheKeyQueryStringAction) AsDeliveryRuleResponseHeaderAction() (*DeliveryRuleResponseHeaderAction, bool) { + return nil, false +} + +// AsDeliveryRuleCacheExpirationAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheKeyQueryStringAction. +func (drckqsa DeliveryRuleCacheKeyQueryStringAction) AsDeliveryRuleCacheExpirationAction() (*DeliveryRuleCacheExpirationAction, bool) { + return nil, false +} + +// AsDeliveryRuleCacheKeyQueryStringAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheKeyQueryStringAction. +func (drckqsa DeliveryRuleCacheKeyQueryStringAction) AsDeliveryRuleCacheKeyQueryStringAction() (*DeliveryRuleCacheKeyQueryStringAction, bool) { + return &drckqsa, true +} + +// AsDeliveryRuleAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheKeyQueryStringAction. +func (drckqsa DeliveryRuleCacheKeyQueryStringAction) AsDeliveryRuleAction() (*DeliveryRuleAction, bool) { + return nil, false +} + +// AsBasicDeliveryRuleAction is the BasicDeliveryRuleAction implementation for DeliveryRuleCacheKeyQueryStringAction. +func (drckqsa DeliveryRuleCacheKeyQueryStringAction) AsBasicDeliveryRuleAction() (BasicDeliveryRuleAction, bool) { + return &drckqsa, true +} + +// BasicDeliveryRuleCondition a condition for the delivery rule. +type BasicDeliveryRuleCondition interface { + AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) + AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) + AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) + AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) + AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) + AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) + AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) + AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) + AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) + AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) + AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) + AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) + AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) + AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) + AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) +} + +// DeliveryRuleCondition a condition for the delivery rule. +type DeliveryRuleCondition struct { + // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' + Name Name `json:"name,omitempty"` +} + +func unmarshalBasicDeliveryRuleCondition(body []byte) (BasicDeliveryRuleCondition, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["name"] { + case string(NameRemoteAddress): + var drrac DeliveryRuleRemoteAddressCondition + err := json.Unmarshal(body, &drrac) + return drrac, err + case string(NameRequestMethod): + var drrmc DeliveryRuleRequestMethodCondition + err := json.Unmarshal(body, &drrmc) + return drrmc, err + case string(NameQueryString): + var drqsc DeliveryRuleQueryStringCondition + err := json.Unmarshal(body, &drqsc) + return drqsc, err + case string(NamePostArgs): + var drpac DeliveryRulePostArgsCondition + err := json.Unmarshal(body, &drpac) + return drpac, err + case string(NameRequestURI): + var drruc DeliveryRuleRequestURICondition + err := json.Unmarshal(body, &drruc) + return drruc, err + case string(NameRequestHeader): + var drrhc DeliveryRuleRequestHeaderCondition + err := json.Unmarshal(body, &drrhc) + return drrhc, err + case string(NameRequestBody): + var drrbc DeliveryRuleRequestBodyCondition + err := json.Unmarshal(body, &drrbc) + return drrbc, err + case string(NameRequestScheme): + var drrsc DeliveryRuleRequestSchemeCondition + err := json.Unmarshal(body, &drrsc) + return drrsc, err + case string(NameURLPath): + var drupc DeliveryRuleURLPathCondition + err := json.Unmarshal(body, &drupc) + return drupc, err + case string(NameURLFileExtension): + var drufec DeliveryRuleURLFileExtensionCondition + err := json.Unmarshal(body, &drufec) + return drufec, err + case string(NameURLFileName): + var drufnc DeliveryRuleURLFileNameCondition + err := json.Unmarshal(body, &drufnc) + return drufnc, err + case string(NameHTTPVersion): + var drhvc DeliveryRuleHTTPVersionCondition + err := json.Unmarshal(body, &drhvc) + return drhvc, err + case string(NameCookies): + var drcc DeliveryRuleCookiesCondition + err := json.Unmarshal(body, &drcc) + return drcc, err + case string(NameIsDevice): + var dridc DeliveryRuleIsDeviceCondition + err := json.Unmarshal(body, &dridc) + return dridc, err + default: + var drc DeliveryRuleCondition + err := json.Unmarshal(body, &drc) + return drc, err + } +} +func unmarshalBasicDeliveryRuleConditionArray(body []byte) ([]BasicDeliveryRuleCondition, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + drcArray := make([]BasicDeliveryRuleCondition, len(rawMessages)) + + for index, rawMessage := range rawMessages { + drc, err := unmarshalBasicDeliveryRuleCondition(*rawMessage) + if err != nil { + return nil, err + } + drcArray[index] = drc + } + return drcArray, nil +} + +// MarshalJSON is the custom marshaler for DeliveryRuleCondition. +func (drc DeliveryRuleCondition) MarshalJSON() ([]byte, error) { + drc.Name = NameDeliveryRuleCondition + objectMap := make(map[string]interface{}) + if drc.Name != "" { + objectMap["name"] = drc.Name + } + return json.Marshal(objectMap) +} + +// AsDeliveryRuleRemoteAddressCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. +func (drc DeliveryRuleCondition) AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestMethodCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. +func (drc DeliveryRuleCondition) AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) { + return nil, false +} + +// AsDeliveryRuleQueryStringCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. +func (drc DeliveryRuleCondition) AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) { + return nil, false +} + +// AsDeliveryRulePostArgsCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. +func (drc DeliveryRuleCondition) AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestURICondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. +func (drc DeliveryRuleCondition) AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestHeaderCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. +func (drc DeliveryRuleCondition) AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestBodyCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. +func (drc DeliveryRuleCondition) AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestSchemeCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. +func (drc DeliveryRuleCondition) AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) { + return nil, false +} + +// AsDeliveryRuleURLPathCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. +func (drc DeliveryRuleCondition) AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) { + return nil, false +} + +// AsDeliveryRuleURLFileExtensionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. +func (drc DeliveryRuleCondition) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) { + return nil, false +} + +// AsDeliveryRuleURLFileNameCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. +func (drc DeliveryRuleCondition) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) { + return nil, false +} + +// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. +func (drc DeliveryRuleCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { + return nil, false +} + +// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. +func (drc DeliveryRuleCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { + return nil, false +} + +// AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. +func (drc DeliveryRuleCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { + return nil, false +} + +// AsDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. +func (drc DeliveryRuleCondition) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) { + return &drc, true +} + +// AsBasicDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCondition. +func (drc DeliveryRuleCondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRuleCondition, bool) { + return &drc, true +} + +// DeliveryRuleCookiesCondition defines the Cookies condition for the delivery rule. +type DeliveryRuleCookiesCondition struct { + // Parameters - Defines the parameters for the condition. + Parameters *CookiesMatchConditionParameters `json:"parameters,omitempty"` + // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' + Name Name `json:"name,omitempty"` +} + +// MarshalJSON is the custom marshaler for DeliveryRuleCookiesCondition. +func (drcc DeliveryRuleCookiesCondition) MarshalJSON() ([]byte, error) { + drcc.Name = NameCookies + objectMap := make(map[string]interface{}) + if drcc.Parameters != nil { + objectMap["parameters"] = drcc.Parameters + } + if drcc.Name != "" { + objectMap["name"] = drcc.Name + } + return json.Marshal(objectMap) +} + +// AsDeliveryRuleRemoteAddressCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. +func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestMethodCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. +func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) { + return nil, false +} + +// AsDeliveryRuleQueryStringCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. +func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) { + return nil, false +} + +// AsDeliveryRulePostArgsCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. +func (drcc DeliveryRuleCookiesCondition) AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestURICondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. +func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestHeaderCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. +func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestBodyCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. +func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestSchemeCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. +func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) { + return nil, false +} + +// AsDeliveryRuleURLPathCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. +func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) { + return nil, false +} + +// AsDeliveryRuleURLFileExtensionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. +func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) { + return nil, false +} + +// AsDeliveryRuleURLFileNameCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. +func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) { + return nil, false +} + +// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. +func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { + return nil, false +} + +// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. +func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { + return &drcc, true +} + +// AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. +func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { + return nil, false +} + +// AsDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. +func (drcc DeliveryRuleCookiesCondition) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) { + return nil, false +} + +// AsBasicDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleCookiesCondition. +func (drcc DeliveryRuleCookiesCondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRuleCondition, bool) { + return &drcc, true +} + +// DeliveryRuleHTTPVersionCondition defines the HttpVersion condition for the delivery rule. +type DeliveryRuleHTTPVersionCondition struct { + // Parameters - Defines the parameters for the condition. + Parameters *HTTPVersionMatchConditionParameters `json:"parameters,omitempty"` + // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' + Name Name `json:"name,omitempty"` +} + +// MarshalJSON is the custom marshaler for DeliveryRuleHTTPVersionCondition. +func (drhvc DeliveryRuleHTTPVersionCondition) MarshalJSON() ([]byte, error) { + drhvc.Name = NameHTTPVersion + objectMap := make(map[string]interface{}) + if drhvc.Parameters != nil { + objectMap["parameters"] = drhvc.Parameters + } + if drhvc.Name != "" { + objectMap["name"] = drhvc.Name + } + return json.Marshal(objectMap) +} + +// AsDeliveryRuleRemoteAddressCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. +func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestMethodCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. +func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) { + return nil, false +} + +// AsDeliveryRuleQueryStringCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. +func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) { + return nil, false +} + +// AsDeliveryRulePostArgsCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. +func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestURICondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. +func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestHeaderCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. +func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestBodyCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. +func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestSchemeCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. +func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) { + return nil, false +} + +// AsDeliveryRuleURLPathCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. +func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) { + return nil, false +} + +// AsDeliveryRuleURLFileExtensionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. +func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) { + return nil, false +} + +// AsDeliveryRuleURLFileNameCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. +func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) { + return nil, false +} + +// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. +func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { + return &drhvc, true +} + +// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. +func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { + return nil, false +} + +// AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. +func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { + return nil, false +} + +// AsDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. +func (drhvc DeliveryRuleHTTPVersionCondition) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) { + return nil, false +} + +// AsBasicDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleHTTPVersionCondition. +func (drhvc DeliveryRuleHTTPVersionCondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRuleCondition, bool) { + return &drhvc, true +} + +// DeliveryRuleIsDeviceCondition defines the IsDevice condition for the delivery rule. +type DeliveryRuleIsDeviceCondition struct { + // Parameters - Defines the parameters for the condition. + Parameters *IsDeviceMatchConditionParameters `json:"parameters,omitempty"` + // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' + Name Name `json:"name,omitempty"` +} + +// MarshalJSON is the custom marshaler for DeliveryRuleIsDeviceCondition. +func (dridc DeliveryRuleIsDeviceCondition) MarshalJSON() ([]byte, error) { + dridc.Name = NameIsDevice + objectMap := make(map[string]interface{}) + if dridc.Parameters != nil { + objectMap["parameters"] = dridc.Parameters + } + if dridc.Name != "" { + objectMap["name"] = dridc.Name + } + return json.Marshal(objectMap) +} + +// AsDeliveryRuleRemoteAddressCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. +func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestMethodCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. +func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) { + return nil, false +} + +// AsDeliveryRuleQueryStringCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. +func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) { + return nil, false +} + +// AsDeliveryRulePostArgsCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. +func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestURICondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. +func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestHeaderCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. +func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestBodyCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. +func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestSchemeCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. +func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) { + return nil, false +} + +// AsDeliveryRuleURLPathCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. +func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) { + return nil, false +} + +// AsDeliveryRuleURLFileExtensionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. +func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) { + return nil, false +} + +// AsDeliveryRuleURLFileNameCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. +func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) { + return nil, false +} + +// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. +func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { + return nil, false +} + +// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. +func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { + return nil, false +} + +// AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. +func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { + return &dridc, true +} + +// AsDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. +func (dridc DeliveryRuleIsDeviceCondition) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) { + return nil, false +} + +// AsBasicDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleIsDeviceCondition. +func (dridc DeliveryRuleIsDeviceCondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRuleCondition, bool) { + return &dridc, true +} + +// DeliveryRulePostArgsCondition defines the PostArgs condition for the delivery rule. +type DeliveryRulePostArgsCondition struct { + // Parameters - Defines the parameters for the condition. + Parameters *PostArgsMatchConditionParameters `json:"parameters,omitempty"` + // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' + Name Name `json:"name,omitempty"` +} + +// MarshalJSON is the custom marshaler for DeliveryRulePostArgsCondition. +func (drpac DeliveryRulePostArgsCondition) MarshalJSON() ([]byte, error) { + drpac.Name = NamePostArgs + objectMap := make(map[string]interface{}) + if drpac.Parameters != nil { + objectMap["parameters"] = drpac.Parameters + } + if drpac.Name != "" { + objectMap["name"] = drpac.Name + } + return json.Marshal(objectMap) +} + +// AsDeliveryRuleRemoteAddressCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. +func (drpac DeliveryRulePostArgsCondition) AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestMethodCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. +func (drpac DeliveryRulePostArgsCondition) AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) { + return nil, false +} + +// AsDeliveryRuleQueryStringCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. +func (drpac DeliveryRulePostArgsCondition) AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) { + return nil, false +} + +// AsDeliveryRulePostArgsCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. +func (drpac DeliveryRulePostArgsCondition) AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) { + return &drpac, true +} + +// AsDeliveryRuleRequestURICondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. +func (drpac DeliveryRulePostArgsCondition) AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestHeaderCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. +func (drpac DeliveryRulePostArgsCondition) AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestBodyCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. +func (drpac DeliveryRulePostArgsCondition) AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestSchemeCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. +func (drpac DeliveryRulePostArgsCondition) AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) { + return nil, false +} + +// AsDeliveryRuleURLPathCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. +func (drpac DeliveryRulePostArgsCondition) AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) { + return nil, false +} + +// AsDeliveryRuleURLFileExtensionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. +func (drpac DeliveryRulePostArgsCondition) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) { + return nil, false +} + +// AsDeliveryRuleURLFileNameCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. +func (drpac DeliveryRulePostArgsCondition) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) { + return nil, false +} + +// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. +func (drpac DeliveryRulePostArgsCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { + return nil, false +} + +// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. +func (drpac DeliveryRulePostArgsCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { + return nil, false +} + +// AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. +func (drpac DeliveryRulePostArgsCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { + return nil, false +} + +// AsDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. +func (drpac DeliveryRulePostArgsCondition) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) { + return nil, false +} + +// AsBasicDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRulePostArgsCondition. +func (drpac DeliveryRulePostArgsCondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRuleCondition, bool) { + return &drpac, true +} + +// DeliveryRuleQueryStringCondition defines the QueryString condition for the delivery rule. +type DeliveryRuleQueryStringCondition struct { + // Parameters - Defines the parameters for the condition. + Parameters *QueryStringMatchConditionParameters `json:"parameters,omitempty"` + // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' + Name Name `json:"name,omitempty"` +} + +// MarshalJSON is the custom marshaler for DeliveryRuleQueryStringCondition. +func (drqsc DeliveryRuleQueryStringCondition) MarshalJSON() ([]byte, error) { + drqsc.Name = NameQueryString + objectMap := make(map[string]interface{}) + if drqsc.Parameters != nil { + objectMap["parameters"] = drqsc.Parameters + } + if drqsc.Name != "" { + objectMap["name"] = drqsc.Name + } + return json.Marshal(objectMap) +} + +// AsDeliveryRuleRemoteAddressCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. +func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestMethodCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. +func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) { + return nil, false +} + +// AsDeliveryRuleQueryStringCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. +func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) { + return &drqsc, true +} + +// AsDeliveryRulePostArgsCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. +func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestURICondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. +func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestHeaderCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. +func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestBodyCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. +func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestSchemeCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. +func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) { + return nil, false +} + +// AsDeliveryRuleURLPathCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. +func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) { + return nil, false +} + +// AsDeliveryRuleURLFileExtensionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. +func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) { + return nil, false +} + +// AsDeliveryRuleURLFileNameCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. +func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) { + return nil, false +} + +// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. +func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { + return nil, false +} + +// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. +func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { + return nil, false +} + +// AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. +func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { + return nil, false +} + +// AsDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. +func (drqsc DeliveryRuleQueryStringCondition) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) { + return nil, false +} + +// AsBasicDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleQueryStringCondition. +func (drqsc DeliveryRuleQueryStringCondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRuleCondition, bool) { + return &drqsc, true +} + +// DeliveryRuleRemoteAddressCondition defines the RemoteAddress condition for the delivery rule. +type DeliveryRuleRemoteAddressCondition struct { + // Parameters - Defines the parameters for the condition. + Parameters *RemoteAddressMatchConditionParameters `json:"parameters,omitempty"` + // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' + Name Name `json:"name,omitempty"` +} + +// MarshalJSON is the custom marshaler for DeliveryRuleRemoteAddressCondition. +func (drrac DeliveryRuleRemoteAddressCondition) MarshalJSON() ([]byte, error) { + drrac.Name = NameRemoteAddress + objectMap := make(map[string]interface{}) + if drrac.Parameters != nil { + objectMap["parameters"] = drrac.Parameters + } + if drrac.Name != "" { + objectMap["name"] = drrac.Name + } + return json.Marshal(objectMap) +} + +// AsDeliveryRuleRemoteAddressCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. +func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) { + return &drrac, true +} + +// AsDeliveryRuleRequestMethodCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. +func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) { + return nil, false +} + +// AsDeliveryRuleQueryStringCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. +func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) { + return nil, false +} + +// AsDeliveryRulePostArgsCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. +func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestURICondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. +func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestHeaderCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. +func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestBodyCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. +func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestSchemeCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. +func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) { + return nil, false +} + +// AsDeliveryRuleURLPathCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. +func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) { + return nil, false +} + +// AsDeliveryRuleURLFileExtensionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. +func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) { + return nil, false +} + +// AsDeliveryRuleURLFileNameCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. +func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) { + return nil, false +} + +// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. +func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { + return nil, false +} + +// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. +func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { + return nil, false +} + +// AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. +func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { + return nil, false +} + +// AsDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. +func (drrac DeliveryRuleRemoteAddressCondition) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) { + return nil, false +} + +// AsBasicDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRemoteAddressCondition. +func (drrac DeliveryRuleRemoteAddressCondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRuleCondition, bool) { + return &drrac, true +} + +// DeliveryRuleRequestBodyCondition defines the RequestBody condition for the delivery rule. +type DeliveryRuleRequestBodyCondition struct { + // Parameters - Defines the parameters for the condition. + Parameters *RequestBodyMatchConditionParameters `json:"parameters,omitempty"` + // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' + Name Name `json:"name,omitempty"` +} + +// MarshalJSON is the custom marshaler for DeliveryRuleRequestBodyCondition. +func (drrbc DeliveryRuleRequestBodyCondition) MarshalJSON() ([]byte, error) { + drrbc.Name = NameRequestBody + objectMap := make(map[string]interface{}) + if drrbc.Parameters != nil { + objectMap["parameters"] = drrbc.Parameters + } + if drrbc.Name != "" { + objectMap["name"] = drrbc.Name + } + return json.Marshal(objectMap) +} + +// AsDeliveryRuleRemoteAddressCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. +func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestMethodCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. +func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) { + return nil, false +} + +// AsDeliveryRuleQueryStringCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. +func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) { + return nil, false +} + +// AsDeliveryRulePostArgsCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. +func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestURICondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. +func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestHeaderCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. +func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestBodyCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. +func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) { + return &drrbc, true +} + +// AsDeliveryRuleRequestSchemeCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. +func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) { + return nil, false +} + +// AsDeliveryRuleURLPathCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. +func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) { + return nil, false +} + +// AsDeliveryRuleURLFileExtensionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. +func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) { + return nil, false +} + +// AsDeliveryRuleURLFileNameCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. +func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) { + return nil, false +} + +// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. +func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { + return nil, false +} + +// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. +func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { + return nil, false +} + +// AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. +func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { + return nil, false +} + +// AsDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. +func (drrbc DeliveryRuleRequestBodyCondition) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) { + return nil, false +} + +// AsBasicDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestBodyCondition. +func (drrbc DeliveryRuleRequestBodyCondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRuleCondition, bool) { + return &drrbc, true +} + +// DeliveryRuleRequestHeaderAction defines the request header action for the delivery rule. +type DeliveryRuleRequestHeaderAction struct { + // Parameters - Defines the parameters for the action. + Parameters *HeaderActionParameters `json:"parameters,omitempty"` + // Name - Possible values include: 'NameDeliveryRuleAction', 'NameURLRedirect', 'NameURLRewrite', 'NameModifyRequestHeader', 'NameModifyResponseHeader', 'NameCacheExpiration', 'NameCacheKeyQueryString' + Name NameBasicDeliveryRuleAction `json:"name,omitempty"` +} + +// MarshalJSON is the custom marshaler for DeliveryRuleRequestHeaderAction. +func (drrha DeliveryRuleRequestHeaderAction) MarshalJSON() ([]byte, error) { + drrha.Name = NameModifyRequestHeader + objectMap := make(map[string]interface{}) + if drrha.Parameters != nil { + objectMap["parameters"] = drrha.Parameters + } + if drrha.Name != "" { + objectMap["name"] = drrha.Name + } + return json.Marshal(objectMap) +} + +// AsURLRedirectAction is the BasicDeliveryRuleAction implementation for DeliveryRuleRequestHeaderAction. +func (drrha DeliveryRuleRequestHeaderAction) AsURLRedirectAction() (*URLRedirectAction, bool) { + return nil, false +} + +// AsURLRewriteAction is the BasicDeliveryRuleAction implementation for DeliveryRuleRequestHeaderAction. +func (drrha DeliveryRuleRequestHeaderAction) AsURLRewriteAction() (*URLRewriteAction, bool) { + return nil, false +} + +// AsDeliveryRuleRequestHeaderAction is the BasicDeliveryRuleAction implementation for DeliveryRuleRequestHeaderAction. +func (drrha DeliveryRuleRequestHeaderAction) AsDeliveryRuleRequestHeaderAction() (*DeliveryRuleRequestHeaderAction, bool) { + return &drrha, true +} + +// AsDeliveryRuleResponseHeaderAction is the BasicDeliveryRuleAction implementation for DeliveryRuleRequestHeaderAction. +func (drrha DeliveryRuleRequestHeaderAction) AsDeliveryRuleResponseHeaderAction() (*DeliveryRuleResponseHeaderAction, bool) { + return nil, false +} + +// AsDeliveryRuleCacheExpirationAction is the BasicDeliveryRuleAction implementation for DeliveryRuleRequestHeaderAction. +func (drrha DeliveryRuleRequestHeaderAction) AsDeliveryRuleCacheExpirationAction() (*DeliveryRuleCacheExpirationAction, bool) { + return nil, false +} + +// AsDeliveryRuleCacheKeyQueryStringAction is the BasicDeliveryRuleAction implementation for DeliveryRuleRequestHeaderAction. +func (drrha DeliveryRuleRequestHeaderAction) AsDeliveryRuleCacheKeyQueryStringAction() (*DeliveryRuleCacheKeyQueryStringAction, bool) { + return nil, false +} + +// AsDeliveryRuleAction is the BasicDeliveryRuleAction implementation for DeliveryRuleRequestHeaderAction. +func (drrha DeliveryRuleRequestHeaderAction) AsDeliveryRuleAction() (*DeliveryRuleAction, bool) { + return nil, false +} + +// AsBasicDeliveryRuleAction is the BasicDeliveryRuleAction implementation for DeliveryRuleRequestHeaderAction. +func (drrha DeliveryRuleRequestHeaderAction) AsBasicDeliveryRuleAction() (BasicDeliveryRuleAction, bool) { + return &drrha, true +} + +// DeliveryRuleRequestHeaderCondition defines the RequestHeader condition for the delivery rule. +type DeliveryRuleRequestHeaderCondition struct { + // Parameters - Defines the parameters for the condition. + Parameters *RequestHeaderMatchConditionParameters `json:"parameters,omitempty"` + // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' + Name Name `json:"name,omitempty"` +} + +// MarshalJSON is the custom marshaler for DeliveryRuleRequestHeaderCondition. +func (drrhc DeliveryRuleRequestHeaderCondition) MarshalJSON() ([]byte, error) { + drrhc.Name = NameRequestHeader + objectMap := make(map[string]interface{}) + if drrhc.Parameters != nil { + objectMap["parameters"] = drrhc.Parameters + } + if drrhc.Name != "" { + objectMap["name"] = drrhc.Name + } + return json.Marshal(objectMap) +} + +// AsDeliveryRuleRemoteAddressCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. +func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestMethodCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. +func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) { + return nil, false +} + +// AsDeliveryRuleQueryStringCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. +func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) { + return nil, false +} + +// AsDeliveryRulePostArgsCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. +func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestURICondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. +func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestHeaderCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. +func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) { + return &drrhc, true +} + +// AsDeliveryRuleRequestBodyCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. +func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestSchemeCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. +func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) { + return nil, false +} + +// AsDeliveryRuleURLPathCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. +func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) { + return nil, false +} + +// AsDeliveryRuleURLFileExtensionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. +func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) { + return nil, false +} + +// AsDeliveryRuleURLFileNameCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. +func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) { + return nil, false +} + +// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. +func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { + return nil, false +} + +// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. +func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { + return nil, false +} + +// AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. +func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { + return nil, false +} + +// AsDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. +func (drrhc DeliveryRuleRequestHeaderCondition) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) { + return nil, false +} + +// AsBasicDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestHeaderCondition. +func (drrhc DeliveryRuleRequestHeaderCondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRuleCondition, bool) { + return &drrhc, true +} + +// DeliveryRuleRequestMethodCondition defines the RequestMethod condition for the delivery rule. +type DeliveryRuleRequestMethodCondition struct { + // Parameters - Defines the parameters for the condition. + Parameters *RequestMethodMatchConditionParameters `json:"parameters,omitempty"` + // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' + Name Name `json:"name,omitempty"` +} + +// MarshalJSON is the custom marshaler for DeliveryRuleRequestMethodCondition. +func (drrmc DeliveryRuleRequestMethodCondition) MarshalJSON() ([]byte, error) { + drrmc.Name = NameRequestMethod + objectMap := make(map[string]interface{}) + if drrmc.Parameters != nil { + objectMap["parameters"] = drrmc.Parameters + } + if drrmc.Name != "" { + objectMap["name"] = drrmc.Name + } + return json.Marshal(objectMap) +} + +// AsDeliveryRuleRemoteAddressCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. +func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestMethodCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. +func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) { + return &drrmc, true +} + +// AsDeliveryRuleQueryStringCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. +func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) { + return nil, false +} + +// AsDeliveryRulePostArgsCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. +func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestURICondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. +func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestHeaderCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. +func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestBodyCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. +func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestSchemeCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. +func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) { + return nil, false +} + +// AsDeliveryRuleURLPathCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. +func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) { + return nil, false +} + +// AsDeliveryRuleURLFileExtensionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. +func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) { + return nil, false +} + +// AsDeliveryRuleURLFileNameCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. +func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) { + return nil, false +} + +// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. +func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { + return nil, false +} + +// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. +func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { + return nil, false +} + +// AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. +func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { + return nil, false +} + +// AsDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. +func (drrmc DeliveryRuleRequestMethodCondition) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) { + return nil, false +} + +// AsBasicDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestMethodCondition. +func (drrmc DeliveryRuleRequestMethodCondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRuleCondition, bool) { + return &drrmc, true +} + +// DeliveryRuleRequestSchemeCondition defines the RequestScheme condition for the delivery rule. +type DeliveryRuleRequestSchemeCondition struct { + // Parameters - Defines the parameters for the condition. + Parameters *RequestSchemeMatchConditionParameters `json:"parameters,omitempty"` + // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' + Name Name `json:"name,omitempty"` +} + +// MarshalJSON is the custom marshaler for DeliveryRuleRequestSchemeCondition. +func (drrsc DeliveryRuleRequestSchemeCondition) MarshalJSON() ([]byte, error) { + drrsc.Name = NameRequestScheme + objectMap := make(map[string]interface{}) + if drrsc.Parameters != nil { + objectMap["parameters"] = drrsc.Parameters + } + if drrsc.Name != "" { + objectMap["name"] = drrsc.Name + } + return json.Marshal(objectMap) +} + +// AsDeliveryRuleRemoteAddressCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. +func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestMethodCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. +func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) { + return nil, false +} + +// AsDeliveryRuleQueryStringCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. +func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) { + return nil, false +} + +// AsDeliveryRulePostArgsCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. +func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestURICondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. +func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestHeaderCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. +func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestBodyCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. +func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestSchemeCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. +func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) { + return &drrsc, true +} + +// AsDeliveryRuleURLPathCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. +func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) { + return nil, false +} + +// AsDeliveryRuleURLFileExtensionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. +func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) { + return nil, false +} + +// AsDeliveryRuleURLFileNameCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. +func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) { + return nil, false +} + +// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. +func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { + return nil, false +} + +// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. +func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { + return nil, false +} + +// AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. +func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { + return nil, false +} + +// AsDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. +func (drrsc DeliveryRuleRequestSchemeCondition) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) { + return nil, false +} + +// AsBasicDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestSchemeCondition. +func (drrsc DeliveryRuleRequestSchemeCondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRuleCondition, bool) { + return &drrsc, true +} + +// DeliveryRuleRequestURICondition defines the RequestUri condition for the delivery rule. +type DeliveryRuleRequestURICondition struct { + // Parameters - Defines the parameters for the condition. + Parameters *RequestURIMatchConditionParameters `json:"parameters,omitempty"` + // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' + Name Name `json:"name,omitempty"` +} + +// MarshalJSON is the custom marshaler for DeliveryRuleRequestURICondition. +func (drruc DeliveryRuleRequestURICondition) MarshalJSON() ([]byte, error) { + drruc.Name = NameRequestURI + objectMap := make(map[string]interface{}) + if drruc.Parameters != nil { + objectMap["parameters"] = drruc.Parameters + } + if drruc.Name != "" { + objectMap["name"] = drruc.Name + } + return json.Marshal(objectMap) +} + +// AsDeliveryRuleRemoteAddressCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. +func (drruc DeliveryRuleRequestURICondition) AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestMethodCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. +func (drruc DeliveryRuleRequestURICondition) AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) { + return nil, false +} + +// AsDeliveryRuleQueryStringCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. +func (drruc DeliveryRuleRequestURICondition) AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) { + return nil, false +} + +// AsDeliveryRulePostArgsCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. +func (drruc DeliveryRuleRequestURICondition) AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestURICondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. +func (drruc DeliveryRuleRequestURICondition) AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) { + return &drruc, true +} + +// AsDeliveryRuleRequestHeaderCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. +func (drruc DeliveryRuleRequestURICondition) AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestBodyCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. +func (drruc DeliveryRuleRequestURICondition) AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestSchemeCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. +func (drruc DeliveryRuleRequestURICondition) AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) { + return nil, false +} + +// AsDeliveryRuleURLPathCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. +func (drruc DeliveryRuleRequestURICondition) AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) { + return nil, false +} + +// AsDeliveryRuleURLFileExtensionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. +func (drruc DeliveryRuleRequestURICondition) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) { + return nil, false +} + +// AsDeliveryRuleURLFileNameCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. +func (drruc DeliveryRuleRequestURICondition) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) { + return nil, false +} + +// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. +func (drruc DeliveryRuleRequestURICondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { + return nil, false +} + +// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. +func (drruc DeliveryRuleRequestURICondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { + return nil, false +} + +// AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. +func (drruc DeliveryRuleRequestURICondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { + return nil, false +} + +// AsDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. +func (drruc DeliveryRuleRequestURICondition) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) { + return nil, false +} + +// AsBasicDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleRequestURICondition. +func (drruc DeliveryRuleRequestURICondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRuleCondition, bool) { + return &drruc, true +} + +// DeliveryRuleResponseHeaderAction defines the response header action for the delivery rule. +type DeliveryRuleResponseHeaderAction struct { + // Parameters - Defines the parameters for the action. + Parameters *HeaderActionParameters `json:"parameters,omitempty"` + // Name - Possible values include: 'NameDeliveryRuleAction', 'NameURLRedirect', 'NameURLRewrite', 'NameModifyRequestHeader', 'NameModifyResponseHeader', 'NameCacheExpiration', 'NameCacheKeyQueryString' + Name NameBasicDeliveryRuleAction `json:"name,omitempty"` +} + +// MarshalJSON is the custom marshaler for DeliveryRuleResponseHeaderAction. +func (drrha DeliveryRuleResponseHeaderAction) MarshalJSON() ([]byte, error) { + drrha.Name = NameModifyResponseHeader + objectMap := make(map[string]interface{}) + if drrha.Parameters != nil { + objectMap["parameters"] = drrha.Parameters + } + if drrha.Name != "" { + objectMap["name"] = drrha.Name + } + return json.Marshal(objectMap) +} + +// AsURLRedirectAction is the BasicDeliveryRuleAction implementation for DeliveryRuleResponseHeaderAction. +func (drrha DeliveryRuleResponseHeaderAction) AsURLRedirectAction() (*URLRedirectAction, bool) { + return nil, false +} + +// AsURLRewriteAction is the BasicDeliveryRuleAction implementation for DeliveryRuleResponseHeaderAction. +func (drrha DeliveryRuleResponseHeaderAction) AsURLRewriteAction() (*URLRewriteAction, bool) { + return nil, false +} + +// AsDeliveryRuleRequestHeaderAction is the BasicDeliveryRuleAction implementation for DeliveryRuleResponseHeaderAction. +func (drrha DeliveryRuleResponseHeaderAction) AsDeliveryRuleRequestHeaderAction() (*DeliveryRuleRequestHeaderAction, bool) { + return nil, false +} + +// AsDeliveryRuleResponseHeaderAction is the BasicDeliveryRuleAction implementation for DeliveryRuleResponseHeaderAction. +func (drrha DeliveryRuleResponseHeaderAction) AsDeliveryRuleResponseHeaderAction() (*DeliveryRuleResponseHeaderAction, bool) { + return &drrha, true +} + +// AsDeliveryRuleCacheExpirationAction is the BasicDeliveryRuleAction implementation for DeliveryRuleResponseHeaderAction. +func (drrha DeliveryRuleResponseHeaderAction) AsDeliveryRuleCacheExpirationAction() (*DeliveryRuleCacheExpirationAction, bool) { + return nil, false +} + +// AsDeliveryRuleCacheKeyQueryStringAction is the BasicDeliveryRuleAction implementation for DeliveryRuleResponseHeaderAction. +func (drrha DeliveryRuleResponseHeaderAction) AsDeliveryRuleCacheKeyQueryStringAction() (*DeliveryRuleCacheKeyQueryStringAction, bool) { + return nil, false +} + +// AsDeliveryRuleAction is the BasicDeliveryRuleAction implementation for DeliveryRuleResponseHeaderAction. +func (drrha DeliveryRuleResponseHeaderAction) AsDeliveryRuleAction() (*DeliveryRuleAction, bool) { + return nil, false +} + +// AsBasicDeliveryRuleAction is the BasicDeliveryRuleAction implementation for DeliveryRuleResponseHeaderAction. +func (drrha DeliveryRuleResponseHeaderAction) AsBasicDeliveryRuleAction() (BasicDeliveryRuleAction, bool) { + return &drrha, true +} + +// DeliveryRuleURLFileExtensionCondition defines the UrlFileExtension condition for the delivery rule. +type DeliveryRuleURLFileExtensionCondition struct { + // Parameters - Defines the parameters for the condition. + Parameters *URLFileExtensionMatchConditionParameters `json:"parameters,omitempty"` + // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' + Name Name `json:"name,omitempty"` +} + +// MarshalJSON is the custom marshaler for DeliveryRuleURLFileExtensionCondition. +func (drufec DeliveryRuleURLFileExtensionCondition) MarshalJSON() ([]byte, error) { + drufec.Name = NameURLFileExtension + objectMap := make(map[string]interface{}) + if drufec.Parameters != nil { + objectMap["parameters"] = drufec.Parameters + } + if drufec.Name != "" { + objectMap["name"] = drufec.Name + } + return json.Marshal(objectMap) +} + +// AsDeliveryRuleRemoteAddressCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. +func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestMethodCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. +func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) { + return nil, false +} + +// AsDeliveryRuleQueryStringCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. +func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) { + return nil, false +} + +// AsDeliveryRulePostArgsCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. +func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestURICondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. +func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestHeaderCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. +func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestBodyCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. +func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestSchemeCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. +func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) { + return nil, false +} + +// AsDeliveryRuleURLPathCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. +func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) { + return nil, false +} + +// AsDeliveryRuleURLFileExtensionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. +func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) { + return &drufec, true +} + +// AsDeliveryRuleURLFileNameCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. +func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) { + return nil, false +} + +// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. +func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { + return nil, false +} + +// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. +func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { + return nil, false +} + +// AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. +func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { + return nil, false +} + +// AsDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. +func (drufec DeliveryRuleURLFileExtensionCondition) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) { + return nil, false +} + +// AsBasicDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileExtensionCondition. +func (drufec DeliveryRuleURLFileExtensionCondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRuleCondition, bool) { + return &drufec, true +} + +// DeliveryRuleURLFileNameCondition defines the UrlFileName condition for the delivery rule. +type DeliveryRuleURLFileNameCondition struct { + // Parameters - Defines the parameters for the condition. + Parameters *URLFileNameMatchConditionParameters `json:"parameters,omitempty"` + // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' + Name Name `json:"name,omitempty"` +} + +// MarshalJSON is the custom marshaler for DeliveryRuleURLFileNameCondition. +func (drufnc DeliveryRuleURLFileNameCondition) MarshalJSON() ([]byte, error) { + drufnc.Name = NameURLFileName + objectMap := make(map[string]interface{}) + if drufnc.Parameters != nil { + objectMap["parameters"] = drufnc.Parameters + } + if drufnc.Name != "" { + objectMap["name"] = drufnc.Name + } + return json.Marshal(objectMap) +} + +// AsDeliveryRuleRemoteAddressCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. +func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestMethodCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. +func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) { + return nil, false +} + +// AsDeliveryRuleQueryStringCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. +func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) { + return nil, false +} + +// AsDeliveryRulePostArgsCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. +func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestURICondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. +func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestHeaderCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. +func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestBodyCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. +func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestSchemeCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. +func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) { + return nil, false +} + +// AsDeliveryRuleURLPathCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. +func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) { + return nil, false +} + +// AsDeliveryRuleURLFileExtensionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. +func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) { + return nil, false +} + +// AsDeliveryRuleURLFileNameCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. +func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) { + return &drufnc, true +} + +// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. +func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { + return nil, false +} + +// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. +func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { + return nil, false +} + +// AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. +func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { + return nil, false +} + +// AsDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. +func (drufnc DeliveryRuleURLFileNameCondition) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) { + return nil, false +} + +// AsBasicDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLFileNameCondition. +func (drufnc DeliveryRuleURLFileNameCondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRuleCondition, bool) { + return &drufnc, true +} + +// DeliveryRuleURLPathCondition defines the UrlPath condition for the delivery rule. +type DeliveryRuleURLPathCondition struct { + // Parameters - Defines the parameters for the condition. + Parameters *URLPathMatchConditionParameters `json:"parameters,omitempty"` + // Name - Possible values include: 'NameDeliveryRuleCondition', 'NameRemoteAddress', 'NameRequestMethod', 'NameQueryString', 'NamePostArgs', 'NameRequestURI', 'NameRequestHeader', 'NameRequestBody', 'NameRequestScheme', 'NameURLPath', 'NameURLFileExtension', 'NameURLFileName', 'NameHTTPVersion', 'NameCookies', 'NameIsDevice' + Name Name `json:"name,omitempty"` +} + +// MarshalJSON is the custom marshaler for DeliveryRuleURLPathCondition. +func (drupc DeliveryRuleURLPathCondition) MarshalJSON() ([]byte, error) { + drupc.Name = NameURLPath + objectMap := make(map[string]interface{}) + if drupc.Parameters != nil { + objectMap["parameters"] = drupc.Parameters + } + if drupc.Name != "" { + objectMap["name"] = drupc.Name + } + return json.Marshal(objectMap) +} + +// AsDeliveryRuleRemoteAddressCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. +func (drupc DeliveryRuleURLPathCondition) AsDeliveryRuleRemoteAddressCondition() (*DeliveryRuleRemoteAddressCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestMethodCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. +func (drupc DeliveryRuleURLPathCondition) AsDeliveryRuleRequestMethodCondition() (*DeliveryRuleRequestMethodCondition, bool) { + return nil, false +} + +// AsDeliveryRuleQueryStringCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. +func (drupc DeliveryRuleURLPathCondition) AsDeliveryRuleQueryStringCondition() (*DeliveryRuleQueryStringCondition, bool) { + return nil, false +} + +// AsDeliveryRulePostArgsCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. +func (drupc DeliveryRuleURLPathCondition) AsDeliveryRulePostArgsCondition() (*DeliveryRulePostArgsCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestURICondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. +func (drupc DeliveryRuleURLPathCondition) AsDeliveryRuleRequestURICondition() (*DeliveryRuleRequestURICondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestHeaderCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. +func (drupc DeliveryRuleURLPathCondition) AsDeliveryRuleRequestHeaderCondition() (*DeliveryRuleRequestHeaderCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestBodyCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. +func (drupc DeliveryRuleURLPathCondition) AsDeliveryRuleRequestBodyCondition() (*DeliveryRuleRequestBodyCondition, bool) { + return nil, false +} + +// AsDeliveryRuleRequestSchemeCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. +func (drupc DeliveryRuleURLPathCondition) AsDeliveryRuleRequestSchemeCondition() (*DeliveryRuleRequestSchemeCondition, bool) { + return nil, false +} + +// AsDeliveryRuleURLPathCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. +func (drupc DeliveryRuleURLPathCondition) AsDeliveryRuleURLPathCondition() (*DeliveryRuleURLPathCondition, bool) { + return &drupc, true +} + +// AsDeliveryRuleURLFileExtensionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. +func (drupc DeliveryRuleURLPathCondition) AsDeliveryRuleURLFileExtensionCondition() (*DeliveryRuleURLFileExtensionCondition, bool) { + return nil, false +} + +// AsDeliveryRuleURLFileNameCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. +func (drupc DeliveryRuleURLPathCondition) AsDeliveryRuleURLFileNameCondition() (*DeliveryRuleURLFileNameCondition, bool) { + return nil, false +} + +// AsDeliveryRuleHTTPVersionCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. +func (drupc DeliveryRuleURLPathCondition) AsDeliveryRuleHTTPVersionCondition() (*DeliveryRuleHTTPVersionCondition, bool) { + return nil, false +} + +// AsDeliveryRuleCookiesCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. +func (drupc DeliveryRuleURLPathCondition) AsDeliveryRuleCookiesCondition() (*DeliveryRuleCookiesCondition, bool) { + return nil, false +} + +// AsDeliveryRuleIsDeviceCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. +func (drupc DeliveryRuleURLPathCondition) AsDeliveryRuleIsDeviceCondition() (*DeliveryRuleIsDeviceCondition, bool) { + return nil, false +} + +// AsDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. +func (drupc DeliveryRuleURLPathCondition) AsDeliveryRuleCondition() (*DeliveryRuleCondition, bool) { + return nil, false +} + +// AsBasicDeliveryRuleCondition is the BasicDeliveryRuleCondition implementation for DeliveryRuleURLPathCondition. +func (drupc DeliveryRuleURLPathCondition) AsBasicDeliveryRuleCondition() (BasicDeliveryRuleCondition, bool) { + return &drupc, true +} + +// EdgeNode edgenode is a global Point of Presence (POP) location used to deliver CDN content to end users. +type EdgeNode struct { + *EdgeNodeProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for EdgeNode. +func (en EdgeNode) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if en.EdgeNodeProperties != nil { + objectMap["properties"] = en.EdgeNodeProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for EdgeNode struct. +func (en *EdgeNode) 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 edgeNodeProperties EdgeNodeProperties + err = json.Unmarshal(*v, &edgeNodeProperties) + if err != nil { + return err + } + en.EdgeNodeProperties = &edgeNodeProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + en.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + en.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + en.Type = &typeVar + } + } + } + + return nil +} + +// EdgeNodeProperties the JSON object that contains the properties required to create an edgenode. +type EdgeNodeProperties struct { + // IPAddressGroups - List of ip address groups. + IPAddressGroups *[]IPAddressGroup `json:"ipAddressGroups,omitempty"` +} + +// EdgenodeResult result of the request to list CDN edgenodes. It contains a list of ip address group and a +// URL link to get the next set of results. +type EdgenodeResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; Edge node of CDN service. + Value *[]EdgeNode `json:"value,omitempty"` + // NextLink - URL to get the next set of edgenode list results if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// EdgenodeResultIterator provides access to a complete listing of EdgeNode values. +type EdgenodeResultIterator struct { + i int + page EdgenodeResultPage +} + +// 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 *EdgenodeResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EdgenodeResultIterator.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 *EdgenodeResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter EdgenodeResultIterator) 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 EdgenodeResultIterator) Response() EdgenodeResult { + 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 EdgenodeResultIterator) Value() EdgeNode { + if !iter.page.NotDone() { + return EdgeNode{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the EdgenodeResultIterator type. +func NewEdgenodeResultIterator(page EdgenodeResultPage) EdgenodeResultIterator { + return EdgenodeResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (er EdgenodeResult) IsEmpty() bool { + return er.Value == nil || len(*er.Value) == 0 +} + +// edgenodeResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (er EdgenodeResult) edgenodeResultPreparer(ctx context.Context) (*http.Request, error) { + if er.NextLink == nil || len(to.String(er.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(er.NextLink))) +} + +// EdgenodeResultPage contains a page of EdgeNode values. +type EdgenodeResultPage struct { + fn func(context.Context, EdgenodeResult) (EdgenodeResult, error) + er EdgenodeResult +} + +// 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 *EdgenodeResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EdgenodeResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.er) + if err != nil { + return err + } + page.er = next + 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 *EdgenodeResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page EdgenodeResultPage) NotDone() bool { + return !page.er.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page EdgenodeResultPage) Response() EdgenodeResult { + return page.er +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page EdgenodeResultPage) Values() []EdgeNode { + if page.er.IsEmpty() { + return nil + } + return *page.er.Value +} + +// Creates a new instance of the EdgenodeResultPage type. +func NewEdgenodeResultPage(getNextPage func(context.Context, EdgenodeResult) (EdgenodeResult, error)) EdgenodeResultPage { + return EdgenodeResultPage{fn: getNextPage} +} + +// Endpoint CDN endpoint is the entity within a CDN profile containing configuration information such as +// origin, protocol, content caching and delivery behavior. The CDN endpoint uses the URL format +// .azureedge.net. +type Endpoint struct { + autorest.Response `json:"-"` + *EndpointProperties `json:"properties,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Endpoint. +func (e Endpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if e.EndpointProperties != nil { + objectMap["properties"] = e.EndpointProperties + } + if e.Location != nil { + objectMap["location"] = e.Location + } + if e.Tags != nil { + objectMap["tags"] = e.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Endpoint struct. +func (e *Endpoint) 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 endpointProperties EndpointProperties + err = json.Unmarshal(*v, &endpointProperties) + if err != nil { + return err + } + e.EndpointProperties = &endpointProperties + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + e.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + e.Tags = tags + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + e.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + e.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + e.Type = &typeVar + } + } + } + + return nil +} + +// EndpointListResult result of the request to list endpoints. It contains a list of endpoint objects and a +// URL link to get the next set of results. +type EndpointListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of CDN endpoints within a profile + Value *[]Endpoint `json:"value,omitempty"` + // NextLink - URL to get the next set of endpoint objects if there is any. + NextLink *string `json:"nextLink,omitempty"` +} + +// EndpointListResultIterator provides access to a complete listing of Endpoint values. +type EndpointListResultIterator struct { + i int + page EndpointListResultPage +} + +// 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 *EndpointListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EndpointListResultIterator.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 *EndpointListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter EndpointListResultIterator) 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 EndpointListResultIterator) Response() EndpointListResult { + 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 EndpointListResultIterator) Value() Endpoint { + if !iter.page.NotDone() { + return Endpoint{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the EndpointListResultIterator type. +func NewEndpointListResultIterator(page EndpointListResultPage) EndpointListResultIterator { + return EndpointListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (elr EndpointListResult) IsEmpty() bool { + return elr.Value == nil || len(*elr.Value) == 0 +} + +// endpointListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (elr EndpointListResult) endpointListResultPreparer(ctx context.Context) (*http.Request, error) { + if elr.NextLink == nil || len(to.String(elr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(elr.NextLink))) +} + +// EndpointListResultPage contains a page of Endpoint values. +type EndpointListResultPage struct { + fn func(context.Context, EndpointListResult) (EndpointListResult, error) + elr EndpointListResult +} + +// 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 *EndpointListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EndpointListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.elr) + if err != nil { + return err + } + page.elr = next + 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 *EndpointListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page EndpointListResultPage) NotDone() bool { + return !page.elr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page EndpointListResultPage) Response() EndpointListResult { + return page.elr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page EndpointListResultPage) Values() []Endpoint { + if page.elr.IsEmpty() { + return nil + } + return *page.elr.Value +} + +// Creates a new instance of the EndpointListResultPage type. +func NewEndpointListResultPage(getNextPage func(context.Context, EndpointListResult) (EndpointListResult, error)) EndpointListResultPage { + return EndpointListResultPage{fn: getNextPage} +} + +// EndpointProperties the JSON object that contains the properties required to create an endpoint. +type EndpointProperties struct { + // HostName - READ-ONLY; The host name of the endpoint structured as {endpointName}.{DNSZone}, e.g. contoso.azureedge.net + HostName *string `json:"hostName,omitempty"` + // Origins - The source of the content being delivered via CDN. + Origins *[]DeepCreatedOrigin `json:"origins,omitempty"` + // OriginGroups - The origin groups comprising of origins that are used for load balancing the traffic based on availability. + OriginGroups *[]DeepCreatedOriginGroup `json:"originGroups,omitempty"` + // ResourceState - READ-ONLY; Resource status of the endpoint. Possible values include: 'EndpointResourceStateCreating', 'EndpointResourceStateDeleting', 'EndpointResourceStateRunning', 'EndpointResourceStateStarting', 'EndpointResourceStateStopped', 'EndpointResourceStateStopping' + ResourceState EndpointResourceState `json:"resourceState,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning status of the endpoint. + ProvisioningState *string `json:"provisioningState,omitempty"` + // OriginPath - A directory path on the origin that CDN can use to retrieve content from, e.g. contoso.cloudapp.net/originpath. + OriginPath *string `json:"originPath,omitempty"` + // ContentTypesToCompress - List of content types on which compression applies. The value should be a valid MIME type. + ContentTypesToCompress *[]string `json:"contentTypesToCompress,omitempty"` + // OriginHostHeader - The host header value sent to the origin with each request. This property at Endpoint is only allowed when endpoint uses single origin and can be overridden by the same property specified at origin.If you leave this blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud Services require this host header value to match the origin hostname by default. + OriginHostHeader *string `json:"originHostHeader,omitempty"` + // IsCompressionEnabled - Indicates whether content compression is enabled on CDN. Default value is false. If compression is enabled, content will be served as compressed if user requests for a compressed version. Content won't be compressed on CDN when requested content is smaller than 1 byte or larger than 1 MB. + IsCompressionEnabled *bool `json:"isCompressionEnabled,omitempty"` + // IsHTTPAllowed - Indicates whether HTTP traffic is allowed on the endpoint. Default value is true. At least one protocol (HTTP or HTTPS) must be allowed. + IsHTTPAllowed *bool `json:"isHttpAllowed,omitempty"` + // IsHTTPSAllowed - Indicates whether HTTPS traffic is allowed on the endpoint. Default value is true. At least one protocol (HTTP or HTTPS) must be allowed. + IsHTTPSAllowed *bool `json:"isHttpsAllowed,omitempty"` + // QueryStringCachingBehavior - Defines how CDN caches requests that include query strings. You can ignore any query strings when caching, bypass caching to prevent requests that contain query strings from being cached, or cache every request with a unique URL. Possible values include: 'QueryStringCachingBehaviorIgnoreQueryString', 'QueryStringCachingBehaviorBypassCaching', 'QueryStringCachingBehaviorUseQueryString', 'QueryStringCachingBehaviorNotSet' + QueryStringCachingBehavior QueryStringCachingBehavior `json:"queryStringCachingBehavior,omitempty"` + // OptimizationType - Specifies what scenario the customer wants this CDN endpoint to optimize for, e.g. Download, Media services. With this information, CDN can apply scenario driven optimization. Possible values include: 'GeneralWebDelivery', 'GeneralMediaStreaming', 'VideoOnDemandMediaStreaming', 'LargeFileDownload', 'DynamicSiteAcceleration' + OptimizationType OptimizationType `json:"optimizationType,omitempty"` + // ProbePath - Path to a file hosted on the origin which helps accelerate delivery of the dynamic content and calculate the most optimal routes for the CDN. This is relative to the origin path. This property is only relevant when using a single origin. + ProbePath *string `json:"probePath,omitempty"` + // GeoFilters - List of rules defining the user's geo access within a CDN endpoint. Each geo filter defines an access rule to a specified path or content, e.g. block APAC for path /pictures/ + GeoFilters *[]GeoFilter `json:"geoFilters,omitempty"` + // DefaultOriginGroup - A reference to the origin group. + DefaultOriginGroup *ResourceReference `json:"defaultOriginGroup,omitempty"` + // URLSigningKeys - List of keys used to validate the signed URL hashes. + URLSigningKeys *URLSigningKey `json:"urlSigningKeys,omitempty"` + // DeliveryPolicy - A policy that specifies the delivery rules to be used for an endpoint. + DeliveryPolicy *EndpointPropertiesUpdateParametersDeliveryPolicy `json:"deliveryPolicy,omitempty"` + // WebApplicationFirewallPolicyLink - Defines the Web Application Firewall policy for the endpoint (if applicable) + WebApplicationFirewallPolicyLink *EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink `json:"webApplicationFirewallPolicyLink,omitempty"` +} + +// EndpointPropertiesUpdateParameters the JSON object containing endpoint update parameters. +type EndpointPropertiesUpdateParameters struct { + // OriginPath - A directory path on the origin that CDN can use to retrieve content from, e.g. contoso.cloudapp.net/originpath. + OriginPath *string `json:"originPath,omitempty"` + // ContentTypesToCompress - List of content types on which compression applies. The value should be a valid MIME type. + ContentTypesToCompress *[]string `json:"contentTypesToCompress,omitempty"` + // OriginHostHeader - The host header value sent to the origin with each request. This property at Endpoint is only allowed when endpoint uses single origin and can be overridden by the same property specified at origin.If you leave this blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud Services require this host header value to match the origin hostname by default. + OriginHostHeader *string `json:"originHostHeader,omitempty"` + // IsCompressionEnabled - Indicates whether content compression is enabled on CDN. Default value is false. If compression is enabled, content will be served as compressed if user requests for a compressed version. Content won't be compressed on CDN when requested content is smaller than 1 byte or larger than 1 MB. + IsCompressionEnabled *bool `json:"isCompressionEnabled,omitempty"` + // IsHTTPAllowed - Indicates whether HTTP traffic is allowed on the endpoint. Default value is true. At least one protocol (HTTP or HTTPS) must be allowed. + IsHTTPAllowed *bool `json:"isHttpAllowed,omitempty"` + // IsHTTPSAllowed - Indicates whether HTTPS traffic is allowed on the endpoint. Default value is true. At least one protocol (HTTP or HTTPS) must be allowed. + IsHTTPSAllowed *bool `json:"isHttpsAllowed,omitempty"` + // QueryStringCachingBehavior - Defines how CDN caches requests that include query strings. You can ignore any query strings when caching, bypass caching to prevent requests that contain query strings from being cached, or cache every request with a unique URL. Possible values include: 'QueryStringCachingBehaviorIgnoreQueryString', 'QueryStringCachingBehaviorBypassCaching', 'QueryStringCachingBehaviorUseQueryString', 'QueryStringCachingBehaviorNotSet' + QueryStringCachingBehavior QueryStringCachingBehavior `json:"queryStringCachingBehavior,omitempty"` + // OptimizationType - Specifies what scenario the customer wants this CDN endpoint to optimize for, e.g. Download, Media services. With this information, CDN can apply scenario driven optimization. Possible values include: 'GeneralWebDelivery', 'GeneralMediaStreaming', 'VideoOnDemandMediaStreaming', 'LargeFileDownload', 'DynamicSiteAcceleration' + OptimizationType OptimizationType `json:"optimizationType,omitempty"` + // ProbePath - Path to a file hosted on the origin which helps accelerate delivery of the dynamic content and calculate the most optimal routes for the CDN. This is relative to the origin path. This property is only relevant when using a single origin. + ProbePath *string `json:"probePath,omitempty"` + // GeoFilters - List of rules defining the user's geo access within a CDN endpoint. Each geo filter defines an access rule to a specified path or content, e.g. block APAC for path /pictures/ + GeoFilters *[]GeoFilter `json:"geoFilters,omitempty"` + // DefaultOriginGroup - A reference to the origin group. + DefaultOriginGroup *ResourceReference `json:"defaultOriginGroup,omitempty"` + // URLSigningKeys - List of keys used to validate the signed URL hashes. + URLSigningKeys *URLSigningKey `json:"urlSigningKeys,omitempty"` + // DeliveryPolicy - A policy that specifies the delivery rules to be used for an endpoint. + DeliveryPolicy *EndpointPropertiesUpdateParametersDeliveryPolicy `json:"deliveryPolicy,omitempty"` + // WebApplicationFirewallPolicyLink - Defines the Web Application Firewall policy for the endpoint (if applicable) + WebApplicationFirewallPolicyLink *EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink `json:"webApplicationFirewallPolicyLink,omitempty"` +} + +// EndpointPropertiesUpdateParametersDeliveryPolicy a policy that specifies the delivery rules to be used +// for an endpoint. +type EndpointPropertiesUpdateParametersDeliveryPolicy struct { + // Description - User-friendly description of the policy. + Description *string `json:"description,omitempty"` + // Rules - A list of the delivery rules. + Rules *[]DeliveryRule `json:"rules,omitempty"` +} + +// EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink defines the Web Application Firewall +// policy for the endpoint (if applicable) +type EndpointPropertiesUpdateParametersWebApplicationFirewallPolicyLink struct { + // ID - Resource ID. + ID *string `json:"id,omitempty"` +} + +// EndpointsCreateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type EndpointsCreateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *EndpointsCreateFuture) Result(client EndpointsClient) (e Endpoint, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("cdn.EndpointsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if e.Response.Response, err = future.GetResult(sender); err == nil && e.Response.Response.StatusCode != http.StatusNoContent { + e, err = client.CreateResponder(e.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsCreateFuture", "Result", e.Response.Response, "Failure responding to request") + } + } + return +} + +// EndpointsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type EndpointsDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *EndpointsDeleteFuture) Result(client EndpointsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("cdn.EndpointsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// EndpointsLoadContentFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type EndpointsLoadContentFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *EndpointsLoadContentFuture) Result(client EndpointsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsLoadContentFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("cdn.EndpointsLoadContentFuture") + return + } + ar.Response = future.Response() + return +} + +// EndpointsPurgeContentFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type EndpointsPurgeContentFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *EndpointsPurgeContentFuture) Result(client EndpointsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsPurgeContentFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("cdn.EndpointsPurgeContentFuture") + return + } + ar.Response = future.Response() + return +} + +// EndpointsStartFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type EndpointsStartFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *EndpointsStartFuture) Result(client EndpointsClient) (e Endpoint, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsStartFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("cdn.EndpointsStartFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if e.Response.Response, err = future.GetResult(sender); err == nil && e.Response.Response.StatusCode != http.StatusNoContent { + e, err = client.StartResponder(e.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsStartFuture", "Result", e.Response.Response, "Failure responding to request") + } + } + return +} + +// EndpointsStopFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type EndpointsStopFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *EndpointsStopFuture) Result(client EndpointsClient) (e Endpoint, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsStopFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("cdn.EndpointsStopFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if e.Response.Response, err = future.GetResult(sender); err == nil && e.Response.Response.StatusCode != http.StatusNoContent { + e, err = client.StopResponder(e.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsStopFuture", "Result", e.Response.Response, "Failure responding to request") + } + } + return +} + +// EndpointsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type EndpointsUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *EndpointsUpdateFuture) Result(client EndpointsClient) (e Endpoint, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("cdn.EndpointsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if e.Response.Response, err = future.GetResult(sender); err == nil && e.Response.Response.StatusCode != http.StatusNoContent { + e, err = client.UpdateResponder(e.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.EndpointsUpdateFuture", "Result", e.Response.Response, "Failure responding to request") + } + } + return +} + +// EndpointType defines the ARM Resource ID for the linked endpoints +type EndpointType struct { + // ID - ARM Resource ID string. + ID *string `json:"id,omitempty"` +} + +// EndpointUpdateParameters properties required to create or update an endpoint. +type EndpointUpdateParameters struct { + // Tags - Endpoint tags. + Tags map[string]*string `json:"tags"` + *EndpointPropertiesUpdateParameters `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for EndpointUpdateParameters. +func (eup EndpointUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if eup.Tags != nil { + objectMap["tags"] = eup.Tags + } + if eup.EndpointPropertiesUpdateParameters != nil { + objectMap["properties"] = eup.EndpointPropertiesUpdateParameters + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for EndpointUpdateParameters struct. +func (eup *EndpointUpdateParameters) 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 + } + eup.Tags = tags + } + case "properties": + if v != nil { + var endpointPropertiesUpdateParameters EndpointPropertiesUpdateParameters + err = json.Unmarshal(*v, &endpointPropertiesUpdateParameters) + if err != nil { + return err + } + eup.EndpointPropertiesUpdateParameters = &endpointPropertiesUpdateParameters + } + } + } + + return nil +} + +// ErrorResponse error response indicates CDN service is not able to process the incoming request. The +// reason is provided in the error message. +type ErrorResponse struct { + // Code - READ-ONLY; Error code. + Code *string `json:"code,omitempty"` + // Message - READ-ONLY; Error message indicating why the operation failed. + Message *string `json:"message,omitempty"` +} + +// GeoFilter rules defining user's geo access within a CDN endpoint. +type GeoFilter struct { + // RelativePath - Relative path applicable to geo filter. (e.g. '/mypictures', '/mypicture/kitty.jpg', and etc.) + RelativePath *string `json:"relativePath,omitempty"` + // Action - Action of the geo filter, i.e. allow or block access. Possible values include: 'GeoFilterActionsBlock', 'GeoFilterActionsAllow' + Action GeoFilterActions `json:"action,omitempty"` + // CountryCodes - Two letter country codes defining user country access in a geo filter, e.g. AU, MX, US. + CountryCodes *[]string `json:"countryCodes,omitempty"` +} + +// HeaderActionParameters defines the parameters for the request header action. +type HeaderActionParameters struct { + OdataType *string `json:"@odata.type,omitempty"` + // HeaderAction - Action to perform. Possible values include: 'Append', 'Overwrite', 'Delete' + HeaderAction HeaderAction `json:"headerAction,omitempty"` + // HeaderName - Name of the header to modify + HeaderName *string `json:"headerName,omitempty"` + // Value - Value for the specified action + Value *string `json:"value,omitempty"` +} + +// HealthProbeParameters the JSON object that contains the properties to send health probes to origin. +type HealthProbeParameters struct { + // ProbePath - The path relative to the origin that is used to determine the health of the origin. + ProbePath *string `json:"probePath,omitempty"` + // ProbeRequestType - The type of health probe request that is made. Possible values include: 'NotSet', 'GET', 'HEAD' + ProbeRequestType HealthProbeRequestType `json:"probeRequestType,omitempty"` + // ProbeProtocol - Protocol to use for health probe. Possible values include: 'ProbeProtocolNotSet', 'ProbeProtocolHTTP', 'ProbeProtocolHTTPS' + ProbeProtocol ProbeProtocol `json:"probeProtocol,omitempty"` + // ProbeIntervalInSeconds - The number of seconds between health probes.Default is 240sec. + ProbeIntervalInSeconds *int32 `json:"probeIntervalInSeconds,omitempty"` +} + +// HTTPErrorRangeParameters the JSON object that represents the range for http status codes +type HTTPErrorRangeParameters struct { + // Begin - The inclusive start of the http status code range. + Begin *int32 `json:"begin,omitempty"` + // End - The inclusive end of the http status code range. + End *int32 `json:"end,omitempty"` +} + +// HTTPVersionMatchConditionParameters defines the parameters for HttpVersion match conditions +type HTTPVersionMatchConditionParameters struct { + OdataType *string `json:"@odata.type,omitempty"` + // Operator - Describes operator to be matched + Operator *string `json:"operator,omitempty"` + // NegateCondition - Describes if this is negate condition or not + NegateCondition *bool `json:"negateCondition,omitempty"` + // MatchValues - The match value for the condition of the delivery rule + MatchValues *[]string `json:"matchValues,omitempty"` +} + +// IPAddressGroup CDN Ip address group +type IPAddressGroup struct { + // DeliveryRegion - The delivery region of the ip address group + DeliveryRegion *string `json:"deliveryRegion,omitempty"` + // Ipv4Addresses - The list of ip v4 addresses. + Ipv4Addresses *[]CidrIPAddress `json:"ipv4Addresses,omitempty"` + // Ipv6Addresses - The list of ip v6 addresses. + Ipv6Addresses *[]CidrIPAddress `json:"ipv6Addresses,omitempty"` +} + +// IsDeviceMatchConditionParameters defines the parameters for IsDevice match conditions +type IsDeviceMatchConditionParameters struct { + OdataType *string `json:"@odata.type,omitempty"` + // Operator - Describes operator to be matched + Operator *string `json:"operator,omitempty"` + // NegateCondition - Describes if this is negate condition or not + NegateCondition *bool `json:"negateCondition,omitempty"` + // MatchValues - The match value for the condition of the delivery rule + MatchValues *[]string `json:"matchValues,omitempty"` + // Transforms - List of transforms + Transforms *[]Transform `json:"transforms,omitempty"` +} + +// KeyVaultCertificateSourceParameters describes the parameters for using a user's KeyVault certificate for +// securing custom domain. +type KeyVaultCertificateSourceParameters struct { + OdataType *string `json:"@odata.type,omitempty"` + // SubscriptionID - Subscription Id of the user's Key Vault containing the SSL certificate + SubscriptionID *string `json:"subscriptionId,omitempty"` + // ResourceGroupName - Resource group of the user's Key Vault containing the SSL certificate + ResourceGroupName *string `json:"resourceGroupName,omitempty"` + // VaultName - The name of the user's Key Vault containing the SSL certificate + VaultName *string `json:"vaultName,omitempty"` + // SecretName - The name of Key Vault Secret (representing the full certificate PFX) in Key Vault. + SecretName *string `json:"secretName,omitempty"` + // SecretVersion - The version(GUID) of Key Vault Secret in Key Vault. + SecretVersion *string `json:"secretVersion,omitempty"` + // UpdateRule - Describes the action that shall be taken when the certificate is updated in Key Vault. + UpdateRule *string `json:"updateRule,omitempty"` + // DeleteRule - Describes the action that shall be taken when the certificate is removed from Key Vault. + DeleteRule *string `json:"deleteRule,omitempty"` +} + +// KeyVaultSigningKeyParameters describes the parameters for using a user's KeyVault for URL Signing Key. +type KeyVaultSigningKeyParameters struct { + OdataType *string `json:"@odata.type,omitempty"` + // SubscriptionID - Subscription Id of the user's Key Vault containing the secret + SubscriptionID *string `json:"subscriptionId,omitempty"` + // ResourceGroupName - Resource group of the user's Key Vault containing the secret + ResourceGroupName *string `json:"resourceGroupName,omitempty"` + // VaultName - The name of the user's Key Vault containing the secret + VaultName *string `json:"vaultName,omitempty"` + // SecretName - The name of secret in Key Vault. + SecretName *string `json:"secretName,omitempty"` + // SecretVersion - The version(GUID) of secret in Key Vault. + SecretVersion *string `json:"secretVersion,omitempty"` +} + +// LoadParameters parameters required for content load. +type LoadParameters struct { + // ContentPaths - The path to the content to be loaded. Path should be a relative file URL of the origin. + ContentPaths *[]string `json:"contentPaths,omitempty"` +} + +// ManagedHTTPSParameters defines the certificate source parameters using CDN managed certificate for +// enabling SSL. +type ManagedHTTPSParameters struct { + // CertificateSourceParameters - Defines the certificate source parameters using CDN managed certificate for enabling SSL. + CertificateSourceParameters *CertificateSourceParameters `json:"certificateSourceParameters,omitempty"` + // ProtocolType - Defines the TLS extension protocol that is used for secure delivery. Possible values include: 'ServerNameIndication', 'IPBased' + ProtocolType ProtocolType `json:"protocolType,omitempty"` + // MinimumTLSVersion - TLS protocol version that will be used for Https. Possible values include: 'None', 'TLS10', 'TLS12' + MinimumTLSVersion MinimumTLSVersion `json:"minimumTlsVersion,omitempty"` + // CertificateSource - Possible values include: 'CertificateSourceCustomDomainHTTPSParameters', 'CertificateSourceCdn', 'CertificateSourceAzureKeyVault' + CertificateSource CertificateSource `json:"certificateSource,omitempty"` +} + +// MarshalJSON is the custom marshaler for ManagedHTTPSParameters. +func (mhp ManagedHTTPSParameters) MarshalJSON() ([]byte, error) { + mhp.CertificateSource = CertificateSourceCdn + objectMap := make(map[string]interface{}) + if mhp.CertificateSourceParameters != nil { + objectMap["certificateSourceParameters"] = mhp.CertificateSourceParameters + } + if mhp.ProtocolType != "" { + objectMap["protocolType"] = mhp.ProtocolType + } + if mhp.MinimumTLSVersion != "" { + objectMap["minimumTlsVersion"] = mhp.MinimumTLSVersion + } + if mhp.CertificateSource != "" { + objectMap["certificateSource"] = mhp.CertificateSource + } + return json.Marshal(objectMap) +} + +// AsManagedHTTPSParameters is the BasicCustomDomainHTTPSParameters implementation for ManagedHTTPSParameters. +func (mhp ManagedHTTPSParameters) AsManagedHTTPSParameters() (*ManagedHTTPSParameters, bool) { + return &mhp, true +} + +// AsUserManagedHTTPSParameters is the BasicCustomDomainHTTPSParameters implementation for ManagedHTTPSParameters. +func (mhp ManagedHTTPSParameters) AsUserManagedHTTPSParameters() (*UserManagedHTTPSParameters, bool) { + return nil, false +} + +// AsCustomDomainHTTPSParameters is the BasicCustomDomainHTTPSParameters implementation for ManagedHTTPSParameters. +func (mhp ManagedHTTPSParameters) AsCustomDomainHTTPSParameters() (*CustomDomainHTTPSParameters, bool) { + return nil, false +} + +// AsBasicCustomDomainHTTPSParameters is the BasicCustomDomainHTTPSParameters implementation for ManagedHTTPSParameters. +func (mhp ManagedHTTPSParameters) AsBasicCustomDomainHTTPSParameters() (BasicCustomDomainHTTPSParameters, bool) { + return &mhp, true +} + +// ManagedRuleDefinition describes a managed rule definition. +type ManagedRuleDefinition struct { + // RuleID - READ-ONLY; Identifier for the managed rule. + RuleID *string `json:"ruleId,omitempty"` + // Description - READ-ONLY; Describes the functionality of the managed rule. + Description *string `json:"description,omitempty"` +} + +// ManagedRuleGroupDefinition describes a managed rule group. +type ManagedRuleGroupDefinition struct { + // RuleGroupName - READ-ONLY; Name of the managed rule group. + RuleGroupName *string `json:"ruleGroupName,omitempty"` + // Description - READ-ONLY; Description of the managed rule group. + Description *string `json:"description,omitempty"` + // Rules - READ-ONLY; List of rules within the managed rule group. + Rules *[]ManagedRuleDefinition `json:"rules,omitempty"` +} + +// ManagedRuleGroupOverride defines a managed rule group override setting. +type ManagedRuleGroupOverride struct { + // RuleGroupName - Describes the managed rule group within the rule set to override + RuleGroupName *string `json:"ruleGroupName,omitempty"` + // Rules - List of rules that will be disabled. If none specified, all rules in the group will be disabled. + Rules *[]ManagedRuleOverride `json:"rules,omitempty"` +} + +// ManagedRuleOverride defines a managed rule group override setting. +type ManagedRuleOverride struct { + // RuleID - Identifier for the managed rule. + RuleID *string `json:"ruleId,omitempty"` + // EnabledState - Describes if the managed rule is in enabled or disabled state. Defaults to Disabled if not specified. Possible values include: 'ManagedRuleEnabledStateDisabled', 'ManagedRuleEnabledStateEnabled' + EnabledState ManagedRuleEnabledState `json:"enabledState,omitempty"` + // Action - Describes the override action to be applied when rule matches. Possible values include: 'Allow', 'Block', 'Log', 'Redirect' + Action ActionType `json:"action,omitempty"` +} + +// ManagedRuleSet defines a managed rule set. +type ManagedRuleSet struct { + // RuleSetType - Defines the rule set type to use. + RuleSetType *string `json:"ruleSetType,omitempty"` + // RuleSetVersion - Defines the version of the rule set to use. + RuleSetVersion *string `json:"ruleSetVersion,omitempty"` + // AnomalyScore - Verizon only : If the rule set supports anomaly detection mode, this describes the threshold for blocking requests. + AnomalyScore *int32 `json:"anomalyScore,omitempty"` + // RuleGroupOverrides - Defines the rule overrides to apply to the rule set. + RuleGroupOverrides *[]ManagedRuleGroupOverride `json:"ruleGroupOverrides,omitempty"` +} + +// ManagedRuleSetDefinition describes a managed rule set definition. +type ManagedRuleSetDefinition struct { + // ManagedRuleSetDefinitionProperties - Describes managed rule set definition properties. + *ManagedRuleSetDefinitionProperties `json:"properties,omitempty"` + // Sku - The pricing tier (defines a CDN provider, feature list and rate) of the CdnWebApplicationFirewallPolicy. + Sku *Sku `json:"sku,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ManagedRuleSetDefinition. +func (mrsd ManagedRuleSetDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mrsd.ManagedRuleSetDefinitionProperties != nil { + objectMap["properties"] = mrsd.ManagedRuleSetDefinitionProperties + } + if mrsd.Sku != nil { + objectMap["sku"] = mrsd.Sku + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ManagedRuleSetDefinition struct. +func (mrsd *ManagedRuleSetDefinition) 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 managedRuleSetDefinitionProperties ManagedRuleSetDefinitionProperties + err = json.Unmarshal(*v, &managedRuleSetDefinitionProperties) + if err != nil { + return err + } + mrsd.ManagedRuleSetDefinitionProperties = &managedRuleSetDefinitionProperties + } + case "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + mrsd.Sku = &sku + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + mrsd.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mrsd.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mrsd.Type = &typeVar + } + } + } + + return nil +} + +// ManagedRuleSetDefinitionList list of managed rule set definitions available for use in a policy. +type ManagedRuleSetDefinitionList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of managed rule set definitions. + Value *[]ManagedRuleSetDefinition `json:"value,omitempty"` + // NextLink - URL to retrieve next set of managed rule set definitions. + NextLink *string `json:"nextLink,omitempty"` +} + +// ManagedRuleSetDefinitionListIterator provides access to a complete listing of ManagedRuleSetDefinition +// values. +type ManagedRuleSetDefinitionListIterator struct { + i int + page ManagedRuleSetDefinitionListPage +} + +// 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 *ManagedRuleSetDefinitionListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedRuleSetDefinitionListIterator.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 *ManagedRuleSetDefinitionListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ManagedRuleSetDefinitionListIterator) 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 ManagedRuleSetDefinitionListIterator) Response() ManagedRuleSetDefinitionList { + 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 ManagedRuleSetDefinitionListIterator) Value() ManagedRuleSetDefinition { + if !iter.page.NotDone() { + return ManagedRuleSetDefinition{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ManagedRuleSetDefinitionListIterator type. +func NewManagedRuleSetDefinitionListIterator(page ManagedRuleSetDefinitionListPage) ManagedRuleSetDefinitionListIterator { + return ManagedRuleSetDefinitionListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (mrsdl ManagedRuleSetDefinitionList) IsEmpty() bool { + return mrsdl.Value == nil || len(*mrsdl.Value) == 0 +} + +// managedRuleSetDefinitionListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (mrsdl ManagedRuleSetDefinitionList) managedRuleSetDefinitionListPreparer(ctx context.Context) (*http.Request, error) { + if mrsdl.NextLink == nil || len(to.String(mrsdl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(mrsdl.NextLink))) +} + +// ManagedRuleSetDefinitionListPage contains a page of ManagedRuleSetDefinition values. +type ManagedRuleSetDefinitionListPage struct { + fn func(context.Context, ManagedRuleSetDefinitionList) (ManagedRuleSetDefinitionList, error) + mrsdl ManagedRuleSetDefinitionList +} + +// 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 *ManagedRuleSetDefinitionListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagedRuleSetDefinitionListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.mrsdl) + if err != nil { + return err + } + page.mrsdl = next + 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 *ManagedRuleSetDefinitionListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ManagedRuleSetDefinitionListPage) NotDone() bool { + return !page.mrsdl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ManagedRuleSetDefinitionListPage) Response() ManagedRuleSetDefinitionList { + return page.mrsdl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ManagedRuleSetDefinitionListPage) Values() []ManagedRuleSetDefinition { + if page.mrsdl.IsEmpty() { + return nil + } + return *page.mrsdl.Value +} + +// Creates a new instance of the ManagedRuleSetDefinitionListPage type. +func NewManagedRuleSetDefinitionListPage(getNextPage func(context.Context, ManagedRuleSetDefinitionList) (ManagedRuleSetDefinitionList, error)) ManagedRuleSetDefinitionListPage { + return ManagedRuleSetDefinitionListPage{fn: getNextPage} +} + +// ManagedRuleSetDefinitionProperties properties for a managed rule set definition. +type ManagedRuleSetDefinitionProperties struct { + // ProvisioningState - READ-ONLY; Provisioning state of the managed rule set. + ProvisioningState *string `json:"provisioningState,omitempty"` + // RuleSetType - READ-ONLY; Type of the managed rule set. + RuleSetType *string `json:"ruleSetType,omitempty"` + // RuleSetVersion - READ-ONLY; Version of the managed rule set type. + RuleSetVersion *string `json:"ruleSetVersion,omitempty"` + // RuleGroups - READ-ONLY; Rule groups of the managed rule set. + RuleGroups *[]ManagedRuleGroupDefinition `json:"ruleGroups,omitempty"` +} + +// ManagedRuleSetList defines the list of managed rule sets for the policy. +type ManagedRuleSetList struct { + // ManagedRuleSets - List of rule sets. + ManagedRuleSets *[]ManagedRuleSet `json:"managedRuleSets,omitempty"` +} + +// MatchCondition define match conditions +type MatchCondition struct { + // MatchVariable - Match variable to compare against. Possible values include: 'RemoteAddr', 'SocketAddr', 'RequestMethod', 'RequestHeader', 'RequestURI', 'QueryString', 'RequestBody', 'Cookies', 'PostArgs' + MatchVariable MatchVariable `json:"matchVariable,omitempty"` + // Selector - Selector can used to match a specific key for QueryString, Cookies, RequestHeader or PostArgs. + Selector *string `json:"selector,omitempty"` + // Operator - Describes operator to be matched. Possible values include: 'OperatorAny', 'OperatorIPMatch', 'OperatorGeoMatch', 'OperatorEqual', 'OperatorContains', 'OperatorLessThan', 'OperatorGreaterThan', 'OperatorLessThanOrEqual', 'OperatorGreaterThanOrEqual', 'OperatorBeginsWith', 'OperatorEndsWith', 'OperatorRegEx' + Operator Operator `json:"operator,omitempty"` + // NegateCondition - Describes if the result of this condition should be negated. + NegateCondition *bool `json:"negateCondition,omitempty"` + // MatchValue - List of possible match values. + MatchValue *[]string `json:"matchValue,omitempty"` + // Transforms - List of transforms. + Transforms *[]TransformType `json:"transforms,omitempty"` +} + +// Operation CDN REST API operation +type Operation struct { + // Name - READ-ONLY; Operation name: {provider}/{resource}/{operation} + Name *string `json:"name,omitempty"` + // Display - The object that represents the operation. + Display *OperationDisplay `json:"display,omitempty"` +} + +// OperationDisplay the object that represents the operation. +type OperationDisplay struct { + // Provider - READ-ONLY; Service provider: Microsoft.Cdn + Provider *string `json:"provider,omitempty"` + // Resource - READ-ONLY; Resource on which the operation is performed: Profile, endpoint, etc. + Resource *string `json:"resource,omitempty"` + // Operation - READ-ONLY; Operation type: Read, write, delete, etc. + Operation *string `json:"operation,omitempty"` +} + +// OperationsListResult result of the request to list CDN operations. It contains a list of operations and +// a URL link to get the next set of results. +type OperationsListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of CDN operations supported by the CDN resource provider. + Value *[]Operation `json:"value,omitempty"` + // NextLink - URL to get the next set of operation list results if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// OperationsListResultIterator provides access to a complete listing of Operation values. +type OperationsListResultIterator struct { + i int + page OperationsListResultPage +} + +// 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 *OperationsListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsListResultIterator.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 *OperationsListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter OperationsListResultIterator) 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 OperationsListResultIterator) Response() OperationsListResult { + 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 OperationsListResultIterator) Value() Operation { + if !iter.page.NotDone() { + return Operation{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the OperationsListResultIterator type. +func NewOperationsListResultIterator(page OperationsListResultPage) OperationsListResultIterator { + return OperationsListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (olr OperationsListResult) IsEmpty() bool { + return olr.Value == nil || len(*olr.Value) == 0 +} + +// operationsListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (olr OperationsListResult) operationsListResultPreparer(ctx context.Context) (*http.Request, error) { + if olr.NextLink == nil || len(to.String(olr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(olr.NextLink))) +} + +// OperationsListResultPage contains a page of Operation values. +type OperationsListResultPage struct { + fn func(context.Context, OperationsListResult) (OperationsListResult, error) + olr OperationsListResult +} + +// 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 *OperationsListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.olr) + if err != nil { + return err + } + page.olr = next + 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 *OperationsListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page OperationsListResultPage) NotDone() bool { + return !page.olr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page OperationsListResultPage) Response() OperationsListResult { + return page.olr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page OperationsListResultPage) Values() []Operation { + if page.olr.IsEmpty() { + return nil + } + return *page.olr.Value +} + +// Creates a new instance of the OperationsListResultPage type. +func NewOperationsListResultPage(getNextPage func(context.Context, OperationsListResult) (OperationsListResult, error)) OperationsListResultPage { + return OperationsListResultPage{fn: getNextPage} +} + +// Origin CDN origin is the source of the content being delivered via CDN. When the edge nodes represented +// by an endpoint do not have the requested content cached, they attempt to fetch it from one or more of +// the configured origins. +type Origin struct { + autorest.Response `json:"-"` + *OriginProperties `json:"properties,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Origin. +func (o Origin) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if o.OriginProperties != nil { + objectMap["properties"] = o.OriginProperties + } + if o.Location != nil { + objectMap["location"] = o.Location + } + if o.Tags != nil { + objectMap["tags"] = o.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Origin struct. +func (o *Origin) 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 originProperties OriginProperties + err = json.Unmarshal(*v, &originProperties) + if err != nil { + return err + } + o.OriginProperties = &originProperties + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + o.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + o.Tags = tags + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + o.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + o.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + o.Type = &typeVar + } + } + } + + return nil +} + +// OriginGroup origin group comprising of origins is used for load balancing to origins when the content +// cannot be served from CDN. +type OriginGroup struct { + autorest.Response `json:"-"` + *OriginGroupProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for OriginGroup. +func (og OriginGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if og.OriginGroupProperties != nil { + objectMap["properties"] = og.OriginGroupProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for OriginGroup struct. +func (og *OriginGroup) 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 originGroupProperties OriginGroupProperties + err = json.Unmarshal(*v, &originGroupProperties) + if err != nil { + return err + } + og.OriginGroupProperties = &originGroupProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + og.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + og.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + og.Type = &typeVar + } + } + } + + return nil +} + +// OriginGroupListResult result of the request to list origin groups. It contains a list of origin groups +// objects and a URL link to get the next set of results. +type OriginGroupListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of CDN origin groups within an endpoint + Value *[]OriginGroup `json:"value,omitempty"` + // NextLink - URL to get the next set of origin objects if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// OriginGroupListResultIterator provides access to a complete listing of OriginGroup values. +type OriginGroupListResultIterator struct { + i int + page OriginGroupListResultPage +} + +// 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 *OriginGroupListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OriginGroupListResultIterator.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 *OriginGroupListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter OriginGroupListResultIterator) 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 OriginGroupListResultIterator) Response() OriginGroupListResult { + 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 OriginGroupListResultIterator) Value() OriginGroup { + if !iter.page.NotDone() { + return OriginGroup{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the OriginGroupListResultIterator type. +func NewOriginGroupListResultIterator(page OriginGroupListResultPage) OriginGroupListResultIterator { + return OriginGroupListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (oglr OriginGroupListResult) IsEmpty() bool { + return oglr.Value == nil || len(*oglr.Value) == 0 +} + +// originGroupListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (oglr OriginGroupListResult) originGroupListResultPreparer(ctx context.Context) (*http.Request, error) { + if oglr.NextLink == nil || len(to.String(oglr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(oglr.NextLink))) +} + +// OriginGroupListResultPage contains a page of OriginGroup values. +type OriginGroupListResultPage struct { + fn func(context.Context, OriginGroupListResult) (OriginGroupListResult, error) + oglr OriginGroupListResult +} + +// 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 *OriginGroupListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OriginGroupListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.oglr) + if err != nil { + return err + } + page.oglr = next + 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 *OriginGroupListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page OriginGroupListResultPage) NotDone() bool { + return !page.oglr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page OriginGroupListResultPage) Response() OriginGroupListResult { + return page.oglr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page OriginGroupListResultPage) Values() []OriginGroup { + if page.oglr.IsEmpty() { + return nil + } + return *page.oglr.Value +} + +// Creates a new instance of the OriginGroupListResultPage type. +func NewOriginGroupListResultPage(getNextPage func(context.Context, OriginGroupListResult) (OriginGroupListResult, error)) OriginGroupListResultPage { + return OriginGroupListResultPage{fn: getNextPage} +} + +// OriginGroupProperties the JSON object that contains the properties of the origin group. +type OriginGroupProperties struct { + // ResourceState - READ-ONLY; Resource status of the origin group. Possible values include: 'OriginGroupResourceStateCreating', 'OriginGroupResourceStateActive', 'OriginGroupResourceStateDeleting' + ResourceState OriginGroupResourceState `json:"resourceState,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning status of the origin group. + ProvisioningState *string `json:"provisioningState,omitempty"` + // HealthProbeSettings - Health probe settings to the origin that is used to determine the health of the origin. + HealthProbeSettings *HealthProbeParameters `json:"healthProbeSettings,omitempty"` + // Origins - The source of the content being delivered via CDN within given origin group. + Origins *[]ResourceReference `json:"origins,omitempty"` + // TrafficRestorationTimeToHealedOrNewEndpointsInMinutes - Time in minutes to shift the traffic to the endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is added. Default is 10 mins. This property is currently not supported. + TrafficRestorationTimeToHealedOrNewEndpointsInMinutes *int32 `json:"trafficRestorationTimeToHealedOrNewEndpointsInMinutes,omitempty"` + // ResponseBasedOriginErrorDetectionSettings - The JSON object that contains the properties to determine origin health using real requests/responses. This property is currently not supported. + ResponseBasedOriginErrorDetectionSettings *ResponseBasedOriginErrorDetectionParameters `json:"responseBasedOriginErrorDetectionSettings,omitempty"` +} + +// OriginGroupsCreateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type OriginGroupsCreateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *OriginGroupsCreateFuture) Result(client OriginGroupsClient) (og OriginGroup, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.OriginGroupsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("cdn.OriginGroupsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if og.Response.Response, err = future.GetResult(sender); err == nil && og.Response.Response.StatusCode != http.StatusNoContent { + og, err = client.CreateResponder(og.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.OriginGroupsCreateFuture", "Result", og.Response.Response, "Failure responding to request") + } + } + return +} + +// OriginGroupsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type OriginGroupsDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *OriginGroupsDeleteFuture) Result(client OriginGroupsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.OriginGroupsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("cdn.OriginGroupsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// OriginGroupsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type OriginGroupsUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *OriginGroupsUpdateFuture) Result(client OriginGroupsClient) (og OriginGroup, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.OriginGroupsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("cdn.OriginGroupsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if og.Response.Response, err = future.GetResult(sender); err == nil && og.Response.Response.StatusCode != http.StatusNoContent { + og, err = client.UpdateResponder(og.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.OriginGroupsUpdateFuture", "Result", og.Response.Response, "Failure responding to request") + } + } + return +} + +// OriginGroupUpdateParameters origin group properties needed for origin group creation or update. +type OriginGroupUpdateParameters struct { + *OriginGroupUpdatePropertiesParameters `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for OriginGroupUpdateParameters. +func (ogup OriginGroupUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ogup.OriginGroupUpdatePropertiesParameters != nil { + objectMap["properties"] = ogup.OriginGroupUpdatePropertiesParameters + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for OriginGroupUpdateParameters struct. +func (ogup *OriginGroupUpdateParameters) 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 originGroupUpdatePropertiesParameters OriginGroupUpdatePropertiesParameters + err = json.Unmarshal(*v, &originGroupUpdatePropertiesParameters) + if err != nil { + return err + } + ogup.OriginGroupUpdatePropertiesParameters = &originGroupUpdatePropertiesParameters + } + } + } + + return nil +} + +// OriginGroupUpdatePropertiesParameters the JSON object that contains the properties of the origin group. +type OriginGroupUpdatePropertiesParameters struct { + // HealthProbeSettings - Health probe settings to the origin that is used to determine the health of the origin. + HealthProbeSettings *HealthProbeParameters `json:"healthProbeSettings,omitempty"` + // Origins - The source of the content being delivered via CDN within given origin group. + Origins *[]ResourceReference `json:"origins,omitempty"` + // TrafficRestorationTimeToHealedOrNewEndpointsInMinutes - Time in minutes to shift the traffic to the endpoint gradually when an unhealthy endpoint comes healthy or a new endpoint is added. Default is 10 mins. This property is currently not supported. + TrafficRestorationTimeToHealedOrNewEndpointsInMinutes *int32 `json:"trafficRestorationTimeToHealedOrNewEndpointsInMinutes,omitempty"` + // ResponseBasedOriginErrorDetectionSettings - The JSON object that contains the properties to determine origin health using real requests/responses. This property is currently not supported. + ResponseBasedOriginErrorDetectionSettings *ResponseBasedOriginErrorDetectionParameters `json:"responseBasedOriginErrorDetectionSettings,omitempty"` +} + +// OriginListResult result of the request to list origins. It contains a list of origin objects and a URL +// link to get the next set of results. +type OriginListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of CDN origins within an endpoint + Value *[]Origin `json:"value,omitempty"` + // NextLink - URL to get the next set of origin objects if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// OriginListResultIterator provides access to a complete listing of Origin values. +type OriginListResultIterator struct { + i int + page OriginListResultPage +} + +// 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 *OriginListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OriginListResultIterator.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 *OriginListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter OriginListResultIterator) 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 OriginListResultIterator) Response() OriginListResult { + 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 OriginListResultIterator) Value() Origin { + if !iter.page.NotDone() { + return Origin{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the OriginListResultIterator type. +func NewOriginListResultIterator(page OriginListResultPage) OriginListResultIterator { + return OriginListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (olr OriginListResult) IsEmpty() bool { + return olr.Value == nil || len(*olr.Value) == 0 +} + +// originListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (olr OriginListResult) originListResultPreparer(ctx context.Context) (*http.Request, error) { + if olr.NextLink == nil || len(to.String(olr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(olr.NextLink))) +} + +// OriginListResultPage contains a page of Origin values. +type OriginListResultPage struct { + fn func(context.Context, OriginListResult) (OriginListResult, error) + olr OriginListResult +} + +// 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 *OriginListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OriginListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.olr) + if err != nil { + return err + } + page.olr = next + 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 *OriginListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page OriginListResultPage) NotDone() bool { + return !page.olr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page OriginListResultPage) Response() OriginListResult { + return page.olr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page OriginListResultPage) Values() []Origin { + if page.olr.IsEmpty() { + return nil + } + return *page.olr.Value +} + +// Creates a new instance of the OriginListResultPage type. +func NewOriginListResultPage(getNextPage func(context.Context, OriginListResult) (OriginListResult, error)) OriginListResultPage { + return OriginListResultPage{fn: getNextPage} +} + +// OriginProperties the JSON object that contains the properties of the origin. +type OriginProperties struct { + // ResourceState - READ-ONLY; Resource status of the origin. Possible values include: 'OriginResourceStateCreating', 'OriginResourceStateActive', 'OriginResourceStateDeleting' + ResourceState OriginResourceState `json:"resourceState,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning status of the origin. + ProvisioningState *string `json:"provisioningState,omitempty"` + // PrivateEndpointStatus - READ-ONLY; The approval status for the connection to the Private Link. Possible values include: 'Pending', 'Approved', 'Rejected', 'Disconnected', 'Timeout' + PrivateEndpointStatus PrivateEndpointStatus `json:"privateEndpointStatus,omitempty"` + // HostName - The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are supported.This should be unique across all origins in an endpoint. + HostName *string `json:"hostName,omitempty"` + // HTTPPort - The value of the HTTP port. Must be between 1 and 65535. + HTTPPort *int32 `json:"httpPort,omitempty"` + // HTTPSPort - The value of the HTTPS port. Must be between 1 and 65535. + HTTPSPort *int32 `json:"httpsPort,omitempty"` + // OriginHostHeader - The host header value sent to the origin with each request. If you leave this blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud Services require this host header value to match the origin hostname by default. This overrides the host header defined at Endpoint + OriginHostHeader *string `json:"originHostHeader,omitempty"` + // Priority - Priority of origin in given origin group for load balancing. Higher priorities will not be used for load balancing if any lower priority origin is healthy.Must be between 1 and 5 + Priority *int32 `json:"priority,omitempty"` + // Weight - Weight of the origin in given origin group for load balancing. Must be between 1 and 1000 + Weight *int32 `json:"weight,omitempty"` + // Enabled - Origin is enabled for load balancing or not + Enabled *bool `json:"enabled,omitempty"` + // PrivateLinkAlias - The Alias of the Private Link resource. Populating this optional field indicates that this origin is 'Private' + PrivateLinkAlias *string `json:"privateLinkAlias,omitempty"` + // PrivateLinkResourceID - The Resource Id of the Private Link resource. Populating this optional field indicates that this backend is 'Private' + PrivateLinkResourceID *string `json:"privateLinkResourceId,omitempty"` + // PrivateLinkLocation - The location of the Private Link resource. Required only if 'privateLinkResourceId' is populated + PrivateLinkLocation *string `json:"privateLinkLocation,omitempty"` + // PrivateLinkApprovalMessage - A custom message to be included in the approval request to connect to the Private Link. + PrivateLinkApprovalMessage *string `json:"privateLinkApprovalMessage,omitempty"` +} + +// OriginsCreateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type OriginsCreateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *OriginsCreateFuture) Result(client OriginsClient) (o Origin, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.OriginsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("cdn.OriginsCreateFuture") + 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.CreateResponder(o.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.OriginsCreateFuture", "Result", o.Response.Response, "Failure responding to request") + } + } + return +} + +// OriginsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type OriginsDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *OriginsDeleteFuture) Result(client OriginsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.OriginsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("cdn.OriginsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// OriginsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type OriginsUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *OriginsUpdateFuture) Result(client OriginsClient) (o Origin, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.OriginsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("cdn.OriginsUpdateFuture") + 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.UpdateResponder(o.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.OriginsUpdateFuture", "Result", o.Response.Response, "Failure responding to request") + } + } + return +} + +// OriginUpdateParameters origin properties needed for origin update. +type OriginUpdateParameters struct { + // Tags - Origin tags. + Tags map[string]*string `json:"tags"` + *OriginUpdatePropertiesParameters `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for OriginUpdateParameters. +func (oup OriginUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if oup.Tags != nil { + objectMap["tags"] = oup.Tags + } + if oup.OriginUpdatePropertiesParameters != nil { + objectMap["properties"] = oup.OriginUpdatePropertiesParameters + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for OriginUpdateParameters struct. +func (oup *OriginUpdateParameters) 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 + } + oup.Tags = tags + } + case "properties": + if v != nil { + var originUpdatePropertiesParameters OriginUpdatePropertiesParameters + err = json.Unmarshal(*v, &originUpdatePropertiesParameters) + if err != nil { + return err + } + oup.OriginUpdatePropertiesParameters = &originUpdatePropertiesParameters + } + } + } + + return nil +} + +// OriginUpdatePropertiesParameters the JSON object that contains the properties of the origin. +type OriginUpdatePropertiesParameters struct { + // HostName - The address of the origin. Domain names, IPv4 addresses, and IPv6 addresses are supported.This should be unique across all origins in an endpoint. + HostName *string `json:"hostName,omitempty"` + // HTTPPort - The value of the HTTP port. Must be between 1 and 65535. + HTTPPort *int32 `json:"httpPort,omitempty"` + // HTTPSPort - The value of the HTTPS port. Must be between 1 and 65535. + HTTPSPort *int32 `json:"httpsPort,omitempty"` + // OriginHostHeader - The host header value sent to the origin with each request. If you leave this blank, the request hostname determines this value. Azure CDN origins, such as Web Apps, Blob Storage, and Cloud Services require this host header value to match the origin hostname by default. This overrides the host header defined at Endpoint + OriginHostHeader *string `json:"originHostHeader,omitempty"` + // Priority - Priority of origin in given origin group for load balancing. Higher priorities will not be used for load balancing if any lower priority origin is healthy.Must be between 1 and 5 + Priority *int32 `json:"priority,omitempty"` + // Weight - Weight of the origin in given origin group for load balancing. Must be between 1 and 1000 + Weight *int32 `json:"weight,omitempty"` + // Enabled - Origin is enabled for load balancing or not + Enabled *bool `json:"enabled,omitempty"` + // PrivateLinkAlias - The Alias of the Private Link resource. Populating this optional field indicates that this origin is 'Private' + PrivateLinkAlias *string `json:"privateLinkAlias,omitempty"` + // PrivateLinkResourceID - The Resource Id of the Private Link resource. Populating this optional field indicates that this backend is 'Private' + PrivateLinkResourceID *string `json:"privateLinkResourceId,omitempty"` + // PrivateLinkLocation - The location of the Private Link resource. Required only if 'privateLinkResourceId' is populated + PrivateLinkLocation *string `json:"privateLinkLocation,omitempty"` + // PrivateLinkApprovalMessage - A custom message to be included in the approval request to connect to the Private Link. + PrivateLinkApprovalMessage *string `json:"privateLinkApprovalMessage,omitempty"` +} + +// PoliciesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type PoliciesCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *PoliciesCreateOrUpdateFuture) Result(client PoliciesClient) (wafp WebApplicationFirewallPolicy, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.PoliciesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("cdn.PoliciesCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if wafp.Response.Response, err = future.GetResult(sender); err == nil && wafp.Response.Response.StatusCode != http.StatusNoContent { + wafp, err = client.CreateOrUpdateResponder(wafp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.PoliciesCreateOrUpdateFuture", "Result", wafp.Response.Response, "Failure responding to request") + } + } + return +} + +// PoliciesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type PoliciesUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *PoliciesUpdateFuture) Result(client PoliciesClient) (wafp WebApplicationFirewallPolicy, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.PoliciesUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("cdn.PoliciesUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if wafp.Response.Response, err = future.GetResult(sender); err == nil && wafp.Response.Response.StatusCode != http.StatusNoContent { + wafp, err = client.UpdateResponder(wafp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.PoliciesUpdateFuture", "Result", wafp.Response.Response, "Failure responding to request") + } + } + return +} + +// PolicySettings defines contents of a web application firewall global configuration +type PolicySettings struct { + // EnabledState - describes if the policy is in enabled state or disabled state. Possible values include: 'PolicyEnabledStateDisabled', 'PolicyEnabledStateEnabled' + EnabledState PolicyEnabledState `json:"enabledState,omitempty"` + // Mode - Describes if it is in detection mode or prevention mode at policy level. Possible values include: 'Prevention', 'Detection' + Mode PolicyMode `json:"mode,omitempty"` + // DefaultRedirectURL - If action type is redirect, this field represents the default redirect URL for the client. + DefaultRedirectURL *string `json:"defaultRedirectUrl,omitempty"` + // DefaultCustomBlockResponseStatusCode - If the action type is block, this field defines the default customer overridable http response status code. + DefaultCustomBlockResponseStatusCode *int32 `json:"defaultCustomBlockResponseStatusCode,omitempty"` + // DefaultCustomBlockResponseBody - If the action type is block, customer can override the response body. The body must be specified in base64 encoding. + DefaultCustomBlockResponseBody *string `json:"defaultCustomBlockResponseBody,omitempty"` +} + +// PostArgsMatchConditionParameters defines the parameters for PostArgs match conditions +type PostArgsMatchConditionParameters struct { + OdataType *string `json:"@odata.type,omitempty"` + // Selector - Name of PostArg to be matched + Selector *string `json:"selector,omitempty"` + // Operator - Describes operator to be matched. Possible values include: 'PostArgsOperatorAny', 'PostArgsOperatorEqual', 'PostArgsOperatorContains', 'PostArgsOperatorBeginsWith', 'PostArgsOperatorEndsWith', 'PostArgsOperatorLessThan', 'PostArgsOperatorLessThanOrEqual', 'PostArgsOperatorGreaterThan', 'PostArgsOperatorGreaterThanOrEqual' + Operator PostArgsOperator `json:"operator,omitempty"` + // NegateCondition - Describes if this is negate condition or not + NegateCondition *bool `json:"negateCondition,omitempty"` + // MatchValues - The match value for the condition of the delivery rule + MatchValues *[]string `json:"matchValues,omitempty"` + // Transforms - List of transforms + Transforms *[]Transform `json:"transforms,omitempty"` +} + +// Profile CDN profile is a logical grouping of endpoints that share the same settings, such as CDN +// provider and pricing tier. +type Profile struct { + autorest.Response `json:"-"` + // Sku - The pricing tier (defines a CDN provider, feature list and rate) of the CDN profile. + Sku *Sku `json:"sku,omitempty"` + *ProfileProperties `json:"properties,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Profile. +func (p Profile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if p.Sku != nil { + objectMap["sku"] = p.Sku + } + if p.ProfileProperties != nil { + objectMap["properties"] = p.ProfileProperties + } + if p.Location != nil { + objectMap["location"] = p.Location + } + if p.Tags != nil { + objectMap["tags"] = p.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Profile struct. +func (p *Profile) 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 + } + p.Sku = &sku + } + case "properties": + if v != nil { + var profileProperties ProfileProperties + err = json.Unmarshal(*v, &profileProperties) + if err != nil { + return err + } + p.ProfileProperties = &profileProperties + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + p.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + p.Tags = tags + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + p.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + p.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + p.Type = &typeVar + } + } + } + + return nil +} + +// ProfileListResult result of the request to list profiles. It contains a list of profile objects and a +// URL link to get the next set of results. +type ProfileListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of CDN profiles within a resource group. + Value *[]Profile `json:"value,omitempty"` + // NextLink - URL to get the next set of profile objects if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// ProfileListResultIterator provides access to a complete listing of Profile values. +type ProfileListResultIterator struct { + i int + page ProfileListResultPage +} + +// 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 *ProfileListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProfileListResultIterator.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 *ProfileListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ProfileListResultIterator) 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 ProfileListResultIterator) Response() ProfileListResult { + 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 ProfileListResultIterator) Value() Profile { + if !iter.page.NotDone() { + return Profile{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ProfileListResultIterator type. +func NewProfileListResultIterator(page ProfileListResultPage) ProfileListResultIterator { + return ProfileListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (plr ProfileListResult) IsEmpty() bool { + return plr.Value == nil || len(*plr.Value) == 0 +} + +// profileListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (plr ProfileListResult) profileListResultPreparer(ctx context.Context) (*http.Request, error) { + if plr.NextLink == nil || len(to.String(plr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(plr.NextLink))) +} + +// ProfileListResultPage contains a page of Profile values. +type ProfileListResultPage struct { + fn func(context.Context, ProfileListResult) (ProfileListResult, error) + plr ProfileListResult +} + +// 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 *ProfileListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProfileListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.plr) + if err != nil { + return err + } + page.plr = next + 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 *ProfileListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ProfileListResultPage) NotDone() bool { + return !page.plr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ProfileListResultPage) Response() ProfileListResult { + return page.plr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ProfileListResultPage) Values() []Profile { + if page.plr.IsEmpty() { + return nil + } + return *page.plr.Value +} + +// Creates a new instance of the ProfileListResultPage type. +func NewProfileListResultPage(getNextPage func(context.Context, ProfileListResult) (ProfileListResult, error)) ProfileListResultPage { + return ProfileListResultPage{fn: getNextPage} +} + +// ProfileProperties the JSON object that contains the properties required to create a profile. +type ProfileProperties struct { + // ResourceState - READ-ONLY; Resource status of the profile. Possible values include: 'ProfileResourceStateCreating', 'ProfileResourceStateActive', 'ProfileResourceStateDeleting', 'ProfileResourceStateDisabled' + ResourceState ProfileResourceState `json:"resourceState,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning status of the profile. + ProvisioningState *string `json:"provisioningState,omitempty"` +} + +// ProfilesCreateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ProfilesCreateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ProfilesCreateFuture) Result(client ProfilesClient) (p Profile, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.ProfilesCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("cdn.ProfilesCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if p.Response.Response, err = future.GetResult(sender); err == nil && p.Response.Response.StatusCode != http.StatusNoContent { + p, err = client.CreateResponder(p.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.ProfilesCreateFuture", "Result", p.Response.Response, "Failure responding to request") + } + } + return +} + +// ProfilesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ProfilesDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ProfilesDeleteFuture) Result(client ProfilesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.ProfilesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("cdn.ProfilesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ProfilesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ProfilesUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ProfilesUpdateFuture) Result(client ProfilesClient) (p Profile, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.ProfilesUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("cdn.ProfilesUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if p.Response.Response, err = future.GetResult(sender); err == nil && p.Response.Response.StatusCode != http.StatusNoContent { + p, err = client.UpdateResponder(p.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.ProfilesUpdateFuture", "Result", p.Response.Response, "Failure responding to request") + } + } + return +} + +// ProfileUpdateParameters properties required to update a profile. +type ProfileUpdateParameters struct { + // Tags - Profile tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for ProfileUpdateParameters. +func (pup ProfileUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pup.Tags != nil { + objectMap["tags"] = pup.Tags + } + return json.Marshal(objectMap) +} + +// 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; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// PurgeParameters parameters required for content purge. +type PurgeParameters struct { + // ContentPaths - The path to the content to be purged. Can describe a file path or a wild card directory. + ContentPaths *[]string `json:"contentPaths,omitempty"` +} + +// QueryStringMatchConditionParameters defines the parameters for QueryString match conditions +type QueryStringMatchConditionParameters struct { + OdataType *string `json:"@odata.type,omitempty"` + // Operator - Describes operator to be matched. Possible values include: 'QueryStringOperatorAny', 'QueryStringOperatorEqual', 'QueryStringOperatorContains', 'QueryStringOperatorBeginsWith', 'QueryStringOperatorEndsWith', 'QueryStringOperatorLessThan', 'QueryStringOperatorLessThanOrEqual', 'QueryStringOperatorGreaterThan', 'QueryStringOperatorGreaterThanOrEqual' + Operator QueryStringOperator `json:"operator,omitempty"` + // NegateCondition - Describes if this is negate condition or not + NegateCondition *bool `json:"negateCondition,omitempty"` + // MatchValues - The match value for the condition of the delivery rule + MatchValues *[]string `json:"matchValues,omitempty"` + // Transforms - List of transforms + Transforms *[]Transform `json:"transforms,omitempty"` +} + +// RateLimitRule defines a rate limiting rule that can be included in a waf policy +type RateLimitRule struct { + // RateLimitThreshold - Defines rate limit threshold. + RateLimitThreshold *int32 `json:"rateLimitThreshold,omitempty"` + // RateLimitDurationInMinutes - Defines rate limit duration. Default is 1 minute. + RateLimitDurationInMinutes *int32 `json:"rateLimitDurationInMinutes,omitempty"` + // Name - Defines the name of the custom rule + Name *string `json:"name,omitempty"` + // EnabledState - Describes if the custom rule is in enabled or disabled state. Defaults to Enabled if not specified. Possible values include: 'CustomRuleEnabledStateDisabled', 'CustomRuleEnabledStateEnabled' + EnabledState CustomRuleEnabledState `json:"enabledState,omitempty"` + // Priority - Defines in what order this rule be evaluated in the overall list of custom rules + Priority *int32 `json:"priority,omitempty"` + // MatchConditions - List of match conditions. + MatchConditions *[]MatchCondition `json:"matchConditions,omitempty"` + // Action - Describes what action to be applied when rule matches. Possible values include: 'Allow', 'Block', 'Log', 'Redirect' + Action ActionType `json:"action,omitempty"` +} + +// RateLimitRuleList defines contents of rate limit rules +type RateLimitRuleList struct { + // Rules - List of rules + Rules *[]RateLimitRule `json:"rules,omitempty"` +} + +// RemoteAddressMatchConditionParameters defines the parameters for RemoteAddress match conditions +type RemoteAddressMatchConditionParameters struct { + OdataType *string `json:"@odata.type,omitempty"` + // Operator - Describes operator to be matched. Possible values include: 'RemoteAddressOperatorAny', 'RemoteAddressOperatorIPMatch', 'RemoteAddressOperatorGeoMatch' + Operator RemoteAddressOperator `json:"operator,omitempty"` + // NegateCondition - Describes if this is negate condition or not + NegateCondition *bool `json:"negateCondition,omitempty"` + // MatchValues - Match values to match against. The operator will apply to each value in here with OR semantics. If any of them match the variable with the given operator this match condition is considered a match. + MatchValues *[]string `json:"matchValues,omitempty"` + // Transforms - List of transforms + Transforms *[]Transform `json:"transforms,omitempty"` +} + +// RequestBodyMatchConditionParameters defines the parameters for RequestBody match conditions +type RequestBodyMatchConditionParameters struct { + OdataType *string `json:"@odata.type,omitempty"` + // Operator - Describes operator to be matched. Possible values include: 'RequestBodyOperatorAny', 'RequestBodyOperatorEqual', 'RequestBodyOperatorContains', 'RequestBodyOperatorBeginsWith', 'RequestBodyOperatorEndsWith', 'RequestBodyOperatorLessThan', 'RequestBodyOperatorLessThanOrEqual', 'RequestBodyOperatorGreaterThan', 'RequestBodyOperatorGreaterThanOrEqual' + Operator RequestBodyOperator `json:"operator,omitempty"` + // NegateCondition - Describes if this is negate condition or not + NegateCondition *bool `json:"negateCondition,omitempty"` + // MatchValues - The match value for the condition of the delivery rule + MatchValues *[]string `json:"matchValues,omitempty"` + // Transforms - List of transforms + Transforms *[]Transform `json:"transforms,omitempty"` +} + +// RequestHeaderMatchConditionParameters defines the parameters for RequestHeader match conditions +type RequestHeaderMatchConditionParameters struct { + OdataType *string `json:"@odata.type,omitempty"` + // Selector - Name of Header to be matched + Selector *string `json:"selector,omitempty"` + // Operator - Describes operator to be matched. Possible values include: 'RequestHeaderOperatorAny', 'RequestHeaderOperatorEqual', 'RequestHeaderOperatorContains', 'RequestHeaderOperatorBeginsWith', 'RequestHeaderOperatorEndsWith', 'RequestHeaderOperatorLessThan', 'RequestHeaderOperatorLessThanOrEqual', 'RequestHeaderOperatorGreaterThan', 'RequestHeaderOperatorGreaterThanOrEqual' + Operator RequestHeaderOperator `json:"operator,omitempty"` + // NegateCondition - Describes if this is negate condition or not + NegateCondition *bool `json:"negateCondition,omitempty"` + // MatchValues - The match value for the condition of the delivery rule + MatchValues *[]string `json:"matchValues,omitempty"` + // Transforms - List of transforms + Transforms *[]Transform `json:"transforms,omitempty"` +} + +// RequestMethodMatchConditionParameters defines the parameters for RequestMethod match conditions +type RequestMethodMatchConditionParameters struct { + OdataType *string `json:"@odata.type,omitempty"` + // Operator - Describes operator to be matched + Operator *string `json:"operator,omitempty"` + // NegateCondition - Describes if this is negate condition or not + NegateCondition *bool `json:"negateCondition,omitempty"` + // MatchValues - The match value for the condition of the delivery rule + MatchValues *[]string `json:"matchValues,omitempty"` +} + +// RequestSchemeMatchConditionParameters defines the parameters for RequestScheme match conditions +type RequestSchemeMatchConditionParameters struct { + OdataType *string `json:"@odata.type,omitempty"` + // Operator - Describes operator to be matched + Operator *string `json:"operator,omitempty"` + // NegateCondition - Describes if this is negate condition or not + NegateCondition *bool `json:"negateCondition,omitempty"` + // MatchValues - The match value for the condition of the delivery rule + MatchValues *[]string `json:"matchValues,omitempty"` +} + +// RequestURIMatchConditionParameters defines the parameters for RequestUri match conditions +type RequestURIMatchConditionParameters struct { + OdataType *string `json:"@odata.type,omitempty"` + // Operator - Describes operator to be matched. Possible values include: 'RequestURIOperatorAny', 'RequestURIOperatorEqual', 'RequestURIOperatorContains', 'RequestURIOperatorBeginsWith', 'RequestURIOperatorEndsWith', 'RequestURIOperatorLessThan', 'RequestURIOperatorLessThanOrEqual', 'RequestURIOperatorGreaterThan', 'RequestURIOperatorGreaterThanOrEqual' + Operator RequestURIOperator `json:"operator,omitempty"` + // NegateCondition - Describes if this is negate condition or not + NegateCondition *bool `json:"negateCondition,omitempty"` + // MatchValues - The match value for the condition of the delivery rule + MatchValues *[]string `json:"matchValues,omitempty"` + // Transforms - List of transforms + Transforms *[]Transform `json:"transforms,omitempty"` +} + +// Resource the core properties of ARM resources +type Resource struct { + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// ResourceReference reference to another resource. +type ResourceReference struct { + // ID - Resource ID. + ID *string `json:"id,omitempty"` +} + +// ResourceUsage output of check resource usage API. +type ResourceUsage struct { + // ResourceType - READ-ONLY; Resource type for which the usage is provided. + ResourceType *string `json:"resourceType,omitempty"` + // Unit - READ-ONLY; Unit of the usage. e.g. Count. + Unit *string `json:"unit,omitempty"` + // CurrentValue - READ-ONLY; Actual value of usage on the specified resource type. + CurrentValue *int32 `json:"currentValue,omitempty"` + // Limit - READ-ONLY; Quota of the specified resource type. + Limit *int32 `json:"limit,omitempty"` +} + +// ResourceUsageListResult output of check resource usage API. +type ResourceUsageListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of resource usages. + Value *[]ResourceUsage `json:"value,omitempty"` + // NextLink - URL to get the next set of custom domain objects if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// ResourceUsageListResultIterator provides access to a complete listing of ResourceUsage values. +type ResourceUsageListResultIterator struct { + i int + page ResourceUsageListResultPage +} + +// 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 *ResourceUsageListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceUsageListResultIterator.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 *ResourceUsageListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ResourceUsageListResultIterator) 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 ResourceUsageListResultIterator) Response() ResourceUsageListResult { + 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 ResourceUsageListResultIterator) Value() ResourceUsage { + if !iter.page.NotDone() { + return ResourceUsage{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ResourceUsageListResultIterator type. +func NewResourceUsageListResultIterator(page ResourceUsageListResultPage) ResourceUsageListResultIterator { + return ResourceUsageListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rulr ResourceUsageListResult) IsEmpty() bool { + return rulr.Value == nil || len(*rulr.Value) == 0 +} + +// resourceUsageListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rulr ResourceUsageListResult) resourceUsageListResultPreparer(ctx context.Context) (*http.Request, error) { + if rulr.NextLink == nil || len(to.String(rulr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rulr.NextLink))) +} + +// ResourceUsageListResultPage contains a page of ResourceUsage values. +type ResourceUsageListResultPage struct { + fn func(context.Context, ResourceUsageListResult) (ResourceUsageListResult, error) + rulr ResourceUsageListResult +} + +// 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 *ResourceUsageListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceUsageListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.rulr) + if err != nil { + return err + } + page.rulr = next + 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 *ResourceUsageListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ResourceUsageListResultPage) NotDone() bool { + return !page.rulr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ResourceUsageListResultPage) Response() ResourceUsageListResult { + return page.rulr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ResourceUsageListResultPage) Values() []ResourceUsage { + if page.rulr.IsEmpty() { + return nil + } + return *page.rulr.Value +} + +// Creates a new instance of the ResourceUsageListResultPage type. +func NewResourceUsageListResultPage(getNextPage func(context.Context, ResourceUsageListResult) (ResourceUsageListResult, error)) ResourceUsageListResultPage { + return ResourceUsageListResultPage{fn: getNextPage} +} + +// ResponseBasedOriginErrorDetectionParameters the JSON object that contains the properties to determine +// origin health using real requests/responses. +type ResponseBasedOriginErrorDetectionParameters struct { + // ResponseBasedDetectedErrorTypes - Type of response errors for real user requests for which origin will be deemed unhealthy. Possible values include: 'ResponseBasedDetectedErrorTypesNone', 'ResponseBasedDetectedErrorTypesTCPErrorsOnly', 'ResponseBasedDetectedErrorTypesTCPAndHTTPErrors' + ResponseBasedDetectedErrorTypes ResponseBasedDetectedErrorTypes `json:"responseBasedDetectedErrorTypes,omitempty"` + // ResponseBasedFailoverThresholdPercentage - The percentage of failed requests in the sample where failover should trigger. + ResponseBasedFailoverThresholdPercentage *int32 `json:"responseBasedFailoverThresholdPercentage,omitempty"` + // HTTPErrorRanges - The list of Http status code ranges that are considered as server errors for origin and it is marked as unhealthy. + HTTPErrorRanges *[]HTTPErrorRangeParameters `json:"httpErrorRanges,omitempty"` +} + +// Sku the pricing tier (defines a CDN provider, feature list and rate) of the CDN profile. +type Sku struct { + // Name - Name of the pricing tier. Possible values include: 'StandardVerizon', 'PremiumVerizon', 'CustomVerizon', 'StandardAkamai', 'StandardChinaCdn', 'StandardMicrosoft', 'PremiumChinaCdn' + Name SkuName `json:"name,omitempty"` +} + +// SsoURI the URI required to login to the supplemental portal from the Azure portal. +type SsoURI struct { + autorest.Response `json:"-"` + // SsoURIValue - READ-ONLY; The URI used to login to the supplemental portal. + SsoURIValue *string `json:"ssoUriValue,omitempty"` +} + +// SupportedOptimizationTypesListResult the result of the GetSupportedOptimizationTypes API +type SupportedOptimizationTypesListResult struct { + autorest.Response `json:"-"` + // SupportedOptimizationTypes - READ-ONLY; Supported optimization types for a profile. + SupportedOptimizationTypes *[]OptimizationType `json:"supportedOptimizationTypes,omitempty"` +} + +// TrackedResource the resource model definition for a ARM tracked top level resource. +type TrackedResource struct { + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + 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.Location != nil { + objectMap["location"] = tr.Location + } + if tr.Tags != nil { + objectMap["tags"] = tr.Tags + } + return json.Marshal(objectMap) +} + +// URLFileExtensionMatchConditionParameters defines the parameters for UrlFileExtension match conditions +type URLFileExtensionMatchConditionParameters struct { + OdataType *string `json:"@odata.type,omitempty"` + // Operator - Describes operator to be matched. Possible values include: 'URLFileExtensionOperatorAny', 'URLFileExtensionOperatorEqual', 'URLFileExtensionOperatorContains', 'URLFileExtensionOperatorBeginsWith', 'URLFileExtensionOperatorEndsWith', 'URLFileExtensionOperatorLessThan', 'URLFileExtensionOperatorLessThanOrEqual', 'URLFileExtensionOperatorGreaterThan', 'URLFileExtensionOperatorGreaterThanOrEqual' + Operator URLFileExtensionOperator `json:"operator,omitempty"` + // NegateCondition - Describes if this is negate condition or not + NegateCondition *bool `json:"negateCondition,omitempty"` + // MatchValues - The match value for the condition of the delivery rule + MatchValues *[]string `json:"matchValues,omitempty"` + // Transforms - List of transforms + Transforms *[]Transform `json:"transforms,omitempty"` +} + +// URLFileNameMatchConditionParameters defines the parameters for UrlFilename match conditions +type URLFileNameMatchConditionParameters struct { + OdataType *string `json:"@odata.type,omitempty"` + // Operator - Describes operator to be matched. Possible values include: 'URLFileNameOperatorAny', 'URLFileNameOperatorEqual', 'URLFileNameOperatorContains', 'URLFileNameOperatorBeginsWith', 'URLFileNameOperatorEndsWith', 'URLFileNameOperatorLessThan', 'URLFileNameOperatorLessThanOrEqual', 'URLFileNameOperatorGreaterThan', 'URLFileNameOperatorGreaterThanOrEqual' + Operator URLFileNameOperator `json:"operator,omitempty"` + // NegateCondition - Describes if this is negate condition or not + NegateCondition *bool `json:"negateCondition,omitempty"` + // MatchValues - The match value for the condition of the delivery rule + MatchValues *[]string `json:"matchValues,omitempty"` + // Transforms - List of transforms + Transforms *[]Transform `json:"transforms,omitempty"` +} + +// URLPathMatchConditionParameters defines the parameters for UrlPath match conditions +type URLPathMatchConditionParameters struct { + OdataType *string `json:"@odata.type,omitempty"` + // Operator - Describes operator to be matched. Possible values include: 'URLPathOperatorAny', 'URLPathOperatorEqual', 'URLPathOperatorContains', 'URLPathOperatorBeginsWith', 'URLPathOperatorEndsWith', 'URLPathOperatorLessThan', 'URLPathOperatorLessThanOrEqual', 'URLPathOperatorGreaterThan', 'URLPathOperatorGreaterThanOrEqual', 'URLPathOperatorWildcard' + Operator URLPathOperator `json:"operator,omitempty"` + // NegateCondition - Describes if this is negate condition or not + NegateCondition *bool `json:"negateCondition,omitempty"` + // MatchValues - The match value for the condition of the delivery rule + MatchValues *[]string `json:"matchValues,omitempty"` + // Transforms - List of transforms + Transforms *[]Transform `json:"transforms,omitempty"` +} + +// URLRedirectAction defines the url redirect action for the delivery rule. +type URLRedirectAction struct { + // Parameters - Defines the parameters for the action. + Parameters *URLRedirectActionParameters `json:"parameters,omitempty"` + // Name - Possible values include: 'NameDeliveryRuleAction', 'NameURLRedirect', 'NameURLRewrite', 'NameModifyRequestHeader', 'NameModifyResponseHeader', 'NameCacheExpiration', 'NameCacheKeyQueryString' + Name NameBasicDeliveryRuleAction `json:"name,omitempty"` +} + +// MarshalJSON is the custom marshaler for URLRedirectAction. +func (ura URLRedirectAction) MarshalJSON() ([]byte, error) { + ura.Name = NameURLRedirect + objectMap := make(map[string]interface{}) + if ura.Parameters != nil { + objectMap["parameters"] = ura.Parameters + } + if ura.Name != "" { + objectMap["name"] = ura.Name + } + return json.Marshal(objectMap) +} + +// AsURLRedirectAction is the BasicDeliveryRuleAction implementation for URLRedirectAction. +func (ura URLRedirectAction) AsURLRedirectAction() (*URLRedirectAction, bool) { + return &ura, true +} + +// AsURLRewriteAction is the BasicDeliveryRuleAction implementation for URLRedirectAction. +func (ura URLRedirectAction) AsURLRewriteAction() (*URLRewriteAction, bool) { + return nil, false +} + +// AsDeliveryRuleRequestHeaderAction is the BasicDeliveryRuleAction implementation for URLRedirectAction. +func (ura URLRedirectAction) AsDeliveryRuleRequestHeaderAction() (*DeliveryRuleRequestHeaderAction, bool) { + return nil, false +} + +// AsDeliveryRuleResponseHeaderAction is the BasicDeliveryRuleAction implementation for URLRedirectAction. +func (ura URLRedirectAction) AsDeliveryRuleResponseHeaderAction() (*DeliveryRuleResponseHeaderAction, bool) { + return nil, false +} + +// AsDeliveryRuleCacheExpirationAction is the BasicDeliveryRuleAction implementation for URLRedirectAction. +func (ura URLRedirectAction) AsDeliveryRuleCacheExpirationAction() (*DeliveryRuleCacheExpirationAction, bool) { + return nil, false +} + +// AsDeliveryRuleCacheKeyQueryStringAction is the BasicDeliveryRuleAction implementation for URLRedirectAction. +func (ura URLRedirectAction) AsDeliveryRuleCacheKeyQueryStringAction() (*DeliveryRuleCacheKeyQueryStringAction, bool) { + return nil, false +} + +// AsDeliveryRuleAction is the BasicDeliveryRuleAction implementation for URLRedirectAction. +func (ura URLRedirectAction) AsDeliveryRuleAction() (*DeliveryRuleAction, bool) { + return nil, false +} + +// AsBasicDeliveryRuleAction is the BasicDeliveryRuleAction implementation for URLRedirectAction. +func (ura URLRedirectAction) AsBasicDeliveryRuleAction() (BasicDeliveryRuleAction, bool) { + return &ura, true +} + +// URLRedirectActionParameters defines the parameters for the url redirect action. +type URLRedirectActionParameters struct { + OdataType *string `json:"@odata.type,omitempty"` + // RedirectType - The redirect type the rule will use when redirecting traffic. Possible values include: 'Moved', 'Found', 'TemporaryRedirect', 'PermanentRedirect' + RedirectType RedirectType `json:"redirectType,omitempty"` + // DestinationProtocol - Protocol to use for the redirect. The default value is MatchRequest. Possible values include: 'MatchRequest', 'HTTP', 'HTTPS' + DestinationProtocol DestinationProtocol `json:"destinationProtocol,omitempty"` + // CustomPath - The full path to redirect. Path cannot be empty and must start with /. Leave empty to use the incoming path as destination path. + CustomPath *string `json:"customPath,omitempty"` + // CustomHostname - Host to redirect. Leave empty to use the incoming host as the destination host. + CustomHostname *string `json:"customHostname,omitempty"` + // CustomQueryString - The set of query strings to be placed in the redirect URL. Setting this value would replace any existing query string; leave empty to preserve the incoming query string. Query string must be in = format. ? and & will be added automatically so do not include them. + CustomQueryString *string `json:"customQueryString,omitempty"` + // CustomFragment - Fragment to add to the redirect URL. Fragment is the part of the URL that comes after #. Do not include the #. + CustomFragment *string `json:"customFragment,omitempty"` +} + +// URLRewriteAction defines the url rewrite action for the delivery rule. +type URLRewriteAction struct { + // Parameters - Defines the parameters for the action. + Parameters *URLRewriteActionParameters `json:"parameters,omitempty"` + // Name - Possible values include: 'NameDeliveryRuleAction', 'NameURLRedirect', 'NameURLRewrite', 'NameModifyRequestHeader', 'NameModifyResponseHeader', 'NameCacheExpiration', 'NameCacheKeyQueryString' + Name NameBasicDeliveryRuleAction `json:"name,omitempty"` +} + +// MarshalJSON is the custom marshaler for URLRewriteAction. +func (ura URLRewriteAction) MarshalJSON() ([]byte, error) { + ura.Name = NameURLRewrite + objectMap := make(map[string]interface{}) + if ura.Parameters != nil { + objectMap["parameters"] = ura.Parameters + } + if ura.Name != "" { + objectMap["name"] = ura.Name + } + return json.Marshal(objectMap) +} + +// AsURLRedirectAction is the BasicDeliveryRuleAction implementation for URLRewriteAction. +func (ura URLRewriteAction) AsURLRedirectAction() (*URLRedirectAction, bool) { + return nil, false +} + +// AsURLRewriteAction is the BasicDeliveryRuleAction implementation for URLRewriteAction. +func (ura URLRewriteAction) AsURLRewriteAction() (*URLRewriteAction, bool) { + return &ura, true +} + +// AsDeliveryRuleRequestHeaderAction is the BasicDeliveryRuleAction implementation for URLRewriteAction. +func (ura URLRewriteAction) AsDeliveryRuleRequestHeaderAction() (*DeliveryRuleRequestHeaderAction, bool) { + return nil, false +} + +// AsDeliveryRuleResponseHeaderAction is the BasicDeliveryRuleAction implementation for URLRewriteAction. +func (ura URLRewriteAction) AsDeliveryRuleResponseHeaderAction() (*DeliveryRuleResponseHeaderAction, bool) { + return nil, false +} + +// AsDeliveryRuleCacheExpirationAction is the BasicDeliveryRuleAction implementation for URLRewriteAction. +func (ura URLRewriteAction) AsDeliveryRuleCacheExpirationAction() (*DeliveryRuleCacheExpirationAction, bool) { + return nil, false +} + +// AsDeliveryRuleCacheKeyQueryStringAction is the BasicDeliveryRuleAction implementation for URLRewriteAction. +func (ura URLRewriteAction) AsDeliveryRuleCacheKeyQueryStringAction() (*DeliveryRuleCacheKeyQueryStringAction, bool) { + return nil, false +} + +// AsDeliveryRuleAction is the BasicDeliveryRuleAction implementation for URLRewriteAction. +func (ura URLRewriteAction) AsDeliveryRuleAction() (*DeliveryRuleAction, bool) { + return nil, false +} + +// AsBasicDeliveryRuleAction is the BasicDeliveryRuleAction implementation for URLRewriteAction. +func (ura URLRewriteAction) AsBasicDeliveryRuleAction() (BasicDeliveryRuleAction, bool) { + return &ura, true +} + +// URLRewriteActionParameters defines the parameters for the url rewrite action. +type URLRewriteActionParameters struct { + OdataType *string `json:"@odata.type,omitempty"` + // SourcePattern - define a request URI pattern that identifies the type of requests that may be rewritten. If value is blank, all strings are matched. + SourcePattern *string `json:"sourcePattern,omitempty"` + // Destination - Define the relative URL to which the above requests will be rewritten by. + Destination *string `json:"destination,omitempty"` + // PreserveUnmatchedPath - Whether to preserve unmatched path. Default value is true. + PreserveUnmatchedPath *bool `json:"preserveUnmatchedPath,omitempty"` +} + +// URLSigningActionParameters defines the parameters for the Url Signing action. +type URLSigningActionParameters struct { + // KeyID - Id reference of the key to be used to verify the hash and should be defined in UrlSigningKeys + KeyID *string `json:"keyId,omitempty"` + // Algorithm - Algorithm to use for URL signing. Possible values include: 'SHA256' + Algorithm Algorithm `json:"algorithm,omitempty"` + // ParameterNameOverride - Defines which query string parameters in the url to be considered for expires, key id etc. + ParameterNameOverride *[]URLSigningParamIdentifier `json:"parameterNameOverride,omitempty"` + // IPSubnets - Match values to match against. Supports CIDR ranges (both IPv4 and IPv6). + IPSubnets *[]string `json:"ipSubnets,omitempty"` +} + +// URLSigningKey url signing key +type URLSigningKey struct { + // KeyID - Defines the customer defined key Id. This id will exist in the incoming request to indicate the key used to form the hash. + KeyID *string `json:"keyId,omitempty"` + // KeySourceParameters - Defines the parameters for using customer key vault for Url Signing Key. + KeySourceParameters *KeyVaultSigningKeyParameters `json:"keySourceParameters,omitempty"` +} + +// URLSigningParamIdentifier defines how to identify a parameter for a specific purpose e.g. expires +type URLSigningParamIdentifier struct { + // ParamIndicator - Indicates the purpose of the parameter. Possible values include: 'Expires', 'KeyID', 'Signature' + ParamIndicator ParamIndicator `json:"paramIndicator,omitempty"` + // ParamName - Parameter name + ParamName *string `json:"paramName,omitempty"` +} + +// UserManagedHTTPSParameters defines the certificate source parameters using user's keyvault certificate +// for enabling SSL. +type UserManagedHTTPSParameters struct { + // CertificateSourceParameters - Defines the certificate source parameters using user's keyvault certificate for enabling SSL. + CertificateSourceParameters *KeyVaultCertificateSourceParameters `json:"certificateSourceParameters,omitempty"` + // ProtocolType - Defines the TLS extension protocol that is used for secure delivery. Possible values include: 'ServerNameIndication', 'IPBased' + ProtocolType ProtocolType `json:"protocolType,omitempty"` + // MinimumTLSVersion - TLS protocol version that will be used for Https. Possible values include: 'None', 'TLS10', 'TLS12' + MinimumTLSVersion MinimumTLSVersion `json:"minimumTlsVersion,omitempty"` + // CertificateSource - Possible values include: 'CertificateSourceCustomDomainHTTPSParameters', 'CertificateSourceCdn', 'CertificateSourceAzureKeyVault' + CertificateSource CertificateSource `json:"certificateSource,omitempty"` +} + +// MarshalJSON is the custom marshaler for UserManagedHTTPSParameters. +func (umhp UserManagedHTTPSParameters) MarshalJSON() ([]byte, error) { + umhp.CertificateSource = CertificateSourceAzureKeyVault + objectMap := make(map[string]interface{}) + if umhp.CertificateSourceParameters != nil { + objectMap["certificateSourceParameters"] = umhp.CertificateSourceParameters + } + if umhp.ProtocolType != "" { + objectMap["protocolType"] = umhp.ProtocolType + } + if umhp.MinimumTLSVersion != "" { + objectMap["minimumTlsVersion"] = umhp.MinimumTLSVersion + } + if umhp.CertificateSource != "" { + objectMap["certificateSource"] = umhp.CertificateSource + } + return json.Marshal(objectMap) +} + +// AsManagedHTTPSParameters is the BasicCustomDomainHTTPSParameters implementation for UserManagedHTTPSParameters. +func (umhp UserManagedHTTPSParameters) AsManagedHTTPSParameters() (*ManagedHTTPSParameters, bool) { + return nil, false +} + +// AsUserManagedHTTPSParameters is the BasicCustomDomainHTTPSParameters implementation for UserManagedHTTPSParameters. +func (umhp UserManagedHTTPSParameters) AsUserManagedHTTPSParameters() (*UserManagedHTTPSParameters, bool) { + return &umhp, true +} + +// AsCustomDomainHTTPSParameters is the BasicCustomDomainHTTPSParameters implementation for UserManagedHTTPSParameters. +func (umhp UserManagedHTTPSParameters) AsCustomDomainHTTPSParameters() (*CustomDomainHTTPSParameters, bool) { + return nil, false +} + +// AsBasicCustomDomainHTTPSParameters is the BasicCustomDomainHTTPSParameters implementation for UserManagedHTTPSParameters. +func (umhp UserManagedHTTPSParameters) AsBasicCustomDomainHTTPSParameters() (BasicCustomDomainHTTPSParameters, bool) { + return &umhp, true +} + +// ValidateCustomDomainInput input of the custom domain to be validated for DNS mapping. +type ValidateCustomDomainInput struct { + // HostName - The host name of the custom domain. Must be a domain name. + HostName *string `json:"hostName,omitempty"` +} + +// ValidateCustomDomainOutput output of custom domain validation. +type ValidateCustomDomainOutput struct { + autorest.Response `json:"-"` + // CustomDomainValidated - READ-ONLY; Indicates whether the custom domain is valid or not. + CustomDomainValidated *bool `json:"customDomainValidated,omitempty"` + // Reason - READ-ONLY; The reason why the custom domain is not valid. + Reason *string `json:"reason,omitempty"` + // Message - READ-ONLY; Error message describing why the custom domain is not valid. + Message *string `json:"message,omitempty"` +} + +// ValidateProbeInput input of the validate probe API. +type ValidateProbeInput struct { + // ProbeURL - The probe URL to validate. + ProbeURL *string `json:"probeURL,omitempty"` +} + +// ValidateProbeOutput output of the validate probe API. +type ValidateProbeOutput struct { + autorest.Response `json:"-"` + // IsValid - READ-ONLY; Indicates whether the probe URL is accepted or not. + IsValid *bool `json:"isValid,omitempty"` + // ErrorCode - READ-ONLY; Specifies the error code when the probe url is not accepted. + ErrorCode *string `json:"errorCode,omitempty"` + // Message - READ-ONLY; The detailed error message describing why the probe URL is not accepted. + Message *string `json:"message,omitempty"` +} + +// WebApplicationFirewallPolicy defines web application firewall policy for Azure CDN. +type WebApplicationFirewallPolicy struct { + autorest.Response `json:"-"` + // WebApplicationFirewallPolicyProperties - Properties of the web application firewall policy. + *WebApplicationFirewallPolicyProperties `json:"properties,omitempty"` + // Etag - Gets a unique read-only string that changes whenever the resource is updated. + Etag *string `json:"etag,omitempty"` + // Sku - The pricing tier (defines a CDN provider, feature list and rate) of the CdnWebApplicationFirewallPolicy. + Sku *Sku `json:"sku,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // ID - READ-ONLY; Resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for WebApplicationFirewallPolicy. +func (wafp WebApplicationFirewallPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wafp.WebApplicationFirewallPolicyProperties != nil { + objectMap["properties"] = wafp.WebApplicationFirewallPolicyProperties + } + if wafp.Etag != nil { + objectMap["etag"] = wafp.Etag + } + if wafp.Sku != nil { + objectMap["sku"] = wafp.Sku + } + if wafp.Location != nil { + objectMap["location"] = wafp.Location + } + if wafp.Tags != nil { + objectMap["tags"] = wafp.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for WebApplicationFirewallPolicy struct. +func (wafp *WebApplicationFirewallPolicy) 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 webApplicationFirewallPolicyProperties WebApplicationFirewallPolicyProperties + err = json.Unmarshal(*v, &webApplicationFirewallPolicyProperties) + if err != nil { + return err + } + wafp.WebApplicationFirewallPolicyProperties = &webApplicationFirewallPolicyProperties + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + wafp.Etag = &etag + } + case "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + wafp.Sku = &sku + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + wafp.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + wafp.Tags = tags + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + wafp.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + wafp.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + wafp.Type = &typeVar + } + } + } + + return nil +} + +// WebApplicationFirewallPolicyList defines a list of WebApplicationFirewallPolicies for Azure CDN. It +// contains a list of WebApplicationFirewallPolicy objects and a URL link to get the next set of results. +type WebApplicationFirewallPolicyList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of Azure CDN WebApplicationFirewallPolicies within a resource group. + Value *[]WebApplicationFirewallPolicy `json:"value,omitempty"` + // NextLink - URL to get the next set of WebApplicationFirewallPolicy objects if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// WebApplicationFirewallPolicyListIterator provides access to a complete listing of +// WebApplicationFirewallPolicy values. +type WebApplicationFirewallPolicyListIterator struct { + i int + page WebApplicationFirewallPolicyListPage +} + +// 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 *WebApplicationFirewallPolicyListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WebApplicationFirewallPolicyListIterator.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 *WebApplicationFirewallPolicyListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter WebApplicationFirewallPolicyListIterator) 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 WebApplicationFirewallPolicyListIterator) Response() WebApplicationFirewallPolicyList { + 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 WebApplicationFirewallPolicyListIterator) Value() WebApplicationFirewallPolicy { + if !iter.page.NotDone() { + return WebApplicationFirewallPolicy{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the WebApplicationFirewallPolicyListIterator type. +func NewWebApplicationFirewallPolicyListIterator(page WebApplicationFirewallPolicyListPage) WebApplicationFirewallPolicyListIterator { + return WebApplicationFirewallPolicyListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (wafpl WebApplicationFirewallPolicyList) IsEmpty() bool { + return wafpl.Value == nil || len(*wafpl.Value) == 0 +} + +// webApplicationFirewallPolicyListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (wafpl WebApplicationFirewallPolicyList) webApplicationFirewallPolicyListPreparer(ctx context.Context) (*http.Request, error) { + if wafpl.NextLink == nil || len(to.String(wafpl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(wafpl.NextLink))) +} + +// WebApplicationFirewallPolicyListPage contains a page of WebApplicationFirewallPolicy values. +type WebApplicationFirewallPolicyListPage struct { + fn func(context.Context, WebApplicationFirewallPolicyList) (WebApplicationFirewallPolicyList, error) + wafpl WebApplicationFirewallPolicyList +} + +// 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 *WebApplicationFirewallPolicyListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WebApplicationFirewallPolicyListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.wafpl) + if err != nil { + return err + } + page.wafpl = next + 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 *WebApplicationFirewallPolicyListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page WebApplicationFirewallPolicyListPage) NotDone() bool { + return !page.wafpl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page WebApplicationFirewallPolicyListPage) Response() WebApplicationFirewallPolicyList { + return page.wafpl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page WebApplicationFirewallPolicyListPage) Values() []WebApplicationFirewallPolicy { + if page.wafpl.IsEmpty() { + return nil + } + return *page.wafpl.Value +} + +// Creates a new instance of the WebApplicationFirewallPolicyListPage type. +func NewWebApplicationFirewallPolicyListPage(getNextPage func(context.Context, WebApplicationFirewallPolicyList) (WebApplicationFirewallPolicyList, error)) WebApplicationFirewallPolicyListPage { + return WebApplicationFirewallPolicyListPage{fn: getNextPage} +} + +// WebApplicationFirewallPolicyPatchParameters properties required to update a +// CdnWebApplicationFirewallPolicy. +type WebApplicationFirewallPolicyPatchParameters struct { + // Tags - CdnWebApplicationFirewallPolicy tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for WebApplicationFirewallPolicyPatchParameters. +func (wafppp WebApplicationFirewallPolicyPatchParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wafppp.Tags != nil { + objectMap["tags"] = wafppp.Tags + } + return json.Marshal(objectMap) +} + +// WebApplicationFirewallPolicyProperties defines CDN web application firewall policy properties. +type WebApplicationFirewallPolicyProperties struct { + // PolicySettings - Describes policySettings for policy + PolicySettings *PolicySettings `json:"policySettings,omitempty"` + // RateLimitRules - Describes rate limit rules inside the policy. + RateLimitRules *RateLimitRuleList `json:"rateLimitRules,omitempty"` + // CustomRules - Describes custom rules inside the policy. + CustomRules *CustomRuleList `json:"customRules,omitempty"` + // ManagedRules - Describes managed rules inside the policy. + ManagedRules *ManagedRuleSetList `json:"managedRules,omitempty"` + // EndpointLinks - READ-ONLY; Describes Azure CDN endpoints associated with this Web Application Firewall policy. + EndpointLinks *[]EndpointType `json:"endpointLinks,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the WebApplicationFirewallPolicy. Possible values include: 'ProvisioningStateCreating', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // ResourceState - READ-ONLY; Possible values include: 'PolicyResourceStateCreating', 'PolicyResourceStateEnabling', 'PolicyResourceStateEnabled', 'PolicyResourceStateDisabling', 'PolicyResourceStateDisabled', 'PolicyResourceStateDeleting' + ResourceState PolicyResourceState `json:"resourceState,omitempty"` +} diff --git a/services/preview/cdn/mgmt/2020-04-15/cdn/operations.go b/services/preview/cdn/mgmt/2020-04-15/cdn/operations.go new file mode 100644 index 000000000000..33fa90279dc0 --- /dev/null +++ b/services/preview/cdn/mgmt/2020-04-15/cdn/operations.go @@ -0,0 +1,147 @@ +package cdn + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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 cdn Management Client +type OperationsClient struct { + BaseClient +} + +// NewOperationsClient creates an instance of the OperationsClient client. +func NewOperationsClient(subscriptionID string, subscriptionID1 string) OperationsClient { + return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) +} + +// 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, subscriptionID1 string) OperationsClient { + return OperationsClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} +} + +// List lists all of the available CDN REST API operations. +func (client OperationsClient) List(ctx context.Context) (result OperationsListResultPage, 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, "cdn.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, "cdn.OperationsClient", "List", resp, "Failure sending request") + return + } + + result.olr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.OperationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2020-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.Cdn/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 OperationsListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 OperationsListResult) (result OperationsListResult, err error) { + req, err := lastResults.operationsListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "cdn.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, "cdn.OperationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.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 OperationsListResultIterator, 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/cdn/mgmt/2020-04-15/cdn/origingroups.go b/services/preview/cdn/mgmt/2020-04-15/cdn/origingroups.go new file mode 100644 index 000000000000..3604de65e02a --- /dev/null +++ b/services/preview/cdn/mgmt/2020-04-15/cdn/origingroups.go @@ -0,0 +1,524 @@ +package cdn + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// OriginGroupsClient is the cdn Management Client +type OriginGroupsClient struct { + BaseClient +} + +// NewOriginGroupsClient creates an instance of the OriginGroupsClient client. +func NewOriginGroupsClient(subscriptionID string, subscriptionID1 string) OriginGroupsClient { + return NewOriginGroupsClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) +} + +// NewOriginGroupsClientWithBaseURI creates an instance of the OriginGroupsClient 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 NewOriginGroupsClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) OriginGroupsClient { + return OriginGroupsClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} +} + +// Create creates a new origin group within the specified endpoint. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - name of the CDN profile which is unique within the resource group. +// endpointName - name of the endpoint under the profile which is unique globally. +// originGroupName - name of the origin group which is unique within the endpoint. +// originGroup - origin group properties +func (client OriginGroupsClient) Create(ctx context.Context, resourceGroupName string, profileName string, endpointName string, originGroupName string, originGroup OriginGroup) (result OriginGroupsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OriginGroupsClient.Create") + 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("cdn.OriginGroupsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, profileName, endpointName, originGroupName, originGroup) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.OriginGroupsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.OriginGroupsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client OriginGroupsClient) CreatePreparer(ctx context.Context, resourceGroupName string, profileName string, endpointName string, originGroupName string, originGroup OriginGroup) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "endpointName": autorest.Encode("path", endpointName), + "originGroupName": autorest.Encode("path", originGroupName), + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-15" + 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.Cdn/profiles/{profileName}/endpoints/{endpointName}/originGroups/{originGroupName}", pathParameters), + autorest.WithJSON(originGroup), + 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 OriginGroupsClient) CreateSender(req *http.Request) (future OriginGroupsCreateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client OriginGroupsClient) CreateResponder(resp *http.Response) (result OriginGroup, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes an existing origin group within an endpoint. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - name of the CDN profile which is unique within the resource group. +// endpointName - name of the endpoint under the profile which is unique globally. +// originGroupName - name of the origin group which is unique within the endpoint. +func (client OriginGroupsClient) Delete(ctx context.Context, resourceGroupName string, profileName string, endpointName string, originGroupName string) (result OriginGroupsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OriginGroupsClient.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("cdn.OriginGroupsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, profileName, endpointName, originGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.OriginGroupsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.OriginGroupsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client OriginGroupsClient) DeletePreparer(ctx context.Context, resourceGroupName string, profileName string, endpointName string, originGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "endpointName": autorest.Encode("path", endpointName), + "originGroupName": autorest.Encode("path", originGroupName), + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/originGroups/{originGroupName}", 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 OriginGroupsClient) DeleteSender(req *http.Request) (future OriginGroupsDeleteFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client OriginGroupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets an existing origin group within an endpoint. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - name of the CDN profile which is unique within the resource group. +// endpointName - name of the endpoint under the profile which is unique globally. +// originGroupName - name of the origin group which is unique within the endpoint. +func (client OriginGroupsClient) Get(ctx context.Context, resourceGroupName string, profileName string, endpointName string, originGroupName string) (result OriginGroup, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OriginGroupsClient.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("cdn.OriginGroupsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, profileName, endpointName, originGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.OriginGroupsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "cdn.OriginGroupsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.OriginGroupsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client OriginGroupsClient) GetPreparer(ctx context.Context, resourceGroupName string, profileName string, endpointName string, originGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "endpointName": autorest.Encode("path", endpointName), + "originGroupName": autorest.Encode("path", originGroupName), + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/originGroups/{originGroupName}", 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 OriginGroupsClient) 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 OriginGroupsClient) GetResponder(resp *http.Response) (result OriginGroup, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByEndpoint lists all of the existing origin groups within an endpoint. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - name of the CDN profile which is unique within the resource group. +// endpointName - name of the endpoint under the profile which is unique globally. +func (client OriginGroupsClient) ListByEndpoint(ctx context.Context, resourceGroupName string, profileName string, endpointName string) (result OriginGroupListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OriginGroupsClient.ListByEndpoint") + defer func() { + sc := -1 + if result.oglr.Response.Response != nil { + sc = result.oglr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("cdn.OriginGroupsClient", "ListByEndpoint", err.Error()) + } + + result.fn = client.listByEndpointNextResults + req, err := client.ListByEndpointPreparer(ctx, resourceGroupName, profileName, endpointName) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.OriginGroupsClient", "ListByEndpoint", nil, "Failure preparing request") + return + } + + resp, err := client.ListByEndpointSender(req) + if err != nil { + result.oglr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "cdn.OriginGroupsClient", "ListByEndpoint", resp, "Failure sending request") + return + } + + result.oglr, err = client.ListByEndpointResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.OriginGroupsClient", "ListByEndpoint", resp, "Failure responding to request") + } + + return +} + +// ListByEndpointPreparer prepares the ListByEndpoint request. +func (client OriginGroupsClient) ListByEndpointPreparer(ctx context.Context, resourceGroupName string, profileName string, endpointName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "endpointName": autorest.Encode("path", endpointName), + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/originGroups", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByEndpointSender sends the ListByEndpoint request. The method will close the +// http.Response Body if it receives an error. +func (client OriginGroupsClient) ListByEndpointSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByEndpointResponder handles the response to the ListByEndpoint request. The method always +// closes the http.Response Body. +func (client OriginGroupsClient) ListByEndpointResponder(resp *http.Response) (result OriginGroupListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByEndpointNextResults retrieves the next set of results, if any. +func (client OriginGroupsClient) listByEndpointNextResults(ctx context.Context, lastResults OriginGroupListResult) (result OriginGroupListResult, err error) { + req, err := lastResults.originGroupListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "cdn.OriginGroupsClient", "listByEndpointNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByEndpointSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "cdn.OriginGroupsClient", "listByEndpointNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByEndpointResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.OriginGroupsClient", "listByEndpointNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByEndpointComplete enumerates all values, automatically crossing page boundaries as required. +func (client OriginGroupsClient) ListByEndpointComplete(ctx context.Context, resourceGroupName string, profileName string, endpointName string) (result OriginGroupListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OriginGroupsClient.ListByEndpoint") + 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.ListByEndpoint(ctx, resourceGroupName, profileName, endpointName) + return +} + +// Update updates an existing origin group within an endpoint. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - name of the CDN profile which is unique within the resource group. +// endpointName - name of the endpoint under the profile which is unique globally. +// originGroupName - name of the origin group which is unique within the endpoint. +// originGroupUpdateProperties - origin group properties +func (client OriginGroupsClient) Update(ctx context.Context, resourceGroupName string, profileName string, endpointName string, originGroupName string, originGroupUpdateProperties OriginGroupUpdateParameters) (result OriginGroupsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OriginGroupsClient.Update") + 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("cdn.OriginGroupsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, profileName, endpointName, originGroupName, originGroupUpdateProperties) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.OriginGroupsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.OriginGroupsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client OriginGroupsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, profileName string, endpointName string, originGroupName string, originGroupUpdateProperties OriginGroupUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "endpointName": autorest.Encode("path", endpointName), + "originGroupName": autorest.Encode("path", originGroupName), + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-15" + 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.Cdn/profiles/{profileName}/endpoints/{endpointName}/originGroups/{originGroupName}", pathParameters), + autorest.WithJSON(originGroupUpdateProperties), + 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 OriginGroupsClient) UpdateSender(req *http.Request) (future OriginGroupsUpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client OriginGroupsClient) UpdateResponder(resp *http.Response) (result OriginGroup, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/cdn/mgmt/2020-04-15/cdn/origins.go b/services/preview/cdn/mgmt/2020-04-15/cdn/origins.go new file mode 100644 index 000000000000..ab9bb647eceb --- /dev/null +++ b/services/preview/cdn/mgmt/2020-04-15/cdn/origins.go @@ -0,0 +1,524 @@ +package cdn + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// OriginsClient is the cdn Management Client +type OriginsClient struct { + BaseClient +} + +// NewOriginsClient creates an instance of the OriginsClient client. +func NewOriginsClient(subscriptionID string, subscriptionID1 string) OriginsClient { + return NewOriginsClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) +} + +// NewOriginsClientWithBaseURI creates an instance of the OriginsClient 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 NewOriginsClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) OriginsClient { + return OriginsClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} +} + +// Create creates a new origin within the specified endpoint. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - name of the CDN profile which is unique within the resource group. +// endpointName - name of the endpoint under the profile which is unique globally. +// originName - name of the origin that is unique within the endpoint. +// origin - origin properties +func (client OriginsClient) Create(ctx context.Context, resourceGroupName string, profileName string, endpointName string, originName string, origin Origin) (result OriginsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OriginsClient.Create") + 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("cdn.OriginsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, profileName, endpointName, originName, origin) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.OriginsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.OriginsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client OriginsClient) CreatePreparer(ctx context.Context, resourceGroupName string, profileName string, endpointName string, originName string, origin Origin) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "endpointName": autorest.Encode("path", endpointName), + "originName": autorest.Encode("path", originName), + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-15" + 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.Cdn/profiles/{profileName}/endpoints/{endpointName}/origins/{originName}", pathParameters), + autorest.WithJSON(origin), + 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 OriginsClient) CreateSender(req *http.Request) (future OriginsCreateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client OriginsClient) CreateResponder(resp *http.Response) (result Origin, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes an existing origin within an endpoint. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - name of the CDN profile which is unique within the resource group. +// endpointName - name of the endpoint under the profile which is unique globally. +// originName - name of the origin which is unique within the endpoint. +func (client OriginsClient) Delete(ctx context.Context, resourceGroupName string, profileName string, endpointName string, originName string) (result OriginsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OriginsClient.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("cdn.OriginsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, profileName, endpointName, originName) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.OriginsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.OriginsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client OriginsClient) DeletePreparer(ctx context.Context, resourceGroupName string, profileName string, endpointName string, originName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "endpointName": autorest.Encode("path", endpointName), + "originName": autorest.Encode("path", originName), + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/origins/{originName}", 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 OriginsClient) DeleteSender(req *http.Request) (future OriginsDeleteFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client OriginsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets an existing origin within an endpoint. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - name of the CDN profile which is unique within the resource group. +// endpointName - name of the endpoint under the profile which is unique globally. +// originName - name of the origin which is unique within the endpoint. +func (client OriginsClient) Get(ctx context.Context, resourceGroupName string, profileName string, endpointName string, originName string) (result Origin, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OriginsClient.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("cdn.OriginsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, profileName, endpointName, originName) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.OriginsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "cdn.OriginsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.OriginsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client OriginsClient) GetPreparer(ctx context.Context, resourceGroupName string, profileName string, endpointName string, originName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "endpointName": autorest.Encode("path", endpointName), + "originName": autorest.Encode("path", originName), + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/origins/{originName}", 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 OriginsClient) 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 OriginsClient) GetResponder(resp *http.Response) (result Origin, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByEndpoint lists all of the existing origins within an endpoint. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - name of the CDN profile which is unique within the resource group. +// endpointName - name of the endpoint under the profile which is unique globally. +func (client OriginsClient) ListByEndpoint(ctx context.Context, resourceGroupName string, profileName string, endpointName string) (result OriginListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OriginsClient.ListByEndpoint") + defer func() { + sc := -1 + if result.olr.Response.Response != nil { + sc = result.olr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("cdn.OriginsClient", "ListByEndpoint", err.Error()) + } + + result.fn = client.listByEndpointNextResults + req, err := client.ListByEndpointPreparer(ctx, resourceGroupName, profileName, endpointName) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.OriginsClient", "ListByEndpoint", nil, "Failure preparing request") + return + } + + resp, err := client.ListByEndpointSender(req) + if err != nil { + result.olr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "cdn.OriginsClient", "ListByEndpoint", resp, "Failure sending request") + return + } + + result.olr, err = client.ListByEndpointResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.OriginsClient", "ListByEndpoint", resp, "Failure responding to request") + } + + return +} + +// ListByEndpointPreparer prepares the ListByEndpoint request. +func (client OriginsClient) ListByEndpointPreparer(ctx context.Context, resourceGroupName string, profileName string, endpointName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "endpointName": autorest.Encode("path", endpointName), + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/endpoints/{endpointName}/origins", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByEndpointSender sends the ListByEndpoint request. The method will close the +// http.Response Body if it receives an error. +func (client OriginsClient) ListByEndpointSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByEndpointResponder handles the response to the ListByEndpoint request. The method always +// closes the http.Response Body. +func (client OriginsClient) ListByEndpointResponder(resp *http.Response) (result OriginListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByEndpointNextResults retrieves the next set of results, if any. +func (client OriginsClient) listByEndpointNextResults(ctx context.Context, lastResults OriginListResult) (result OriginListResult, err error) { + req, err := lastResults.originListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "cdn.OriginsClient", "listByEndpointNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByEndpointSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "cdn.OriginsClient", "listByEndpointNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByEndpointResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.OriginsClient", "listByEndpointNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByEndpointComplete enumerates all values, automatically crossing page boundaries as required. +func (client OriginsClient) ListByEndpointComplete(ctx context.Context, resourceGroupName string, profileName string, endpointName string) (result OriginListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OriginsClient.ListByEndpoint") + 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.ListByEndpoint(ctx, resourceGroupName, profileName, endpointName) + return +} + +// Update updates an existing origin within an endpoint. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - name of the CDN profile which is unique within the resource group. +// endpointName - name of the endpoint under the profile which is unique globally. +// originName - name of the origin which is unique within the endpoint. +// originUpdateProperties - origin properties +func (client OriginsClient) Update(ctx context.Context, resourceGroupName string, profileName string, endpointName string, originName string, originUpdateProperties OriginUpdateParameters) (result OriginsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OriginsClient.Update") + 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("cdn.OriginsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, profileName, endpointName, originName, originUpdateProperties) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.OriginsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.OriginsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client OriginsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, profileName string, endpointName string, originName string, originUpdateProperties OriginUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "endpointName": autorest.Encode("path", endpointName), + "originName": autorest.Encode("path", originName), + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-15" + 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.Cdn/profiles/{profileName}/endpoints/{endpointName}/origins/{originName}", pathParameters), + autorest.WithJSON(originUpdateProperties), + 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 OriginsClient) UpdateSender(req *http.Request) (future OriginsUpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client OriginsClient) UpdateResponder(resp *http.Response) (result Origin, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/cdn/mgmt/2020-04-15/cdn/policies.go b/services/preview/cdn/mgmt/2020-04-15/cdn/policies.go new file mode 100644 index 000000000000..5a65430ad18c --- /dev/null +++ b/services/preview/cdn/mgmt/2020-04-15/cdn/policies.go @@ -0,0 +1,521 @@ +package cdn + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// PoliciesClient is the cdn Management Client +type PoliciesClient struct { + BaseClient +} + +// NewPoliciesClient creates an instance of the PoliciesClient client. +func NewPoliciesClient(subscriptionID string, subscriptionID1 string) PoliciesClient { + return NewPoliciesClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) +} + +// NewPoliciesClientWithBaseURI creates an instance of the PoliciesClient 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 NewPoliciesClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) PoliciesClient { + return PoliciesClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} +} + +// CreateOrUpdate create or update policy with specified rule set name within a resource group. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// policyName - the name of the CdnWebApplicationFirewallPolicy. +// cdnWebApplicationFirewallPolicy - policy to be created. +func (client PoliciesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, policyName string, cdnWebApplicationFirewallPolicy WebApplicationFirewallPolicy) (result PoliciesCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PoliciesClient.CreateOrUpdate") + 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: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: policyName, + Constraints: []validation.Constraint{{Target: "policyName", Name: validation.MaxLength, Rule: 128, Chain: nil}}}, + {TargetValue: cdnWebApplicationFirewallPolicy, + Constraints: []validation.Constraint{{Target: "cdnWebApplicationFirewallPolicy.WebApplicationFirewallPolicyProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "cdnWebApplicationFirewallPolicy.WebApplicationFirewallPolicyProperties.PolicySettings", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "cdnWebApplicationFirewallPolicy.WebApplicationFirewallPolicyProperties.PolicySettings.DefaultCustomBlockResponseBody", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "cdnWebApplicationFirewallPolicy.WebApplicationFirewallPolicyProperties.PolicySettings.DefaultCustomBlockResponseBody", Name: validation.Pattern, Rule: `^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$`, Chain: nil}}}, + }}, + }}, + {Target: "cdnWebApplicationFirewallPolicy.Sku", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("cdn.PoliciesClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, policyName, cdnWebApplicationFirewallPolicy) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.PoliciesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.PoliciesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client PoliciesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, policyName string, cdnWebApplicationFirewallPolicy WebApplicationFirewallPolicy) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-15" + 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.Cdn/CdnWebApplicationFirewallPolicies/{policyName}", pathParameters), + autorest.WithJSON(cdnWebApplicationFirewallPolicy), + 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 PoliciesClient) CreateOrUpdateSender(req *http.Request) (future PoliciesCreateOrUpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client PoliciesClient) CreateOrUpdateResponder(resp *http.Response) (result WebApplicationFirewallPolicy, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes Policy +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// policyName - the name of the CdnWebApplicationFirewallPolicy. +func (client PoliciesClient) Delete(ctx context.Context, resourceGroupName string, policyName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PoliciesClient.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: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: policyName, + Constraints: []validation.Constraint{{Target: "policyName", Name: validation.MaxLength, Rule: 128, Chain: nil}}}}); err != nil { + return result, validation.NewError("cdn.PoliciesClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, policyName) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.PoliciesClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "cdn.PoliciesClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.PoliciesClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client PoliciesClient) DeletePreparer(ctx context.Context, resourceGroupName string, policyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/CdnWebApplicationFirewallPolicies/{policyName}", 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 PoliciesClient) 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 PoliciesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieve protection policy with specified name within a resource group. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// policyName - the name of the CdnWebApplicationFirewallPolicy. +func (client PoliciesClient) Get(ctx context.Context, resourceGroupName string, policyName string) (result WebApplicationFirewallPolicy, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PoliciesClient.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: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: policyName, + Constraints: []validation.Constraint{{Target: "policyName", Name: validation.MaxLength, Rule: 128, Chain: nil}}}}); err != nil { + return result, validation.NewError("cdn.PoliciesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, policyName) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.PoliciesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "cdn.PoliciesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.PoliciesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client PoliciesClient) GetPreparer(ctx context.Context, resourceGroupName string, policyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/CdnWebApplicationFirewallPolicies/{policyName}", 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 PoliciesClient) 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 PoliciesClient) GetResponder(resp *http.Response) (result WebApplicationFirewallPolicy, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists all of the protection policies within a resource group. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +func (client PoliciesClient) List(ctx context.Context, resourceGroupName string) (result WebApplicationFirewallPolicyListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PoliciesClient.List") + defer func() { + sc := -1 + if result.wafpl.Response.Response != nil { + sc = result.wafpl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("cdn.PoliciesClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.PoliciesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.wafpl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "cdn.PoliciesClient", "List", resp, "Failure sending request") + return + } + + result.wafpl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.PoliciesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client PoliciesClient) ListPreparer(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 = "2020-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/CdnWebApplicationFirewallPolicies", 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 PoliciesClient) 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 PoliciesClient) ListResponder(resp *http.Response) (result WebApplicationFirewallPolicyList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 PoliciesClient) listNextResults(ctx context.Context, lastResults WebApplicationFirewallPolicyList) (result WebApplicationFirewallPolicyList, err error) { + req, err := lastResults.webApplicationFirewallPolicyListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "cdn.PoliciesClient", "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, "cdn.PoliciesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.PoliciesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client PoliciesClient) ListComplete(ctx context.Context, resourceGroupName string) (result WebApplicationFirewallPolicyListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PoliciesClient.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) + return +} + +// Update update an existing CdnWebApplicationFirewallPolicy with the specified policy name under the specified +// subscription and resource group +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// policyName - the name of the CdnWebApplicationFirewallPolicy. +// cdnWebApplicationFirewallPolicyPatchParameters - cdnWebApplicationFirewallPolicy parameters to be patched. +func (client PoliciesClient) Update(ctx context.Context, resourceGroupName string, policyName string, cdnWebApplicationFirewallPolicyPatchParameters WebApplicationFirewallPolicyPatchParameters) (result PoliciesUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PoliciesClient.Update") + 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: 80, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9_\-\(\)\.]*[^\.]$`, Chain: nil}}}, + {TargetValue: policyName, + Constraints: []validation.Constraint{{Target: "policyName", Name: validation.MaxLength, Rule: 128, Chain: nil}}}}); err != nil { + return result, validation.NewError("cdn.PoliciesClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, policyName, cdnWebApplicationFirewallPolicyPatchParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.PoliciesClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.PoliciesClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client PoliciesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, policyName string, cdnWebApplicationFirewallPolicyPatchParameters WebApplicationFirewallPolicyPatchParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "policyName": autorest.Encode("path", policyName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-15" + 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.Cdn/CdnWebApplicationFirewallPolicies/{policyName}", pathParameters), + autorest.WithJSON(cdnWebApplicationFirewallPolicyPatchParameters), + 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 PoliciesClient) UpdateSender(req *http.Request) (future PoliciesUpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client PoliciesClient) UpdateResponder(resp *http.Response) (result WebApplicationFirewallPolicy, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/cdn/mgmt/2020-04-15/cdn/profiles.go b/services/preview/cdn/mgmt/2020-04-15/cdn/profiles.go new file mode 100644 index 000000000000..668d52b9aab8 --- /dev/null +++ b/services/preview/cdn/mgmt/2020-04-15/cdn/profiles.go @@ -0,0 +1,911 @@ +package cdn + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// ProfilesClient is the cdn Management Client +type ProfilesClient struct { + BaseClient +} + +// NewProfilesClient creates an instance of the ProfilesClient client. +func NewProfilesClient(subscriptionID string, subscriptionID1 string) ProfilesClient { + return NewProfilesClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) +} + +// NewProfilesClientWithBaseURI creates an instance of the ProfilesClient 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 NewProfilesClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) ProfilesClient { + return ProfilesClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} +} + +// Create creates a new CDN profile with a profile name under the specified subscription and resource group. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - name of the CDN profile which is unique within the resource group. +// profile - profile properties needed to create a new profile. +func (client ProfilesClient) Create(ctx context.Context, resourceGroupName string, profileName string, profile Profile) (result ProfilesCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProfilesClient.Create") + 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: profile, + Constraints: []validation.Constraint{{Target: "profile.Sku", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("cdn.ProfilesClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, profileName, profile) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.ProfilesClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.ProfilesClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ProfilesClient) CreatePreparer(ctx context.Context, resourceGroupName string, profileName string, profile Profile) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-15" + 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.Cdn/profiles/{profileName}", pathParameters), + autorest.WithJSON(profile), + 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 ProfilesClient) CreateSender(req *http.Request) (future ProfilesCreateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ProfilesClient) CreateResponder(resp *http.Response) (result Profile, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes an existing CDN profile with the specified parameters. Deleting a profile will result in the deletion +// of all of the sub-resources including endpoints, origins and custom domains. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - name of the CDN profile which is unique within the resource group. +func (client ProfilesClient) Delete(ctx context.Context, resourceGroupName string, profileName string) (result ProfilesDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProfilesClient.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("cdn.ProfilesClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, profileName) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.ProfilesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.ProfilesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ProfilesClient) DeletePreparer(ctx context.Context, resourceGroupName string, profileName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}", 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 ProfilesClient) DeleteSender(req *http.Request) (future ProfilesDeleteFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ProfilesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// GenerateSsoURI generates a dynamic SSO URI used to sign in to the CDN supplemental portal. Supplemental portal is +// used to configure advanced feature capabilities that are not yet available in the Azure portal, such as core reports +// in a standard profile; rules engine, advanced HTTP reports, and real-time stats and alerts in a premium profile. The +// SSO URI changes approximately every 10 minutes. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - name of the CDN profile which is unique within the resource group. +func (client ProfilesClient) GenerateSsoURI(ctx context.Context, resourceGroupName string, profileName string) (result SsoURI, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProfilesClient.GenerateSsoURI") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("cdn.ProfilesClient", "GenerateSsoURI", err.Error()) + } + + req, err := client.GenerateSsoURIPreparer(ctx, resourceGroupName, profileName) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.ProfilesClient", "GenerateSsoURI", nil, "Failure preparing request") + return + } + + resp, err := client.GenerateSsoURISender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "cdn.ProfilesClient", "GenerateSsoURI", resp, "Failure sending request") + return + } + + result, err = client.GenerateSsoURIResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.ProfilesClient", "GenerateSsoURI", resp, "Failure responding to request") + } + + return +} + +// GenerateSsoURIPreparer prepares the GenerateSsoURI request. +func (client ProfilesClient) GenerateSsoURIPreparer(ctx context.Context, resourceGroupName string, profileName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/generateSsoUri", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GenerateSsoURISender sends the GenerateSsoURI request. The method will close the +// http.Response Body if it receives an error. +func (client ProfilesClient) GenerateSsoURISender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GenerateSsoURIResponder handles the response to the GenerateSsoURI request. The method always +// closes the http.Response Body. +func (client ProfilesClient) GenerateSsoURIResponder(resp *http.Response) (result SsoURI, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets a CDN profile with the specified profile name under the specified subscription and resource group. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - name of the CDN profile which is unique within the resource group. +func (client ProfilesClient) Get(ctx context.Context, resourceGroupName string, profileName string) (result Profile, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProfilesClient.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("cdn.ProfilesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, profileName) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.ProfilesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "cdn.ProfilesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.ProfilesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ProfilesClient) GetPreparer(ctx context.Context, resourceGroupName string, profileName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}", 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 ProfilesClient) 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 ProfilesClient) GetResponder(resp *http.Response) (result Profile, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists all of the CDN profiles within an Azure subscription. +func (client ProfilesClient) List(ctx context.Context) (result ProfileListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProfilesClient.List") + defer func() { + sc := -1 + if result.plr.Response.Response != nil { + sc = result.plr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.ProfilesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.plr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "cdn.ProfilesClient", "List", resp, "Failure sending request") + return + } + + result.plr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.ProfilesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client ProfilesClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Cdn/profiles", 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 ProfilesClient) 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 ProfilesClient) ListResponder(resp *http.Response) (result ProfileListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 ProfilesClient) listNextResults(ctx context.Context, lastResults ProfileListResult) (result ProfileListResult, err error) { + req, err := lastResults.profileListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "cdn.ProfilesClient", "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, "cdn.ProfilesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.ProfilesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ProfilesClient) ListComplete(ctx context.Context) (result ProfileListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProfilesClient.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 of the CDN profiles within a resource group. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +func (client ProfilesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ProfileListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProfilesClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.plr.Response.Response != nil { + sc = result.plr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("cdn.ProfilesClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.ProfilesClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.plr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "cdn.ProfilesClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.plr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.ProfilesClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client ProfilesClient) 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 = "2020-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles", 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 ProfilesClient) 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 ProfilesClient) ListByResourceGroupResponder(resp *http.Response) (result ProfileListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 ProfilesClient) listByResourceGroupNextResults(ctx context.Context, lastResults ProfileListResult) (result ProfileListResult, err error) { + req, err := lastResults.profileListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "cdn.ProfilesClient", "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, "cdn.ProfilesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.ProfilesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client ProfilesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ProfileListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProfilesClient.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 +} + +// ListResourceUsage checks the quota and actual usage of endpoints under the given CDN profile. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - name of the CDN profile which is unique within the resource group. +func (client ProfilesClient) ListResourceUsage(ctx context.Context, resourceGroupName string, profileName string) (result ResourceUsageListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProfilesClient.ListResourceUsage") + defer func() { + sc := -1 + if result.rulr.Response.Response != nil { + sc = result.rulr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("cdn.ProfilesClient", "ListResourceUsage", err.Error()) + } + + result.fn = client.listResourceUsageNextResults + req, err := client.ListResourceUsagePreparer(ctx, resourceGroupName, profileName) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.ProfilesClient", "ListResourceUsage", nil, "Failure preparing request") + return + } + + resp, err := client.ListResourceUsageSender(req) + if err != nil { + result.rulr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "cdn.ProfilesClient", "ListResourceUsage", resp, "Failure sending request") + return + } + + result.rulr, err = client.ListResourceUsageResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.ProfilesClient", "ListResourceUsage", resp, "Failure responding to request") + } + + return +} + +// ListResourceUsagePreparer prepares the ListResourceUsage request. +func (client ProfilesClient) ListResourceUsagePreparer(ctx context.Context, resourceGroupName string, profileName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/checkResourceUsage", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListResourceUsageSender sends the ListResourceUsage request. The method will close the +// http.Response Body if it receives an error. +func (client ProfilesClient) ListResourceUsageSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResourceUsageResponder handles the response to the ListResourceUsage request. The method always +// closes the http.Response Body. +func (client ProfilesClient) ListResourceUsageResponder(resp *http.Response) (result ResourceUsageListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listResourceUsageNextResults retrieves the next set of results, if any. +func (client ProfilesClient) listResourceUsageNextResults(ctx context.Context, lastResults ResourceUsageListResult) (result ResourceUsageListResult, err error) { + req, err := lastResults.resourceUsageListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "cdn.ProfilesClient", "listResourceUsageNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListResourceUsageSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "cdn.ProfilesClient", "listResourceUsageNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResourceUsageResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.ProfilesClient", "listResourceUsageNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListResourceUsageComplete enumerates all values, automatically crossing page boundaries as required. +func (client ProfilesClient) ListResourceUsageComplete(ctx context.Context, resourceGroupName string, profileName string) (result ResourceUsageListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProfilesClient.ListResourceUsage") + 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.ListResourceUsage(ctx, resourceGroupName, profileName) + return +} + +// ListSupportedOptimizationTypes gets the supported optimization types for the current profile. A user can create an +// endpoint with an optimization type from the listed values. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - name of the CDN profile which is unique within the resource group. +func (client ProfilesClient) ListSupportedOptimizationTypes(ctx context.Context, resourceGroupName string, profileName string) (result SupportedOptimizationTypesListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProfilesClient.ListSupportedOptimizationTypes") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("cdn.ProfilesClient", "ListSupportedOptimizationTypes", err.Error()) + } + + req, err := client.ListSupportedOptimizationTypesPreparer(ctx, resourceGroupName, profileName) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.ProfilesClient", "ListSupportedOptimizationTypes", nil, "Failure preparing request") + return + } + + resp, err := client.ListSupportedOptimizationTypesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "cdn.ProfilesClient", "ListSupportedOptimizationTypes", resp, "Failure sending request") + return + } + + result, err = client.ListSupportedOptimizationTypesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.ProfilesClient", "ListSupportedOptimizationTypes", resp, "Failure responding to request") + } + + return +} + +// ListSupportedOptimizationTypesPreparer prepares the ListSupportedOptimizationTypes request. +func (client ProfilesClient) ListSupportedOptimizationTypesPreparer(ctx context.Context, resourceGroupName string, profileName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cdn/profiles/{profileName}/getSupportedOptimizationTypes", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSupportedOptimizationTypesSender sends the ListSupportedOptimizationTypes request. The method will close the +// http.Response Body if it receives an error. +func (client ProfilesClient) ListSupportedOptimizationTypesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSupportedOptimizationTypesResponder handles the response to the ListSupportedOptimizationTypes request. The method always +// closes the http.Response Body. +func (client ProfilesClient) ListSupportedOptimizationTypesResponder(resp *http.Response) (result SupportedOptimizationTypesListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update updates an existing CDN profile with the specified profile name under the specified subscription and resource +// group. +// Parameters: +// resourceGroupName - name of the Resource group within the Azure subscription. +// profileName - name of the CDN profile which is unique within the resource group. +// profileUpdateParameters - profile properties needed to update an existing profile. +func (client ProfilesClient) Update(ctx context.Context, resourceGroupName string, profileName string, profileUpdateParameters ProfileUpdateParameters) (result ProfilesUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProfilesClient.Update") + 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("cdn.ProfilesClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, profileName, profileUpdateParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.ProfilesClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.ProfilesClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ProfilesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, profileName string, profileUpdateParameters ProfileUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "profileName": autorest.Encode("path", profileName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-15" + 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.Cdn/profiles/{profileName}", pathParameters), + autorest.WithJSON(profileUpdateParameters), + 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 ProfilesClient) UpdateSender(req *http.Request) (future ProfilesUpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ProfilesClient) UpdateResponder(resp *http.Response) (result Profile, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/cdn/mgmt/2020-04-15/cdn/resourceusage.go b/services/preview/cdn/mgmt/2020-04-15/cdn/resourceusage.go new file mode 100644 index 000000000000..79d8b37e434c --- /dev/null +++ b/services/preview/cdn/mgmt/2020-04-15/cdn/resourceusage.go @@ -0,0 +1,151 @@ +package cdn + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// ResourceUsageClient is the cdn Management Client +type ResourceUsageClient struct { + BaseClient +} + +// NewResourceUsageClient creates an instance of the ResourceUsageClient client. +func NewResourceUsageClient(subscriptionID string, subscriptionID1 string) ResourceUsageClient { + return NewResourceUsageClientWithBaseURI(DefaultBaseURI, subscriptionID, subscriptionID1) +} + +// NewResourceUsageClientWithBaseURI creates an instance of the ResourceUsageClient 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 NewResourceUsageClientWithBaseURI(baseURI string, subscriptionID string, subscriptionID1 string) ResourceUsageClient { + return ResourceUsageClient{NewWithBaseURI(baseURI, subscriptionID, subscriptionID1)} +} + +// List check the quota and actual usage of the CDN profiles under the given subscription. +func (client ResourceUsageClient) List(ctx context.Context) (result ResourceUsageListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceUsageClient.List") + defer func() { + sc := -1 + if result.rulr.Response.Response != nil { + sc = result.rulr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.ResourceUsageClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.rulr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "cdn.ResourceUsageClient", "List", resp, "Failure sending request") + return + } + + result.rulr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.ResourceUsageClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client ResourceUsageClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-15" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Cdn/checkResourceUsage", 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 ResourceUsageClient) 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 ResourceUsageClient) ListResponder(resp *http.Response) (result ResourceUsageListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 ResourceUsageClient) listNextResults(ctx context.Context, lastResults ResourceUsageListResult) (result ResourceUsageListResult, err error) { + req, err := lastResults.resourceUsageListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "cdn.ResourceUsageClient", "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, "cdn.ResourceUsageClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "cdn.ResourceUsageClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ResourceUsageClient) ListComplete(ctx context.Context) (result ResourceUsageListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceUsageClient.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/cdn/mgmt/2020-04-15/cdn/version.go b/services/preview/cdn/mgmt/2020-04-15/cdn/version.go new file mode 100644 index 000000000000..7bf4c245bed7 --- /dev/null +++ b/services/preview/cdn/mgmt/2020-04-15/cdn/version.go @@ -0,0 +1,30 @@ +package cdn + +import "github.com/Azure/azure-sdk-for-go/version" + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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() + " cdn/2020-04-15" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/services/preview/cognitiveservices/v1.0/anomalydetector/models.go b/services/preview/cognitiveservices/v1.0/anomalydetector/models.go index 32dc03500469..7f9746354860 100644 --- a/services/preview/cognitiveservices/v1.0/anomalydetector/models.go +++ b/services/preview/cognitiveservices/v1.0/anomalydetector/models.go @@ -37,6 +37,8 @@ const ( Minutely Granularity = "minutely" // Monthly ... Monthly Granularity = "monthly" + // Secondly ... + Secondly Granularity = "secondly" // Weekly ... Weekly Granularity = "weekly" // Yearly ... @@ -45,7 +47,7 @@ const ( // PossibleGranularityValues returns an array of possible values for the Granularity const type. func PossibleGranularityValues() []Granularity { - return []Granularity{Daily, Hourly, Minutely, Monthly, Weekly, Yearly} + return []Granularity{Daily, Hourly, Minutely, Monthly, Secondly, Weekly, Yearly} } // APIError error information returned by the API. @@ -60,7 +62,7 @@ type APIError struct { type ChangePointDetectRequest struct { // Series - Time series data points. Points should be sorted by timestamp in ascending order to match the change point detection result. Series *[]Point `json:"series,omitempty"` - // Granularity - Can only be one of yearly, monthly, weekly, daily, hourly or minutely. Granularity is used for verify whether input series is valid. Possible values include: 'Yearly', 'Monthly', 'Weekly', 'Daily', 'Hourly', 'Minutely' + // Granularity - Can only be one of yearly, monthly, weekly, daily, hourly, minutely or secondly. Granularity is used for verify whether input series is valid. Possible values include: 'Yearly', 'Monthly', 'Weekly', 'Daily', 'Hourly', 'Minutely', 'Secondly' Granularity Granularity `json:"granularity,omitempty"` // CustomInterval - Custom Interval is used to set non-standard time interval, for example, if the series is 5 minutes, request can be set as {"granularity":"minutely", "customInterval":5}. CustomInterval *int32 `json:"customInterval,omitempty"` @@ -135,7 +137,7 @@ type Point struct { type Request struct { // Series - Time series data points. Points should be sorted by timestamp in ascending order to match the anomaly detection result. If the data is not sorted correctly or there is duplicated timestamp, the API will not work. In such case, an error message will be returned. Series *[]Point `json:"series,omitempty"` - // Granularity - Possible values include: 'Yearly', 'Monthly', 'Weekly', 'Daily', 'Hourly', 'Minutely' + // Granularity - Possible values include: 'Yearly', 'Monthly', 'Weekly', 'Daily', 'Hourly', 'Minutely', 'Secondly' Granularity Granularity `json:"granularity,omitempty"` // CustomInterval - Custom Interval is used to set non-standard time interval, for example, if the series is 5 minutes, request can be set as {"granularity":"minutely", "customInterval":5}. CustomInterval *int32 `json:"customInterval,omitempty"` diff --git a/services/preview/cognitiveservices/v3.0/luis/authoring/authoringapi/interfaces.go b/services/preview/cognitiveservices/v3.0/luis/authoring/authoringapi/interfaces.go index 8c0b1e2c5d5e..c5a270d08f1d 100644 --- a/services/preview/cognitiveservices/v3.0/luis/authoring/authoringapi/interfaces.go +++ b/services/preview/cognitiveservices/v3.0/luis/authoring/authoringapi/interfaces.go @@ -39,10 +39,10 @@ var _ FeaturesClientAPI = (*authoring.FeaturesClient)(nil) // ExamplesClientAPI contains the set of methods on the ExamplesClient type. type ExamplesClientAPI interface { - Add(ctx context.Context, appID uuid.UUID, versionID string, exampleLabelObject authoring.ExampleLabelObject) (result authoring.LabelExampleResponse, err error) - Batch(ctx context.Context, appID uuid.UUID, versionID string, exampleLabelObjectArray []authoring.ExampleLabelObject) (result authoring.ListBatchLabelExample, err error) + Add(ctx context.Context, appID uuid.UUID, versionID string, exampleLabelObject authoring.ExampleLabelObject, enableNestedChildren *bool) (result authoring.LabelExampleResponse, err error) + Batch(ctx context.Context, appID uuid.UUID, versionID string, exampleLabelObjectArray []authoring.ExampleLabelObject, enableNestedChildren *bool) (result authoring.ListBatchLabelExample, err error) Delete(ctx context.Context, appID uuid.UUID, versionID string, exampleID int32) (result authoring.OperationStatus, err error) - List(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (result authoring.ListLabeledUtterance, err error) + List(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32, enableNestedChildren *bool) (result authoring.ListLabeledUtterance, err error) } var _ ExamplesClientAPI = (*authoring.ExamplesClient)(nil) @@ -125,11 +125,11 @@ type ModelClientAPI interface { ListCustomPrebuiltModels(ctx context.Context, appID uuid.UUID, versionID string) (result authoring.ListCustomPrebuiltModel, err error) ListEntities(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (result authoring.ListNDepthEntityExtractor, err error) ListEntityRoles(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (result authoring.ListEntityRole, err error) - ListEntitySuggestions(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, take *int32) (result authoring.ListEntitiesSuggestionExample, err error) + ListEntitySuggestions(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, take *int32, enableNestedChildren *bool) (result authoring.ListEntitiesSuggestionExample, err error) ListHierarchicalEntities(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (result authoring.ListHierarchicalEntityExtractor, err error) ListHierarchicalEntityRoles(ctx context.Context, appID uuid.UUID, versionID string, hEntityID uuid.UUID) (result authoring.ListEntityRole, err error) ListIntents(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (result authoring.ListIntentClassifier, err error) - ListIntentSuggestions(ctx context.Context, appID uuid.UUID, versionID string, intentID uuid.UUID, take *int32) (result authoring.ListIntentsSuggestionExample, err error) + ListIntentSuggestions(ctx context.Context, appID uuid.UUID, versionID string, intentID uuid.UUID, take *int32, enableNestedChildren *bool) (result authoring.ListIntentsSuggestionExample, err error) ListModels(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (result authoring.ListModelInfoResponse, err error) ListPatternAnyEntityInfos(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (result authoring.ListPatternAnyEntityExtractor, err error) ListPatternAnyEntityRoles(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID) (result authoring.ListEntityRole, err error) @@ -218,16 +218,6 @@ type TrainClientAPI interface { var _ TrainClientAPI = (*authoring.TrainClient)(nil) -// PermissionsClientAPI contains the set of methods on the PermissionsClient type. -type PermissionsClientAPI interface { - Add(ctx context.Context, appID uuid.UUID, userToAdd authoring.UserCollaborator) (result authoring.OperationStatus, err error) - Delete(ctx context.Context, appID uuid.UUID, userToDelete authoring.UserCollaborator) (result authoring.OperationStatus, err error) - List(ctx context.Context, appID uuid.UUID) (result authoring.UserAccessList, err error) - Update(ctx context.Context, appID uuid.UUID, collaborators authoring.CollaboratorsArray) (result authoring.OperationStatus, err error) -} - -var _ PermissionsClientAPI = (*authoring.PermissionsClient)(nil) - // PatternClientAPI contains the set of methods on the PatternClient type. type PatternClientAPI interface { AddPattern(ctx context.Context, appID uuid.UUID, versionID string, pattern authoring.PatternRuleCreateObject) (result authoring.PatternRuleInfo, err error) diff --git a/services/preview/cognitiveservices/v3.0/luis/authoring/examples.go b/services/preview/cognitiveservices/v3.0/luis/authoring/examples.go index ce9cdbba30e3..6966a182c8ea 100644 --- a/services/preview/cognitiveservices/v3.0/luis/authoring/examples.go +++ b/services/preview/cognitiveservices/v3.0/luis/authoring/examples.go @@ -42,7 +42,8 @@ func NewExamplesClient(endpoint string) ExamplesClient { // appID - the application ID. // versionID - the version ID. // exampleLabelObject - a labeled example utterance with the expected intent and entities. -func (client ExamplesClient) Add(ctx context.Context, appID uuid.UUID, versionID string, exampleLabelObject ExampleLabelObject) (result LabelExampleResponse, err error) { +// enableNestedChildren - toggles nested/flat format +func (client ExamplesClient) Add(ctx context.Context, appID uuid.UUID, versionID string, exampleLabelObject ExampleLabelObject, enableNestedChildren *bool) (result LabelExampleResponse, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ExamplesClient.Add") defer func() { @@ -53,7 +54,7 @@ func (client ExamplesClient) Add(ctx context.Context, appID uuid.UUID, versionID tracing.EndSpan(ctx, sc, err) }() } - req, err := client.AddPreparer(ctx, appID, versionID, exampleLabelObject) + req, err := client.AddPreparer(ctx, appID, versionID, exampleLabelObject, enableNestedChildren) if err != nil { err = autorest.NewErrorWithError(err, "authoring.ExamplesClient", "Add", nil, "Failure preparing request") return @@ -75,7 +76,7 @@ func (client ExamplesClient) Add(ctx context.Context, appID uuid.UUID, versionID } // AddPreparer prepares the Add request. -func (client ExamplesClient) AddPreparer(ctx context.Context, appID uuid.UUID, versionID string, exampleLabelObject ExampleLabelObject) (*http.Request, error) { +func (client ExamplesClient) AddPreparer(ctx context.Context, appID uuid.UUID, versionID string, exampleLabelObject ExampleLabelObject, enableNestedChildren *bool) (*http.Request, error) { urlParameters := map[string]interface{}{ "Endpoint": client.Endpoint, } @@ -85,12 +86,20 @@ func (client ExamplesClient) AddPreparer(ctx context.Context, appID uuid.UUID, v "versionId": autorest.Encode("path", versionID), } + queryParameters := map[string]interface{}{} + if enableNestedChildren != nil { + queryParameters["enableNestedChildren"] = autorest.Encode("query", *enableNestedChildren) + } else { + queryParameters["enableNestedChildren"] = autorest.Encode("query", false) + } + preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/example", pathParameters), - autorest.WithJSON(exampleLabelObject)) + autorest.WithJSON(exampleLabelObject), + autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -118,7 +127,8 @@ func (client ExamplesClient) AddResponder(resp *http.Response) (result LabelExam // appID - the application ID. // versionID - the version ID. // exampleLabelObjectArray - array of example utterances. -func (client ExamplesClient) Batch(ctx context.Context, appID uuid.UUID, versionID string, exampleLabelObjectArray []ExampleLabelObject) (result ListBatchLabelExample, err error) { +// enableNestedChildren - toggles nested/flat format +func (client ExamplesClient) Batch(ctx context.Context, appID uuid.UUID, versionID string, exampleLabelObjectArray []ExampleLabelObject, enableNestedChildren *bool) (result ListBatchLabelExample, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ExamplesClient.Batch") defer func() { @@ -135,7 +145,7 @@ func (client ExamplesClient) Batch(ctx context.Context, appID uuid.UUID, version return result, validation.NewError("authoring.ExamplesClient", "Batch", err.Error()) } - req, err := client.BatchPreparer(ctx, appID, versionID, exampleLabelObjectArray) + req, err := client.BatchPreparer(ctx, appID, versionID, exampleLabelObjectArray, enableNestedChildren) if err != nil { err = autorest.NewErrorWithError(err, "authoring.ExamplesClient", "Batch", nil, "Failure preparing request") return @@ -157,7 +167,7 @@ func (client ExamplesClient) Batch(ctx context.Context, appID uuid.UUID, version } // BatchPreparer prepares the Batch request. -func (client ExamplesClient) BatchPreparer(ctx context.Context, appID uuid.UUID, versionID string, exampleLabelObjectArray []ExampleLabelObject) (*http.Request, error) { +func (client ExamplesClient) BatchPreparer(ctx context.Context, appID uuid.UUID, versionID string, exampleLabelObjectArray []ExampleLabelObject, enableNestedChildren *bool) (*http.Request, error) { urlParameters := map[string]interface{}{ "Endpoint": client.Endpoint, } @@ -167,12 +177,20 @@ func (client ExamplesClient) BatchPreparer(ctx context.Context, appID uuid.UUID, "versionId": autorest.Encode("path", versionID), } + queryParameters := map[string]interface{}{} + if enableNestedChildren != nil { + queryParameters["enableNestedChildren"] = autorest.Encode("query", *enableNestedChildren) + } else { + queryParameters["enableNestedChildren"] = autorest.Encode("query", false) + } + preparer := autorest.CreatePreparer( autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPost(), autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), autorest.WithPathParameters("/apps/{appId}/versions/{versionId}/examples", pathParameters), - autorest.WithJSON(exampleLabelObjectArray)) + autorest.WithJSON(exampleLabelObjectArray), + autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -276,7 +294,8 @@ func (client ExamplesClient) DeleteResponder(resp *http.Response) (result Operat // versionID - the version ID. // skip - the number of entries to skip. Default value is 0. // take - the number of entries to return. Maximum page size is 500. Default is 100. -func (client ExamplesClient) List(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (result ListLabeledUtterance, err error) { +// enableNestedChildren - toggles nested/flat format +func (client ExamplesClient) List(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32, enableNestedChildren *bool) (result ListLabeledUtterance, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ExamplesClient.List") defer func() { @@ -299,7 +318,7 @@ func (client ExamplesClient) List(ctx context.Context, appID uuid.UUID, versionI return result, validation.NewError("authoring.ExamplesClient", "List", err.Error()) } - req, err := client.ListPreparer(ctx, appID, versionID, skip, take) + req, err := client.ListPreparer(ctx, appID, versionID, skip, take, enableNestedChildren) if err != nil { err = autorest.NewErrorWithError(err, "authoring.ExamplesClient", "List", nil, "Failure preparing request") return @@ -321,7 +340,7 @@ func (client ExamplesClient) List(ctx context.Context, appID uuid.UUID, versionI } // ListPreparer prepares the List request. -func (client ExamplesClient) ListPreparer(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32) (*http.Request, error) { +func (client ExamplesClient) ListPreparer(ctx context.Context, appID uuid.UUID, versionID string, skip *int32, take *int32, enableNestedChildren *bool) (*http.Request, error) { urlParameters := map[string]interface{}{ "Endpoint": client.Endpoint, } @@ -342,6 +361,11 @@ func (client ExamplesClient) ListPreparer(ctx context.Context, appID uuid.UUID, } else { queryParameters["take"] = autorest.Encode("query", 100) } + if enableNestedChildren != nil { + queryParameters["enableNestedChildren"] = autorest.Encode("query", *enableNestedChildren) + } else { + queryParameters["enableNestedChildren"] = autorest.Encode("query", false) + } preparer := autorest.CreatePreparer( autorest.AsGet(), diff --git a/services/preview/cognitiveservices/v3.0/luis/authoring/model.go b/services/preview/cognitiveservices/v3.0/luis/authoring/model.go index 527f97a750de..bb083547b428 100644 --- a/services/preview/cognitiveservices/v3.0/luis/authoring/model.go +++ b/services/preview/cognitiveservices/v3.0/luis/authoring/model.go @@ -5962,7 +5962,8 @@ func (client ModelClient) ListEntityRolesResponder(resp *http.Response) (result // versionID - the version ID. // entityID - the target entity extractor model to enhance. // take - the number of entries to return. Maximum page size is 500. Default is 100. -func (client ModelClient) ListEntitySuggestions(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, take *int32) (result ListEntitiesSuggestionExample, err error) { +// enableNestedChildren - toggles nested/flat format +func (client ModelClient) ListEntitySuggestions(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, take *int32, enableNestedChildren *bool) (result ListEntitiesSuggestionExample, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.ListEntitySuggestions") defer func() { @@ -5982,7 +5983,7 @@ func (client ModelClient) ListEntitySuggestions(ctx context.Context, appID uuid. return result, validation.NewError("authoring.ModelClient", "ListEntitySuggestions", err.Error()) } - req, err := client.ListEntitySuggestionsPreparer(ctx, appID, versionID, entityID, take) + req, err := client.ListEntitySuggestionsPreparer(ctx, appID, versionID, entityID, take, enableNestedChildren) if err != nil { err = autorest.NewErrorWithError(err, "authoring.ModelClient", "ListEntitySuggestions", nil, "Failure preparing request") return @@ -6004,7 +6005,7 @@ func (client ModelClient) ListEntitySuggestions(ctx context.Context, appID uuid. } // ListEntitySuggestionsPreparer prepares the ListEntitySuggestions request. -func (client ModelClient) ListEntitySuggestionsPreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, take *int32) (*http.Request, error) { +func (client ModelClient) ListEntitySuggestionsPreparer(ctx context.Context, appID uuid.UUID, versionID string, entityID uuid.UUID, take *int32, enableNestedChildren *bool) (*http.Request, error) { urlParameters := map[string]interface{}{ "Endpoint": client.Endpoint, } @@ -6021,6 +6022,11 @@ func (client ModelClient) ListEntitySuggestionsPreparer(ctx context.Context, app } else { queryParameters["take"] = autorest.Encode("query", 100) } + if enableNestedChildren != nil { + queryParameters["enableNestedChildren"] = autorest.Encode("query", *enableNestedChildren) + } else { + queryParameters["enableNestedChildren"] = autorest.Encode("query", false) + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -6331,7 +6337,8 @@ func (client ModelClient) ListIntentsResponder(resp *http.Response) (result List // versionID - the version ID. // intentID - the intent classifier ID. // take - the number of entries to return. Maximum page size is 500. Default is 100. -func (client ModelClient) ListIntentSuggestions(ctx context.Context, appID uuid.UUID, versionID string, intentID uuid.UUID, take *int32) (result ListIntentsSuggestionExample, err error) { +// enableNestedChildren - toggles nested/flat format +func (client ModelClient) ListIntentSuggestions(ctx context.Context, appID uuid.UUID, versionID string, intentID uuid.UUID, take *int32, enableNestedChildren *bool) (result ListIntentsSuggestionExample, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ModelClient.ListIntentSuggestions") defer func() { @@ -6351,7 +6358,7 @@ func (client ModelClient) ListIntentSuggestions(ctx context.Context, appID uuid. return result, validation.NewError("authoring.ModelClient", "ListIntentSuggestions", err.Error()) } - req, err := client.ListIntentSuggestionsPreparer(ctx, appID, versionID, intentID, take) + req, err := client.ListIntentSuggestionsPreparer(ctx, appID, versionID, intentID, take, enableNestedChildren) if err != nil { err = autorest.NewErrorWithError(err, "authoring.ModelClient", "ListIntentSuggestions", nil, "Failure preparing request") return @@ -6373,7 +6380,7 @@ func (client ModelClient) ListIntentSuggestions(ctx context.Context, appID uuid. } // ListIntentSuggestionsPreparer prepares the ListIntentSuggestions request. -func (client ModelClient) ListIntentSuggestionsPreparer(ctx context.Context, appID uuid.UUID, versionID string, intentID uuid.UUID, take *int32) (*http.Request, error) { +func (client ModelClient) ListIntentSuggestionsPreparer(ctx context.Context, appID uuid.UUID, versionID string, intentID uuid.UUID, take *int32, enableNestedChildren *bool) (*http.Request, error) { urlParameters := map[string]interface{}{ "Endpoint": client.Endpoint, } @@ -6390,6 +6397,11 @@ func (client ModelClient) ListIntentSuggestionsPreparer(ctx context.Context, app } else { queryParameters["take"] = autorest.Encode("query", 100) } + if enableNestedChildren != nil { + queryParameters["enableNestedChildren"] = autorest.Encode("query", *enableNestedChildren) + } else { + queryParameters["enableNestedChildren"] = autorest.Encode("query", false) + } preparer := autorest.CreatePreparer( autorest.AsGet(), diff --git a/services/preview/cognitiveservices/v3.0/luis/authoring/models.go b/services/preview/cognitiveservices/v3.0/luis/authoring/models.go index 630f11875fff..15384ad377e2 100644 --- a/services/preview/cognitiveservices/v3.0/luis/authoring/models.go +++ b/services/preview/cognitiveservices/v3.0/luis/authoring/models.go @@ -811,7 +811,8 @@ type EntityLabel struct { // Role - The role of the predicted entity. Role *string `json:"role,omitempty"` // RoleID - The role id for the predicted entity. - RoleID *uuid.UUID `json:"roleId,omitempty"` + RoleID *uuid.UUID `json:"roleId,omitempty"` + Children *[]EntityLabel `json:"children,omitempty"` } // EntityLabelObject defines the entity type and position of the extracted entity within the example. @@ -824,6 +825,8 @@ type EntityLabelObject struct { EndCharIndex *int32 `json:"endCharIndex,omitempty"` // Role - The role the entity plays in the utterance. Role *string `json:"role,omitempty"` + // Children - The identified entities within the example utterance. + Children *[]EntityLabelObject `json:"children,omitempty"` } // EntityModelCreateObject an entity extractor create object. @@ -864,7 +867,8 @@ type EntityPrediction struct { // EndTokenIndex - The index within the utterance where the extracted entity ends. EndTokenIndex *int32 `json:"endTokenIndex,omitempty"` // Phrase - The actual token(s) that comprise the entity. - Phrase *string `json:"phrase,omitempty"` + Phrase *string `json:"phrase,omitempty"` + Children *[]EntityPrediction `json:"children,omitempty"` } // EntityRole entity extractor role @@ -1114,7 +1118,8 @@ type JSONEntity struct { // Entity - The entity name. Entity *string `json:"entity,omitempty"` // Role - The role the entity plays in the utterance. - Role *string `json:"role,omitempty"` + Role *string `json:"role,omitempty"` + Children *[]JSONEntity `json:"children,omitempty"` } // JSONModelFeature exported Model - Phraselist Model Feature. @@ -1927,6 +1932,7 @@ type ModelFeatureInformation struct { ModelName *string `json:"modelName,omitempty"` // FeatureName - The name of the feature used. FeatureName *string `json:"featureName,omitempty"` + IsRequired *bool `json:"isRequired,omitempty"` } // ModelInfo base type used in entity types. @@ -2382,7 +2388,6 @@ type TaskUpdateObject struct { // UserAccessList list of user permissions. type UserAccessList struct { - autorest.Response `json:"-"` // Owner - The email address of owner of the application. Owner *string `json:"owner,omitempty"` Emails *[]string `json:"emails,omitempty"` diff --git a/services/preview/cognitiveservices/v3.0/luis/authoring/permissions.go b/services/preview/cognitiveservices/v3.0/luis/authoring/permissions.go deleted file mode 100644 index a2c626ccfa23..000000000000 --- a/services/preview/cognitiveservices/v3.0/luis/authoring/permissions.go +++ /dev/null @@ -1,333 +0,0 @@ -package authoring - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// 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" - "github.com/satori/go.uuid" - "net/http" -) - -// PermissionsClient is the client for the Permissions methods of the Authoring service. -type PermissionsClient struct { - BaseClient -} - -// NewPermissionsClient creates an instance of the PermissionsClient client. -func NewPermissionsClient(endpoint string) PermissionsClient { - return PermissionsClient{New(endpoint)} -} - -// Add adds a user to the allowed list of users to access this LUIS application. Users are added using their email -// address. -// Parameters: -// appID - the application ID. -// userToAdd - a model containing the user's email address. -func (client PermissionsClient) Add(ctx context.Context, appID uuid.UUID, userToAdd UserCollaborator) (result OperationStatus, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PermissionsClient.Add") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.AddPreparer(ctx, appID, userToAdd) - if err != nil { - err = autorest.NewErrorWithError(err, "authoring.PermissionsClient", "Add", nil, "Failure preparing request") - return - } - - resp, err := client.AddSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "authoring.PermissionsClient", "Add", resp, "Failure sending request") - return - } - - result, err = client.AddResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "authoring.PermissionsClient", "Add", resp, "Failure responding to request") - } - - return -} - -// AddPreparer prepares the Add request. -func (client PermissionsClient) AddPreparer(ctx context.Context, appID uuid.UUID, userToAdd UserCollaborator) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "Endpoint": client.Endpoint, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPost(), - autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), - autorest.WithPathParameters("/apps/{appId}/permissions", pathParameters), - autorest.WithJSON(userToAdd)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// AddSender sends the Add request. The method will close the -// http.Response Body if it receives an error. -func (client PermissionsClient) AddSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// AddResponder handles the response to the Add request. The method always -// closes the http.Response Body. -func (client PermissionsClient) AddResponder(resp *http.Response) (result OperationStatus, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete removes a user from the allowed list of users to access this LUIS application. Users are removed using their -// email address. -// Parameters: -// appID - the application ID. -// userToDelete - a model containing the user's email address. -func (client PermissionsClient) Delete(ctx context.Context, appID uuid.UUID, userToDelete UserCollaborator) (result OperationStatus, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PermissionsClient.Delete") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.DeletePreparer(ctx, appID, userToDelete) - if err != nil { - err = autorest.NewErrorWithError(err, "authoring.PermissionsClient", "Delete", nil, "Failure preparing request") - return - } - - resp, err := client.DeleteSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "authoring.PermissionsClient", "Delete", resp, "Failure sending request") - return - } - - result, err = client.DeleteResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "authoring.PermissionsClient", "Delete", resp, "Failure responding to request") - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client PermissionsClient) DeletePreparer(ctx context.Context, appID uuid.UUID, userToDelete UserCollaborator) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "Endpoint": client.Endpoint, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsDelete(), - autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), - autorest.WithPathParameters("/apps/{appId}/permissions", pathParameters), - autorest.WithJSON(userToDelete)) - 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 PermissionsClient) DeleteSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client PermissionsClient) DeleteResponder(resp *http.Response) (result OperationStatus, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// List gets the list of user emails that have permissions to access your application. -// Parameters: -// appID - the application ID. -func (client PermissionsClient) List(ctx context.Context, appID uuid.UUID) (result UserAccessList, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PermissionsClient.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, appID) - if err != nil { - err = autorest.NewErrorWithError(err, "authoring.PermissionsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "authoring.PermissionsClient", "List", resp, "Failure sending request") - return - } - - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "authoring.PermissionsClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client PermissionsClient) ListPreparer(ctx context.Context, appID uuid.UUID) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "Endpoint": client.Endpoint, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), - autorest.WithPathParameters("/apps/{appId}/permissions", pathParameters)) - 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 PermissionsClient) 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 PermissionsClient) ListResponder(resp *http.Response) (result UserAccessList, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Update replaces the current user access list with the new list sent in the body. If an empty list is sent, all -// access to other users will be removed. -// Parameters: -// appID - the application ID. -// collaborators - a model containing a list of user email addresses. -func (client PermissionsClient) Update(ctx context.Context, appID uuid.UUID, collaborators CollaboratorsArray) (result OperationStatus, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PermissionsClient.Update") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, appID, collaborators) - if err != nil { - err = autorest.NewErrorWithError(err, "authoring.PermissionsClient", "Update", nil, "Failure preparing request") - return - } - - resp, err := client.UpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "authoring.PermissionsClient", "Update", resp, "Failure sending request") - return - } - - result, err = client.UpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "authoring.PermissionsClient", "Update", resp, "Failure responding to request") - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client PermissionsClient) UpdatePreparer(ctx context.Context, appID uuid.UUID, collaborators CollaboratorsArray) (*http.Request, error) { - urlParameters := map[string]interface{}{ - "Endpoint": client.Endpoint, - } - - pathParameters := map[string]interface{}{ - "appId": autorest.Encode("path", appID), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithCustomBaseURL("{Endpoint}/luis/authoring/v3.0-preview", urlParameters), - autorest.WithPathParameters("/apps/{appId}/permissions", pathParameters), - autorest.WithJSON(collaborators)) - 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 PermissionsClient) UpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client PermissionsClient) UpdateResponder(resp *http.Response) (result OperationStatus, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/services/preview/containerregistry/mgmt/2019-12-01-preview/containerregistry/containerregistryapi/interfaces.go b/services/preview/containerregistry/mgmt/2019-12-01-preview/containerregistry/containerregistryapi/interfaces.go index 048614aeb990..722075f09258 100644 --- a/services/preview/containerregistry/mgmt/2019-12-01-preview/containerregistry/containerregistryapi/interfaces.go +++ b/services/preview/containerregistry/mgmt/2019-12-01-preview/containerregistry/containerregistryapi/interfaces.go @@ -22,6 +22,17 @@ import ( "github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2019-12-01-preview/containerregistry" ) +// ExportPipelinesClientAPI contains the set of methods on the ExportPipelinesClient type. +type ExportPipelinesClientAPI interface { + Create(ctx context.Context, resourceGroupName string, registryName string, exportPipelineName string, exportPipelineCreateParameters containerregistry.ExportPipeline) (result containerregistry.ExportPipelinesCreateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, registryName string, exportPipelineName string) (result containerregistry.ExportPipelinesDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, registryName string, exportPipelineName string) (result containerregistry.ExportPipeline, err error) + List(ctx context.Context, resourceGroupName string, registryName string) (result containerregistry.ExportPipelineListResultPage, err error) + ListComplete(ctx context.Context, resourceGroupName string, registryName string) (result containerregistry.ExportPipelineListResultIterator, err error) +} + +var _ ExportPipelinesClientAPI = (*containerregistry.ExportPipelinesClient)(nil) + // 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) @@ -46,6 +57,17 @@ type RegistriesClientAPI interface { var _ RegistriesClientAPI = (*containerregistry.RegistriesClient)(nil) +// ImportPipelinesClientAPI contains the set of methods on the ImportPipelinesClient type. +type ImportPipelinesClientAPI interface { + Create(ctx context.Context, resourceGroupName string, registryName string, importPipelineName string, importPipelineCreateParameters containerregistry.ImportPipeline) (result containerregistry.ImportPipelinesCreateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, registryName string, importPipelineName string) (result containerregistry.ImportPipelinesDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, registryName string, importPipelineName string) (result containerregistry.ImportPipeline, err error) + List(ctx context.Context, resourceGroupName string, registryName string) (result containerregistry.ImportPipelineListResultPage, err error) + ListComplete(ctx context.Context, resourceGroupName string, registryName string) (result containerregistry.ImportPipelineListResultIterator, err error) +} + +var _ ImportPipelinesClientAPI = (*containerregistry.ImportPipelinesClient)(nil) + // OperationsClientAPI contains the set of methods on the OperationsClient type. type OperationsClientAPI interface { List(ctx context.Context) (result containerregistry.OperationListResultPage, err error) @@ -54,6 +76,17 @@ type OperationsClientAPI interface { var _ OperationsClientAPI = (*containerregistry.OperationsClient)(nil) +// PipelineRunsClientAPI contains the set of methods on the PipelineRunsClient type. +type PipelineRunsClientAPI interface { + Create(ctx context.Context, resourceGroupName string, registryName string, pipelineRunName string, pipelineRunCreateParameters containerregistry.PipelineRun) (result containerregistry.PipelineRunsCreateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, registryName string, pipelineRunName string) (result containerregistry.PipelineRunsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, registryName string, pipelineRunName string) (result containerregistry.PipelineRun, err error) + List(ctx context.Context, resourceGroupName string, registryName string) (result containerregistry.PipelineRunListResultPage, err error) + ListComplete(ctx context.Context, resourceGroupName string, registryName string) (result containerregistry.PipelineRunListResultIterator, err error) +} + +var _ PipelineRunsClientAPI = (*containerregistry.PipelineRunsClient)(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) diff --git a/services/preview/containerregistry/mgmt/2019-12-01-preview/containerregistry/exportpipelines.go b/services/preview/containerregistry/mgmt/2019-12-01-preview/containerregistry/exportpipelines.go new file mode 100644 index 000000000000..0fd9312fea42 --- /dev/null +++ b/services/preview/containerregistry/mgmt/2019-12-01-preview/containerregistry/exportpipelines.go @@ -0,0 +1,450 @@ +package containerregistry + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// ExportPipelinesClient is the client for the ExportPipelines methods of the Containerregistry service. +type ExportPipelinesClient struct { + BaseClient +} + +// NewExportPipelinesClient creates an instance of the ExportPipelinesClient client. +func NewExportPipelinesClient(subscriptionID string) ExportPipelinesClient { + return NewExportPipelinesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewExportPipelinesClientWithBaseURI creates an instance of the ExportPipelinesClient 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 NewExportPipelinesClientWithBaseURI(baseURI string, subscriptionID string) ExportPipelinesClient { + return ExportPipelinesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create creates an export pipeline 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. +// exportPipelineName - the name of the export pipeline. +// exportPipelineCreateParameters - the parameters for creating an export pipeline. +func (client ExportPipelinesClient) Create(ctx context.Context, resourceGroupName string, registryName string, exportPipelineName string, exportPipelineCreateParameters ExportPipeline) (result ExportPipelinesCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExportPipelinesClient.Create") + 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.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: exportPipelineName, + Constraints: []validation.Constraint{{Target: "exportPipelineName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "exportPipelineName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "exportPipelineName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}, + {TargetValue: exportPipelineCreateParameters, + Constraints: []validation.Constraint{{Target: "exportPipelineCreateParameters.ExportPipelineProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "exportPipelineCreateParameters.ExportPipelineProperties.Target", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "exportPipelineCreateParameters.ExportPipelineProperties.Target.KeyVaultURI", Name: validation.Null, Rule: true, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("containerregistry.ExportPipelinesClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, registryName, exportPipelineName, exportPipelineCreateParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ExportPipelinesClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ExportPipelinesClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ExportPipelinesClient) CreatePreparer(ctx context.Context, resourceGroupName string, registryName string, exportPipelineName string, exportPipelineCreateParameters ExportPipeline) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "exportPipelineName": autorest.Encode("path", exportPipelineName), + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-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}/exportPipelines/{exportPipelineName}", pathParameters), + autorest.WithJSON(exportPipelineCreateParameters), + 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 ExportPipelinesClient) CreateSender(req *http.Request) (future ExportPipelinesCreateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ExportPipelinesClient) CreateResponder(resp *http.Response) (result ExportPipeline, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes an export pipeline 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. +// exportPipelineName - the name of the export pipeline. +func (client ExportPipelinesClient) Delete(ctx context.Context, resourceGroupName string, registryName string, exportPipelineName string) (result ExportPipelinesDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExportPipelinesClient.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.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: exportPipelineName, + Constraints: []validation.Constraint{{Target: "exportPipelineName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "exportPipelineName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "exportPipelineName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.ExportPipelinesClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, registryName, exportPipelineName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ExportPipelinesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ExportPipelinesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ExportPipelinesClient) DeletePreparer(ctx context.Context, resourceGroupName string, registryName string, exportPipelineName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "exportPipelineName": autorest.Encode("path", exportPipelineName), + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-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}/exportPipelines/{exportPipelineName}", 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 ExportPipelinesClient) DeleteSender(req *http.Request) (future ExportPipelinesDeleteFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ExportPipelinesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the properties of the export pipeline. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +// exportPipelineName - the name of the export pipeline. +func (client ExportPipelinesClient) Get(ctx context.Context, resourceGroupName string, registryName string, exportPipelineName string) (result ExportPipeline, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExportPipelinesClient.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: exportPipelineName, + Constraints: []validation.Constraint{{Target: "exportPipelineName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "exportPipelineName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "exportPipelineName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.ExportPipelinesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, registryName, exportPipelineName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ExportPipelinesClient", "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.ExportPipelinesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ExportPipelinesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ExportPipelinesClient) GetPreparer(ctx context.Context, resourceGroupName string, registryName string, exportPipelineName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "exportPipelineName": autorest.Encode("path", exportPipelineName), + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-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}/exportPipelines/{exportPipelineName}", 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 ExportPipelinesClient) 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 ExportPipelinesClient) GetResponder(resp *http.Response) (result ExportPipeline, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists all export pipelines 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 ExportPipelinesClient) List(ctx context.Context, resourceGroupName string, registryName string) (result ExportPipelineListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExportPipelinesClient.List") + defer func() { + sc := -1 + if result.eplr.Response.Response != nil { + sc = result.eplr.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.ExportPipelinesClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, registryName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ExportPipelinesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.eplr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.ExportPipelinesClient", "List", resp, "Failure sending request") + return + } + + result.eplr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ExportPipelinesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client ExportPipelinesClient) 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-12-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}/exportPipelines", 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 ExportPipelinesClient) 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 ExportPipelinesClient) ListResponder(resp *http.Response) (result ExportPipelineListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 ExportPipelinesClient) listNextResults(ctx context.Context, lastResults ExportPipelineListResult) (result ExportPipelineListResult, err error) { + req, err := lastResults.exportPipelineListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerregistry.ExportPipelinesClient", "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.ExportPipelinesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ExportPipelinesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ExportPipelinesClient) ListComplete(ctx context.Context, resourceGroupName string, registryName string) (result ExportPipelineListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExportPipelinesClient.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/2019-12-01-preview/containerregistry/importpipelines.go b/services/preview/containerregistry/mgmt/2019-12-01-preview/containerregistry/importpipelines.go new file mode 100644 index 000000000000..2a87e3d9758b --- /dev/null +++ b/services/preview/containerregistry/mgmt/2019-12-01-preview/containerregistry/importpipelines.go @@ -0,0 +1,450 @@ +package containerregistry + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// ImportPipelinesClient is the client for the ImportPipelines methods of the Containerregistry service. +type ImportPipelinesClient struct { + BaseClient +} + +// NewImportPipelinesClient creates an instance of the ImportPipelinesClient client. +func NewImportPipelinesClient(subscriptionID string) ImportPipelinesClient { + return NewImportPipelinesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewImportPipelinesClientWithBaseURI creates an instance of the ImportPipelinesClient 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 NewImportPipelinesClientWithBaseURI(baseURI string, subscriptionID string) ImportPipelinesClient { + return ImportPipelinesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create creates an import pipeline 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. +// importPipelineName - the name of the import pipeline. +// importPipelineCreateParameters - the parameters for creating an import pipeline. +func (client ImportPipelinesClient) Create(ctx context.Context, resourceGroupName string, registryName string, importPipelineName string, importPipelineCreateParameters ImportPipeline) (result ImportPipelinesCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ImportPipelinesClient.Create") + 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.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: importPipelineName, + Constraints: []validation.Constraint{{Target: "importPipelineName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "importPipelineName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "importPipelineName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}, + {TargetValue: importPipelineCreateParameters, + Constraints: []validation.Constraint{{Target: "importPipelineCreateParameters.ImportPipelineProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "importPipelineCreateParameters.ImportPipelineProperties.Source", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "importPipelineCreateParameters.ImportPipelineProperties.Source.KeyVaultURI", Name: validation.Null, Rule: true, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("containerregistry.ImportPipelinesClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, registryName, importPipelineName, importPipelineCreateParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ImportPipelinesClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ImportPipelinesClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ImportPipelinesClient) CreatePreparer(ctx context.Context, resourceGroupName string, registryName string, importPipelineName string, importPipelineCreateParameters ImportPipeline) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "importPipelineName": autorest.Encode("path", importPipelineName), + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-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}/importPipelines/{importPipelineName}", pathParameters), + autorest.WithJSON(importPipelineCreateParameters), + 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 ImportPipelinesClient) CreateSender(req *http.Request) (future ImportPipelinesCreateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ImportPipelinesClient) CreateResponder(resp *http.Response) (result ImportPipeline, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes an import pipeline 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. +// importPipelineName - the name of the import pipeline. +func (client ImportPipelinesClient) Delete(ctx context.Context, resourceGroupName string, registryName string, importPipelineName string) (result ImportPipelinesDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ImportPipelinesClient.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.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: importPipelineName, + Constraints: []validation.Constraint{{Target: "importPipelineName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "importPipelineName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "importPipelineName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.ImportPipelinesClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, registryName, importPipelineName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ImportPipelinesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ImportPipelinesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ImportPipelinesClient) DeletePreparer(ctx context.Context, resourceGroupName string, registryName string, importPipelineName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "importPipelineName": autorest.Encode("path", importPipelineName), + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-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}/importPipelines/{importPipelineName}", 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 ImportPipelinesClient) DeleteSender(req *http.Request) (future ImportPipelinesDeleteFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ImportPipelinesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the properties of the import pipeline. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +// importPipelineName - the name of the import pipeline. +func (client ImportPipelinesClient) Get(ctx context.Context, resourceGroupName string, registryName string, importPipelineName string) (result ImportPipeline, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ImportPipelinesClient.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: importPipelineName, + Constraints: []validation.Constraint{{Target: "importPipelineName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "importPipelineName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "importPipelineName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.ImportPipelinesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, registryName, importPipelineName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ImportPipelinesClient", "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.ImportPipelinesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ImportPipelinesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ImportPipelinesClient) GetPreparer(ctx context.Context, resourceGroupName string, registryName string, importPipelineName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "importPipelineName": autorest.Encode("path", importPipelineName), + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-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}/importPipelines/{importPipelineName}", 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 ImportPipelinesClient) 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 ImportPipelinesClient) GetResponder(resp *http.Response) (result ImportPipeline, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists all import pipelines 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 ImportPipelinesClient) List(ctx context.Context, resourceGroupName string, registryName string) (result ImportPipelineListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ImportPipelinesClient.List") + defer func() { + sc := -1 + if result.iplr.Response.Response != nil { + sc = result.iplr.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.ImportPipelinesClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, registryName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ImportPipelinesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.iplr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.ImportPipelinesClient", "List", resp, "Failure sending request") + return + } + + result.iplr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ImportPipelinesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client ImportPipelinesClient) 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-12-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}/importPipelines", 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 ImportPipelinesClient) 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 ImportPipelinesClient) ListResponder(resp *http.Response) (result ImportPipelineListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 ImportPipelinesClient) listNextResults(ctx context.Context, lastResults ImportPipelineListResult) (result ImportPipelineListResult, err error) { + req, err := lastResults.importPipelineListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerregistry.ImportPipelinesClient", "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.ImportPipelinesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ImportPipelinesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ImportPipelinesClient) ListComplete(ctx context.Context, resourceGroupName string, registryName string) (result ImportPipelineListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ImportPipelinesClient.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/2019-12-01-preview/containerregistry/models.go b/services/preview/containerregistry/mgmt/2019-12-01-preview/containerregistry/models.go index 1b4f353cc9d6..04f2bed713b1 100644 --- a/services/preview/containerregistry/mgmt/2019-12-01-preview/containerregistry/models.go +++ b/services/preview/containerregistry/mgmt/2019-12-01-preview/containerregistry/models.go @@ -204,6 +204,64 @@ func PossiblePasswordNameValues() []PasswordName { return []PasswordName{Password, Password2} } +// PipelineOptions enumerates the values for pipeline options. +type PipelineOptions string + +const ( + // ContinueOnErrors ... + ContinueOnErrors PipelineOptions = "ContinueOnErrors" + // DeleteSourceBlobOnSuccess ... + DeleteSourceBlobOnSuccess PipelineOptions = "DeleteSourceBlobOnSuccess" + // OverwriteBlobs ... + OverwriteBlobs PipelineOptions = "OverwriteBlobs" + // OverwriteTags ... + OverwriteTags PipelineOptions = "OverwriteTags" +) + +// PossiblePipelineOptionsValues returns an array of possible values for the PipelineOptions const type. +func PossiblePipelineOptionsValues() []PipelineOptions { + return []PipelineOptions{ContinueOnErrors, DeleteSourceBlobOnSuccess, OverwriteBlobs, OverwriteTags} +} + +// PipelineRunSourceType enumerates the values for pipeline run source type. +type PipelineRunSourceType string + +const ( + // AzureStorageBlob ... + AzureStorageBlob PipelineRunSourceType = "AzureStorageBlob" +) + +// PossiblePipelineRunSourceTypeValues returns an array of possible values for the PipelineRunSourceType const type. +func PossiblePipelineRunSourceTypeValues() []PipelineRunSourceType { + return []PipelineRunSourceType{AzureStorageBlob} +} + +// PipelineRunTargetType enumerates the values for pipeline run target type. +type PipelineRunTargetType string + +const ( + // PipelineRunTargetTypeAzureStorageBlob ... + PipelineRunTargetTypeAzureStorageBlob PipelineRunTargetType = "AzureStorageBlob" +) + +// PossiblePipelineRunTargetTypeValues returns an array of possible values for the PipelineRunTargetType const type. +func PossiblePipelineRunTargetTypeValues() []PipelineRunTargetType { + return []PipelineRunTargetType{PipelineRunTargetTypeAzureStorageBlob} +} + +// PipelineSourceType enumerates the values for pipeline source type. +type PipelineSourceType string + +const ( + // AzureStorageBlobContainer ... + AzureStorageBlobContainer PipelineSourceType = "AzureStorageBlobContainer" +) + +// PossiblePipelineSourceTypeValues returns an array of possible values for the PipelineSourceType const type. +func PossiblePipelineSourceTypeValues() []PipelineSourceType { + return []PipelineSourceType{AzureStorageBlobContainer} +} + // PolicyStatus enumerates the values for policy status. type PolicyStatus string @@ -242,6 +300,21 @@ func PossibleProvisioningStateValues() []ProvisioningState { return []ProvisioningState{Canceled, Creating, Deleting, Failed, Succeeded, Updating} } +// 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 @@ -1141,7 +1214,7 @@ type BaseImageTrigger struct { 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 - The current status of trigger. Possible values include: 'TriggerStatusEnabled', 'TriggerStatusDisabled' Status TriggerStatus `json:"status,omitempty"` // Name - The name of the trigger. Name *string `json:"name,omitempty"` @@ -1155,7 +1228,7 @@ type BaseImageTriggerUpdateParameters struct { 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 - The current status of trigger. Possible values include: 'TriggerStatusEnabled', 'TriggerStatusDisabled' Status TriggerStatus `json:"status,omitempty"` // Name - The name of the trigger. Name *string `json:"name,omitempty"` @@ -2004,6 +2077,313 @@ func (erm EventResponseMessage) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// ExportPipeline an object that represents an export pipeline for a container registry. +type ExportPipeline struct { + autorest.Response `json:"-"` + // Identity - The identity of the export pipeline. + Identity *IdentityProperties `json:"identity,omitempty"` + // ExportPipelineProperties - The properties of the export pipeline. + *ExportPipelineProperties `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"` +} + +// MarshalJSON is the custom marshaler for ExportPipeline. +func (ep ExportPipeline) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ep.Identity != nil { + objectMap["identity"] = ep.Identity + } + if ep.ExportPipelineProperties != nil { + objectMap["properties"] = ep.ExportPipelineProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ExportPipeline struct. +func (ep *ExportPipeline) 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 + } + ep.Identity = &identity + } + case "properties": + if v != nil { + var exportPipelineProperties ExportPipelineProperties + err = json.Unmarshal(*v, &exportPipelineProperties) + if err != nil { + return err + } + ep.ExportPipelineProperties = &exportPipelineProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ep.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ep.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ep.Type = &typeVar + } + } + } + + return nil +} + +// ExportPipelineListResult the result of a request to list export pipelines for a container registry. +type ExportPipelineListResult struct { + autorest.Response `json:"-"` + // Value - The list of export pipelines. Since this list may be incomplete, the nextLink field should be used to request the next list of export pipelines. + Value *[]ExportPipeline `json:"value,omitempty"` + // NextLink - The URI that can be used to request the next list of pipeline runs. + NextLink *string `json:"nextLink,omitempty"` +} + +// ExportPipelineListResultIterator provides access to a complete listing of ExportPipeline values. +type ExportPipelineListResultIterator struct { + i int + page ExportPipelineListResultPage +} + +// 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 *ExportPipelineListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExportPipelineListResultIterator.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 *ExportPipelineListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ExportPipelineListResultIterator) 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 ExportPipelineListResultIterator) Response() ExportPipelineListResult { + 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 ExportPipelineListResultIterator) Value() ExportPipeline { + if !iter.page.NotDone() { + return ExportPipeline{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ExportPipelineListResultIterator type. +func NewExportPipelineListResultIterator(page ExportPipelineListResultPage) ExportPipelineListResultIterator { + return ExportPipelineListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (eplr ExportPipelineListResult) IsEmpty() bool { + return eplr.Value == nil || len(*eplr.Value) == 0 +} + +// exportPipelineListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (eplr ExportPipelineListResult) exportPipelineListResultPreparer(ctx context.Context) (*http.Request, error) { + if eplr.NextLink == nil || len(to.String(eplr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(eplr.NextLink))) +} + +// ExportPipelineListResultPage contains a page of ExportPipeline values. +type ExportPipelineListResultPage struct { + fn func(context.Context, ExportPipelineListResult) (ExportPipelineListResult, error) + eplr ExportPipelineListResult +} + +// 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 *ExportPipelineListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExportPipelineListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.eplr) + if err != nil { + return err + } + page.eplr = next + 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 *ExportPipelineListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ExportPipelineListResultPage) NotDone() bool { + return !page.eplr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ExportPipelineListResultPage) Response() ExportPipelineListResult { + return page.eplr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ExportPipelineListResultPage) Values() []ExportPipeline { + if page.eplr.IsEmpty() { + return nil + } + return *page.eplr.Value +} + +// Creates a new instance of the ExportPipelineListResultPage type. +func NewExportPipelineListResultPage(getNextPage func(context.Context, ExportPipelineListResult) (ExportPipelineListResult, error)) ExportPipelineListResultPage { + return ExportPipelineListResultPage{fn: getNextPage} +} + +// ExportPipelineProperties the properties of an export pipeline. +type ExportPipelineProperties struct { + // Target - The target properties of the export pipeline. + Target *ExportPipelineTargetProperties `json:"target,omitempty"` + // Options - The list of all options configured for the pipeline. + Options *[]PipelineOptions `json:"options,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state of the pipeline at the time the operation was called. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// ExportPipelinesCreateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ExportPipelinesCreateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ExportPipelinesCreateFuture) Result(client ExportPipelinesClient) (ep ExportPipeline, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ExportPipelinesCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerregistry.ExportPipelinesCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if ep.Response.Response, err = future.GetResult(sender); err == nil && ep.Response.Response.StatusCode != http.StatusNoContent { + ep, err = client.CreateResponder(ep.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ExportPipelinesCreateFuture", "Result", ep.Response.Response, "Failure responding to request") + } + } + return +} + +// ExportPipelinesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ExportPipelinesDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ExportPipelinesDeleteFuture) Result(client ExportPipelinesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ExportPipelinesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerregistry.ExportPipelinesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ExportPipelineTargetProperties the properties of the export pipeline target. +type ExportPipelineTargetProperties struct { + // Type - The type of target for the export pipeline. + Type *string `json:"type,omitempty"` + // URI - The target uri of the export pipeline. + // When 'AzureStorageBlob': "https://accountName.blob.core.windows.net/containerName/blobName" + // When 'AzureStorageBlobContainer': "https://accountName.blob.core.windows.net/containerName" + URI *string `json:"uri,omitempty"` + // KeyVaultURI - They key vault secret uri to obtain the target storage SAS token. + KeyVaultURI *string `json:"keyVaultUri,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. @@ -2322,17 +2702,326 @@ type ImportImageParameters struct { 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'). +// ImportPipeline an object that represents an import pipeline for a container registry. +type ImportPipeline struct { + autorest.Response `json:"-"` + // Identity - The identity of the import pipeline. + Identity *IdentityProperties `json:"identity,omitempty"` + // ImportPipelineProperties - The properties of the import pipeline. + *ImportPipelineProperties `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"` +} + +// MarshalJSON is the custom marshaler for ImportPipeline. +func (IP ImportPipeline) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if IP.Identity != nil { + objectMap["identity"] = IP.Identity + } + if IP.ImportPipelineProperties != nil { + objectMap["properties"] = IP.ImportPipelineProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ImportPipeline struct. +func (IP *ImportPipeline) 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 + } + IP.Identity = &identity + } + case "properties": + if v != nil { + var importPipelineProperties ImportPipelineProperties + err = json.Unmarshal(*v, &importPipelineProperties) + if err != nil { + return err + } + IP.ImportPipelineProperties = &importPipelineProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + IP.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + IP.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + IP.Type = &typeVar + } + } + } + + return nil +} + +// ImportPipelineListResult the result of a request to list import pipelines for a container registry. +type ImportPipelineListResult struct { + autorest.Response `json:"-"` + // Value - The list of import pipelines. Since this list may be incomplete, the nextLink field should be used to request the next list of import pipelines. + Value *[]ImportPipeline `json:"value,omitempty"` + // NextLink - The URI that can be used to request the next list of pipeline runs. + NextLink *string `json:"nextLink,omitempty"` +} + +// ImportPipelineListResultIterator provides access to a complete listing of ImportPipeline values. +type ImportPipelineListResultIterator struct { + i int + page ImportPipelineListResultPage +} + +// 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 *ImportPipelineListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ImportPipelineListResultIterator.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 *ImportPipelineListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ImportPipelineListResultIterator) 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 ImportPipelineListResultIterator) Response() ImportPipelineListResult { + 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 ImportPipelineListResultIterator) Value() ImportPipeline { + if !iter.page.NotDone() { + return ImportPipeline{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ImportPipelineListResultIterator type. +func NewImportPipelineListResultIterator(page ImportPipelineListResultPage) ImportPipelineListResultIterator { + return ImportPipelineListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (iplr ImportPipelineListResult) IsEmpty() bool { + return iplr.Value == nil || len(*iplr.Value) == 0 +} + +// importPipelineListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (iplr ImportPipelineListResult) importPipelineListResultPreparer(ctx context.Context) (*http.Request, error) { + if iplr.NextLink == nil || len(to.String(iplr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(iplr.NextLink))) +} + +// ImportPipelineListResultPage contains a page of ImportPipeline values. +type ImportPipelineListResultPage struct { + fn func(context.Context, ImportPipelineListResult) (ImportPipelineListResult, error) + iplr ImportPipelineListResult +} + +// 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 *ImportPipelineListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ImportPipelineListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.iplr) + if err != nil { + return err + } + page.iplr = next + 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 *ImportPipelineListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ImportPipelineListResultPage) NotDone() bool { + return !page.iplr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ImportPipelineListResultPage) Response() ImportPipelineListResult { + return page.iplr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ImportPipelineListResultPage) Values() []ImportPipeline { + if page.iplr.IsEmpty() { + return nil + } + return *page.iplr.Value +} + +// Creates a new instance of the ImportPipelineListResultPage type. +func NewImportPipelineListResultPage(getNextPage func(context.Context, ImportPipelineListResult) (ImportPipelineListResult, error)) ImportPipelineListResultPage { + return ImportPipelineListResultPage{fn: getNextPage} +} + +// ImportPipelineProperties the properties of an import pipeline. +type ImportPipelineProperties struct { + // Source - The source properties of the import pipeline. + Source *ImportPipelineSourceProperties `json:"source,omitempty"` + // Trigger - The properties that describe the trigger of the import pipeline. + Trigger *PipelineTriggerProperties `json:"trigger,omitempty"` + // Options - The list of all options configured for the pipeline. + Options *[]PipelineOptions `json:"options,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state of the pipeline at the time the operation was called. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// ImportPipelinesCreateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ImportPipelinesCreateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ImportPipelinesCreateFuture) Result(client ImportPipelinesClient) (IP ImportPipeline, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ImportPipelinesCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerregistry.ImportPipelinesCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if IP.Response.Response, err = future.GetResult(sender); err == nil && IP.Response.Response.StatusCode != http.StatusNoContent { + IP, err = client.CreateResponder(IP.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ImportPipelinesCreateFuture", "Result", IP.Response.Response, "Failure responding to request") + } + } + return +} + +// ImportPipelinesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ImportPipelinesDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ImportPipelinesDeleteFuture) Result(client ImportPipelinesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ImportPipelinesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerregistry.ImportPipelinesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ImportPipelineSourceProperties the properties of the import pipeline source. +type ImportPipelineSourceProperties struct { + // Type - The type of source for the import pipeline. Possible values include: 'AzureStorageBlobContainer' + Type PipelineSourceType `json:"type,omitempty"` + // URI - The source uri of the import pipeline. + // When 'AzureStorageBlob': "https://accountName.blob.core.windows.net/containerName/blobName" + // When 'AzureStorageBlobContainer': "https://accountName.blob.core.windows.net/containerName" + URI *string `json:"uri,omitempty"` + // KeyVaultURI - They key vault secret uri to obtain the source storage SAS token. + KeyVaultURI *string `json:"keyVaultUri,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"` } @@ -2667,6 +3356,370 @@ type OverrideTaskStepProperties struct { UpdateTriggerToken *string `json:"updateTriggerToken,omitempty"` } +// PipelineRun an object that represents a pipeline run for a container registry. +type PipelineRun struct { + autorest.Response `json:"-"` + // PipelineRunProperties - The properties of a pipeline run. + *PipelineRunProperties `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"` +} + +// MarshalJSON is the custom marshaler for PipelineRun. +func (pr PipelineRun) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pr.PipelineRunProperties != nil { + objectMap["properties"] = pr.PipelineRunProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PipelineRun struct. +func (pr *PipelineRun) 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 pipelineRunProperties PipelineRunProperties + err = json.Unmarshal(*v, &pipelineRunProperties) + if err != nil { + return err + } + pr.PipelineRunProperties = &pipelineRunProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + pr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + pr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pr.Type = &typeVar + } + } + } + + return nil +} + +// PipelineRunListResult the result of a request to list pipeline runs for a container registry. +type PipelineRunListResult struct { + autorest.Response `json:"-"` + // Value - The list of pipeline runs. Since this list may be incomplete, the nextLink field should be used to request the next list of pipeline runs. + Value *[]PipelineRun `json:"value,omitempty"` + // NextLink - The URI that can be used to request the next list of pipeline runs. + NextLink *string `json:"nextLink,omitempty"` +} + +// PipelineRunListResultIterator provides access to a complete listing of PipelineRun values. +type PipelineRunListResultIterator struct { + i int + page PipelineRunListResultPage +} + +// 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 *PipelineRunListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PipelineRunListResultIterator.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 *PipelineRunListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter PipelineRunListResultIterator) 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 PipelineRunListResultIterator) Response() PipelineRunListResult { + 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 PipelineRunListResultIterator) Value() PipelineRun { + if !iter.page.NotDone() { + return PipelineRun{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the PipelineRunListResultIterator type. +func NewPipelineRunListResultIterator(page PipelineRunListResultPage) PipelineRunListResultIterator { + return PipelineRunListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (prlr PipelineRunListResult) IsEmpty() bool { + return prlr.Value == nil || len(*prlr.Value) == 0 +} + +// pipelineRunListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (prlr PipelineRunListResult) pipelineRunListResultPreparer(ctx context.Context) (*http.Request, error) { + if prlr.NextLink == nil || len(to.String(prlr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(prlr.NextLink))) +} + +// PipelineRunListResultPage contains a page of PipelineRun values. +type PipelineRunListResultPage struct { + fn func(context.Context, PipelineRunListResult) (PipelineRunListResult, error) + prlr PipelineRunListResult +} + +// 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 *PipelineRunListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PipelineRunListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.prlr) + if err != nil { + return err + } + page.prlr = next + 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 *PipelineRunListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page PipelineRunListResultPage) NotDone() bool { + return !page.prlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page PipelineRunListResultPage) Response() PipelineRunListResult { + return page.prlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page PipelineRunListResultPage) Values() []PipelineRun { + if page.prlr.IsEmpty() { + return nil + } + return *page.prlr.Value +} + +// Creates a new instance of the PipelineRunListResultPage type. +func NewPipelineRunListResultPage(getNextPage func(context.Context, PipelineRunListResult) (PipelineRunListResult, error)) PipelineRunListResultPage { + return PipelineRunListResultPage{fn: getNextPage} +} + +// PipelineRunProperties the properties of a pipeline run. +type PipelineRunProperties struct { + // ProvisioningState - READ-ONLY; The provisioning state of a pipeline run. Possible values include: 'Creating', 'Updating', 'Deleting', 'Succeeded', 'Failed', 'Canceled' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // Request - The request parameters for a pipeline run. + Request *PipelineRunRequest `json:"request,omitempty"` + // Response - READ-ONLY; The response of a pipeline run. + Response *PipelineRunResponse `json:"response,omitempty"` + // ForceUpdateTag - How the pipeline run should be forced to recreate even if the pipeline run configuration has not changed. + ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` +} + +// PipelineRunRequest the request properties provided for a pipeline run. +type PipelineRunRequest struct { + // PipelineResourceID - The resource ID of the pipeline to run. + PipelineResourceID *string `json:"pipelineResourceId,omitempty"` + // Artifacts - List of source artifacts to be transferred by the pipeline. + // 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'). + Artifacts *[]string `json:"artifacts,omitempty"` + // Source - The source properties of the pipeline run. + Source *PipelineRunSourceProperties `json:"source,omitempty"` + // Target - The target properties of the pipeline run. + Target *PipelineRunTargetProperties `json:"target,omitempty"` + // CatalogDigest - The digest of the tar used to transfer the artifacts. + CatalogDigest *string `json:"catalogDigest,omitempty"` +} + +// PipelineRunResponse the response properties returned for a pipeline run. +type PipelineRunResponse struct { + // Status - The current status of the pipeline run. + Status *string `json:"status,omitempty"` + // ImportedArtifacts - The artifacts imported in the pipeline run. + ImportedArtifacts *[]string `json:"importedArtifacts,omitempty"` + // Progress - The current progress of the copy operation. + Progress *ProgressProperties `json:"progress,omitempty"` + // StartTime - The time the pipeline run started. + StartTime *date.Time `json:"startTime,omitempty"` + // FinishTime - The time the pipeline run finished. + FinishTime *date.Time `json:"finishTime,omitempty"` + // Source - The source of the pipeline run. + Source *ImportPipelineSourceProperties `json:"source,omitempty"` + // Target - The target of the pipeline run. + Target *ExportPipelineTargetProperties `json:"target,omitempty"` + // CatalogDigest - The digest of the tar used to transfer the artifacts. + CatalogDigest *string `json:"catalogDigest,omitempty"` + // Trigger - The trigger that caused the pipeline run. + Trigger *PipelineTriggerDescriptor `json:"trigger,omitempty"` + // PipelineRunErrorMessage - The detailed error message for the pipeline run in the case of failure. + PipelineRunErrorMessage *string `json:"pipelineRunErrorMessage,omitempty"` +} + +// PipelineRunsCreateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type PipelineRunsCreateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *PipelineRunsCreateFuture) Result(client PipelineRunsClient) (pr PipelineRun, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.PipelineRunsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerregistry.PipelineRunsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pr.Response.Response, err = future.GetResult(sender); err == nil && pr.Response.Response.StatusCode != http.StatusNoContent { + pr, err = client.CreateResponder(pr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.PipelineRunsCreateFuture", "Result", pr.Response.Response, "Failure responding to request") + } + } + return +} + +// PipelineRunsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type PipelineRunsDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *PipelineRunsDeleteFuture) Result(client PipelineRunsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.PipelineRunsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("containerregistry.PipelineRunsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// PipelineRunSourceProperties ... +type PipelineRunSourceProperties struct { + // Type - The type of the source. Possible values include: 'AzureStorageBlob' + Type PipelineRunSourceType `json:"type,omitempty"` + // Name - The name of the source. + Name *string `json:"name,omitempty"` +} + +// PipelineRunTargetProperties ... +type PipelineRunTargetProperties struct { + // Type - The type of the target. Possible values include: 'PipelineRunTargetTypeAzureStorageBlob' + Type PipelineRunTargetType `json:"type,omitempty"` + // Name - The name of the target. + Name *string `json:"name,omitempty"` +} + +// PipelineSourceTriggerDescriptor ... +type PipelineSourceTriggerDescriptor struct { + // Timestamp - The timestamp when the source update happened. + Timestamp *date.Time `json:"timestamp,omitempty"` +} + +// PipelineSourceTriggerProperties ... +type PipelineSourceTriggerProperties struct { + // Status - The current status of the source trigger. Possible values include: 'TriggerStatusEnabled', 'TriggerStatusDisabled' + Status TriggerStatus `json:"status,omitempty"` +} + +// PipelineTriggerDescriptor ... +type PipelineTriggerDescriptor struct { + // SourceTrigger - The source trigger that caused the pipeline run. + SourceTrigger *PipelineSourceTriggerDescriptor `json:"sourceTrigger,omitempty"` +} + +// PipelineTriggerProperties ... +type PipelineTriggerProperties struct { + // SourceTrigger - The source trigger properties of the pipeline. + SourceTrigger *PipelineSourceTriggerProperties `json:"sourceTrigger,omitempty"` +} + // 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: 'Windows', 'Linux' @@ -3233,6 +4286,12 @@ type PrivateLinkServiceConnectionState struct { ActionsRequired ActionsRequired `json:"actionsRequired,omitempty"` } +// ProgressProperties ... +type ProgressProperties struct { + // Percentage - The percentage complete of the copy operation. + Percentage *string `json:"percentage,omitempty"` +} + // ProxyResource the resource model definition for a ARM proxy resource. It will have everything other than // required location and tags. type ProxyResource struct { @@ -3755,6 +4814,8 @@ type RegistryProperties struct { 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"` } // RegistryPropertiesUpdateParameters the parameters for updating the properties of a container registry. @@ -3769,6 +4830,8 @@ type RegistryPropertiesUpdateParameters struct { 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"` } // RegistryUpdateParameters the parameters for updating a container registry. @@ -4124,6 +5187,8 @@ type ReplicationProperties struct { 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"` } // ReplicationsCreateFuture an abstraction for monitoring and retrieving the results of a long-running @@ -4211,6 +5276,8 @@ func (future *ReplicationsUpdateFuture) Result(client ReplicationsClient) (r Rep 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. @@ -4219,9 +5286,51 @@ func (rup ReplicationUpdateParameters) MarshalJSON() ([]byte, error) { 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. @@ -5167,7 +6276,7 @@ type SourceTrigger struct { 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 - The current status of trigger. Possible values include: 'TriggerStatusEnabled', 'TriggerStatusDisabled' Status TriggerStatus `json:"status,omitempty"` // Name - The name of the trigger. Name *string `json:"name,omitempty"` @@ -5197,7 +6306,7 @@ type SourceTriggerUpdateParameters struct { 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 - The current status of trigger. Possible values include: 'TriggerStatusEnabled', 'TriggerStatusDisabled' Status TriggerStatus `json:"status,omitempty"` // Name - The name of the trigger. Name *string `json:"name,omitempty"` @@ -6697,7 +7806,7 @@ func (tup *TaskUpdateParameters) UnmarshalJSON(body []byte) error { 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 - The current status of trigger. Possible values include: 'TriggerStatusEnabled', 'TriggerStatusDisabled' Status TriggerStatus `json:"status,omitempty"` // Name - The name of the trigger. Name *string `json:"name,omitempty"` @@ -6715,7 +7824,7 @@ type TimerTriggerDescriptor struct { 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 - The current status of trigger. Possible values include: 'TriggerStatusEnabled', 'TriggerStatusDisabled' Status TriggerStatus `json:"status,omitempty"` // Name - The name of the trigger. Name *string `json:"name,omitempty"` diff --git a/services/preview/containerregistry/mgmt/2019-12-01-preview/containerregistry/pipelineruns.go b/services/preview/containerregistry/mgmt/2019-12-01-preview/containerregistry/pipelineruns.go new file mode 100644 index 000000000000..4cf4abc5aef3 --- /dev/null +++ b/services/preview/containerregistry/mgmt/2019-12-01-preview/containerregistry/pipelineruns.go @@ -0,0 +1,454 @@ +package containerregistry + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// PipelineRunsClient is the client for the PipelineRuns methods of the Containerregistry service. +type PipelineRunsClient struct { + BaseClient +} + +// NewPipelineRunsClient creates an instance of the PipelineRunsClient client. +func NewPipelineRunsClient(subscriptionID string) PipelineRunsClient { + return NewPipelineRunsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPipelineRunsClientWithBaseURI creates an instance of the PipelineRunsClient 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 NewPipelineRunsClientWithBaseURI(baseURI string, subscriptionID string) PipelineRunsClient { + return PipelineRunsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create creates a pipeline 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. +// pipelineRunName - the name of the pipeline run. +// pipelineRunCreateParameters - the parameters for creating a pipeline run. +func (client PipelineRunsClient) Create(ctx context.Context, resourceGroupName string, registryName string, pipelineRunName string, pipelineRunCreateParameters PipelineRun) (result PipelineRunsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PipelineRunsClient.Create") + 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.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: pipelineRunName, + Constraints: []validation.Constraint{{Target: "pipelineRunName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "pipelineRunName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "pipelineRunName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}, + {TargetValue: pipelineRunCreateParameters, + Constraints: []validation.Constraint{{Target: "pipelineRunCreateParameters.PipelineRunProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "pipelineRunCreateParameters.PipelineRunProperties.Response", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "pipelineRunCreateParameters.PipelineRunProperties.Response.Source", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "pipelineRunCreateParameters.PipelineRunProperties.Response.Source.KeyVaultURI", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "pipelineRunCreateParameters.PipelineRunProperties.Response.Target", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "pipelineRunCreateParameters.PipelineRunProperties.Response.Target.KeyVaultURI", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + }}}}}); err != nil { + return result, validation.NewError("containerregistry.PipelineRunsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, registryName, pipelineRunName, pipelineRunCreateParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.PipelineRunsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.PipelineRunsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client PipelineRunsClient) CreatePreparer(ctx context.Context, resourceGroupName string, registryName string, pipelineRunName string, pipelineRunCreateParameters PipelineRun) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "pipelineRunName": autorest.Encode("path", pipelineRunName), + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-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}/pipelineRuns/{pipelineRunName}", pathParameters), + autorest.WithJSON(pipelineRunCreateParameters), + 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 PipelineRunsClient) CreateSender(req *http.Request) (future PipelineRunsCreateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client PipelineRunsClient) CreateResponder(resp *http.Response) (result PipelineRun, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a pipeline run 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. +// pipelineRunName - the name of the pipeline run. +func (client PipelineRunsClient) Delete(ctx context.Context, resourceGroupName string, registryName string, pipelineRunName string) (result PipelineRunsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PipelineRunsClient.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.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: pipelineRunName, + Constraints: []validation.Constraint{{Target: "pipelineRunName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "pipelineRunName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "pipelineRunName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.PipelineRunsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, registryName, pipelineRunName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.PipelineRunsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.PipelineRunsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client PipelineRunsClient) DeletePreparer(ctx context.Context, resourceGroupName string, registryName string, pipelineRunName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "pipelineRunName": autorest.Encode("path", pipelineRunName), + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-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}/pipelineRuns/{pipelineRunName}", 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 PipelineRunsClient) DeleteSender(req *http.Request) (future PipelineRunsDeleteFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client PipelineRunsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the detailed information for a given pipeline run. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +// pipelineRunName - the name of the pipeline run. +func (client PipelineRunsClient) Get(ctx context.Context, resourceGroupName string, registryName string, pipelineRunName string) (result PipelineRun, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PipelineRunsClient.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: pipelineRunName, + Constraints: []validation.Constraint{{Target: "pipelineRunName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "pipelineRunName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "pipelineRunName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.PipelineRunsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, registryName, pipelineRunName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.PipelineRunsClient", "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.PipelineRunsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.PipelineRunsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client PipelineRunsClient) GetPreparer(ctx context.Context, resourceGroupName string, registryName string, pipelineRunName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "pipelineRunName": autorest.Encode("path", pipelineRunName), + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-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}/pipelineRuns/{pipelineRunName}", 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 PipelineRunsClient) 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 PipelineRunsClient) GetResponder(resp *http.Response) (result PipelineRun, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists all the pipeline runs 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 PipelineRunsClient) List(ctx context.Context, resourceGroupName string, registryName string) (result PipelineRunListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PipelineRunsClient.List") + defer func() { + sc := -1 + if result.prlr.Response.Response != nil { + sc = result.prlr.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.PipelineRunsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, registryName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.PipelineRunsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.prlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.PipelineRunsClient", "List", resp, "Failure sending request") + return + } + + result.prlr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.PipelineRunsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client PipelineRunsClient) 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-12-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}/pipelineRuns", 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 PipelineRunsClient) 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 PipelineRunsClient) ListResponder(resp *http.Response) (result PipelineRunListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 PipelineRunsClient) listNextResults(ctx context.Context, lastResults PipelineRunListResult) (result PipelineRunListResult, err error) { + req, err := lastResults.pipelineRunListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerregistry.PipelineRunsClient", "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.PipelineRunsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.PipelineRunsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client PipelineRunsClient) ListComplete(ctx context.Context, resourceGroupName string, registryName string) (result PipelineRunListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PipelineRunsClient.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/containerservice/mgmt/2019-10-27-preview/containerservice/agentpools.go b/services/preview/containerservice/mgmt/2019-10-27-preview/containerservice/agentpools.go index 54f029262777..5de453fb8e05 100644 --- a/services/preview/containerservice/mgmt/2019-10-27-preview/containerservice/agentpools.go +++ b/services/preview/containerservice/mgmt/2019-10-27-preview/containerservice/agentpools.go @@ -65,14 +65,7 @@ func (client AgentPoolsClient) CreateOrUpdate(ctx context.Context, resourceGroup {TargetValue: resourceName, Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}, - {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}, - {TargetValue: parameters, - Constraints: []validation.Constraint{{Target: "parameters.ManagedClusterAgentPoolProfileProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "parameters.ManagedClusterAgentPoolProfileProperties.Count", Name: validation.Null, Rule: true, - Chain: []validation.Constraint{{Target: "parameters.ManagedClusterAgentPoolProfileProperties.Count", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, - {Target: "parameters.ManagedClusterAgentPoolProfileProperties.Count", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, - }}, - }}}}}); err != nil { + {Target: "resourceName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]$|^[a-zA-Z0-9][-_a-zA-Z0-9]{0,61}[a-zA-Z0-9]$`, Chain: nil}}}}); err != nil { return result, validation.NewError("containerservice.AgentPoolsClient", "CreateOrUpdate", err.Error()) } diff --git a/services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/notebookworkspaces.go b/services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/notebookworkspaces.go index b7f9cc1a3ed1..ef2a4cac2827 100644 --- a/services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/notebookworkspaces.go +++ b/services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/notebookworkspaces.go @@ -45,7 +45,7 @@ func NewNotebookWorkspacesClientWithBaseURI(baseURI string, subscriptionID strin // CreateOrUpdate creates the notebook workspace for a Cosmos DB account. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // notebookCreateUpdateParameters - the notebook workspace to create for the current database account. func (client NotebookWorkspacesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, accountName string, notebookCreateUpdateParameters NotebookWorkspaceCreateUpdateParameters) (result NotebookWorkspacesCreateOrUpdateFuture, err error) { @@ -60,6 +60,8 @@ func (client NotebookWorkspacesClient) CreateOrUpdate(ctx context.Context, resou }() } 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}, @@ -137,7 +139,7 @@ func (client NotebookWorkspacesClient) CreateOrUpdateResponder(resp *http.Respon // Delete deletes the notebook workspace for a Cosmos DB account. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. func (client NotebookWorkspacesClient) Delete(ctx context.Context, resourceGroupName string, accountName string) (result NotebookWorkspacesDeleteFuture, err error) { if tracing.IsEnabled() { @@ -151,6 +153,8 @@ func (client NotebookWorkspacesClient) Delete(ctx context.Context, resourceGroup }() } 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}, @@ -225,7 +229,7 @@ func (client NotebookWorkspacesClient) DeleteResponder(resp *http.Response) (res // Get gets the notebook workspace for a Cosmos DB account. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. func (client NotebookWorkspacesClient) Get(ctx context.Context, resourceGroupName string, accountName string) (result NotebookWorkspace, err error) { if tracing.IsEnabled() { @@ -239,6 +243,8 @@ func (client NotebookWorkspacesClient) Get(ctx context.Context, resourceGroupNam }() } 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}, @@ -314,7 +320,7 @@ func (client NotebookWorkspacesClient) GetResponder(resp *http.Response) (result // ListByDatabaseAccount gets the notebook workspace resources of an existing Cosmos DB account. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. func (client NotebookWorkspacesClient) ListByDatabaseAccount(ctx context.Context, resourceGroupName string, accountName string) (result NotebookWorkspaceListResult, err error) { if tracing.IsEnabled() { @@ -328,6 +334,8 @@ func (client NotebookWorkspacesClient) ListByDatabaseAccount(ctx context.Context }() } 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}, @@ -402,7 +410,7 @@ func (client NotebookWorkspacesClient) ListByDatabaseAccountResponder(resp *http // ListConnectionInfo retrieves the connection info for the notebook workspace // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. func (client NotebookWorkspacesClient) ListConnectionInfo(ctx context.Context, resourceGroupName string, accountName string) (result NotebookWorkspaceConnectionInfoResult, err error) { if tracing.IsEnabled() { @@ -416,6 +424,8 @@ func (client NotebookWorkspacesClient) ListConnectionInfo(ctx context.Context, r }() } 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}, @@ -491,7 +501,7 @@ func (client NotebookWorkspacesClient) ListConnectionInfoResponder(resp *http.Re // RegenerateAuthToken regenerates the auth token for the notebook workspace // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. func (client NotebookWorkspacesClient) RegenerateAuthToken(ctx context.Context, resourceGroupName string, accountName string) (result NotebookWorkspacesRegenerateAuthTokenFuture, err error) { if tracing.IsEnabled() { @@ -505,6 +515,8 @@ func (client NotebookWorkspacesClient) RegenerateAuthToken(ctx context.Context, }() } 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}, @@ -579,7 +591,7 @@ func (client NotebookWorkspacesClient) RegenerateAuthTokenResponder(resp *http.R // Start starts the notebook workspace // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. func (client NotebookWorkspacesClient) Start(ctx context.Context, resourceGroupName string, accountName string) (result NotebookWorkspacesStartFuture, err error) { if tracing.IsEnabled() { @@ -593,6 +605,8 @@ func (client NotebookWorkspacesClient) Start(ctx context.Context, resourceGroupN }() } 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}, diff --git a/services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/privatelinkresources.go b/services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/privatelinkresources.go index a13e3bddebd2..215288ea9a8e 100644 --- a/services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/privatelinkresources.go +++ b/services/preview/cosmos-db/mgmt/2019-08-01-preview/documentdb/privatelinkresources.go @@ -45,7 +45,7 @@ func NewPrivateLinkResourcesClientWithBaseURI(baseURI string, subscriptionID str // Get gets the private link resources that need to be created for a Cosmos DB account. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. // groupName - the name of the private link resource. func (client PrivateLinkResourcesClient) Get(ctx context.Context, resourceGroupName string, accountName string, groupName string) (result PrivateLinkResource, err error) { @@ -60,6 +60,8 @@ func (client PrivateLinkResourcesClient) Get(ctx context.Context, resourceGroupN }() } 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}, @@ -135,7 +137,7 @@ func (client PrivateLinkResourcesClient) GetResponder(resp *http.Response) (resu // ListByDatabaseAccount gets the private link resources that need to be created for a Cosmos DB account. // Parameters: -// resourceGroupName - name of an Azure resource group. +// resourceGroupName - the name of the resource group. The name is case insensitive. // accountName - cosmos DB database account name. func (client PrivateLinkResourcesClient) ListByDatabaseAccount(ctx context.Context, resourceGroupName string, accountName string) (result PrivateLinkResourceListResult, err error) { if tracing.IsEnabled() { @@ -149,6 +151,8 @@ func (client PrivateLinkResourcesClient) ListByDatabaseAccount(ctx context.Conte }() } 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}, diff --git a/services/preview/desktopvirtualization/mgmt/2019-01-23-preview/desktopvirtualization/applicationgroups.go b/services/preview/desktopvirtualization/mgmt/2019-01-23-preview/desktopvirtualization/applicationgroups.go index f717ae51e905..e7dd7925ecb3 100644 --- a/services/preview/desktopvirtualization/mgmt/2019-01-23-preview/desktopvirtualization/applicationgroups.go +++ b/services/preview/desktopvirtualization/mgmt/2019-01-23-preview/desktopvirtualization/applicationgroups.go @@ -68,7 +68,10 @@ func (client ApplicationGroupsClient) CreateOrUpdate(ctx context.Context, resour {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, {TargetValue: applicationGroupName, Constraints: []validation.Constraint{{Target: "applicationGroupName", Name: validation.MaxLength, Rule: 24, Chain: nil}, - {Target: "applicationGroupName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + {Target: "applicationGroupName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: applicationGroup, + Constraints: []validation.Constraint{{Target: "applicationGroup.ApplicationGroupProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "applicationGroup.ApplicationGroupProperties.HostPoolArmPath", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { return result, validation.NewError("desktopvirtualization.ApplicationGroupsClient", "CreateOrUpdate", err.Error()) } diff --git a/services/preview/desktopvirtualization/mgmt/2019-01-23-preview/desktopvirtualization/applications.go b/services/preview/desktopvirtualization/mgmt/2019-01-23-preview/desktopvirtualization/applications.go index 2e8737dc049f..0f6ad278b9d8 100644 --- a/services/preview/desktopvirtualization/mgmt/2019-01-23-preview/desktopvirtualization/applications.go +++ b/services/preview/desktopvirtualization/mgmt/2019-01-23-preview/desktopvirtualization/applications.go @@ -71,7 +71,9 @@ func (client ApplicationsClient) CreateOrUpdate(ctx context.Context, resourceGro {Target: "applicationGroupName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, {TargetValue: applicationName, Constraints: []validation.Constraint{{Target: "applicationName", Name: validation.MaxLength, Rule: 24, Chain: nil}, - {Target: "applicationName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + {Target: "applicationName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: application, + Constraints: []validation.Constraint{{Target: "application.ApplicationProperties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { return result, validation.NewError("desktopvirtualization.ApplicationsClient", "CreateOrUpdate", err.Error()) } diff --git a/services/preview/desktopvirtualization/mgmt/2019-01-23-preview/desktopvirtualization/hostpools.go b/services/preview/desktopvirtualization/mgmt/2019-01-23-preview/desktopvirtualization/hostpools.go index a9f42c3bad4a..f0249354deae 100644 --- a/services/preview/desktopvirtualization/mgmt/2019-01-23-preview/desktopvirtualization/hostpools.go +++ b/services/preview/desktopvirtualization/mgmt/2019-01-23-preview/desktopvirtualization/hostpools.go @@ -67,7 +67,9 @@ func (client HostPoolsClient) CreateOrUpdate(ctx context.Context, resourceGroupN {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, {TargetValue: hostPoolName, Constraints: []validation.Constraint{{Target: "hostPoolName", Name: validation.MaxLength, Rule: 24, Chain: nil}, - {Target: "hostPoolName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + {Target: "hostPoolName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: hostPool, + Constraints: []validation.Constraint{{Target: "hostPool.HostPoolProperties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { return result, validation.NewError("desktopvirtualization.HostPoolsClient", "CreateOrUpdate", err.Error()) } diff --git a/services/preview/desktopvirtualization/mgmt/2019-01-23-preview/desktopvirtualization/models.go b/services/preview/desktopvirtualization/mgmt/2019-01-23-preview/desktopvirtualization/models.go index e86c9bdf85e1..683198ed38f5 100644 --- a/services/preview/desktopvirtualization/mgmt/2019-01-23-preview/desktopvirtualization/models.go +++ b/services/preview/desktopvirtualization/mgmt/2019-01-23-preview/desktopvirtualization/models.go @@ -196,11 +196,11 @@ type Application struct { autorest.Response `json:"-"` // ApplicationProperties - Detailed properties for Application *ApplicationProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource ID. + // 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; Resource name. + // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. + // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. Type *string `json:"type,omitempty"` } @@ -271,13 +271,13 @@ type ApplicationGroup struct { *ApplicationGroupProperties `json:"properties,omitempty"` // Tags - Resource tags. Tags map[string]*string `json:"tags"` - // Location - Resource location. + // Location - The geo-location where the resource lives Location *string `json:"location,omitempty"` - // ID - READ-ONLY; Resource ID. + // 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; Resource name. + // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. + // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. Type *string `json:"type,omitempty"` } @@ -517,11 +517,11 @@ type ApplicationGroupPatch struct { Tags interface{} `json:"tags,omitempty"` // ApplicationGroupPatchProperties - ApplicationGroup properties that can be patched. *ApplicationGroupPatchProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource ID. + // 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; Resource name. + // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. + // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. Type *string `json:"type,omitempty"` } @@ -862,6 +862,18 @@ type ApplicationProperties struct { IconContent *[]byte `json:"iconContent,omitempty"` } +// AzureEntityResource the resource model definition for a 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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + // CloudError error response of an operation failure type CloudError struct { // Code - Error code @@ -875,11 +887,11 @@ type Desktop struct { autorest.Response `json:"-"` // DesktopProperties - Detailed properties for Desktop *DesktopProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource ID. + // 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; Resource name. + // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. + // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. Type *string `json:"type,omitempty"` } @@ -1032,13 +1044,13 @@ type HostPool struct { *HostPoolProperties `json:"properties,omitempty"` // Tags - Resource tags. Tags map[string]*string `json:"tags"` - // Location - Resource location. + // Location - The geo-location where the resource lives Location *string `json:"location,omitempty"` - // ID - READ-ONLY; Resource ID. + // 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; Resource name. + // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. + // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. Type *string `json:"type,omitempty"` } @@ -1278,11 +1290,11 @@ type HostPoolPatch struct { Tags interface{} `json:"tags,omitempty"` // HostPoolPatchProperties - HostPool properties that can be patched. *HostPoolPatchProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource ID. + // 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; Resource name. + // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. + // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. Type *string `json:"type,omitempty"` } @@ -1412,6 +1424,17 @@ type HostPoolProperties struct { SsoContext *string `json:"ssoContext,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; 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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + // RegistrationInfo represents a RegistrationInfo definition. type RegistrationInfo struct { // ExpirationTime - Expiration time of registration token. @@ -1428,13 +1451,13 @@ type RegistrationInfoPatch struct { ResetToken *bool `json:"resetToken,omitempty"` } -// Resource ARM resource. +// Resource ... type Resource struct { - // ID - READ-ONLY; Resource ID. + // 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; Resource name. + // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. + // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. Type *string `json:"type,omitempty"` } @@ -1478,11 +1501,11 @@ type SessionHost struct { autorest.Response `json:"-"` // SessionHostProperties - Detailed properties for SessionHost *SessionHostProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource ID. + // 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; Resource name. + // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. + // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. Type *string `json:"type,omitempty"` } @@ -1696,11 +1719,11 @@ func NewSessionHostListPage(getNextPage func(context.Context, SessionHostList) ( type SessionHostPatch struct { // SessionHostPatchProperties - Detailed properties for SessionHost *SessionHostPatchProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource ID. + // 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; Resource name. + // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. + // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. Type *string `json:"type,omitempty"` } @@ -1804,11 +1827,11 @@ type SessionHostProperties struct { type StartMenuItem struct { // StartMenuItemProperties - Detailed properties for StartMenuItem *StartMenuItemProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource ID. + // 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; Resource name. + // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. + // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. Type *string `json:"type,omitempty"` } @@ -2034,17 +2057,17 @@ type StartMenuItemProperties struct { IconIndex *int32 `json:"iconIndex,omitempty"` } -// TrackedResource ARM tracked top level resource. +// TrackedResource the resource model definition for a ARM tracked top level resource type TrackedResource struct { // Tags - Resource tags. Tags map[string]*string `json:"tags"` - // Location - Resource location. + // Location - The geo-location where the resource lives Location *string `json:"location,omitempty"` - // ID - READ-ONLY; Resource ID. + // 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; Resource name. + // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. + // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. Type *string `json:"type,omitempty"` } @@ -2065,11 +2088,11 @@ type UserSession struct { autorest.Response `json:"-"` // UserSessionProperties - Detailed properties for UserSession *UserSessionProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource ID. + // 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; Resource name. + // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. + // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. Type *string `json:"type,omitempty"` } @@ -2300,13 +2323,13 @@ type Workspace struct { *WorkspaceProperties `json:"properties,omitempty"` // Tags - Resource tags. Tags map[string]*string `json:"tags"` - // Location - Resource location. + // Location - The geo-location where the resource lives Location *string `json:"location,omitempty"` - // ID - READ-ONLY; Resource ID. + // 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; Resource name. + // Name - READ-ONLY; The name of the resource Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type. + // Type - READ-ONLY; The type of the resource. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. Type *string `json:"type,omitempty"` } diff --git a/services/preview/desktopvirtualization/mgmt/2019-09-24-preview/desktopvirtualization/activeapplications.go b/services/preview/desktopvirtualization/mgmt/2019-09-24-preview/desktopvirtualization/activeapplications.go new file mode 100644 index 000000000000..6c2ec37afdda --- /dev/null +++ b/services/preview/desktopvirtualization/mgmt/2019-09-24-preview/desktopvirtualization/activeapplications.go @@ -0,0 +1,180 @@ +package desktopvirtualization + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// ActiveApplicationsClient is the client for the ActiveApplications methods of the Desktopvirtualization service. +type ActiveApplicationsClient struct { + BaseClient +} + +// NewActiveApplicationsClient creates an instance of the ActiveApplicationsClient client. +func NewActiveApplicationsClient(subscriptionID string) ActiveApplicationsClient { + return NewActiveApplicationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewActiveApplicationsClientWithBaseURI creates an instance of the ActiveApplicationsClient 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 NewActiveApplicationsClientWithBaseURI(baseURI string, subscriptionID string) ActiveApplicationsClient { + return ActiveApplicationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListBySessionHost list applications for the given session host. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// hostPoolName - the name of the host pool within the specified resource group +// sessionHostName - the name of the session host within the specified host pool +// filter - oData filter expression. Valid properties for filtering are userprincipalname and sessionstate. +func (client ActiveApplicationsClient) ListBySessionHost(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string, filter string) (result ApplicationListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ActiveApplicationsClient.ListBySessionHost") + defer func() { + sc := -1 + if result.al.Response.Response != nil { + sc = result.al.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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: hostPoolName, + Constraints: []validation.Constraint{{Target: "hostPoolName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "hostPoolName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: sessionHostName, + Constraints: []validation.Constraint{{Target: "sessionHostName", Name: validation.MaxLength, Rule: 48, Chain: nil}, + {Target: "sessionHostName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.ActiveApplicationsClient", "ListBySessionHost", err.Error()) + } + + result.fn = client.listBySessionHostNextResults + req, err := client.ListBySessionHostPreparer(ctx, resourceGroupName, hostPoolName, sessionHostName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.ActiveApplicationsClient", "ListBySessionHost", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySessionHostSender(req) + if err != nil { + result.al.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.ActiveApplicationsClient", "ListBySessionHost", resp, "Failure sending request") + return + } + + result.al, err = client.ListBySessionHostResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.ActiveApplicationsClient", "ListBySessionHost", resp, "Failure responding to request") + } + + return +} + +// ListBySessionHostPreparer prepares the ListBySessionHost request. +func (client ActiveApplicationsClient) ListBySessionHostPreparer(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "hostPoolName": autorest.Encode("path", hostPoolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sessionHostName": autorest.Encode("path", sessionHostName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-24-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.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/activeApplications", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBySessionHostSender sends the ListBySessionHost request. The method will close the +// http.Response Body if it receives an error. +func (client ActiveApplicationsClient) ListBySessionHostSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListBySessionHostResponder handles the response to the ListBySessionHost request. The method always +// closes the http.Response Body. +func (client ActiveApplicationsClient) ListBySessionHostResponder(resp *http.Response) (result ApplicationList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listBySessionHostNextResults retrieves the next set of results, if any. +func (client ActiveApplicationsClient) listBySessionHostNextResults(ctx context.Context, lastResults ApplicationList) (result ApplicationList, err error) { + req, err := lastResults.applicationListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "desktopvirtualization.ActiveApplicationsClient", "listBySessionHostNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListBySessionHostSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "desktopvirtualization.ActiveApplicationsClient", "listBySessionHostNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySessionHostResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.ActiveApplicationsClient", "listBySessionHostNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySessionHostComplete enumerates all values, automatically crossing page boundaries as required. +func (client ActiveApplicationsClient) ListBySessionHostComplete(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string, filter string) (result ApplicationListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ActiveApplicationsClient.ListBySessionHost") + 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.ListBySessionHost(ctx, resourceGroupName, hostPoolName, sessionHostName, filter) + return +} diff --git a/services/preview/desktopvirtualization/mgmt/2019-09-24-preview/desktopvirtualization/applicationgroupassignments.go b/services/preview/desktopvirtualization/mgmt/2019-09-24-preview/desktopvirtualization/applicationgroupassignments.go new file mode 100644 index 000000000000..39193fbcd245 --- /dev/null +++ b/services/preview/desktopvirtualization/mgmt/2019-09-24-preview/desktopvirtualization/applicationgroupassignments.go @@ -0,0 +1,176 @@ +package desktopvirtualization + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// ApplicationGroupAssignmentsClient is the client for the ApplicationGroupAssignments methods of the +// Desktopvirtualization service. +type ApplicationGroupAssignmentsClient struct { + BaseClient +} + +// NewApplicationGroupAssignmentsClient creates an instance of the ApplicationGroupAssignmentsClient client. +func NewApplicationGroupAssignmentsClient(subscriptionID string) ApplicationGroupAssignmentsClient { + return NewApplicationGroupAssignmentsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewApplicationGroupAssignmentsClientWithBaseURI creates an instance of the ApplicationGroupAssignmentsClient 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 NewApplicationGroupAssignmentsClientWithBaseURI(baseURI string, subscriptionID string) ApplicationGroupAssignmentsClient { + return ApplicationGroupAssignmentsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// WorkspaceLevelList list application group that user can use. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +// filter - oData filter expression. Valid properties for filtering are applicationGroupType. +func (client ApplicationGroupAssignmentsClient) WorkspaceLevelList(ctx context.Context, resourceGroupName string, workspaceName string, filter string) (result ApplicationGroupListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGroupAssignmentsClient.WorkspaceLevelList") + defer func() { + sc := -1 + if result.agl.Response.Response != nil { + sc = result.agl.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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.ApplicationGroupAssignmentsClient", "WorkspaceLevelList", err.Error()) + } + + result.fn = client.workspaceLevelListNextResults + req, err := client.WorkspaceLevelListPreparer(ctx, resourceGroupName, workspaceName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationGroupAssignmentsClient", "WorkspaceLevelList", nil, "Failure preparing request") + return + } + + resp, err := client.WorkspaceLevelListSender(req) + if err != nil { + result.agl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationGroupAssignmentsClient", "WorkspaceLevelList", resp, "Failure sending request") + return + } + + result.agl, err = client.WorkspaceLevelListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationGroupAssignmentsClient", "WorkspaceLevelList", resp, "Failure responding to request") + } + + return +} + +// WorkspaceLevelListPreparer prepares the WorkspaceLevelList request. +func (client ApplicationGroupAssignmentsClient) WorkspaceLevelListPreparer(ctx context.Context, resourceGroupName string, workspaceName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-09-24-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.DesktopVirtualization/workspaces/{workspaceName}/userApplicationGroupAssignments", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// WorkspaceLevelListSender sends the WorkspaceLevelList request. The method will close the +// http.Response Body if it receives an error. +func (client ApplicationGroupAssignmentsClient) WorkspaceLevelListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// WorkspaceLevelListResponder handles the response to the WorkspaceLevelList request. The method always +// closes the http.Response Body. +func (client ApplicationGroupAssignmentsClient) WorkspaceLevelListResponder(resp *http.Response) (result ApplicationGroupList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// workspaceLevelListNextResults retrieves the next set of results, if any. +func (client ApplicationGroupAssignmentsClient) workspaceLevelListNextResults(ctx context.Context, lastResults ApplicationGroupList) (result ApplicationGroupList, err error) { + req, err := lastResults.applicationGroupListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationGroupAssignmentsClient", "workspaceLevelListNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.WorkspaceLevelListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationGroupAssignmentsClient", "workspaceLevelListNextResults", resp, "Failure sending next results request") + } + result, err = client.WorkspaceLevelListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationGroupAssignmentsClient", "workspaceLevelListNextResults", resp, "Failure responding to next results request") + } + return +} + +// WorkspaceLevelListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ApplicationGroupAssignmentsClient) WorkspaceLevelListComplete(ctx context.Context, resourceGroupName string, workspaceName string, filter string) (result ApplicationGroupListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGroupAssignmentsClient.WorkspaceLevelList") + 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.WorkspaceLevelList(ctx, resourceGroupName, workspaceName, filter) + return +} diff --git a/services/preview/desktopvirtualization/mgmt/2019-09-24-preview/desktopvirtualization/applicationgroups.go b/services/preview/desktopvirtualization/mgmt/2019-09-24-preview/desktopvirtualization/applicationgroups.go new file mode 100644 index 000000000000..caef6bb99858 --- /dev/null +++ b/services/preview/desktopvirtualization/mgmt/2019-09-24-preview/desktopvirtualization/applicationgroups.go @@ -0,0 +1,657 @@ +package desktopvirtualization + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// ApplicationGroupsClient is the client for the ApplicationGroups methods of the Desktopvirtualization service. +type ApplicationGroupsClient struct { + BaseClient +} + +// NewApplicationGroupsClient creates an instance of the ApplicationGroupsClient client. +func NewApplicationGroupsClient(subscriptionID string) ApplicationGroupsClient { + return NewApplicationGroupsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewApplicationGroupsClientWithBaseURI creates an instance of the ApplicationGroupsClient 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 NewApplicationGroupsClientWithBaseURI(baseURI string, subscriptionID string) ApplicationGroupsClient { + return ApplicationGroupsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create or update an applicationGroup. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// applicationGroupName - the name of the application group +// applicationGroup - object containing ApplicationGroup definitions. +func (client ApplicationGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, applicationGroupName string, applicationGroup ApplicationGroup) (result ApplicationGroup, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGroupsClient.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: 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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: applicationGroupName, + Constraints: []validation.Constraint{{Target: "applicationGroupName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "applicationGroupName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: applicationGroup, + Constraints: []validation.Constraint{{Target: "applicationGroup.ApplicationGroupProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "applicationGroup.ApplicationGroupProperties.HostPoolArmPath", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.ApplicationGroupsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, applicationGroupName, applicationGroup) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationGroupsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationGroupsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationGroupsClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ApplicationGroupsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, applicationGroupName string, applicationGroup ApplicationGroup) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationGroupName": autorest.Encode("path", applicationGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-24-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.DesktopVirtualization/applicationGroups/{applicationGroupName}", pathParameters), + autorest.WithJSON(applicationGroup), + 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 ApplicationGroupsClient) 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 ApplicationGroupsClient) CreateOrUpdateResponder(resp *http.Response) (result ApplicationGroup, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete remove an applicationGroup. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// applicationGroupName - the name of the application group +func (client ApplicationGroupsClient) Delete(ctx context.Context, resourceGroupName string, applicationGroupName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGroupsClient.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: 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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: applicationGroupName, + Constraints: []validation.Constraint{{Target: "applicationGroupName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "applicationGroupName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.ApplicationGroupsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, applicationGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationGroupsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationGroupsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationGroupsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ApplicationGroupsClient) DeletePreparer(ctx context.Context, resourceGroupName string, applicationGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationGroupName": autorest.Encode("path", applicationGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-24-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.DesktopVirtualization/applicationGroups/{applicationGroupName}", 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 ApplicationGroupsClient) 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 ApplicationGroupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get an application group. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// applicationGroupName - the name of the application group +func (client ApplicationGroupsClient) Get(ctx context.Context, resourceGroupName string, applicationGroupName string) (result ApplicationGroup, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGroupsClient.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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: applicationGroupName, + Constraints: []validation.Constraint{{Target: "applicationGroupName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "applicationGroupName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.ApplicationGroupsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, applicationGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationGroupsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationGroupsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationGroupsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ApplicationGroupsClient) GetPreparer(ctx context.Context, resourceGroupName string, applicationGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationGroupName": autorest.Encode("path", applicationGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-24-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.DesktopVirtualization/applicationGroups/{applicationGroupName}", 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 ApplicationGroupsClient) 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 ApplicationGroupsClient) GetResponder(resp *http.Response) (result ApplicationGroup, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByResourceGroup list applicationGroups. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// filter - oData filter expression. Valid properties for filtering are applicationGroupType. +func (client ApplicationGroupsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, filter string) (result ApplicationGroupListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGroupsClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.agl.Response.Response != nil { + sc = result.agl.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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.ApplicationGroupsClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationGroupsClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.agl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationGroupsClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.agl, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationGroupsClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client ApplicationGroupsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-24-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.DesktopVirtualization/applicationGroups", 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 ApplicationGroupsClient) 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 ApplicationGroupsClient) ListByResourceGroupResponder(resp *http.Response) (result ApplicationGroupList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 ApplicationGroupsClient) listByResourceGroupNextResults(ctx context.Context, lastResults ApplicationGroupList) (result ApplicationGroupList, err error) { + req, err := lastResults.applicationGroupListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationGroupsClient", "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, "desktopvirtualization.ApplicationGroupsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationGroupsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client ApplicationGroupsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, filter string) (result ApplicationGroupListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGroupsClient.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, filter) + return +} + +// ListBySubscription list applicationGroups in subscription. +// Parameters: +// filter - oData filter expression. Valid properties for filtering are applicationGroupType. +func (client ApplicationGroupsClient) ListBySubscription(ctx context.Context, filter string) (result ApplicationGroupListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGroupsClient.ListBySubscription") + defer func() { + sc := -1 + if result.agl.Response.Response != nil { + sc = result.agl.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("desktopvirtualization.ApplicationGroupsClient", "ListBySubscription", err.Error()) + } + + result.fn = client.listBySubscriptionNextResults + req, err := client.ListBySubscriptionPreparer(ctx, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationGroupsClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.agl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationGroupsClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result.agl, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationGroupsClient", "ListBySubscription", resp, "Failure responding to request") + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client ApplicationGroupsClient) ListBySubscriptionPreparer(ctx context.Context, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-24-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.DesktopVirtualization/applicationGroups", 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 ApplicationGroupsClient) 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 ApplicationGroupsClient) ListBySubscriptionResponder(resp *http.Response) (result ApplicationGroupList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 ApplicationGroupsClient) listBySubscriptionNextResults(ctx context.Context, lastResults ApplicationGroupList) (result ApplicationGroupList, err error) { + req, err := lastResults.applicationGroupListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationGroupsClient", "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, "desktopvirtualization.ApplicationGroupsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationGroupsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client ApplicationGroupsClient) ListBySubscriptionComplete(ctx context.Context, filter string) (result ApplicationGroupListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGroupsClient.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 +} + +// Update update an applicationGroup. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// applicationGroupName - the name of the application group +// applicationGroup - object containing ApplicationGroup definitions. +func (client ApplicationGroupsClient) Update(ctx context.Context, resourceGroupName string, applicationGroupName string, applicationGroup *ApplicationGroupPatch) (result ApplicationGroup, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGroupsClient.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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: applicationGroupName, + Constraints: []validation.Constraint{{Target: "applicationGroupName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "applicationGroupName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.ApplicationGroupsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, applicationGroupName, applicationGroup) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationGroupsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationGroupsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationGroupsClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ApplicationGroupsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, applicationGroupName string, applicationGroup *ApplicationGroupPatch) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationGroupName": autorest.Encode("path", applicationGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-24-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.DesktopVirtualization/applicationGroups/{applicationGroupName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if applicationGroup != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(applicationGroup)) + } + 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 ApplicationGroupsClient) 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 ApplicationGroupsClient) UpdateResponder(resp *http.Response) (result ApplicationGroup, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/desktopvirtualization/mgmt/2019-09-24-preview/desktopvirtualization/applications.go b/services/preview/desktopvirtualization/mgmt/2019-09-24-preview/desktopvirtualization/applications.go new file mode 100644 index 000000000000..4ec7be486127 --- /dev/null +++ b/services/preview/desktopvirtualization/mgmt/2019-09-24-preview/desktopvirtualization/applications.go @@ -0,0 +1,556 @@ +package desktopvirtualization + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// ApplicationsClient is the client for the Applications methods of the Desktopvirtualization service. +type ApplicationsClient struct { + BaseClient +} + +// NewApplicationsClient creates an instance of the ApplicationsClient client. +func NewApplicationsClient(subscriptionID string) ApplicationsClient { + return NewApplicationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewApplicationsClientWithBaseURI creates an instance of the ApplicationsClient 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 NewApplicationsClientWithBaseURI(baseURI string, subscriptionID string) ApplicationsClient { + return ApplicationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create or update an application. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// applicationGroupName - the name of the application group +// applicationName - the name of the application within the specified application group +// application - object containing Application definitions. +func (client ApplicationsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, applicationGroupName string, applicationName string, application Application) (result Application, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationsClient.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: 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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: applicationGroupName, + Constraints: []validation.Constraint{{Target: "applicationGroupName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "applicationGroupName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: applicationName, + Constraints: []validation.Constraint{{Target: "applicationName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "applicationName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: application, + Constraints: []validation.Constraint{{Target: "application.ApplicationProperties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.ApplicationsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, applicationGroupName, applicationName, application) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationsClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ApplicationsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, applicationGroupName string, applicationName string, application Application) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationGroupName": autorest.Encode("path", applicationGroupName), + "applicationName": autorest.Encode("path", applicationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-24-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.DesktopVirtualization/applicationGroups/{applicationGroupName}/applications/{applicationName}", pathParameters), + autorest.WithJSON(application), + 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 ApplicationsClient) 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 ApplicationsClient) CreateOrUpdateResponder(resp *http.Response) (result Application, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete remove an application. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// applicationGroupName - the name of the application group +// applicationName - the name of the application within the specified application group +func (client ApplicationsClient) Delete(ctx context.Context, resourceGroupName string, applicationGroupName string, applicationName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationsClient.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: 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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: applicationGroupName, + Constraints: []validation.Constraint{{Target: "applicationGroupName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "applicationGroupName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: applicationName, + Constraints: []validation.Constraint{{Target: "applicationName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "applicationName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.ApplicationsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, applicationGroupName, applicationName) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ApplicationsClient) DeletePreparer(ctx context.Context, resourceGroupName string, applicationGroupName string, applicationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationGroupName": autorest.Encode("path", applicationGroupName), + "applicationName": autorest.Encode("path", applicationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-24-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.DesktopVirtualization/applicationGroups/{applicationGroupName}/applications/{applicationName}", 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 ApplicationsClient) 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 ApplicationsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get an application. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// applicationGroupName - the name of the application group +// applicationName - the name of the application within the specified application group +func (client ApplicationsClient) Get(ctx context.Context, resourceGroupName string, applicationGroupName string, applicationName string) (result Application, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationsClient.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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: applicationGroupName, + Constraints: []validation.Constraint{{Target: "applicationGroupName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "applicationGroupName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: applicationName, + Constraints: []validation.Constraint{{Target: "applicationName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "applicationName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.ApplicationsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, applicationGroupName, applicationName) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ApplicationsClient) GetPreparer(ctx context.Context, resourceGroupName string, applicationGroupName string, applicationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationGroupName": autorest.Encode("path", applicationGroupName), + "applicationName": autorest.Encode("path", applicationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-24-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.DesktopVirtualization/applicationGroups/{applicationGroupName}/applications/{applicationName}", 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 ApplicationsClient) 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 ApplicationsClient) GetResponder(resp *http.Response) (result Application, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List list applications. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// applicationGroupName - the name of the application group +func (client ApplicationsClient) List(ctx context.Context, resourceGroupName string, applicationGroupName string) (result ApplicationListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationsClient.List") + defer func() { + sc := -1 + if result.al.Response.Response != nil { + sc = result.al.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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: applicationGroupName, + Constraints: []validation.Constraint{{Target: "applicationGroupName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "applicationGroupName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.ApplicationsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, applicationGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.al.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationsClient", "List", resp, "Failure sending request") + return + } + + result.al, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client ApplicationsClient) ListPreparer(ctx context.Context, resourceGroupName string, applicationGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationGroupName": autorest.Encode("path", applicationGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-24-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.DesktopVirtualization/applicationGroups/{applicationGroupName}/applications", 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 ApplicationsClient) 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 ApplicationsClient) ListResponder(resp *http.Response) (result ApplicationList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 ApplicationsClient) listNextResults(ctx context.Context, lastResults ApplicationList) (result ApplicationList, err error) { + req, err := lastResults.applicationListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationsClient", "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, "desktopvirtualization.ApplicationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ApplicationsClient) ListComplete(ctx context.Context, resourceGroupName string, applicationGroupName string) (result ApplicationListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationsClient.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, applicationGroupName) + return +} + +// Update update an application. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// applicationGroupName - the name of the application group +// applicationName - the name of the application within the specified application group +// application - object containing Application definitions. +func (client ApplicationsClient) Update(ctx context.Context, resourceGroupName string, applicationGroupName string, applicationName string, application *ApplicationPatch) (result Application, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationsClient.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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: applicationGroupName, + Constraints: []validation.Constraint{{Target: "applicationGroupName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "applicationGroupName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: applicationName, + Constraints: []validation.Constraint{{Target: "applicationName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "applicationName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.ApplicationsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, applicationGroupName, applicationName, application) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationsClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ApplicationsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, applicationGroupName string, applicationName string, application *ApplicationPatch) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationGroupName": autorest.Encode("path", applicationGroupName), + "applicationName": autorest.Encode("path", applicationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-24-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.DesktopVirtualization/applicationGroups/{applicationGroupName}/applications/{applicationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if application != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(application)) + } + 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 ApplicationsClient) 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 ApplicationsClient) UpdateResponder(resp *http.Response) (result Application, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/desktopvirtualization/mgmt/2019-09-24-preview/desktopvirtualization/client.go b/services/preview/desktopvirtualization/mgmt/2019-09-24-preview/desktopvirtualization/client.go new file mode 100644 index 000000000000..e785801405f9 --- /dev/null +++ b/services/preview/desktopvirtualization/mgmt/2019-09-24-preview/desktopvirtualization/client.go @@ -0,0 +1,52 @@ +// Package desktopvirtualization implements the Azure ARM Desktopvirtualization service API version 2019-09-24-preview. +// +// +package desktopvirtualization + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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 Desktopvirtualization + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Desktopvirtualization. +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/desktopvirtualization/mgmt/2019-09-24-preview/desktopvirtualization/desktops.go b/services/preview/desktopvirtualization/mgmt/2019-09-24-preview/desktopvirtualization/desktops.go new file mode 100644 index 000000000000..274b05243749 --- /dev/null +++ b/services/preview/desktopvirtualization/mgmt/2019-09-24-preview/desktopvirtualization/desktops.go @@ -0,0 +1,326 @@ +package desktopvirtualization + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// DesktopsClient is the client for the Desktops methods of the Desktopvirtualization service. +type DesktopsClient struct { + BaseClient +} + +// NewDesktopsClient creates an instance of the DesktopsClient client. +func NewDesktopsClient(subscriptionID string) DesktopsClient { + return NewDesktopsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDesktopsClientWithBaseURI creates an instance of the DesktopsClient 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 NewDesktopsClientWithBaseURI(baseURI string, subscriptionID string) DesktopsClient { + return DesktopsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get get a desktop. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// applicationGroupName - the name of the application group +// desktopName - the name of the desktop within the specified desktop group +func (client DesktopsClient) Get(ctx context.Context, resourceGroupName string, applicationGroupName string, desktopName string) (result Desktop, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DesktopsClient.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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: applicationGroupName, + Constraints: []validation.Constraint{{Target: "applicationGroupName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "applicationGroupName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: desktopName, + Constraints: []validation.Constraint{{Target: "desktopName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "desktopName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.DesktopsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, applicationGroupName, desktopName) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.DesktopsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.DesktopsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.DesktopsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client DesktopsClient) GetPreparer(ctx context.Context, resourceGroupName string, applicationGroupName string, desktopName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationGroupName": autorest.Encode("path", applicationGroupName), + "desktopName": autorest.Encode("path", desktopName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-24-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.DesktopVirtualization/applicationGroups/{applicationGroupName}/desktops/{desktopName}", 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 DesktopsClient) 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 DesktopsClient) GetResponder(resp *http.Response) (result Desktop, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List list desktops. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// applicationGroupName - the name of the application group +func (client DesktopsClient) List(ctx context.Context, resourceGroupName string, applicationGroupName string) (result DesktopList, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DesktopsClient.List") + defer func() { + 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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: applicationGroupName, + Constraints: []validation.Constraint{{Target: "applicationGroupName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "applicationGroupName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.DesktopsClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx, resourceGroupName, applicationGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.DesktopsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.DesktopsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.DesktopsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client DesktopsClient) ListPreparer(ctx context.Context, resourceGroupName string, applicationGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationGroupName": autorest.Encode("path", applicationGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-24-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.DesktopVirtualization/applicationGroups/{applicationGroupName}/desktops", 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 DesktopsClient) 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 DesktopsClient) ListResponder(resp *http.Response) (result DesktopList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update update a desktop. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// applicationGroupName - the name of the application group +// desktopName - the name of the desktop within the specified desktop group +// desktop - object containing Desktop definitions. +func (client DesktopsClient) Update(ctx context.Context, resourceGroupName string, applicationGroupName string, desktopName string, desktop *DesktopPatch) (result Desktop, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DesktopsClient.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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: applicationGroupName, + Constraints: []validation.Constraint{{Target: "applicationGroupName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "applicationGroupName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: desktopName, + Constraints: []validation.Constraint{{Target: "desktopName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "desktopName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.DesktopsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, applicationGroupName, desktopName, desktop) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.DesktopsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.DesktopsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.DesktopsClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client DesktopsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, applicationGroupName string, desktopName string, desktop *DesktopPatch) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationGroupName": autorest.Encode("path", applicationGroupName), + "desktopName": autorest.Encode("path", desktopName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-24-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.DesktopVirtualization/applicationGroups/{applicationGroupName}/desktops/{desktopName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if desktop != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(desktop)) + } + 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 DesktopsClient) 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 DesktopsClient) UpdateResponder(resp *http.Response) (result Desktop, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/desktopvirtualization/mgmt/2019-09-24-preview/desktopvirtualization/desktopvirtualizationapi/interfaces.go b/services/preview/desktopvirtualization/mgmt/2019-09-24-preview/desktopvirtualization/desktopvirtualizationapi/interfaces.go new file mode 100644 index 000000000000..2bb1f520435a --- /dev/null +++ b/services/preview/desktopvirtualization/mgmt/2019-09-24-preview/desktopvirtualization/desktopvirtualizationapi/interfaces.go @@ -0,0 +1,143 @@ +package desktopvirtualizationapi + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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/desktopvirtualization/mgmt/2019-09-24-preview/desktopvirtualization" + "github.com/Azure/go-autorest/autorest" +) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result desktopvirtualization.ResourceProviderOperationList, err error) +} + +var _ OperationsClientAPI = (*desktopvirtualization.OperationsClient)(nil) + +// WorkspacesClientAPI contains the set of methods on the WorkspacesClient type. +type WorkspacesClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, workspace desktopvirtualization.Workspace) (result desktopvirtualization.Workspace, err error) + Delete(ctx context.Context, resourceGroupName string, workspaceName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, workspaceName string) (result desktopvirtualization.Workspace, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result desktopvirtualization.WorkspaceListPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result desktopvirtualization.WorkspaceListIterator, err error) + ListBySubscription(ctx context.Context) (result desktopvirtualization.WorkspaceListPage, err error) + ListBySubscriptionComplete(ctx context.Context) (result desktopvirtualization.WorkspaceListIterator, err error) + Update(ctx context.Context, resourceGroupName string, workspaceName string, workspace *desktopvirtualization.WorkspacePatch) (result desktopvirtualization.Workspace, err error) +} + +var _ WorkspacesClientAPI = (*desktopvirtualization.WorkspacesClient)(nil) + +// ApplicationGroupAssignmentsClientAPI contains the set of methods on the ApplicationGroupAssignmentsClient type. +type ApplicationGroupAssignmentsClientAPI interface { + WorkspaceLevelList(ctx context.Context, resourceGroupName string, workspaceName string, filter string) (result desktopvirtualization.ApplicationGroupListPage, err error) + WorkspaceLevelListComplete(ctx context.Context, resourceGroupName string, workspaceName string, filter string) (result desktopvirtualization.ApplicationGroupListIterator, err error) +} + +var _ ApplicationGroupAssignmentsClientAPI = (*desktopvirtualization.ApplicationGroupAssignmentsClient)(nil) + +// ApplicationGroupsClientAPI contains the set of methods on the ApplicationGroupsClient type. +type ApplicationGroupsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, applicationGroupName string, applicationGroup desktopvirtualization.ApplicationGroup) (result desktopvirtualization.ApplicationGroup, err error) + Delete(ctx context.Context, resourceGroupName string, applicationGroupName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, applicationGroupName string) (result desktopvirtualization.ApplicationGroup, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string, filter string) (result desktopvirtualization.ApplicationGroupListPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, filter string) (result desktopvirtualization.ApplicationGroupListIterator, err error) + ListBySubscription(ctx context.Context, filter string) (result desktopvirtualization.ApplicationGroupListPage, err error) + ListBySubscriptionComplete(ctx context.Context, filter string) (result desktopvirtualization.ApplicationGroupListIterator, err error) + Update(ctx context.Context, resourceGroupName string, applicationGroupName string, applicationGroup *desktopvirtualization.ApplicationGroupPatch) (result desktopvirtualization.ApplicationGroup, err error) +} + +var _ ApplicationGroupsClientAPI = (*desktopvirtualization.ApplicationGroupsClient)(nil) + +// StartMenuItemsClientAPI contains the set of methods on the StartMenuItemsClient type. +type StartMenuItemsClientAPI interface { + List(ctx context.Context, resourceGroupName string, applicationGroupName string) (result desktopvirtualization.StartMenuItemListPage, err error) + ListComplete(ctx context.Context, resourceGroupName string, applicationGroupName string) (result desktopvirtualization.StartMenuItemListIterator, err error) +} + +var _ StartMenuItemsClientAPI = (*desktopvirtualization.StartMenuItemsClient)(nil) + +// ApplicationsClientAPI contains the set of methods on the ApplicationsClient type. +type ApplicationsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, applicationGroupName string, applicationName string, application desktopvirtualization.Application) (result desktopvirtualization.Application, err error) + Delete(ctx context.Context, resourceGroupName string, applicationGroupName string, applicationName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, applicationGroupName string, applicationName string) (result desktopvirtualization.Application, err error) + List(ctx context.Context, resourceGroupName string, applicationGroupName string) (result desktopvirtualization.ApplicationListPage, err error) + ListComplete(ctx context.Context, resourceGroupName string, applicationGroupName string) (result desktopvirtualization.ApplicationListIterator, err error) + Update(ctx context.Context, resourceGroupName string, applicationGroupName string, applicationName string, application *desktopvirtualization.ApplicationPatch) (result desktopvirtualization.Application, err error) +} + +var _ ApplicationsClientAPI = (*desktopvirtualization.ApplicationsClient)(nil) + +// DesktopsClientAPI contains the set of methods on the DesktopsClient type. +type DesktopsClientAPI interface { + Get(ctx context.Context, resourceGroupName string, applicationGroupName string, desktopName string) (result desktopvirtualization.Desktop, err error) + List(ctx context.Context, resourceGroupName string, applicationGroupName string) (result desktopvirtualization.DesktopList, err error) + Update(ctx context.Context, resourceGroupName string, applicationGroupName string, desktopName string, desktop *desktopvirtualization.DesktopPatch) (result desktopvirtualization.Desktop, err error) +} + +var _ DesktopsClientAPI = (*desktopvirtualization.DesktopsClient)(nil) + +// HostPoolsClientAPI contains the set of methods on the HostPoolsClient type. +type HostPoolsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, hostPoolName string, hostPool desktopvirtualization.HostPool) (result desktopvirtualization.HostPool, err error) + Delete(ctx context.Context, resourceGroupName string, hostPoolName string, force *bool) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, hostPoolName string) (result desktopvirtualization.HostPool, err error) + List(ctx context.Context) (result desktopvirtualization.HostPoolListPage, err error) + ListComplete(ctx context.Context) (result desktopvirtualization.HostPoolListIterator, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result desktopvirtualization.HostPoolListPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result desktopvirtualization.HostPoolListIterator, err error) + Update(ctx context.Context, resourceGroupName string, hostPoolName string, hostPool *desktopvirtualization.HostPoolPatch) (result desktopvirtualization.HostPool, err error) +} + +var _ HostPoolsClientAPI = (*desktopvirtualization.HostPoolsClient)(nil) + +// UserSessionsClientAPI contains the set of methods on the UserSessionsClient type. +type UserSessionsClientAPI interface { + Delete(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string, userSessionID string, force *bool) (result autorest.Response, err error) + Disconnect(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string, userSessionID string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string, userSessionID string) (result desktopvirtualization.UserSession, err error) + List(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string) (result desktopvirtualization.UserSessionListPage, err error) + ListComplete(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string) (result desktopvirtualization.UserSessionListIterator, err error) + ListByHostPool(ctx context.Context, resourceGroupName string, hostPoolName string, filter string) (result desktopvirtualization.UserSessionListPage, err error) + ListByHostPoolComplete(ctx context.Context, resourceGroupName string, hostPoolName string, filter string) (result desktopvirtualization.UserSessionListIterator, err error) + SendMessageMethod(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string, userSessionID string, sendMessage *desktopvirtualization.SendMessage) (result autorest.Response, err error) +} + +var _ UserSessionsClientAPI = (*desktopvirtualization.UserSessionsClient)(nil) + +// SessionHostsClientAPI contains the set of methods on the SessionHostsClient type. +type SessionHostsClientAPI interface { + Delete(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string, force *bool) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string) (result desktopvirtualization.SessionHost, err error) + List(ctx context.Context, resourceGroupName string, hostPoolName string) (result desktopvirtualization.SessionHostListPage, err error) + ListComplete(ctx context.Context, resourceGroupName string, hostPoolName string) (result desktopvirtualization.SessionHostListIterator, err error) + Update(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string, sessionHost *desktopvirtualization.SessionHostPatch) (result desktopvirtualization.SessionHost, err error) +} + +var _ SessionHostsClientAPI = (*desktopvirtualization.SessionHostsClient)(nil) + +// ActiveApplicationsClientAPI contains the set of methods on the ActiveApplicationsClient type. +type ActiveApplicationsClientAPI interface { + ListBySessionHost(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string, filter string) (result desktopvirtualization.ApplicationListPage, err error) + ListBySessionHostComplete(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string, filter string) (result desktopvirtualization.ApplicationListIterator, err error) +} + +var _ ActiveApplicationsClientAPI = (*desktopvirtualization.ActiveApplicationsClient)(nil) diff --git a/services/preview/desktopvirtualization/mgmt/2019-09-24-preview/desktopvirtualization/hostpools.go b/services/preview/desktopvirtualization/mgmt/2019-09-24-preview/desktopvirtualization/hostpools.go new file mode 100644 index 000000000000..70be91818e54 --- /dev/null +++ b/services/preview/desktopvirtualization/mgmt/2019-09-24-preview/desktopvirtualization/hostpools.go @@ -0,0 +1,650 @@ +package desktopvirtualization + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// HostPoolsClient is the client for the HostPools methods of the Desktopvirtualization service. +type HostPoolsClient struct { + BaseClient +} + +// NewHostPoolsClient creates an instance of the HostPoolsClient client. +func NewHostPoolsClient(subscriptionID string) HostPoolsClient { + return NewHostPoolsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewHostPoolsClientWithBaseURI creates an instance of the HostPoolsClient 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 NewHostPoolsClientWithBaseURI(baseURI string, subscriptionID string) HostPoolsClient { + return HostPoolsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create or update a host pool. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// hostPoolName - the name of the host pool within the specified resource group +// hostPool - object containing HostPool definitions. +func (client HostPoolsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, hostPoolName string, hostPool HostPool) (result HostPool, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/HostPoolsClient.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: 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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: hostPoolName, + Constraints: []validation.Constraint{{Target: "hostPoolName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "hostPoolName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: hostPool, + Constraints: []validation.Constraint{{Target: "hostPool.HostPoolProperties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.HostPoolsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, hostPoolName, hostPool) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.HostPoolsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.HostPoolsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.HostPoolsClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client HostPoolsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, hostPoolName string, hostPool HostPool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "hostPoolName": autorest.Encode("path", hostPoolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-24-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.DesktopVirtualization/hostPools/{hostPoolName}", pathParameters), + autorest.WithJSON(hostPool), + 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 HostPoolsClient) 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 HostPoolsClient) CreateOrUpdateResponder(resp *http.Response) (result HostPool, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete remove a host pool. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// hostPoolName - the name of the host pool within the specified resource group +// force - force flag to delete sessionHost. +func (client HostPoolsClient) Delete(ctx context.Context, resourceGroupName string, hostPoolName string, force *bool) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/HostPoolsClient.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: 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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: hostPoolName, + Constraints: []validation.Constraint{{Target: "hostPoolName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "hostPoolName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.HostPoolsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, hostPoolName, force) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.HostPoolsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "desktopvirtualization.HostPoolsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.HostPoolsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client HostPoolsClient) DeletePreparer(ctx context.Context, resourceGroupName string, hostPoolName string, force *bool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "hostPoolName": autorest.Encode("path", hostPoolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-24-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if force != nil { + queryParameters["force"] = autorest.Encode("query", *force) + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}", 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 HostPoolsClient) 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 HostPoolsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get a host pool. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// hostPoolName - the name of the host pool within the specified resource group +func (client HostPoolsClient) Get(ctx context.Context, resourceGroupName string, hostPoolName string) (result HostPool, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/HostPoolsClient.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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: hostPoolName, + Constraints: []validation.Constraint{{Target: "hostPoolName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "hostPoolName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.HostPoolsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, hostPoolName) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.HostPoolsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.HostPoolsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.HostPoolsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client HostPoolsClient) GetPreparer(ctx context.Context, resourceGroupName string, hostPoolName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "hostPoolName": autorest.Encode("path", hostPoolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-24-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.DesktopVirtualization/hostPools/{hostPoolName}", 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 HostPoolsClient) 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 HostPoolsClient) GetResponder(resp *http.Response) (result HostPool, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List list hostPools in subscription. +func (client HostPoolsClient) List(ctx context.Context) (result HostPoolListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/HostPoolsClient.List") + defer func() { + sc := -1 + if result.hpl.Response.Response != nil { + sc = result.hpl.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("desktopvirtualization.HostPoolsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.HostPoolsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.hpl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.HostPoolsClient", "List", resp, "Failure sending request") + return + } + + result.hpl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.HostPoolsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client HostPoolsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-24-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DesktopVirtualization/hostPools", 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 HostPoolsClient) 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 HostPoolsClient) ListResponder(resp *http.Response) (result HostPoolList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 HostPoolsClient) listNextResults(ctx context.Context, lastResults HostPoolList) (result HostPoolList, err error) { + req, err := lastResults.hostPoolListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "desktopvirtualization.HostPoolsClient", "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, "desktopvirtualization.HostPoolsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.HostPoolsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client HostPoolsClient) ListComplete(ctx context.Context) (result HostPoolListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/HostPoolsClient.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 list hostPools. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +func (client HostPoolsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result HostPoolListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/HostPoolsClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.hpl.Response.Response != nil { + sc = result.hpl.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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.HostPoolsClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.HostPoolsClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.hpl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.HostPoolsClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.hpl, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.HostPoolsClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client HostPoolsClient) 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 = "2019-09-24-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.DesktopVirtualization/hostPools", 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 HostPoolsClient) 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 HostPoolsClient) ListByResourceGroupResponder(resp *http.Response) (result HostPoolList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 HostPoolsClient) listByResourceGroupNextResults(ctx context.Context, lastResults HostPoolList) (result HostPoolList, err error) { + req, err := lastResults.hostPoolListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "desktopvirtualization.HostPoolsClient", "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, "desktopvirtualization.HostPoolsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.HostPoolsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client HostPoolsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result HostPoolListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/HostPoolsClient.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 update a host pool. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// hostPoolName - the name of the host pool within the specified resource group +// hostPool - object containing HostPool definitions. +func (client HostPoolsClient) Update(ctx context.Context, resourceGroupName string, hostPoolName string, hostPool *HostPoolPatch) (result HostPool, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/HostPoolsClient.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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: hostPoolName, + Constraints: []validation.Constraint{{Target: "hostPoolName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "hostPoolName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.HostPoolsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, hostPoolName, hostPool) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.HostPoolsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.HostPoolsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.HostPoolsClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client HostPoolsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, hostPoolName string, hostPool *HostPoolPatch) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "hostPoolName": autorest.Encode("path", hostPoolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-24-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.DesktopVirtualization/hostPools/{hostPoolName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if hostPool != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(hostPool)) + } + 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 HostPoolsClient) 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 HostPoolsClient) UpdateResponder(resp *http.Response) (result HostPool, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/desktopvirtualization/mgmt/2019-09-24-preview/desktopvirtualization/models.go b/services/preview/desktopvirtualization/mgmt/2019-09-24-preview/desktopvirtualization/models.go new file mode 100644 index 000000000000..aa0ede12f496 --- /dev/null +++ b/services/preview/desktopvirtualization/mgmt/2019-09-24-preview/desktopvirtualization/models.go @@ -0,0 +1,2654 @@ +package desktopvirtualization + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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/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/desktopvirtualization/mgmt/2019-09-24-preview/desktopvirtualization" + +// ApplicationGroupType enumerates the values for application group type. +type ApplicationGroupType string + +const ( + // ApplicationGroupTypeDesktop ... + ApplicationGroupTypeDesktop ApplicationGroupType = "Desktop" + // ApplicationGroupTypeRemoteApp ... + ApplicationGroupTypeRemoteApp ApplicationGroupType = "RemoteApp" +) + +// PossibleApplicationGroupTypeValues returns an array of possible values for the ApplicationGroupType const type. +func PossibleApplicationGroupTypeValues() []ApplicationGroupType { + return []ApplicationGroupType{ApplicationGroupTypeDesktop, ApplicationGroupTypeRemoteApp} +} + +// ApplicationType enumerates the values for application type. +type ApplicationType string + +const ( + // ApplicationTypeDesktop ... + ApplicationTypeDesktop ApplicationType = "Desktop" + // ApplicationTypeRemoteApp ... + ApplicationTypeRemoteApp ApplicationType = "RemoteApp" +) + +// PossibleApplicationTypeValues returns an array of possible values for the ApplicationType const type. +func PossibleApplicationTypeValues() []ApplicationType { + return []ApplicationType{ApplicationTypeDesktop, ApplicationTypeRemoteApp} +} + +// CommandLineSetting enumerates the values for command line setting. +type CommandLineSetting string + +const ( + // Allow ... + Allow CommandLineSetting = "Allow" + // DoNotAllow ... + DoNotAllow CommandLineSetting = "DoNotAllow" + // Require ... + Require CommandLineSetting = "Require" +) + +// PossibleCommandLineSettingValues returns an array of possible values for the CommandLineSetting const type. +func PossibleCommandLineSettingValues() []CommandLineSetting { + return []CommandLineSetting{Allow, DoNotAllow, Require} +} + +// HostPoolType enumerates the values for host pool type. +type HostPoolType string + +const ( + // Personal ... + Personal HostPoolType = "Personal" + // Shared ... + Shared HostPoolType = "Shared" +) + +// PossibleHostPoolTypeValues returns an array of possible values for the HostPoolType const type. +func PossibleHostPoolTypeValues() []HostPoolType { + return []HostPoolType{Personal, Shared} +} + +// LoadBalancerType enumerates the values for load balancer type. +type LoadBalancerType string + +const ( + // BreadthFirst ... + BreadthFirst LoadBalancerType = "BreadthFirst" + // DepthFirst ... + DepthFirst LoadBalancerType = "DepthFirst" + // Persistent ... + Persistent LoadBalancerType = "Persistent" +) + +// PossibleLoadBalancerTypeValues returns an array of possible values for the LoadBalancerType const type. +func PossibleLoadBalancerTypeValues() []LoadBalancerType { + return []LoadBalancerType{BreadthFirst, DepthFirst, Persistent} +} + +// PersonalDesktopAssignmentType enumerates the values for personal desktop assignment type. +type PersonalDesktopAssignmentType string + +const ( + // Automatic ... + Automatic PersonalDesktopAssignmentType = "Automatic" + // Direct ... + Direct PersonalDesktopAssignmentType = "Direct" +) + +// PossiblePersonalDesktopAssignmentTypeValues returns an array of possible values for the PersonalDesktopAssignmentType const type. +func PossiblePersonalDesktopAssignmentTypeValues() []PersonalDesktopAssignmentType { + return []PersonalDesktopAssignmentType{Automatic, Direct} +} + +// RegistrationTokenOperation enumerates the values for registration token operation. +type RegistrationTokenOperation string + +const ( + // Delete ... + Delete RegistrationTokenOperation = "Delete" + // None ... + None RegistrationTokenOperation = "None" + // Update ... + Update RegistrationTokenOperation = "Update" +) + +// PossibleRegistrationTokenOperationValues returns an array of possible values for the RegistrationTokenOperation const type. +func PossibleRegistrationTokenOperationValues() []RegistrationTokenOperation { + return []RegistrationTokenOperation{Delete, None, Update} +} + +// SessionState enumerates the values for session state. +type SessionState string + +const ( + // Active ... + Active SessionState = "Active" + // Disconnected ... + Disconnected SessionState = "Disconnected" + // LogOff ... + LogOff SessionState = "LogOff" + // Pending ... + Pending SessionState = "Pending" + // Unknown ... + Unknown SessionState = "Unknown" + // UserProfileDiskMounted ... + UserProfileDiskMounted SessionState = "UserProfileDiskMounted" +) + +// PossibleSessionStateValues returns an array of possible values for the SessionState const type. +func PossibleSessionStateValues() []SessionState { + return []SessionState{Active, Disconnected, LogOff, Pending, Unknown, UserProfileDiskMounted} +} + +// Status enumerates the values for status. +type Status string + +const ( + // StatusAvailable ... + StatusAvailable Status = "Available" + // StatusDisconnected ... + StatusDisconnected Status = "Disconnected" + // StatusShutdown ... + StatusShutdown Status = "Shutdown" + // StatusUnavailable ... + StatusUnavailable Status = "Unavailable" + // StatusUpgradeFailed ... + StatusUpgradeFailed Status = "UpgradeFailed" + // StatusUpgrading ... + StatusUpgrading Status = "Upgrading" +) + +// PossibleStatusValues returns an array of possible values for the Status const type. +func PossibleStatusValues() []Status { + return []Status{StatusAvailable, StatusDisconnected, StatusShutdown, StatusUnavailable, StatusUpgradeFailed, StatusUpgrading} +} + +// UpdateState enumerates the values for update state. +type UpdateState string + +const ( + // UpdateStateFailed ... + UpdateStateFailed UpdateState = "Failed" + // UpdateStateInitial ... + UpdateStateInitial UpdateState = "Initial" + // UpdateStatePending ... + UpdateStatePending UpdateState = "Pending" + // UpdateStateStarted ... + UpdateStateStarted UpdateState = "Started" + // UpdateStateSucceeded ... + UpdateStateSucceeded UpdateState = "Succeeded" +) + +// PossibleUpdateStateValues returns an array of possible values for the UpdateState const type. +func PossibleUpdateStateValues() []UpdateState { + return []UpdateState{UpdateStateFailed, UpdateStateInitial, UpdateStatePending, UpdateStateStarted, UpdateStateSucceeded} +} + +// Application schema for Application properties. +type Application struct { + autorest.Response `json:"-"` + // ApplicationProperties - Detailed properties for Application + *ApplicationProperties `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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Application. +func (a Application) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if a.ApplicationProperties != nil { + objectMap["properties"] = a.ApplicationProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Application struct. +func (a *Application) 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 applicationProperties ApplicationProperties + err = json.Unmarshal(*v, &applicationProperties) + if err != nil { + return err + } + a.ApplicationProperties = &applicationProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + a.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + a.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + a.Type = &typeVar + } + } + } + + return nil +} + +// ApplicationGroup represents a ApplicationGroup definition. +type ApplicationGroup struct { + autorest.Response `json:"-"` + // ApplicationGroupProperties - Detailed properties for ApplicationGroup + *ApplicationGroupProperties `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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ApplicationGroup. +func (ag ApplicationGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ag.ApplicationGroupProperties != nil { + objectMap["properties"] = ag.ApplicationGroupProperties + } + if ag.Tags != nil { + objectMap["tags"] = ag.Tags + } + if ag.Location != nil { + objectMap["location"] = ag.Location + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ApplicationGroup struct. +func (ag *ApplicationGroup) 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 applicationGroupProperties ApplicationGroupProperties + err = json.Unmarshal(*v, &applicationGroupProperties) + if err != nil { + return err + } + ag.ApplicationGroupProperties = &applicationGroupProperties + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + ag.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + ag.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ag.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ag.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ag.Type = &typeVar + } + } + } + + return nil +} + +// ApplicationGroupList list of ApplicationGroup definitions. +type ApplicationGroupList struct { + autorest.Response `json:"-"` + // Value - List of ApplicationGroup definitions. + Value *[]ApplicationGroup `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to the next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// ApplicationGroupListIterator provides access to a complete listing of ApplicationGroup values. +type ApplicationGroupListIterator struct { + i int + page ApplicationGroupListPage +} + +// 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 *ApplicationGroupListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGroupListIterator.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 *ApplicationGroupListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ApplicationGroupListIterator) 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 ApplicationGroupListIterator) Response() ApplicationGroupList { + 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 ApplicationGroupListIterator) Value() ApplicationGroup { + if !iter.page.NotDone() { + return ApplicationGroup{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ApplicationGroupListIterator type. +func NewApplicationGroupListIterator(page ApplicationGroupListPage) ApplicationGroupListIterator { + return ApplicationGroupListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (agl ApplicationGroupList) IsEmpty() bool { + return agl.Value == nil || len(*agl.Value) == 0 +} + +// applicationGroupListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (agl ApplicationGroupList) applicationGroupListPreparer(ctx context.Context) (*http.Request, error) { + if agl.NextLink == nil || len(to.String(agl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(agl.NextLink))) +} + +// ApplicationGroupListPage contains a page of ApplicationGroup values. +type ApplicationGroupListPage struct { + fn func(context.Context, ApplicationGroupList) (ApplicationGroupList, error) + agl ApplicationGroupList +} + +// 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 *ApplicationGroupListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGroupListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.agl) + if err != nil { + return err + } + page.agl = next + 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 *ApplicationGroupListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ApplicationGroupListPage) NotDone() bool { + return !page.agl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ApplicationGroupListPage) Response() ApplicationGroupList { + return page.agl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ApplicationGroupListPage) Values() []ApplicationGroup { + if page.agl.IsEmpty() { + return nil + } + return *page.agl.Value +} + +// Creates a new instance of the ApplicationGroupListPage type. +func NewApplicationGroupListPage(getNextPage func(context.Context, ApplicationGroupList) (ApplicationGroupList, error)) ApplicationGroupListPage { + return ApplicationGroupListPage{fn: getNextPage} +} + +// ApplicationGroupPatch applicationGroup properties that can be patched. +type ApplicationGroupPatch struct { + // Tags - tags to be updated + Tags interface{} `json:"tags,omitempty"` + // ApplicationGroupPatchProperties - ApplicationGroup properties that can be patched. + *ApplicationGroupPatchProperties `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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ApplicationGroupPatch. +func (agp ApplicationGroupPatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if agp.Tags != nil { + objectMap["tags"] = agp.Tags + } + if agp.ApplicationGroupPatchProperties != nil { + objectMap["properties"] = agp.ApplicationGroupPatchProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ApplicationGroupPatch struct. +func (agp *ApplicationGroupPatch) 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 interface{} + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + agp.Tags = tags + } + case "properties": + if v != nil { + var applicationGroupPatchProperties ApplicationGroupPatchProperties + err = json.Unmarshal(*v, &applicationGroupPatchProperties) + if err != nil { + return err + } + agp.ApplicationGroupPatchProperties = &applicationGroupPatchProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + agp.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + agp.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + agp.Type = &typeVar + } + } + } + + return nil +} + +// ApplicationGroupPatchProperties applicationGroup properties that can be patched. +type ApplicationGroupPatchProperties struct { + // Description - Description of ApplicationGroup. + Description *string `json:"description,omitempty"` + // FriendlyName - Friendly name of ApplicationGroup. + FriendlyName *string `json:"friendlyName,omitempty"` +} + +// ApplicationGroupProperties schema for ApplicationGroup properties. +type ApplicationGroupProperties struct { + // Description - Description of ApplicationGroup. + Description *string `json:"description,omitempty"` + // FriendlyName - Friendly name of ApplicationGroup. + FriendlyName *string `json:"friendlyName,omitempty"` + // HostPoolArmPath - HostPool arm path of ApplicationGroup. + HostPoolArmPath *string `json:"hostPoolArmPath,omitempty"` + // WorkspaceArmPath - READ-ONLY; Workspace arm path of ApplicationGroup. + WorkspaceArmPath *string `json:"workspaceArmPath,omitempty"` + // ApplicationGroupType - Resource Type of ApplicationGroup. Possible values include: 'ApplicationGroupTypeRemoteApp', 'ApplicationGroupTypeDesktop' + ApplicationGroupType ApplicationGroupType `json:"applicationGroupType,omitempty"` +} + +// ApplicationList list of Application definitions. +type ApplicationList struct { + autorest.Response `json:"-"` + // Value - List of Application definitions. + Value *[]Application `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to the next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// ApplicationListIterator provides access to a complete listing of Application values. +type ApplicationListIterator struct { + i int + page ApplicationListPage +} + +// 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 *ApplicationListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationListIterator.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 *ApplicationListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ApplicationListIterator) 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 ApplicationListIterator) Response() ApplicationList { + 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 ApplicationListIterator) Value() Application { + if !iter.page.NotDone() { + return Application{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ApplicationListIterator type. +func NewApplicationListIterator(page ApplicationListPage) ApplicationListIterator { + return ApplicationListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (al ApplicationList) IsEmpty() bool { + return al.Value == nil || len(*al.Value) == 0 +} + +// applicationListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (al ApplicationList) applicationListPreparer(ctx context.Context) (*http.Request, error) { + if al.NextLink == nil || len(to.String(al.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(al.NextLink))) +} + +// ApplicationListPage contains a page of Application values. +type ApplicationListPage struct { + fn func(context.Context, ApplicationList) (ApplicationList, error) + al ApplicationList +} + +// 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 *ApplicationListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.al) + if err != nil { + return err + } + page.al = next + 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 *ApplicationListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ApplicationListPage) NotDone() bool { + return !page.al.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ApplicationListPage) Response() ApplicationList { + return page.al +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ApplicationListPage) Values() []Application { + if page.al.IsEmpty() { + return nil + } + return *page.al.Value +} + +// Creates a new instance of the ApplicationListPage type. +func NewApplicationListPage(getNextPage func(context.Context, ApplicationList) (ApplicationList, error)) ApplicationListPage { + return ApplicationListPage{fn: getNextPage} +} + +// ApplicationPatch application properties that can be patched. +type ApplicationPatch struct { + // Tags - tags to be updated + Tags interface{} `json:"tags,omitempty"` + // ApplicationPatchProperties - Detailed properties for Application + *ApplicationPatchProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ApplicationPatch. +func (ap ApplicationPatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ap.Tags != nil { + objectMap["tags"] = ap.Tags + } + if ap.ApplicationPatchProperties != nil { + objectMap["properties"] = ap.ApplicationPatchProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ApplicationPatch struct. +func (ap *ApplicationPatch) 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 interface{} + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + ap.Tags = tags + } + case "properties": + if v != nil { + var applicationPatchProperties ApplicationPatchProperties + err = json.Unmarshal(*v, &applicationPatchProperties) + if err != nil { + return err + } + ap.ApplicationPatchProperties = &applicationPatchProperties + } + } + } + + return nil +} + +// ApplicationPatchProperties application properties that can be patched. +type ApplicationPatchProperties struct { + // Description - Description of Application. + Description *string `json:"description,omitempty"` + // FriendlyName - Friendly name of Application. + FriendlyName *string `json:"friendlyName,omitempty"` + // FilePath - Specifies a path for the executable file for the application. + FilePath *string `json:"filePath,omitempty"` + // CommandLineSetting - Specifies whether this published application can be launched with command line arguments provided by the client, command line arguments specified at publish time, or no command line arguments at all. Possible values include: 'DoNotAllow', 'Allow', 'Require' + CommandLineSetting CommandLineSetting `json:"commandLineSetting,omitempty"` + // CommandLineArguments - Command Line Arguments for Application. + CommandLineArguments *string `json:"commandLineArguments,omitempty"` + // ShowInPortal - Specifies whether to show the RemoteApp program in the RD Web Access server. + ShowInPortal *bool `json:"showInPortal,omitempty"` + // IconPath - Path to icon. + IconPath *string `json:"iconPath,omitempty"` + // IconIndex - Index of the icon. + IconIndex *int32 `json:"iconIndex,omitempty"` +} + +// ApplicationProperties schema for Application properties. +type ApplicationProperties struct { + // Description - Description of Application. + Description *string `json:"description,omitempty"` + // FriendlyName - Friendly name of Application. + FriendlyName *string `json:"friendlyName,omitempty"` + // FilePath - Specifies a path for the executable file for the application. + FilePath *string `json:"filePath,omitempty"` + // CommandLineSetting - Specifies whether this published application can be launched with command line arguments provided by the client, command line arguments specified at publish time, or no command line arguments at all. Possible values include: 'DoNotAllow', 'Allow', 'Require' + CommandLineSetting CommandLineSetting `json:"commandLineSetting,omitempty"` + // CommandLineArguments - Command Line Arguments for Application. + CommandLineArguments *string `json:"commandLineArguments,omitempty"` + // ShowInPortal - Specifies whether to show the RemoteApp program in the RD Web Access server. + ShowInPortal *bool `json:"showInPortal,omitempty"` + // IconPath - Path to icon. + IconPath *string `json:"iconPath,omitempty"` + // IconIndex - Index of the icon. + IconIndex *int32 `json:"iconIndex,omitempty"` + // IconHash - READ-ONLY; Hash of the icon. + IconHash *string `json:"iconHash,omitempty"` + // IconContent - READ-ONLY; the icon a 64 bit string as a byte array. + IconContent *[]byte `json:"iconContent,omitempty"` +} + +// AzureEntityResource the resource model definition for a 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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// CloudError error response of an operation failure +type CloudError struct { + // Code - Error code + Code *string `json:"code,omitempty"` + // Message - Error message indicating why the operation failed. + Message *string `json:"message,omitempty"` +} + +// Desktop schema for Desktop properties. +type Desktop struct { + autorest.Response `json:"-"` + // DesktopProperties - Detailed properties for Desktop + *DesktopProperties `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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Desktop. +func (d Desktop) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if d.DesktopProperties != nil { + objectMap["properties"] = d.DesktopProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Desktop struct. +func (d *Desktop) 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 desktopProperties DesktopProperties + err = json.Unmarshal(*v, &desktopProperties) + if err != nil { + return err + } + d.DesktopProperties = &desktopProperties + } + 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 "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + d.Type = &typeVar + } + } + } + + return nil +} + +// DesktopList list of Desktop definitions. +type DesktopList struct { + autorest.Response `json:"-"` + // Value - List of Desktop definitions. + Value *[]Desktop `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to the next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// DesktopPatch desktop properties that can be patched. +type DesktopPatch struct { + // Tags - tags to be updated + Tags interface{} `json:"tags,omitempty"` + // DesktopPatchProperties - Detailed properties for Desktop + *DesktopPatchProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for DesktopPatch. +func (dp DesktopPatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dp.Tags != nil { + objectMap["tags"] = dp.Tags + } + if dp.DesktopPatchProperties != nil { + objectMap["properties"] = dp.DesktopPatchProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DesktopPatch struct. +func (dp *DesktopPatch) 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 interface{} + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + dp.Tags = tags + } + case "properties": + if v != nil { + var desktopPatchProperties DesktopPatchProperties + err = json.Unmarshal(*v, &desktopPatchProperties) + if err != nil { + return err + } + dp.DesktopPatchProperties = &desktopPatchProperties + } + } + } + + return nil +} + +// DesktopPatchProperties desktop properties that can be patched. +type DesktopPatchProperties struct { + // Description - Description of Desktop. + Description *string `json:"description,omitempty"` + // FriendlyName - Friendly name of Desktop. + FriendlyName *string `json:"friendlyName,omitempty"` +} + +// DesktopProperties schema for Desktop properties. +type DesktopProperties struct { + // Description - Description of Desktop. + Description *string `json:"description,omitempty"` + // FriendlyName - Friendly name of Desktop. + FriendlyName *string `json:"friendlyName,omitempty"` + // IconHash - READ-ONLY; Hash of the icon. + IconHash *string `json:"iconHash,omitempty"` + // IconContent - READ-ONLY; The icon a 64 bit string as a byte array. + IconContent *[]byte `json:"iconContent,omitempty"` +} + +// HostPool represents a HostPool definition. +type HostPool struct { + autorest.Response `json:"-"` + // HostPoolProperties - Detailed properties for HostPool + *HostPoolProperties `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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for HostPool. +func (hp HostPool) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if hp.HostPoolProperties != nil { + objectMap["properties"] = hp.HostPoolProperties + } + if hp.Tags != nil { + objectMap["tags"] = hp.Tags + } + if hp.Location != nil { + objectMap["location"] = hp.Location + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for HostPool struct. +func (hp *HostPool) 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 hostPoolProperties HostPoolProperties + err = json.Unmarshal(*v, &hostPoolProperties) + if err != nil { + return err + } + hp.HostPoolProperties = &hostPoolProperties + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + hp.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + hp.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + hp.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + hp.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + hp.Type = &typeVar + } + } + } + + return nil +} + +// HostPoolList list of HostPool definitions. +type HostPoolList struct { + autorest.Response `json:"-"` + // Value - List of HostPool definitions. + Value *[]HostPool `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to the next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// HostPoolListIterator provides access to a complete listing of HostPool values. +type HostPoolListIterator struct { + i int + page HostPoolListPage +} + +// 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 *HostPoolListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/HostPoolListIterator.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 *HostPoolListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter HostPoolListIterator) 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 HostPoolListIterator) Response() HostPoolList { + 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 HostPoolListIterator) Value() HostPool { + if !iter.page.NotDone() { + return HostPool{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the HostPoolListIterator type. +func NewHostPoolListIterator(page HostPoolListPage) HostPoolListIterator { + return HostPoolListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (hpl HostPoolList) IsEmpty() bool { + return hpl.Value == nil || len(*hpl.Value) == 0 +} + +// hostPoolListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (hpl HostPoolList) hostPoolListPreparer(ctx context.Context) (*http.Request, error) { + if hpl.NextLink == nil || len(to.String(hpl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(hpl.NextLink))) +} + +// HostPoolListPage contains a page of HostPool values. +type HostPoolListPage struct { + fn func(context.Context, HostPoolList) (HostPoolList, error) + hpl HostPoolList +} + +// 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 *HostPoolListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/HostPoolListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.hpl) + if err != nil { + return err + } + page.hpl = next + 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 *HostPoolListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page HostPoolListPage) NotDone() bool { + return !page.hpl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page HostPoolListPage) Response() HostPoolList { + return page.hpl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page HostPoolListPage) Values() []HostPool { + if page.hpl.IsEmpty() { + return nil + } + return *page.hpl.Value +} + +// Creates a new instance of the HostPoolListPage type. +func NewHostPoolListPage(getNextPage func(context.Context, HostPoolList) (HostPoolList, error)) HostPoolListPage { + return HostPoolListPage{fn: getNextPage} +} + +// HostPoolPatch hostPool properties that can be patched. +type HostPoolPatch struct { + // Tags - tags to be updated + Tags interface{} `json:"tags,omitempty"` + // HostPoolPatchProperties - HostPool properties that can be patched. + *HostPoolPatchProperties `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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for HostPoolPatch. +func (hpp HostPoolPatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if hpp.Tags != nil { + objectMap["tags"] = hpp.Tags + } + if hpp.HostPoolPatchProperties != nil { + objectMap["properties"] = hpp.HostPoolPatchProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for HostPoolPatch struct. +func (hpp *HostPoolPatch) 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 interface{} + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + hpp.Tags = tags + } + case "properties": + if v != nil { + var hostPoolPatchProperties HostPoolPatchProperties + err = json.Unmarshal(*v, &hostPoolPatchProperties) + if err != nil { + return err + } + hpp.HostPoolPatchProperties = &hostPoolPatchProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + hpp.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + hpp.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + hpp.Type = &typeVar + } + } + } + + return nil +} + +// HostPoolPatchProperties properties of HostPool. +type HostPoolPatchProperties struct { + // FriendlyName - Friendly name of HostPool. + FriendlyName *string `json:"friendlyName,omitempty"` + // Description - Description of HostPool. + Description *string `json:"description,omitempty"` + // CustomRdpProperty - Custom rdp property of HostPool. + CustomRdpProperty *string `json:"customRdpProperty,omitempty"` + // MaxSessionLimit - The max session limit of HostPool. + MaxSessionLimit *int32 `json:"maxSessionLimit,omitempty"` + // PersonalDesktopAssignmentType - PersonalDesktopAssignment type for HostPool. Possible values include: 'Automatic', 'Direct' + PersonalDesktopAssignmentType PersonalDesktopAssignmentType `json:"personalDesktopAssignmentType,omitempty"` + // LoadBalancerType - The type of the load balancer. Possible values include: 'BreadthFirst', 'DepthFirst', 'Persistent' + LoadBalancerType LoadBalancerType `json:"loadBalancerType,omitempty"` + // Ring - The ring number of HostPool. + Ring *int32 `json:"ring,omitempty"` + // ValidationEnvironment - Is validation environment. + ValidationEnvironment *bool `json:"validationEnvironment,omitempty"` + // RegistrationInfo - The registration info of HostPool. + RegistrationInfo *RegistrationInfoPatch `json:"registrationInfo,omitempty"` + // SsoContext - Path to keyvault containing ssoContext secret. + SsoContext *string `json:"ssoContext,omitempty"` +} + +// HostPoolProperties properties of HostPool. +type HostPoolProperties struct { + // FriendlyName - Friendly name of HostPool. + FriendlyName *string `json:"friendlyName,omitempty"` + // Description - Description of HostPool. + Description *string `json:"description,omitempty"` + // HostPoolType - HostPool type for desktop. Possible values include: 'Personal', 'Shared' + HostPoolType HostPoolType `json:"hostPoolType,omitempty"` + // PersonalDesktopAssignmentType - PersonalDesktopAssignment type for HostPool. Possible values include: 'Automatic', 'Direct' + PersonalDesktopAssignmentType PersonalDesktopAssignmentType `json:"personalDesktopAssignmentType,omitempty"` + // CustomRdpProperty - Custom rdp property of HostPool. + CustomRdpProperty *string `json:"customRdpProperty,omitempty"` + // MaxSessionLimit - The max session limit of HostPool. + MaxSessionLimit *int32 `json:"maxSessionLimit,omitempty"` + // LoadBalancerType - The type of the load balancer. Possible values include: 'BreadthFirst', 'DepthFirst', 'Persistent' + LoadBalancerType LoadBalancerType `json:"loadBalancerType,omitempty"` + // Ring - The ring number of HostPool. + Ring *int32 `json:"ring,omitempty"` + // ValidationEnvironment - Is validation environment. + ValidationEnvironment *bool `json:"validationEnvironment,omitempty"` + // RegistrationInfo - The registration info of HostPool. + RegistrationInfo *RegistrationInfo `json:"registrationInfo,omitempty"` + // VMTemplate - VM template for sessionhosts configuration within hostpool. + VMTemplate *string `json:"vmTemplate,omitempty"` + // ApplicationGroupReferences - READ-ONLY; List of applicationGroup links. + ApplicationGroupReferences *[]string `json:"applicationGroupReferences,omitempty"` + // SsoContext - Path to keyvault containing ssoContext secret. + SsoContext *string `json:"ssoContext,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; 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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// RegistrationInfo represents a RegistrationInfo definition. +type RegistrationInfo struct { + // ExpirationTime - Expiration time of registration token. + ExpirationTime *date.Time `json:"expirationTime,omitempty"` + // Token - The registration token base64 encoded string. + Token *string `json:"token,omitempty"` + // RegistrationTokenOperation - The type of resetting the token. Possible values include: 'Delete', 'None', 'Update' + RegistrationTokenOperation RegistrationTokenOperation `json:"registrationTokenOperation,omitempty"` +} + +// RegistrationInfoPatch represents a RegistrationInfo definition. +type RegistrationInfoPatch struct { + // RegistrationTokenOperation - The type of resetting the token. Possible values include: 'Delete', 'None', 'Update' + RegistrationTokenOperation RegistrationTokenOperation `json:"registrationTokenOperation,omitempty"` +} + +// Resource ... +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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// ResourceProviderOperation supported operation of this resource provider. +type ResourceProviderOperation struct { + // Name - Operation name, in format of {provider}/{resource}/{operation} + Name *string `json:"name,omitempty"` + // Display - Display metadata associated with the operation. + Display *ResourceProviderOperationDisplay `json:"display,omitempty"` +} + +// ResourceProviderOperationDisplay display metadata associated with the operation. +type ResourceProviderOperationDisplay struct { + // Provider - Resource provider: Microsoft Desktop Virtualization. + Provider *string `json:"provider,omitempty"` + // Resource - Resource on which the operation is performed. + Resource *string `json:"resource,omitempty"` + // Operation - Type of operation: get, read, delete, etc. + Operation *string `json:"operation,omitempty"` + // Description - Description of this operation. + Description *string `json:"description,omitempty"` +} + +// ResourceProviderOperationList result of the request to list operations. +type ResourceProviderOperationList struct { + autorest.Response `json:"-"` + // Value - List of operations supported by this resource provider. + Value *[]ResourceProviderOperation `json:"value,omitempty"` +} + +// SendMessage represents message sent to a UserSession. +type SendMessage struct { + // MessageTitle - Title of message. + MessageTitle *string `json:"messageTitle,omitempty"` + // MessageBody - Body of message. + MessageBody *string `json:"messageBody,omitempty"` +} + +// SessionHost represents a SessionHost definition. +type SessionHost struct { + autorest.Response `json:"-"` + // SessionHostProperties - Detailed properties for SessionHost + *SessionHostProperties `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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SessionHost. +func (sh SessionHost) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sh.SessionHostProperties != nil { + objectMap["properties"] = sh.SessionHostProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SessionHost struct. +func (sh *SessionHost) 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 sessionHostProperties SessionHostProperties + err = json.Unmarshal(*v, &sessionHostProperties) + if err != nil { + return err + } + sh.SessionHostProperties = &sessionHostProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sh.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sh.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sh.Type = &typeVar + } + } + } + + return nil +} + +// SessionHostList list of SessionHost definitions. +type SessionHostList struct { + autorest.Response `json:"-"` + // Value - List of SessionHost definitions. + Value *[]SessionHost `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to the next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// SessionHostListIterator provides access to a complete listing of SessionHost values. +type SessionHostListIterator struct { + i int + page SessionHostListPage +} + +// 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 *SessionHostListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SessionHostListIterator.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 *SessionHostListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SessionHostListIterator) 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 SessionHostListIterator) Response() SessionHostList { + 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 SessionHostListIterator) Value() SessionHost { + if !iter.page.NotDone() { + return SessionHost{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the SessionHostListIterator type. +func NewSessionHostListIterator(page SessionHostListPage) SessionHostListIterator { + return SessionHostListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (shl SessionHostList) IsEmpty() bool { + return shl.Value == nil || len(*shl.Value) == 0 +} + +// sessionHostListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (shl SessionHostList) sessionHostListPreparer(ctx context.Context) (*http.Request, error) { + if shl.NextLink == nil || len(to.String(shl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(shl.NextLink))) +} + +// SessionHostListPage contains a page of SessionHost values. +type SessionHostListPage struct { + fn func(context.Context, SessionHostList) (SessionHostList, error) + shl SessionHostList +} + +// 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 *SessionHostListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SessionHostListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.shl) + if err != nil { + return err + } + page.shl = next + 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 *SessionHostListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SessionHostListPage) NotDone() bool { + return !page.shl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SessionHostListPage) Response() SessionHostList { + return page.shl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SessionHostListPage) Values() []SessionHost { + if page.shl.IsEmpty() { + return nil + } + return *page.shl.Value +} + +// Creates a new instance of the SessionHostListPage type. +func NewSessionHostListPage(getNextPage func(context.Context, SessionHostList) (SessionHostList, error)) SessionHostListPage { + return SessionHostListPage{fn: getNextPage} +} + +// SessionHostPatch sessionHost properties that can be patched. +type SessionHostPatch struct { + // SessionHostPatchProperties - Detailed properties for SessionHost + *SessionHostPatchProperties `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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SessionHostPatch. +func (shp SessionHostPatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if shp.SessionHostPatchProperties != nil { + objectMap["properties"] = shp.SessionHostPatchProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SessionHostPatch struct. +func (shp *SessionHostPatch) 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 sessionHostPatchProperties SessionHostPatchProperties + err = json.Unmarshal(*v, &sessionHostPatchProperties) + if err != nil { + return err + } + shp.SessionHostPatchProperties = &sessionHostPatchProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + shp.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + shp.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + shp.Type = &typeVar + } + } + } + + return nil +} + +// SessionHostPatchProperties sessionHost properties that can be patched. +type SessionHostPatchProperties struct { + // AllowNewSession - Allow a new session. + AllowNewSession *bool `json:"allowNewSession,omitempty"` + // AssignedUser - User assigned to SessionHost. + AssignedUser *string `json:"assignedUser,omitempty"` +} + +// SessionHostProperties schema for SessionHost properties. +type SessionHostProperties struct { + // LastHeartBeat - Last heart beat from SessionHost. + LastHeartBeat *date.Time `json:"lastHeartBeat,omitempty"` + // Sessions - Number of sessions on SessionHost. + Sessions *int32 `json:"sessions,omitempty"` + // AgentVersion - Version of agent on SessionHost. + AgentVersion *string `json:"agentVersion,omitempty"` + // AllowNewSession - Allow a new session. + AllowNewSession *bool `json:"allowNewSession,omitempty"` + // AssignedUser - User assigned to SessionHost. + AssignedUser *string `json:"assignedUser,omitempty"` + // Status - Status for a SessionHost. Possible values include: 'StatusAvailable', 'StatusUnavailable', 'StatusShutdown', 'StatusDisconnected', 'StatusUpgrading', 'StatusUpgradeFailed' + Status Status `json:"status,omitempty"` + // StatusTimestamp - READ-ONLY; The timestamp of the status. + StatusTimestamp *date.Time `json:"statusTimestamp,omitempty"` + // OsVersion - The version of the OS on the session host. + OsVersion *string `json:"osVersion,omitempty"` + // SxSStackVersion - The version of the side by side stack on the session host. + SxSStackVersion *string `json:"sxSStackVersion,omitempty"` + // UpdateState - Update state of a SessionHost. Possible values include: 'UpdateStateInitial', 'UpdateStatePending', 'UpdateStateStarted', 'UpdateStateSucceeded', 'UpdateStateFailed' + UpdateState UpdateState `json:"updateState,omitempty"` + // LastUpdateTime - READ-ONLY; The timestamp of the last update. + LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"` + // UpdateErrorMessage - The error message. + UpdateErrorMessage *string `json:"updateErrorMessage,omitempty"` +} + +// StartMenuItem represents a StartMenuItem definition. +type StartMenuItem struct { + // StartMenuItemProperties - Detailed properties for StartMenuItem + *StartMenuItemProperties `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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for StartMenuItem. +func (smi StartMenuItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if smi.StartMenuItemProperties != nil { + objectMap["properties"] = smi.StartMenuItemProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for StartMenuItem struct. +func (smi *StartMenuItem) 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 startMenuItemProperties StartMenuItemProperties + err = json.Unmarshal(*v, &startMenuItemProperties) + if err != nil { + return err + } + smi.StartMenuItemProperties = &startMenuItemProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + smi.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + smi.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + smi.Type = &typeVar + } + } + } + + return nil +} + +// StartMenuItemList list of StartMenuItem definitions. +type StartMenuItemList struct { + autorest.Response `json:"-"` + // Value - List of StartMenuItem definitions. + Value *[]StartMenuItem `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to the next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// StartMenuItemListIterator provides access to a complete listing of StartMenuItem values. +type StartMenuItemListIterator struct { + i int + page StartMenuItemListPage +} + +// 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 *StartMenuItemListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StartMenuItemListIterator.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 *StartMenuItemListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter StartMenuItemListIterator) 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 StartMenuItemListIterator) Response() StartMenuItemList { + 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 StartMenuItemListIterator) Value() StartMenuItem { + if !iter.page.NotDone() { + return StartMenuItem{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the StartMenuItemListIterator type. +func NewStartMenuItemListIterator(page StartMenuItemListPage) StartMenuItemListIterator { + return StartMenuItemListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (smil StartMenuItemList) IsEmpty() bool { + return smil.Value == nil || len(*smil.Value) == 0 +} + +// startMenuItemListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (smil StartMenuItemList) startMenuItemListPreparer(ctx context.Context) (*http.Request, error) { + if smil.NextLink == nil || len(to.String(smil.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(smil.NextLink))) +} + +// StartMenuItemListPage contains a page of StartMenuItem values. +type StartMenuItemListPage struct { + fn func(context.Context, StartMenuItemList) (StartMenuItemList, error) + smil StartMenuItemList +} + +// 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 *StartMenuItemListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StartMenuItemListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.smil) + if err != nil { + return err + } + page.smil = next + 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 *StartMenuItemListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page StartMenuItemListPage) NotDone() bool { + return !page.smil.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page StartMenuItemListPage) Response() StartMenuItemList { + return page.smil +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page StartMenuItemListPage) Values() []StartMenuItem { + if page.smil.IsEmpty() { + return nil + } + return *page.smil.Value +} + +// Creates a new instance of the StartMenuItemListPage type. +func NewStartMenuItemListPage(getNextPage func(context.Context, StartMenuItemList) (StartMenuItemList, error)) StartMenuItemListPage { + return StartMenuItemListPage{fn: getNextPage} +} + +// StartMenuItemProperties schema for StartMenuItem properties. +type StartMenuItemProperties struct { + // AppAlias - Alias of StartMenuItem. + AppAlias *string `json:"appAlias,omitempty"` + // FriendlyName - Friendly name of StartMenuItem. + FriendlyName *string `json:"friendlyName,omitempty"` + // FilePath - Path to the file of StartMenuItem. + FilePath *string `json:"filePath,omitempty"` + // CommandLineArguments - Command line arguments for StartMenuItem. + CommandLineArguments *string `json:"commandLineArguments,omitempty"` + // IconPath - Path to the icon. + IconPath *string `json:"iconPath,omitempty"` + // IconIndex - Index of the icon. + IconIndex *int32 `json:"iconIndex,omitempty"` +} + +// TrackedResource the resource model definition for a ARM tracked top level resource +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. Ex- 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) +} + +// UserSession represents a UserSession definition. +type UserSession struct { + autorest.Response `json:"-"` + // UserSessionProperties - Detailed properties for UserSession + *UserSessionProperties `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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for UserSession. +func (us UserSession) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if us.UserSessionProperties != nil { + objectMap["properties"] = us.UserSessionProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for UserSession struct. +func (us *UserSession) 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 userSessionProperties UserSessionProperties + err = json.Unmarshal(*v, &userSessionProperties) + if err != nil { + return err + } + us.UserSessionProperties = &userSessionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + us.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + us.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + us.Type = &typeVar + } + } + } + + return nil +} + +// UserSessionList list of UserSession definitions. +type UserSessionList struct { + autorest.Response `json:"-"` + // Value - List of UserSession definitions. + Value *[]UserSession `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to the next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// UserSessionListIterator provides access to a complete listing of UserSession values. +type UserSessionListIterator struct { + i int + page UserSessionListPage +} + +// 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 *UserSessionListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UserSessionListIterator.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 *UserSessionListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter UserSessionListIterator) 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 UserSessionListIterator) Response() UserSessionList { + 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 UserSessionListIterator) Value() UserSession { + if !iter.page.NotDone() { + return UserSession{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the UserSessionListIterator type. +func NewUserSessionListIterator(page UserSessionListPage) UserSessionListIterator { + return UserSessionListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (usl UserSessionList) IsEmpty() bool { + return usl.Value == nil || len(*usl.Value) == 0 +} + +// userSessionListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (usl UserSessionList) userSessionListPreparer(ctx context.Context) (*http.Request, error) { + if usl.NextLink == nil || len(to.String(usl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(usl.NextLink))) +} + +// UserSessionListPage contains a page of UserSession values. +type UserSessionListPage struct { + fn func(context.Context, UserSessionList) (UserSessionList, error) + usl UserSessionList +} + +// 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 *UserSessionListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UserSessionListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.usl) + if err != nil { + return err + } + page.usl = next + 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 *UserSessionListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page UserSessionListPage) NotDone() bool { + return !page.usl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page UserSessionListPage) Response() UserSessionList { + return page.usl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page UserSessionListPage) Values() []UserSession { + if page.usl.IsEmpty() { + return nil + } + return *page.usl.Value +} + +// Creates a new instance of the UserSessionListPage type. +func NewUserSessionListPage(getNextPage func(context.Context, UserSessionList) (UserSessionList, error)) UserSessionListPage { + return UserSessionListPage{fn: getNextPage} +} + +// UserSessionProperties schema for UserSession properties. +type UserSessionProperties struct { + // UserPrincipalName - The user principal name. + UserPrincipalName *string `json:"userPrincipalName,omitempty"` + // ApplicationType - Application type of application. Possible values include: 'ApplicationTypeRemoteApp', 'ApplicationTypeDesktop' + ApplicationType ApplicationType `json:"applicationType,omitempty"` + // SessionState - State of user session. Possible values include: 'Unknown', 'Active', 'Disconnected', 'Pending', 'LogOff', 'UserProfileDiskMounted' + SessionState SessionState `json:"sessionState,omitempty"` + // ActiveDirectoryUserName - The active directory user name. + ActiveDirectoryUserName *string `json:"activeDirectoryUserName,omitempty"` + // CreateTime - The timestamp of the user session create. + CreateTime *date.Time `json:"createTime,omitempty"` +} + +// Workspace represents a Workspace definition. +type Workspace struct { + autorest.Response `json:"-"` + // WorkspaceProperties - Detailed properties for Workspace + *WorkspaceProperties `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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Workspace. +func (w Workspace) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if w.WorkspaceProperties != nil { + objectMap["properties"] = w.WorkspaceProperties + } + if w.Tags != nil { + objectMap["tags"] = w.Tags + } + if w.Location != nil { + objectMap["location"] = w.Location + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Workspace struct. +func (w *Workspace) 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 workspaceProperties WorkspaceProperties + err = json.Unmarshal(*v, &workspaceProperties) + if err != nil { + return err + } + w.WorkspaceProperties = &workspaceProperties + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + w.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + w.Location = &location + } + 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 + } + } + } + + return nil +} + +// WorkspaceList list of Workspace definitions. +type WorkspaceList struct { + autorest.Response `json:"-"` + // Value - List of Workspace definitions. + Value *[]Workspace `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to the next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// WorkspaceListIterator provides access to a complete listing of Workspace values. +type WorkspaceListIterator struct { + i int + page WorkspaceListPage +} + +// 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 *WorkspaceListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceListIterator.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 *WorkspaceListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter WorkspaceListIterator) 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 WorkspaceListIterator) Response() WorkspaceList { + 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 WorkspaceListIterator) Value() Workspace { + if !iter.page.NotDone() { + return Workspace{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the WorkspaceListIterator type. +func NewWorkspaceListIterator(page WorkspaceListPage) WorkspaceListIterator { + return WorkspaceListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (wl WorkspaceList) IsEmpty() bool { + return wl.Value == nil || len(*wl.Value) == 0 +} + +// workspaceListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (wl WorkspaceList) workspaceListPreparer(ctx context.Context) (*http.Request, error) { + if wl.NextLink == nil || len(to.String(wl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(wl.NextLink))) +} + +// WorkspaceListPage contains a page of Workspace values. +type WorkspaceListPage struct { + fn func(context.Context, WorkspaceList) (WorkspaceList, error) + wl WorkspaceList +} + +// 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 *WorkspaceListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.wl) + if err != nil { + return err + } + page.wl = next + 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 *WorkspaceListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page WorkspaceListPage) NotDone() bool { + return !page.wl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page WorkspaceListPage) Response() WorkspaceList { + return page.wl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page WorkspaceListPage) Values() []Workspace { + if page.wl.IsEmpty() { + return nil + } + return *page.wl.Value +} + +// Creates a new instance of the WorkspaceListPage type. +func NewWorkspaceListPage(getNextPage func(context.Context, WorkspaceList) (WorkspaceList, error)) WorkspaceListPage { + return WorkspaceListPage{fn: getNextPage} +} + +// WorkspacePatch workspace properties that can be patched. +type WorkspacePatch struct { + // Tags - tags to be updated + Tags interface{} `json:"tags,omitempty"` + // WorkspacePatchProperties - Detailed properties for Workspace + *WorkspacePatchProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for WorkspacePatch. +func (wp WorkspacePatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wp.Tags != nil { + objectMap["tags"] = wp.Tags + } + if wp.WorkspacePatchProperties != nil { + objectMap["properties"] = wp.WorkspacePatchProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for WorkspacePatch struct. +func (wp *WorkspacePatch) 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 interface{} + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + wp.Tags = tags + } + case "properties": + if v != nil { + var workspacePatchProperties WorkspacePatchProperties + err = json.Unmarshal(*v, &workspacePatchProperties) + if err != nil { + return err + } + wp.WorkspacePatchProperties = &workspacePatchProperties + } + } + } + + return nil +} + +// WorkspacePatchProperties workspace properties that can be patched. +type WorkspacePatchProperties struct { + // Description - Description of Workspace. + Description *string `json:"description,omitempty"` + // FriendlyName - Friendly name of Workspace. + FriendlyName *string `json:"friendlyName,omitempty"` + // ApplicationGroupReferences - List of applicationGroup links. + ApplicationGroupReferences *[]string `json:"applicationGroupReferences,omitempty"` +} + +// WorkspaceProperties schema for Workspace properties. +type WorkspaceProperties struct { + // Description - Description of Workspace. + Description *string `json:"description,omitempty"` + // FriendlyName - Friendly name of Workspace. + FriendlyName *string `json:"friendlyName,omitempty"` + // ApplicationGroupReferences - List of applicationGroup resource Ids. + ApplicationGroupReferences *[]string `json:"applicationGroupReferences,omitempty"` +} diff --git a/services/preview/desktopvirtualization/mgmt/2019-09-24-preview/desktopvirtualization/operations.go b/services/preview/desktopvirtualization/mgmt/2019-09-24-preview/desktopvirtualization/operations.go new file mode 100644 index 000000000000..2a446d487fa7 --- /dev/null +++ b/services/preview/desktopvirtualization/mgmt/2019-09-24-preview/desktopvirtualization/operations.go @@ -0,0 +1,109 @@ +package desktopvirtualization + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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 Desktopvirtualization 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 list all of the available operations the Desktop Virtualization resource provider supports. +func (client OperationsClient) List(ctx context.Context) (result ResourceProviderOperationList, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.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) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.OperationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.OperationsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.OperationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2019-09-24-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.DesktopVirtualization/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 ResourceProviderOperationList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/desktopvirtualization/mgmt/2019-09-24-preview/desktopvirtualization/sessionhosts.go b/services/preview/desktopvirtualization/mgmt/2019-09-24-preview/desktopvirtualization/sessionhosts.go new file mode 100644 index 000000000000..74e8cc58d624 --- /dev/null +++ b/services/preview/desktopvirtualization/mgmt/2019-09-24-preview/desktopvirtualization/sessionhosts.go @@ -0,0 +1,461 @@ +package desktopvirtualization + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// SessionHostsClient is the client for the SessionHosts methods of the Desktopvirtualization service. +type SessionHostsClient struct { + BaseClient +} + +// NewSessionHostsClient creates an instance of the SessionHostsClient client. +func NewSessionHostsClient(subscriptionID string) SessionHostsClient { + return NewSessionHostsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewSessionHostsClientWithBaseURI creates an instance of the SessionHostsClient 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 NewSessionHostsClientWithBaseURI(baseURI string, subscriptionID string) SessionHostsClient { + return SessionHostsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Delete remove a SessionHost. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// hostPoolName - the name of the host pool within the specified resource group +// sessionHostName - the name of the session host within the specified host pool +// force - force flag to force sessionHost deletion even when userSession exists. +func (client SessionHostsClient) Delete(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string, force *bool) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SessionHostsClient.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: 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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: hostPoolName, + Constraints: []validation.Constraint{{Target: "hostPoolName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "hostPoolName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: sessionHostName, + Constraints: []validation.Constraint{{Target: "sessionHostName", Name: validation.MaxLength, Rule: 48, Chain: nil}, + {Target: "sessionHostName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.SessionHostsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, hostPoolName, sessionHostName, force) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.SessionHostsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "desktopvirtualization.SessionHostsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.SessionHostsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client SessionHostsClient) DeletePreparer(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string, force *bool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "hostPoolName": autorest.Encode("path", hostPoolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sessionHostName": autorest.Encode("path", sessionHostName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-24-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if force != nil { + queryParameters["force"] = autorest.Encode("query", *force) + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}", 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 SessionHostsClient) 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 SessionHostsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get a session host. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// hostPoolName - the name of the host pool within the specified resource group +// sessionHostName - the name of the session host within the specified host pool +func (client SessionHostsClient) Get(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string) (result SessionHost, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SessionHostsClient.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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: hostPoolName, + Constraints: []validation.Constraint{{Target: "hostPoolName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "hostPoolName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: sessionHostName, + Constraints: []validation.Constraint{{Target: "sessionHostName", Name: validation.MaxLength, Rule: 48, Chain: nil}, + {Target: "sessionHostName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.SessionHostsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, hostPoolName, sessionHostName) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.SessionHostsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.SessionHostsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.SessionHostsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client SessionHostsClient) GetPreparer(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "hostPoolName": autorest.Encode("path", hostPoolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sessionHostName": autorest.Encode("path", sessionHostName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-24-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.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}", 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 SessionHostsClient) 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 SessionHostsClient) GetResponder(resp *http.Response) (result SessionHost, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List list sessionHosts. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// hostPoolName - the name of the host pool within the specified resource group +func (client SessionHostsClient) List(ctx context.Context, resourceGroupName string, hostPoolName string) (result SessionHostListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SessionHostsClient.List") + defer func() { + sc := -1 + if result.shl.Response.Response != nil { + sc = result.shl.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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: hostPoolName, + Constraints: []validation.Constraint{{Target: "hostPoolName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "hostPoolName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.SessionHostsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, hostPoolName) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.SessionHostsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.shl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.SessionHostsClient", "List", resp, "Failure sending request") + return + } + + result.shl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.SessionHostsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client SessionHostsClient) ListPreparer(ctx context.Context, resourceGroupName string, hostPoolName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "hostPoolName": autorest.Encode("path", hostPoolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-24-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.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts", 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 SessionHostsClient) 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 SessionHostsClient) ListResponder(resp *http.Response) (result SessionHostList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 SessionHostsClient) listNextResults(ctx context.Context, lastResults SessionHostList) (result SessionHostList, err error) { + req, err := lastResults.sessionHostListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "desktopvirtualization.SessionHostsClient", "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, "desktopvirtualization.SessionHostsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.SessionHostsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client SessionHostsClient) ListComplete(ctx context.Context, resourceGroupName string, hostPoolName string) (result SessionHostListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SessionHostsClient.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, hostPoolName) + return +} + +// Update update a session host. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// hostPoolName - the name of the host pool within the specified resource group +// sessionHostName - the name of the session host within the specified host pool +// sessionHost - object containing SessionHost definitions. +func (client SessionHostsClient) Update(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string, sessionHost *SessionHostPatch) (result SessionHost, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SessionHostsClient.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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: hostPoolName, + Constraints: []validation.Constraint{{Target: "hostPoolName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "hostPoolName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: sessionHostName, + Constraints: []validation.Constraint{{Target: "sessionHostName", Name: validation.MaxLength, Rule: 48, Chain: nil}, + {Target: "sessionHostName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.SessionHostsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, hostPoolName, sessionHostName, sessionHost) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.SessionHostsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.SessionHostsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.SessionHostsClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client SessionHostsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string, sessionHost *SessionHostPatch) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "hostPoolName": autorest.Encode("path", hostPoolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sessionHostName": autorest.Encode("path", sessionHostName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-24-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.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if sessionHost != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(sessionHost)) + } + 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 SessionHostsClient) 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 SessionHostsClient) UpdateResponder(resp *http.Response) (result SessionHost, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/desktopvirtualization/mgmt/2019-09-24-preview/desktopvirtualization/startmenuitems.go b/services/preview/desktopvirtualization/mgmt/2019-09-24-preview/desktopvirtualization/startmenuitems.go new file mode 100644 index 000000000000..aaf6231732bb --- /dev/null +++ b/services/preview/desktopvirtualization/mgmt/2019-09-24-preview/desktopvirtualization/startmenuitems.go @@ -0,0 +1,170 @@ +package desktopvirtualization + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// StartMenuItemsClient is the client for the StartMenuItems methods of the Desktopvirtualization service. +type StartMenuItemsClient struct { + BaseClient +} + +// NewStartMenuItemsClient creates an instance of the StartMenuItemsClient client. +func NewStartMenuItemsClient(subscriptionID string) StartMenuItemsClient { + return NewStartMenuItemsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewStartMenuItemsClientWithBaseURI creates an instance of the StartMenuItemsClient 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 NewStartMenuItemsClientWithBaseURI(baseURI string, subscriptionID string) StartMenuItemsClient { + return StartMenuItemsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List list start menu items in the given application group. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// applicationGroupName - the name of the application group +func (client StartMenuItemsClient) List(ctx context.Context, resourceGroupName string, applicationGroupName string) (result StartMenuItemListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StartMenuItemsClient.List") + defer func() { + sc := -1 + if result.smil.Response.Response != nil { + sc = result.smil.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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: applicationGroupName, + Constraints: []validation.Constraint{{Target: "applicationGroupName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "applicationGroupName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.StartMenuItemsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, applicationGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.StartMenuItemsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.smil.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.StartMenuItemsClient", "List", resp, "Failure sending request") + return + } + + result.smil, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.StartMenuItemsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client StartMenuItemsClient) ListPreparer(ctx context.Context, resourceGroupName string, applicationGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationGroupName": autorest.Encode("path", applicationGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-24-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.DesktopVirtualization/applicationGroups/{applicationGroupName}/startMenuItems", 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 StartMenuItemsClient) 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 StartMenuItemsClient) ListResponder(resp *http.Response) (result StartMenuItemList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 StartMenuItemsClient) listNextResults(ctx context.Context, lastResults StartMenuItemList) (result StartMenuItemList, err error) { + req, err := lastResults.startMenuItemListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "desktopvirtualization.StartMenuItemsClient", "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, "desktopvirtualization.StartMenuItemsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.StartMenuItemsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client StartMenuItemsClient) ListComplete(ctx context.Context, resourceGroupName string, applicationGroupName string) (result StartMenuItemListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StartMenuItemsClient.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, applicationGroupName) + return +} diff --git a/services/preview/desktopvirtualization/mgmt/2019-09-24-preview/desktopvirtualization/usersessions.go b/services/preview/desktopvirtualization/mgmt/2019-09-24-preview/desktopvirtualization/usersessions.go new file mode 100644 index 000000000000..58e22e7726c6 --- /dev/null +++ b/services/preview/desktopvirtualization/mgmt/2019-09-24-preview/desktopvirtualization/usersessions.go @@ -0,0 +1,709 @@ +package desktopvirtualization + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// UserSessionsClient is the client for the UserSessions methods of the Desktopvirtualization service. +type UserSessionsClient struct { + BaseClient +} + +// NewUserSessionsClient creates an instance of the UserSessionsClient client. +func NewUserSessionsClient(subscriptionID string) UserSessionsClient { + return NewUserSessionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewUserSessionsClientWithBaseURI creates an instance of the UserSessionsClient 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 NewUserSessionsClientWithBaseURI(baseURI string, subscriptionID string) UserSessionsClient { + return UserSessionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Delete remove a userSession. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// hostPoolName - the name of the host pool within the specified resource group +// sessionHostName - the name of the session host within the specified host pool +// userSessionID - the name of the user session within the specified session host +// force - force flag to login off userSession. +func (client UserSessionsClient) Delete(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string, userSessionID string, force *bool) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UserSessionsClient.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: 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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: hostPoolName, + Constraints: []validation.Constraint{{Target: "hostPoolName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "hostPoolName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: sessionHostName, + Constraints: []validation.Constraint{{Target: "sessionHostName", Name: validation.MaxLength, Rule: 48, Chain: nil}, + {Target: "sessionHostName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: userSessionID, + Constraints: []validation.Constraint{{Target: "userSessionID", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "userSessionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.UserSessionsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, hostPoolName, sessionHostName, userSessionID, force) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.UserSessionsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "desktopvirtualization.UserSessionsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.UserSessionsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client UserSessionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string, userSessionID string, force *bool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "hostPoolName": autorest.Encode("path", hostPoolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sessionHostName": autorest.Encode("path", sessionHostName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "userSessionId": autorest.Encode("path", userSessionID), + } + + const APIVersion = "2019-09-24-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if force != nil { + queryParameters["force"] = autorest.Encode("query", *force) + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/userSessions/{userSessionId}", 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 UserSessionsClient) 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 UserSessionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Disconnect disconnect a userSession. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// hostPoolName - the name of the host pool within the specified resource group +// sessionHostName - the name of the session host within the specified host pool +// userSessionID - the name of the user session within the specified session host +func (client UserSessionsClient) Disconnect(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string, userSessionID string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UserSessionsClient.Disconnect") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: hostPoolName, + Constraints: []validation.Constraint{{Target: "hostPoolName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "hostPoolName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: sessionHostName, + Constraints: []validation.Constraint{{Target: "sessionHostName", Name: validation.MaxLength, Rule: 48, Chain: nil}, + {Target: "sessionHostName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: userSessionID, + Constraints: []validation.Constraint{{Target: "userSessionID", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "userSessionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.UserSessionsClient", "Disconnect", err.Error()) + } + + req, err := client.DisconnectPreparer(ctx, resourceGroupName, hostPoolName, sessionHostName, userSessionID) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.UserSessionsClient", "Disconnect", nil, "Failure preparing request") + return + } + + resp, err := client.DisconnectSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "desktopvirtualization.UserSessionsClient", "Disconnect", resp, "Failure sending request") + return + } + + result, err = client.DisconnectResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.UserSessionsClient", "Disconnect", resp, "Failure responding to request") + } + + return +} + +// DisconnectPreparer prepares the Disconnect request. +func (client UserSessionsClient) DisconnectPreparer(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string, userSessionID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "hostPoolName": autorest.Encode("path", hostPoolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sessionHostName": autorest.Encode("path", sessionHostName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "userSessionId": autorest.Encode("path", userSessionID), + } + + const APIVersion = "2019-09-24-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.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/userSessions/{userSessionId}/disconnect", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DisconnectSender sends the Disconnect request. The method will close the +// http.Response Body if it receives an error. +func (client UserSessionsClient) DisconnectSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DisconnectResponder handles the response to the Disconnect request. The method always +// closes the http.Response Body. +func (client UserSessionsClient) DisconnectResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get a userSession. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// hostPoolName - the name of the host pool within the specified resource group +// sessionHostName - the name of the session host within the specified host pool +// userSessionID - the name of the user session within the specified session host +func (client UserSessionsClient) Get(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string, userSessionID string) (result UserSession, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UserSessionsClient.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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: hostPoolName, + Constraints: []validation.Constraint{{Target: "hostPoolName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "hostPoolName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: sessionHostName, + Constraints: []validation.Constraint{{Target: "sessionHostName", Name: validation.MaxLength, Rule: 48, Chain: nil}, + {Target: "sessionHostName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: userSessionID, + Constraints: []validation.Constraint{{Target: "userSessionID", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "userSessionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.UserSessionsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, hostPoolName, sessionHostName, userSessionID) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.UserSessionsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.UserSessionsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.UserSessionsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client UserSessionsClient) GetPreparer(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string, userSessionID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "hostPoolName": autorest.Encode("path", hostPoolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sessionHostName": autorest.Encode("path", sessionHostName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "userSessionId": autorest.Encode("path", userSessionID), + } + + const APIVersion = "2019-09-24-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.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/userSessions/{userSessionId}", 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 UserSessionsClient) 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 UserSessionsClient) GetResponder(resp *http.Response) (result UserSession, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List list userSessions. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// hostPoolName - the name of the host pool within the specified resource group +// sessionHostName - the name of the session host within the specified host pool +func (client UserSessionsClient) List(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string) (result UserSessionListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UserSessionsClient.List") + defer func() { + sc := -1 + if result.usl.Response.Response != nil { + sc = result.usl.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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: hostPoolName, + Constraints: []validation.Constraint{{Target: "hostPoolName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "hostPoolName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: sessionHostName, + Constraints: []validation.Constraint{{Target: "sessionHostName", Name: validation.MaxLength, Rule: 48, Chain: nil}, + {Target: "sessionHostName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.UserSessionsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, hostPoolName, sessionHostName) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.UserSessionsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.usl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.UserSessionsClient", "List", resp, "Failure sending request") + return + } + + result.usl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.UserSessionsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client UserSessionsClient) ListPreparer(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "hostPoolName": autorest.Encode("path", hostPoolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sessionHostName": autorest.Encode("path", sessionHostName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-24-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.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/userSessions", 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 UserSessionsClient) 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 UserSessionsClient) ListResponder(resp *http.Response) (result UserSessionList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 UserSessionsClient) listNextResults(ctx context.Context, lastResults UserSessionList) (result UserSessionList, err error) { + req, err := lastResults.userSessionListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "desktopvirtualization.UserSessionsClient", "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, "desktopvirtualization.UserSessionsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.UserSessionsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client UserSessionsClient) ListComplete(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string) (result UserSessionListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UserSessionsClient.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, hostPoolName, sessionHostName) + return +} + +// ListByHostPool list userSessions. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// hostPoolName - the name of the host pool within the specified resource group +// filter - oData filter expression. Valid properties for filtering are userprincipalname and sessionstate. +func (client UserSessionsClient) ListByHostPool(ctx context.Context, resourceGroupName string, hostPoolName string, filter string) (result UserSessionListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UserSessionsClient.ListByHostPool") + defer func() { + sc := -1 + if result.usl.Response.Response != nil { + sc = result.usl.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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: hostPoolName, + Constraints: []validation.Constraint{{Target: "hostPoolName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "hostPoolName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.UserSessionsClient", "ListByHostPool", err.Error()) + } + + result.fn = client.listByHostPoolNextResults + req, err := client.ListByHostPoolPreparer(ctx, resourceGroupName, hostPoolName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.UserSessionsClient", "ListByHostPool", nil, "Failure preparing request") + return + } + + resp, err := client.ListByHostPoolSender(req) + if err != nil { + result.usl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.UserSessionsClient", "ListByHostPool", resp, "Failure sending request") + return + } + + result.usl, err = client.ListByHostPoolResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.UserSessionsClient", "ListByHostPool", resp, "Failure responding to request") + } + + return +} + +// ListByHostPoolPreparer prepares the ListByHostPool request. +func (client UserSessionsClient) ListByHostPoolPreparer(ctx context.Context, resourceGroupName string, hostPoolName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "hostPoolName": autorest.Encode("path", hostPoolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-24-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.DesktopVirtualization/hostPools/{hostPoolName}/userSessions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByHostPoolSender sends the ListByHostPool request. The method will close the +// http.Response Body if it receives an error. +func (client UserSessionsClient) ListByHostPoolSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByHostPoolResponder handles the response to the ListByHostPool request. The method always +// closes the http.Response Body. +func (client UserSessionsClient) ListByHostPoolResponder(resp *http.Response) (result UserSessionList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByHostPoolNextResults retrieves the next set of results, if any. +func (client UserSessionsClient) listByHostPoolNextResults(ctx context.Context, lastResults UserSessionList) (result UserSessionList, err error) { + req, err := lastResults.userSessionListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "desktopvirtualization.UserSessionsClient", "listByHostPoolNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByHostPoolSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "desktopvirtualization.UserSessionsClient", "listByHostPoolNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByHostPoolResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.UserSessionsClient", "listByHostPoolNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByHostPoolComplete enumerates all values, automatically crossing page boundaries as required. +func (client UserSessionsClient) ListByHostPoolComplete(ctx context.Context, resourceGroupName string, hostPoolName string, filter string) (result UserSessionListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UserSessionsClient.ListByHostPool") + 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.ListByHostPool(ctx, resourceGroupName, hostPoolName, filter) + return +} + +// SendMessageMethod send a message to a user. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// hostPoolName - the name of the host pool within the specified resource group +// sessionHostName - the name of the session host within the specified host pool +// userSessionID - the name of the user session within the specified session host +// sendMessage - object containing message includes title and message body +func (client UserSessionsClient) SendMessageMethod(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string, userSessionID string, sendMessage *SendMessage) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UserSessionsClient.SendMessageMethod") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: hostPoolName, + Constraints: []validation.Constraint{{Target: "hostPoolName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "hostPoolName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: sessionHostName, + Constraints: []validation.Constraint{{Target: "sessionHostName", Name: validation.MaxLength, Rule: 48, Chain: nil}, + {Target: "sessionHostName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: userSessionID, + Constraints: []validation.Constraint{{Target: "userSessionID", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "userSessionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.UserSessionsClient", "SendMessageMethod", err.Error()) + } + + req, err := client.SendMessageMethodPreparer(ctx, resourceGroupName, hostPoolName, sessionHostName, userSessionID, sendMessage) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.UserSessionsClient", "SendMessageMethod", nil, "Failure preparing request") + return + } + + resp, err := client.SendMessageMethodSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "desktopvirtualization.UserSessionsClient", "SendMessageMethod", resp, "Failure sending request") + return + } + + result, err = client.SendMessageMethodResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.UserSessionsClient", "SendMessageMethod", resp, "Failure responding to request") + } + + return +} + +// SendMessageMethodPreparer prepares the SendMessageMethod request. +func (client UserSessionsClient) SendMessageMethodPreparer(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string, userSessionID string, sendMessage *SendMessage) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "hostPoolName": autorest.Encode("path", hostPoolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sessionHostName": autorest.Encode("path", sessionHostName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "userSessionId": autorest.Encode("path", userSessionID), + } + + const APIVersion = "2019-09-24-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.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/userSessions/{userSessionId}/sendMessage", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if sendMessage != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(sendMessage)) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SendMessageMethodSender sends the SendMessageMethod request. The method will close the +// http.Response Body if it receives an error. +func (client UserSessionsClient) SendMessageMethodSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// SendMessageMethodResponder handles the response to the SendMessageMethod request. The method always +// closes the http.Response Body. +func (client UserSessionsClient) SendMessageMethodResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/services/preview/desktopvirtualization/mgmt/2019-09-24-preview/desktopvirtualization/version.go b/services/preview/desktopvirtualization/mgmt/2019-09-24-preview/desktopvirtualization/version.go new file mode 100644 index 000000000000..50cd9bf524d2 --- /dev/null +++ b/services/preview/desktopvirtualization/mgmt/2019-09-24-preview/desktopvirtualization/version.go @@ -0,0 +1,30 @@ +package desktopvirtualization + +import "github.com/Azure/azure-sdk-for-go/version" + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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() + " desktopvirtualization/2019-09-24-preview" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/services/preview/desktopvirtualization/mgmt/2019-09-24-preview/desktopvirtualization/workspaces.go b/services/preview/desktopvirtualization/mgmt/2019-09-24-preview/desktopvirtualization/workspaces.go new file mode 100644 index 000000000000..ace45f73db36 --- /dev/null +++ b/services/preview/desktopvirtualization/mgmt/2019-09-24-preview/desktopvirtualization/workspaces.go @@ -0,0 +1,644 @@ +package desktopvirtualization + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// WorkspacesClient is the client for the Workspaces methods of the Desktopvirtualization service. +type WorkspacesClient struct { + BaseClient +} + +// NewWorkspacesClient creates an instance of the WorkspacesClient client. +func NewWorkspacesClient(subscriptionID string) WorkspacesClient { + return NewWorkspacesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWorkspacesClientWithBaseURI creates an instance of the WorkspacesClient 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 NewWorkspacesClientWithBaseURI(baseURI string, subscriptionID string) WorkspacesClient { + return WorkspacesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create or update a workspace. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +// workspace - object containing Workspace definitions. +func (client WorkspacesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, workspace Workspace) (result Workspace, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.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: 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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.WorkspacesClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, workspaceName, workspace) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.WorkspacesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.WorkspacesClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.WorkspacesClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client WorkspacesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, workspaceName string, workspace Workspace) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-09-24-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.DesktopVirtualization/workspaces/{workspaceName}", pathParameters), + autorest.WithJSON(workspace), + 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 WorkspacesClient) 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 WorkspacesClient) CreateOrUpdateResponder(resp *http.Response) (result Workspace, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete remove a workspace. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +func (client WorkspacesClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.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: 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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.WorkspacesClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.WorkspacesClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "desktopvirtualization.WorkspacesClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.WorkspacesClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client WorkspacesClient) DeletePreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-09-24-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.DesktopVirtualization/workspaces/{workspaceName}", 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 WorkspacesClient) 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 WorkspacesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get a workspace. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +func (client WorkspacesClient) Get(ctx context.Context, resourceGroupName string, workspaceName string) (result Workspace, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.WorkspacesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.WorkspacesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.WorkspacesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.WorkspacesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client WorkspacesClient) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-09-24-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.DesktopVirtualization/workspaces/{workspaceName}", 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 WorkspacesClient) 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 WorkspacesClient) GetResponder(resp *http.Response) (result Workspace, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByResourceGroup list workspaces. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +func (client WorkspacesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result WorkspaceListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.wl.Response.Response != nil { + sc = result.wl.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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.WorkspacesClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.WorkspacesClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.wl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.WorkspacesClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.wl, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.WorkspacesClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client WorkspacesClient) 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 = "2019-09-24-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.DesktopVirtualization/workspaces", 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 WorkspacesClient) 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 WorkspacesClient) ListByResourceGroupResponder(resp *http.Response) (result WorkspaceList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 WorkspacesClient) listByResourceGroupNextResults(ctx context.Context, lastResults WorkspaceList) (result WorkspaceList, err error) { + req, err := lastResults.workspaceListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "desktopvirtualization.WorkspacesClient", "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, "desktopvirtualization.WorkspacesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.WorkspacesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client WorkspacesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result WorkspaceListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.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 list workspaces in subscription. +func (client WorkspacesClient) ListBySubscription(ctx context.Context) (result WorkspaceListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.ListBySubscription") + defer func() { + sc := -1 + if result.wl.Response.Response != nil { + sc = result.wl.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("desktopvirtualization.WorkspacesClient", "ListBySubscription", err.Error()) + } + + result.fn = client.listBySubscriptionNextResults + req, err := client.ListBySubscriptionPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.WorkspacesClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.wl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.WorkspacesClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result.wl, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.WorkspacesClient", "ListBySubscription", resp, "Failure responding to request") + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client WorkspacesClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-09-24-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DesktopVirtualization/workspaces", 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 WorkspacesClient) 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 WorkspacesClient) ListBySubscriptionResponder(resp *http.Response) (result WorkspaceList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 WorkspacesClient) listBySubscriptionNextResults(ctx context.Context, lastResults WorkspaceList) (result WorkspaceList, err error) { + req, err := lastResults.workspaceListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "desktopvirtualization.WorkspacesClient", "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, "desktopvirtualization.WorkspacesClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.WorkspacesClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client WorkspacesClient) ListBySubscriptionComplete(ctx context.Context) (result WorkspaceListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.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 update a workspace. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +// workspace - object containing Workspace definitions. +func (client WorkspacesClient) Update(ctx context.Context, resourceGroupName string, workspaceName string, workspace *WorkspacePatch) (result Workspace, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.WorkspacesClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, workspaceName, workspace) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.WorkspacesClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.WorkspacesClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.WorkspacesClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client WorkspacesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, workspaceName string, workspace *WorkspacePatch) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-09-24-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.DesktopVirtualization/workspaces/{workspaceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if workspace != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(workspace)) + } + 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 WorkspacesClient) 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 WorkspacesClient) UpdateResponder(resp *http.Response) (result Workspace, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/desktopvirtualization/mgmt/2019-12-10-preview/desktopvirtualization/activeapplications.go b/services/preview/desktopvirtualization/mgmt/2019-12-10-preview/desktopvirtualization/activeapplications.go new file mode 100644 index 000000000000..544db568814c --- /dev/null +++ b/services/preview/desktopvirtualization/mgmt/2019-12-10-preview/desktopvirtualization/activeapplications.go @@ -0,0 +1,180 @@ +package desktopvirtualization + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// ActiveApplicationsClient is the client for the ActiveApplications methods of the Desktopvirtualization service. +type ActiveApplicationsClient struct { + BaseClient +} + +// NewActiveApplicationsClient creates an instance of the ActiveApplicationsClient client. +func NewActiveApplicationsClient(subscriptionID string) ActiveApplicationsClient { + return NewActiveApplicationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewActiveApplicationsClientWithBaseURI creates an instance of the ActiveApplicationsClient 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 NewActiveApplicationsClientWithBaseURI(baseURI string, subscriptionID string) ActiveApplicationsClient { + return ActiveApplicationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListBySessionHost list applications for the given session host. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// hostPoolName - the name of the host pool within the specified resource group +// sessionHostName - the name of the session host within the specified host pool +// filter - oData filter expression. Valid properties for filtering are userprincipalname and sessionstate. +func (client ActiveApplicationsClient) ListBySessionHost(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string, filter string) (result ApplicationListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ActiveApplicationsClient.ListBySessionHost") + defer func() { + sc := -1 + if result.al.Response.Response != nil { + sc = result.al.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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: hostPoolName, + Constraints: []validation.Constraint{{Target: "hostPoolName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "hostPoolName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: sessionHostName, + Constraints: []validation.Constraint{{Target: "sessionHostName", Name: validation.MaxLength, Rule: 48, Chain: nil}, + {Target: "sessionHostName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.ActiveApplicationsClient", "ListBySessionHost", err.Error()) + } + + result.fn = client.listBySessionHostNextResults + req, err := client.ListBySessionHostPreparer(ctx, resourceGroupName, hostPoolName, sessionHostName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.ActiveApplicationsClient", "ListBySessionHost", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySessionHostSender(req) + if err != nil { + result.al.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.ActiveApplicationsClient", "ListBySessionHost", resp, "Failure sending request") + return + } + + result.al, err = client.ListBySessionHostResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.ActiveApplicationsClient", "ListBySessionHost", resp, "Failure responding to request") + } + + return +} + +// ListBySessionHostPreparer prepares the ListBySessionHost request. +func (client ActiveApplicationsClient) ListBySessionHostPreparer(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "hostPoolName": autorest.Encode("path", hostPoolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sessionHostName": autorest.Encode("path", sessionHostName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-10-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.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/activeApplications", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBySessionHostSender sends the ListBySessionHost request. The method will close the +// http.Response Body if it receives an error. +func (client ActiveApplicationsClient) ListBySessionHostSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListBySessionHostResponder handles the response to the ListBySessionHost request. The method always +// closes the http.Response Body. +func (client ActiveApplicationsClient) ListBySessionHostResponder(resp *http.Response) (result ApplicationList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listBySessionHostNextResults retrieves the next set of results, if any. +func (client ActiveApplicationsClient) listBySessionHostNextResults(ctx context.Context, lastResults ApplicationList) (result ApplicationList, err error) { + req, err := lastResults.applicationListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "desktopvirtualization.ActiveApplicationsClient", "listBySessionHostNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListBySessionHostSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "desktopvirtualization.ActiveApplicationsClient", "listBySessionHostNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySessionHostResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.ActiveApplicationsClient", "listBySessionHostNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySessionHostComplete enumerates all values, automatically crossing page boundaries as required. +func (client ActiveApplicationsClient) ListBySessionHostComplete(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string, filter string) (result ApplicationListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ActiveApplicationsClient.ListBySessionHost") + 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.ListBySessionHost(ctx, resourceGroupName, hostPoolName, sessionHostName, filter) + return +} diff --git a/services/preview/desktopvirtualization/mgmt/2019-12-10-preview/desktopvirtualization/applicationgroupassignments.go b/services/preview/desktopvirtualization/mgmt/2019-12-10-preview/desktopvirtualization/applicationgroupassignments.go new file mode 100644 index 000000000000..572846afea6a --- /dev/null +++ b/services/preview/desktopvirtualization/mgmt/2019-12-10-preview/desktopvirtualization/applicationgroupassignments.go @@ -0,0 +1,176 @@ +package desktopvirtualization + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// ApplicationGroupAssignmentsClient is the client for the ApplicationGroupAssignments methods of the +// Desktopvirtualization service. +type ApplicationGroupAssignmentsClient struct { + BaseClient +} + +// NewApplicationGroupAssignmentsClient creates an instance of the ApplicationGroupAssignmentsClient client. +func NewApplicationGroupAssignmentsClient(subscriptionID string) ApplicationGroupAssignmentsClient { + return NewApplicationGroupAssignmentsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewApplicationGroupAssignmentsClientWithBaseURI creates an instance of the ApplicationGroupAssignmentsClient 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 NewApplicationGroupAssignmentsClientWithBaseURI(baseURI string, subscriptionID string) ApplicationGroupAssignmentsClient { + return ApplicationGroupAssignmentsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// WorkspaceLevelList list application group that user can use. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +// filter - oData filter expression. Valid properties for filtering are applicationGroupType. +func (client ApplicationGroupAssignmentsClient) WorkspaceLevelList(ctx context.Context, resourceGroupName string, workspaceName string, filter string) (result ApplicationGroupListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGroupAssignmentsClient.WorkspaceLevelList") + defer func() { + sc := -1 + if result.agl.Response.Response != nil { + sc = result.agl.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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.ApplicationGroupAssignmentsClient", "WorkspaceLevelList", err.Error()) + } + + result.fn = client.workspaceLevelListNextResults + req, err := client.WorkspaceLevelListPreparer(ctx, resourceGroupName, workspaceName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationGroupAssignmentsClient", "WorkspaceLevelList", nil, "Failure preparing request") + return + } + + resp, err := client.WorkspaceLevelListSender(req) + if err != nil { + result.agl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationGroupAssignmentsClient", "WorkspaceLevelList", resp, "Failure sending request") + return + } + + result.agl, err = client.WorkspaceLevelListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationGroupAssignmentsClient", "WorkspaceLevelList", resp, "Failure responding to request") + } + + return +} + +// WorkspaceLevelListPreparer prepares the WorkspaceLevelList request. +func (client ApplicationGroupAssignmentsClient) WorkspaceLevelListPreparer(ctx context.Context, resourceGroupName string, workspaceName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-12-10-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.DesktopVirtualization/workspaces/{workspaceName}/userApplicationGroupAssignments", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// WorkspaceLevelListSender sends the WorkspaceLevelList request. The method will close the +// http.Response Body if it receives an error. +func (client ApplicationGroupAssignmentsClient) WorkspaceLevelListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// WorkspaceLevelListResponder handles the response to the WorkspaceLevelList request. The method always +// closes the http.Response Body. +func (client ApplicationGroupAssignmentsClient) WorkspaceLevelListResponder(resp *http.Response) (result ApplicationGroupList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// workspaceLevelListNextResults retrieves the next set of results, if any. +func (client ApplicationGroupAssignmentsClient) workspaceLevelListNextResults(ctx context.Context, lastResults ApplicationGroupList) (result ApplicationGroupList, err error) { + req, err := lastResults.applicationGroupListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationGroupAssignmentsClient", "workspaceLevelListNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.WorkspaceLevelListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationGroupAssignmentsClient", "workspaceLevelListNextResults", resp, "Failure sending next results request") + } + result, err = client.WorkspaceLevelListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationGroupAssignmentsClient", "workspaceLevelListNextResults", resp, "Failure responding to next results request") + } + return +} + +// WorkspaceLevelListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ApplicationGroupAssignmentsClient) WorkspaceLevelListComplete(ctx context.Context, resourceGroupName string, workspaceName string, filter string) (result ApplicationGroupListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGroupAssignmentsClient.WorkspaceLevelList") + 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.WorkspaceLevelList(ctx, resourceGroupName, workspaceName, filter) + return +} diff --git a/services/preview/desktopvirtualization/mgmt/2019-12-10-preview/desktopvirtualization/applicationgroups.go b/services/preview/desktopvirtualization/mgmt/2019-12-10-preview/desktopvirtualization/applicationgroups.go new file mode 100644 index 000000000000..e82b9705ba2e --- /dev/null +++ b/services/preview/desktopvirtualization/mgmt/2019-12-10-preview/desktopvirtualization/applicationgroups.go @@ -0,0 +1,657 @@ +package desktopvirtualization + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// ApplicationGroupsClient is the client for the ApplicationGroups methods of the Desktopvirtualization service. +type ApplicationGroupsClient struct { + BaseClient +} + +// NewApplicationGroupsClient creates an instance of the ApplicationGroupsClient client. +func NewApplicationGroupsClient(subscriptionID string) ApplicationGroupsClient { + return NewApplicationGroupsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewApplicationGroupsClientWithBaseURI creates an instance of the ApplicationGroupsClient 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 NewApplicationGroupsClientWithBaseURI(baseURI string, subscriptionID string) ApplicationGroupsClient { + return ApplicationGroupsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create or update an applicationGroup. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// applicationGroupName - the name of the application group +// applicationGroup - object containing ApplicationGroup definitions. +func (client ApplicationGroupsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, applicationGroupName string, applicationGroup ApplicationGroup) (result ApplicationGroup, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGroupsClient.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: 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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: applicationGroupName, + Constraints: []validation.Constraint{{Target: "applicationGroupName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "applicationGroupName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: applicationGroup, + Constraints: []validation.Constraint{{Target: "applicationGroup.ApplicationGroupProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "applicationGroup.ApplicationGroupProperties.HostPoolArmPath", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.ApplicationGroupsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, applicationGroupName, applicationGroup) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationGroupsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationGroupsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationGroupsClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ApplicationGroupsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, applicationGroupName string, applicationGroup ApplicationGroup) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationGroupName": autorest.Encode("path", applicationGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-10-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.DesktopVirtualization/applicationGroups/{applicationGroupName}", pathParameters), + autorest.WithJSON(applicationGroup), + 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 ApplicationGroupsClient) 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 ApplicationGroupsClient) CreateOrUpdateResponder(resp *http.Response) (result ApplicationGroup, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete remove an applicationGroup. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// applicationGroupName - the name of the application group +func (client ApplicationGroupsClient) Delete(ctx context.Context, resourceGroupName string, applicationGroupName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGroupsClient.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: 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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: applicationGroupName, + Constraints: []validation.Constraint{{Target: "applicationGroupName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "applicationGroupName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.ApplicationGroupsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, applicationGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationGroupsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationGroupsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationGroupsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ApplicationGroupsClient) DeletePreparer(ctx context.Context, resourceGroupName string, applicationGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationGroupName": autorest.Encode("path", applicationGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-10-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.DesktopVirtualization/applicationGroups/{applicationGroupName}", 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 ApplicationGroupsClient) 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 ApplicationGroupsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get an application group. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// applicationGroupName - the name of the application group +func (client ApplicationGroupsClient) Get(ctx context.Context, resourceGroupName string, applicationGroupName string) (result ApplicationGroup, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGroupsClient.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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: applicationGroupName, + Constraints: []validation.Constraint{{Target: "applicationGroupName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "applicationGroupName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.ApplicationGroupsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, applicationGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationGroupsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationGroupsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationGroupsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ApplicationGroupsClient) GetPreparer(ctx context.Context, resourceGroupName string, applicationGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationGroupName": autorest.Encode("path", applicationGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-10-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.DesktopVirtualization/applicationGroups/{applicationGroupName}", 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 ApplicationGroupsClient) 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 ApplicationGroupsClient) GetResponder(resp *http.Response) (result ApplicationGroup, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByResourceGroup list applicationGroups. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// filter - oData filter expression. Valid properties for filtering are applicationGroupType. +func (client ApplicationGroupsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, filter string) (result ApplicationGroupListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGroupsClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.agl.Response.Response != nil { + sc = result.agl.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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.ApplicationGroupsClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationGroupsClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.agl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationGroupsClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.agl, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationGroupsClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client ApplicationGroupsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-10-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.DesktopVirtualization/applicationGroups", 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 ApplicationGroupsClient) 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 ApplicationGroupsClient) ListByResourceGroupResponder(resp *http.Response) (result ApplicationGroupList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 ApplicationGroupsClient) listByResourceGroupNextResults(ctx context.Context, lastResults ApplicationGroupList) (result ApplicationGroupList, err error) { + req, err := lastResults.applicationGroupListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationGroupsClient", "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, "desktopvirtualization.ApplicationGroupsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationGroupsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client ApplicationGroupsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, filter string) (result ApplicationGroupListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGroupsClient.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, filter) + return +} + +// ListBySubscription list applicationGroups in subscription. +// Parameters: +// filter - oData filter expression. Valid properties for filtering are applicationGroupType. +func (client ApplicationGroupsClient) ListBySubscription(ctx context.Context, filter string) (result ApplicationGroupListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGroupsClient.ListBySubscription") + defer func() { + sc := -1 + if result.agl.Response.Response != nil { + sc = result.agl.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("desktopvirtualization.ApplicationGroupsClient", "ListBySubscription", err.Error()) + } + + result.fn = client.listBySubscriptionNextResults + req, err := client.ListBySubscriptionPreparer(ctx, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationGroupsClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.agl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationGroupsClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result.agl, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationGroupsClient", "ListBySubscription", resp, "Failure responding to request") + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client ApplicationGroupsClient) ListBySubscriptionPreparer(ctx context.Context, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-10-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.DesktopVirtualization/applicationGroups", 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 ApplicationGroupsClient) 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 ApplicationGroupsClient) ListBySubscriptionResponder(resp *http.Response) (result ApplicationGroupList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 ApplicationGroupsClient) listBySubscriptionNextResults(ctx context.Context, lastResults ApplicationGroupList) (result ApplicationGroupList, err error) { + req, err := lastResults.applicationGroupListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationGroupsClient", "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, "desktopvirtualization.ApplicationGroupsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationGroupsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client ApplicationGroupsClient) ListBySubscriptionComplete(ctx context.Context, filter string) (result ApplicationGroupListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGroupsClient.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 +} + +// Update update an applicationGroup. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// applicationGroupName - the name of the application group +// applicationGroup - object containing ApplicationGroup definitions. +func (client ApplicationGroupsClient) Update(ctx context.Context, resourceGroupName string, applicationGroupName string, applicationGroup *ApplicationGroupPatch) (result ApplicationGroup, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGroupsClient.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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: applicationGroupName, + Constraints: []validation.Constraint{{Target: "applicationGroupName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "applicationGroupName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.ApplicationGroupsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, applicationGroupName, applicationGroup) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationGroupsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationGroupsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationGroupsClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ApplicationGroupsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, applicationGroupName string, applicationGroup *ApplicationGroupPatch) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationGroupName": autorest.Encode("path", applicationGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-10-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.DesktopVirtualization/applicationGroups/{applicationGroupName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if applicationGroup != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(applicationGroup)) + } + 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 ApplicationGroupsClient) 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 ApplicationGroupsClient) UpdateResponder(resp *http.Response) (result ApplicationGroup, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/desktopvirtualization/mgmt/2019-12-10-preview/desktopvirtualization/applications.go b/services/preview/desktopvirtualization/mgmt/2019-12-10-preview/desktopvirtualization/applications.go new file mode 100644 index 000000000000..79bde8120bd9 --- /dev/null +++ b/services/preview/desktopvirtualization/mgmt/2019-12-10-preview/desktopvirtualization/applications.go @@ -0,0 +1,556 @@ +package desktopvirtualization + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// ApplicationsClient is the client for the Applications methods of the Desktopvirtualization service. +type ApplicationsClient struct { + BaseClient +} + +// NewApplicationsClient creates an instance of the ApplicationsClient client. +func NewApplicationsClient(subscriptionID string) ApplicationsClient { + return NewApplicationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewApplicationsClientWithBaseURI creates an instance of the ApplicationsClient 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 NewApplicationsClientWithBaseURI(baseURI string, subscriptionID string) ApplicationsClient { + return ApplicationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create or update an application. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// applicationGroupName - the name of the application group +// applicationName - the name of the application within the specified application group +// application - object containing Application definitions. +func (client ApplicationsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, applicationGroupName string, applicationName string, application Application) (result Application, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationsClient.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: 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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: applicationGroupName, + Constraints: []validation.Constraint{{Target: "applicationGroupName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "applicationGroupName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: applicationName, + Constraints: []validation.Constraint{{Target: "applicationName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "applicationName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: application, + Constraints: []validation.Constraint{{Target: "application.ApplicationProperties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.ApplicationsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, applicationGroupName, applicationName, application) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationsClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ApplicationsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, applicationGroupName string, applicationName string, application Application) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationGroupName": autorest.Encode("path", applicationGroupName), + "applicationName": autorest.Encode("path", applicationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-10-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.DesktopVirtualization/applicationGroups/{applicationGroupName}/applications/{applicationName}", pathParameters), + autorest.WithJSON(application), + 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 ApplicationsClient) 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 ApplicationsClient) CreateOrUpdateResponder(resp *http.Response) (result Application, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete remove an application. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// applicationGroupName - the name of the application group +// applicationName - the name of the application within the specified application group +func (client ApplicationsClient) Delete(ctx context.Context, resourceGroupName string, applicationGroupName string, applicationName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationsClient.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: 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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: applicationGroupName, + Constraints: []validation.Constraint{{Target: "applicationGroupName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "applicationGroupName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: applicationName, + Constraints: []validation.Constraint{{Target: "applicationName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "applicationName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.ApplicationsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, applicationGroupName, applicationName) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ApplicationsClient) DeletePreparer(ctx context.Context, resourceGroupName string, applicationGroupName string, applicationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationGroupName": autorest.Encode("path", applicationGroupName), + "applicationName": autorest.Encode("path", applicationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-10-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.DesktopVirtualization/applicationGroups/{applicationGroupName}/applications/{applicationName}", 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 ApplicationsClient) 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 ApplicationsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get an application. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// applicationGroupName - the name of the application group +// applicationName - the name of the application within the specified application group +func (client ApplicationsClient) Get(ctx context.Context, resourceGroupName string, applicationGroupName string, applicationName string) (result Application, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationsClient.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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: applicationGroupName, + Constraints: []validation.Constraint{{Target: "applicationGroupName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "applicationGroupName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: applicationName, + Constraints: []validation.Constraint{{Target: "applicationName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "applicationName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.ApplicationsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, applicationGroupName, applicationName) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ApplicationsClient) GetPreparer(ctx context.Context, resourceGroupName string, applicationGroupName string, applicationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationGroupName": autorest.Encode("path", applicationGroupName), + "applicationName": autorest.Encode("path", applicationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-10-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.DesktopVirtualization/applicationGroups/{applicationGroupName}/applications/{applicationName}", 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 ApplicationsClient) 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 ApplicationsClient) GetResponder(resp *http.Response) (result Application, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List list applications. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// applicationGroupName - the name of the application group +func (client ApplicationsClient) List(ctx context.Context, resourceGroupName string, applicationGroupName string) (result ApplicationListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationsClient.List") + defer func() { + sc := -1 + if result.al.Response.Response != nil { + sc = result.al.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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: applicationGroupName, + Constraints: []validation.Constraint{{Target: "applicationGroupName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "applicationGroupName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.ApplicationsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, applicationGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.al.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationsClient", "List", resp, "Failure sending request") + return + } + + result.al, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client ApplicationsClient) ListPreparer(ctx context.Context, resourceGroupName string, applicationGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationGroupName": autorest.Encode("path", applicationGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-10-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.DesktopVirtualization/applicationGroups/{applicationGroupName}/applications", 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 ApplicationsClient) 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 ApplicationsClient) ListResponder(resp *http.Response) (result ApplicationList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 ApplicationsClient) listNextResults(ctx context.Context, lastResults ApplicationList) (result ApplicationList, err error) { + req, err := lastResults.applicationListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationsClient", "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, "desktopvirtualization.ApplicationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ApplicationsClient) ListComplete(ctx context.Context, resourceGroupName string, applicationGroupName string) (result ApplicationListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationsClient.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, applicationGroupName) + return +} + +// Update update an application. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// applicationGroupName - the name of the application group +// applicationName - the name of the application within the specified application group +// application - object containing Application definitions. +func (client ApplicationsClient) Update(ctx context.Context, resourceGroupName string, applicationGroupName string, applicationName string, application *ApplicationPatch) (result Application, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationsClient.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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: applicationGroupName, + Constraints: []validation.Constraint{{Target: "applicationGroupName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "applicationGroupName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: applicationName, + Constraints: []validation.Constraint{{Target: "applicationName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "applicationName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.ApplicationsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, applicationGroupName, applicationName, application) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.ApplicationsClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ApplicationsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, applicationGroupName string, applicationName string, application *ApplicationPatch) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationGroupName": autorest.Encode("path", applicationGroupName), + "applicationName": autorest.Encode("path", applicationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-10-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.DesktopVirtualization/applicationGroups/{applicationGroupName}/applications/{applicationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if application != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(application)) + } + 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 ApplicationsClient) 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 ApplicationsClient) UpdateResponder(resp *http.Response) (result Application, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/desktopvirtualization/mgmt/2019-12-10-preview/desktopvirtualization/client.go b/services/preview/desktopvirtualization/mgmt/2019-12-10-preview/desktopvirtualization/client.go new file mode 100644 index 000000000000..33a9c06d58e9 --- /dev/null +++ b/services/preview/desktopvirtualization/mgmt/2019-12-10-preview/desktopvirtualization/client.go @@ -0,0 +1,52 @@ +// Package desktopvirtualization implements the Azure ARM Desktopvirtualization service API version 2019-12-10-preview. +// +// +package desktopvirtualization + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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 Desktopvirtualization + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Desktopvirtualization. +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/desktopvirtualization/mgmt/2019-12-10-preview/desktopvirtualization/desktops.go b/services/preview/desktopvirtualization/mgmt/2019-12-10-preview/desktopvirtualization/desktops.go new file mode 100644 index 000000000000..cea23ace9a70 --- /dev/null +++ b/services/preview/desktopvirtualization/mgmt/2019-12-10-preview/desktopvirtualization/desktops.go @@ -0,0 +1,326 @@ +package desktopvirtualization + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// DesktopsClient is the client for the Desktops methods of the Desktopvirtualization service. +type DesktopsClient struct { + BaseClient +} + +// NewDesktopsClient creates an instance of the DesktopsClient client. +func NewDesktopsClient(subscriptionID string) DesktopsClient { + return NewDesktopsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDesktopsClientWithBaseURI creates an instance of the DesktopsClient 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 NewDesktopsClientWithBaseURI(baseURI string, subscriptionID string) DesktopsClient { + return DesktopsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get get a desktop. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// applicationGroupName - the name of the application group +// desktopName - the name of the desktop within the specified desktop group +func (client DesktopsClient) Get(ctx context.Context, resourceGroupName string, applicationGroupName string, desktopName string) (result Desktop, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DesktopsClient.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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: applicationGroupName, + Constraints: []validation.Constraint{{Target: "applicationGroupName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "applicationGroupName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: desktopName, + Constraints: []validation.Constraint{{Target: "desktopName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "desktopName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.DesktopsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, applicationGroupName, desktopName) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.DesktopsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.DesktopsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.DesktopsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client DesktopsClient) GetPreparer(ctx context.Context, resourceGroupName string, applicationGroupName string, desktopName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationGroupName": autorest.Encode("path", applicationGroupName), + "desktopName": autorest.Encode("path", desktopName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-10-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.DesktopVirtualization/applicationGroups/{applicationGroupName}/desktops/{desktopName}", 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 DesktopsClient) 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 DesktopsClient) GetResponder(resp *http.Response) (result Desktop, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List list desktops. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// applicationGroupName - the name of the application group +func (client DesktopsClient) List(ctx context.Context, resourceGroupName string, applicationGroupName string) (result DesktopList, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DesktopsClient.List") + defer func() { + 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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: applicationGroupName, + Constraints: []validation.Constraint{{Target: "applicationGroupName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "applicationGroupName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.DesktopsClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx, resourceGroupName, applicationGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.DesktopsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.DesktopsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.DesktopsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client DesktopsClient) ListPreparer(ctx context.Context, resourceGroupName string, applicationGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationGroupName": autorest.Encode("path", applicationGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-10-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.DesktopVirtualization/applicationGroups/{applicationGroupName}/desktops", 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 DesktopsClient) 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 DesktopsClient) ListResponder(resp *http.Response) (result DesktopList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update update a desktop. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// applicationGroupName - the name of the application group +// desktopName - the name of the desktop within the specified desktop group +// desktop - object containing Desktop definitions. +func (client DesktopsClient) Update(ctx context.Context, resourceGroupName string, applicationGroupName string, desktopName string, desktop *DesktopPatch) (result Desktop, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DesktopsClient.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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: applicationGroupName, + Constraints: []validation.Constraint{{Target: "applicationGroupName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "applicationGroupName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: desktopName, + Constraints: []validation.Constraint{{Target: "desktopName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "desktopName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.DesktopsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, applicationGroupName, desktopName, desktop) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.DesktopsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.DesktopsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.DesktopsClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client DesktopsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, applicationGroupName string, desktopName string, desktop *DesktopPatch) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationGroupName": autorest.Encode("path", applicationGroupName), + "desktopName": autorest.Encode("path", desktopName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-10-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.DesktopVirtualization/applicationGroups/{applicationGroupName}/desktops/{desktopName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if desktop != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(desktop)) + } + 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 DesktopsClient) 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 DesktopsClient) UpdateResponder(resp *http.Response) (result Desktop, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/desktopvirtualization/mgmt/2019-12-10-preview/desktopvirtualization/desktopvirtualizationapi/interfaces.go b/services/preview/desktopvirtualization/mgmt/2019-12-10-preview/desktopvirtualization/desktopvirtualizationapi/interfaces.go new file mode 100644 index 000000000000..4754971f8766 --- /dev/null +++ b/services/preview/desktopvirtualization/mgmt/2019-12-10-preview/desktopvirtualization/desktopvirtualizationapi/interfaces.go @@ -0,0 +1,143 @@ +package desktopvirtualizationapi + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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/desktopvirtualization/mgmt/2019-12-10-preview/desktopvirtualization" + "github.com/Azure/go-autorest/autorest" +) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result desktopvirtualization.ResourceProviderOperationList, err error) +} + +var _ OperationsClientAPI = (*desktopvirtualization.OperationsClient)(nil) + +// WorkspacesClientAPI contains the set of methods on the WorkspacesClient type. +type WorkspacesClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, workspace desktopvirtualization.Workspace) (result desktopvirtualization.Workspace, err error) + Delete(ctx context.Context, resourceGroupName string, workspaceName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, workspaceName string) (result desktopvirtualization.Workspace, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result desktopvirtualization.WorkspaceListPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result desktopvirtualization.WorkspaceListIterator, err error) + ListBySubscription(ctx context.Context) (result desktopvirtualization.WorkspaceListPage, err error) + ListBySubscriptionComplete(ctx context.Context) (result desktopvirtualization.WorkspaceListIterator, err error) + Update(ctx context.Context, resourceGroupName string, workspaceName string, workspace *desktopvirtualization.WorkspacePatch) (result desktopvirtualization.Workspace, err error) +} + +var _ WorkspacesClientAPI = (*desktopvirtualization.WorkspacesClient)(nil) + +// ApplicationGroupAssignmentsClientAPI contains the set of methods on the ApplicationGroupAssignmentsClient type. +type ApplicationGroupAssignmentsClientAPI interface { + WorkspaceLevelList(ctx context.Context, resourceGroupName string, workspaceName string, filter string) (result desktopvirtualization.ApplicationGroupListPage, err error) + WorkspaceLevelListComplete(ctx context.Context, resourceGroupName string, workspaceName string, filter string) (result desktopvirtualization.ApplicationGroupListIterator, err error) +} + +var _ ApplicationGroupAssignmentsClientAPI = (*desktopvirtualization.ApplicationGroupAssignmentsClient)(nil) + +// ApplicationGroupsClientAPI contains the set of methods on the ApplicationGroupsClient type. +type ApplicationGroupsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, applicationGroupName string, applicationGroup desktopvirtualization.ApplicationGroup) (result desktopvirtualization.ApplicationGroup, err error) + Delete(ctx context.Context, resourceGroupName string, applicationGroupName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, applicationGroupName string) (result desktopvirtualization.ApplicationGroup, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string, filter string) (result desktopvirtualization.ApplicationGroupListPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, filter string) (result desktopvirtualization.ApplicationGroupListIterator, err error) + ListBySubscription(ctx context.Context, filter string) (result desktopvirtualization.ApplicationGroupListPage, err error) + ListBySubscriptionComplete(ctx context.Context, filter string) (result desktopvirtualization.ApplicationGroupListIterator, err error) + Update(ctx context.Context, resourceGroupName string, applicationGroupName string, applicationGroup *desktopvirtualization.ApplicationGroupPatch) (result desktopvirtualization.ApplicationGroup, err error) +} + +var _ ApplicationGroupsClientAPI = (*desktopvirtualization.ApplicationGroupsClient)(nil) + +// StartMenuItemsClientAPI contains the set of methods on the StartMenuItemsClient type. +type StartMenuItemsClientAPI interface { + List(ctx context.Context, resourceGroupName string, applicationGroupName string) (result desktopvirtualization.StartMenuItemListPage, err error) + ListComplete(ctx context.Context, resourceGroupName string, applicationGroupName string) (result desktopvirtualization.StartMenuItemListIterator, err error) +} + +var _ StartMenuItemsClientAPI = (*desktopvirtualization.StartMenuItemsClient)(nil) + +// ApplicationsClientAPI contains the set of methods on the ApplicationsClient type. +type ApplicationsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, applicationGroupName string, applicationName string, application desktopvirtualization.Application) (result desktopvirtualization.Application, err error) + Delete(ctx context.Context, resourceGroupName string, applicationGroupName string, applicationName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, applicationGroupName string, applicationName string) (result desktopvirtualization.Application, err error) + List(ctx context.Context, resourceGroupName string, applicationGroupName string) (result desktopvirtualization.ApplicationListPage, err error) + ListComplete(ctx context.Context, resourceGroupName string, applicationGroupName string) (result desktopvirtualization.ApplicationListIterator, err error) + Update(ctx context.Context, resourceGroupName string, applicationGroupName string, applicationName string, application *desktopvirtualization.ApplicationPatch) (result desktopvirtualization.Application, err error) +} + +var _ ApplicationsClientAPI = (*desktopvirtualization.ApplicationsClient)(nil) + +// DesktopsClientAPI contains the set of methods on the DesktopsClient type. +type DesktopsClientAPI interface { + Get(ctx context.Context, resourceGroupName string, applicationGroupName string, desktopName string) (result desktopvirtualization.Desktop, err error) + List(ctx context.Context, resourceGroupName string, applicationGroupName string) (result desktopvirtualization.DesktopList, err error) + Update(ctx context.Context, resourceGroupName string, applicationGroupName string, desktopName string, desktop *desktopvirtualization.DesktopPatch) (result desktopvirtualization.Desktop, err error) +} + +var _ DesktopsClientAPI = (*desktopvirtualization.DesktopsClient)(nil) + +// HostPoolsClientAPI contains the set of methods on the HostPoolsClient type. +type HostPoolsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, hostPoolName string, hostPool desktopvirtualization.HostPool) (result desktopvirtualization.HostPool, err error) + Delete(ctx context.Context, resourceGroupName string, hostPoolName string, force *bool) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, hostPoolName string) (result desktopvirtualization.HostPool, err error) + List(ctx context.Context) (result desktopvirtualization.HostPoolListPage, err error) + ListComplete(ctx context.Context) (result desktopvirtualization.HostPoolListIterator, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result desktopvirtualization.HostPoolListPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result desktopvirtualization.HostPoolListIterator, err error) + Update(ctx context.Context, resourceGroupName string, hostPoolName string, hostPool *desktopvirtualization.HostPoolPatch) (result desktopvirtualization.HostPool, err error) +} + +var _ HostPoolsClientAPI = (*desktopvirtualization.HostPoolsClient)(nil) + +// UserSessionsClientAPI contains the set of methods on the UserSessionsClient type. +type UserSessionsClientAPI interface { + Delete(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string, userSessionID string, force *bool) (result autorest.Response, err error) + Disconnect(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string, userSessionID string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string, userSessionID string) (result desktopvirtualization.UserSession, err error) + List(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string) (result desktopvirtualization.UserSessionListPage, err error) + ListComplete(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string) (result desktopvirtualization.UserSessionListIterator, err error) + ListByHostPool(ctx context.Context, resourceGroupName string, hostPoolName string, filter string) (result desktopvirtualization.UserSessionListPage, err error) + ListByHostPoolComplete(ctx context.Context, resourceGroupName string, hostPoolName string, filter string) (result desktopvirtualization.UserSessionListIterator, err error) + SendMessageMethod(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string, userSessionID string, sendMessage *desktopvirtualization.SendMessage) (result autorest.Response, err error) +} + +var _ UserSessionsClientAPI = (*desktopvirtualization.UserSessionsClient)(nil) + +// SessionHostsClientAPI contains the set of methods on the SessionHostsClient type. +type SessionHostsClientAPI interface { + Delete(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string, force *bool) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string) (result desktopvirtualization.SessionHost, err error) + List(ctx context.Context, resourceGroupName string, hostPoolName string) (result desktopvirtualization.SessionHostListPage, err error) + ListComplete(ctx context.Context, resourceGroupName string, hostPoolName string) (result desktopvirtualization.SessionHostListIterator, err error) + Update(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string, sessionHost *desktopvirtualization.SessionHostPatch) (result desktopvirtualization.SessionHost, err error) +} + +var _ SessionHostsClientAPI = (*desktopvirtualization.SessionHostsClient)(nil) + +// ActiveApplicationsClientAPI contains the set of methods on the ActiveApplicationsClient type. +type ActiveApplicationsClientAPI interface { + ListBySessionHost(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string, filter string) (result desktopvirtualization.ApplicationListPage, err error) + ListBySessionHostComplete(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string, filter string) (result desktopvirtualization.ApplicationListIterator, err error) +} + +var _ ActiveApplicationsClientAPI = (*desktopvirtualization.ActiveApplicationsClient)(nil) diff --git a/services/preview/desktopvirtualization/mgmt/2019-12-10-preview/desktopvirtualization/hostpools.go b/services/preview/desktopvirtualization/mgmt/2019-12-10-preview/desktopvirtualization/hostpools.go new file mode 100644 index 000000000000..ac7345f2df71 --- /dev/null +++ b/services/preview/desktopvirtualization/mgmt/2019-12-10-preview/desktopvirtualization/hostpools.go @@ -0,0 +1,650 @@ +package desktopvirtualization + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// HostPoolsClient is the client for the HostPools methods of the Desktopvirtualization service. +type HostPoolsClient struct { + BaseClient +} + +// NewHostPoolsClient creates an instance of the HostPoolsClient client. +func NewHostPoolsClient(subscriptionID string) HostPoolsClient { + return NewHostPoolsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewHostPoolsClientWithBaseURI creates an instance of the HostPoolsClient 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 NewHostPoolsClientWithBaseURI(baseURI string, subscriptionID string) HostPoolsClient { + return HostPoolsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create or update a host pool. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// hostPoolName - the name of the host pool within the specified resource group +// hostPool - object containing HostPool definitions. +func (client HostPoolsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, hostPoolName string, hostPool HostPool) (result HostPool, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/HostPoolsClient.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: 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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: hostPoolName, + Constraints: []validation.Constraint{{Target: "hostPoolName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "hostPoolName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: hostPool, + Constraints: []validation.Constraint{{Target: "hostPool.HostPoolProperties", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.HostPoolsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, hostPoolName, hostPool) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.HostPoolsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.HostPoolsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.HostPoolsClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client HostPoolsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, hostPoolName string, hostPool HostPool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "hostPoolName": autorest.Encode("path", hostPoolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-10-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.DesktopVirtualization/hostPools/{hostPoolName}", pathParameters), + autorest.WithJSON(hostPool), + 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 HostPoolsClient) 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 HostPoolsClient) CreateOrUpdateResponder(resp *http.Response) (result HostPool, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete remove a host pool. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// hostPoolName - the name of the host pool within the specified resource group +// force - force flag to delete sessionHost. +func (client HostPoolsClient) Delete(ctx context.Context, resourceGroupName string, hostPoolName string, force *bool) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/HostPoolsClient.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: 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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: hostPoolName, + Constraints: []validation.Constraint{{Target: "hostPoolName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "hostPoolName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.HostPoolsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, hostPoolName, force) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.HostPoolsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "desktopvirtualization.HostPoolsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.HostPoolsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client HostPoolsClient) DeletePreparer(ctx context.Context, resourceGroupName string, hostPoolName string, force *bool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "hostPoolName": autorest.Encode("path", hostPoolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-10-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if force != nil { + queryParameters["force"] = autorest.Encode("query", *force) + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}", 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 HostPoolsClient) 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 HostPoolsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get a host pool. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// hostPoolName - the name of the host pool within the specified resource group +func (client HostPoolsClient) Get(ctx context.Context, resourceGroupName string, hostPoolName string) (result HostPool, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/HostPoolsClient.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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: hostPoolName, + Constraints: []validation.Constraint{{Target: "hostPoolName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "hostPoolName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.HostPoolsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, hostPoolName) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.HostPoolsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.HostPoolsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.HostPoolsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client HostPoolsClient) GetPreparer(ctx context.Context, resourceGroupName string, hostPoolName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "hostPoolName": autorest.Encode("path", hostPoolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-10-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.DesktopVirtualization/hostPools/{hostPoolName}", 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 HostPoolsClient) 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 HostPoolsClient) GetResponder(resp *http.Response) (result HostPool, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List list hostPools in subscription. +func (client HostPoolsClient) List(ctx context.Context) (result HostPoolListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/HostPoolsClient.List") + defer func() { + sc := -1 + if result.hpl.Response.Response != nil { + sc = result.hpl.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("desktopvirtualization.HostPoolsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.HostPoolsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.hpl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.HostPoolsClient", "List", resp, "Failure sending request") + return + } + + result.hpl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.HostPoolsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client HostPoolsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-10-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DesktopVirtualization/hostPools", 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 HostPoolsClient) 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 HostPoolsClient) ListResponder(resp *http.Response) (result HostPoolList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 HostPoolsClient) listNextResults(ctx context.Context, lastResults HostPoolList) (result HostPoolList, err error) { + req, err := lastResults.hostPoolListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "desktopvirtualization.HostPoolsClient", "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, "desktopvirtualization.HostPoolsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.HostPoolsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client HostPoolsClient) ListComplete(ctx context.Context) (result HostPoolListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/HostPoolsClient.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 list hostPools. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +func (client HostPoolsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result HostPoolListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/HostPoolsClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.hpl.Response.Response != nil { + sc = result.hpl.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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.HostPoolsClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.HostPoolsClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.hpl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.HostPoolsClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.hpl, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.HostPoolsClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client HostPoolsClient) 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 = "2019-12-10-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.DesktopVirtualization/hostPools", 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 HostPoolsClient) 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 HostPoolsClient) ListByResourceGroupResponder(resp *http.Response) (result HostPoolList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 HostPoolsClient) listByResourceGroupNextResults(ctx context.Context, lastResults HostPoolList) (result HostPoolList, err error) { + req, err := lastResults.hostPoolListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "desktopvirtualization.HostPoolsClient", "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, "desktopvirtualization.HostPoolsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.HostPoolsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client HostPoolsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result HostPoolListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/HostPoolsClient.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 update a host pool. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// hostPoolName - the name of the host pool within the specified resource group +// hostPool - object containing HostPool definitions. +func (client HostPoolsClient) Update(ctx context.Context, resourceGroupName string, hostPoolName string, hostPool *HostPoolPatch) (result HostPool, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/HostPoolsClient.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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: hostPoolName, + Constraints: []validation.Constraint{{Target: "hostPoolName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "hostPoolName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.HostPoolsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, hostPoolName, hostPool) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.HostPoolsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.HostPoolsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.HostPoolsClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client HostPoolsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, hostPoolName string, hostPool *HostPoolPatch) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "hostPoolName": autorest.Encode("path", hostPoolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-10-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.DesktopVirtualization/hostPools/{hostPoolName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if hostPool != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(hostPool)) + } + 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 HostPoolsClient) 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 HostPoolsClient) UpdateResponder(resp *http.Response) (result HostPool, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/desktopvirtualization/mgmt/2019-12-10-preview/desktopvirtualization/models.go b/services/preview/desktopvirtualization/mgmt/2019-12-10-preview/desktopvirtualization/models.go new file mode 100644 index 000000000000..dca7bcc762d1 --- /dev/null +++ b/services/preview/desktopvirtualization/mgmt/2019-12-10-preview/desktopvirtualization/models.go @@ -0,0 +1,2656 @@ +package desktopvirtualization + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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/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/desktopvirtualization/mgmt/2019-12-10-preview/desktopvirtualization" + +// ApplicationGroupType enumerates the values for application group type. +type ApplicationGroupType string + +const ( + // ApplicationGroupTypeDesktop ... + ApplicationGroupTypeDesktop ApplicationGroupType = "Desktop" + // ApplicationGroupTypeRemoteApp ... + ApplicationGroupTypeRemoteApp ApplicationGroupType = "RemoteApp" +) + +// PossibleApplicationGroupTypeValues returns an array of possible values for the ApplicationGroupType const type. +func PossibleApplicationGroupTypeValues() []ApplicationGroupType { + return []ApplicationGroupType{ApplicationGroupTypeDesktop, ApplicationGroupTypeRemoteApp} +} + +// ApplicationType enumerates the values for application type. +type ApplicationType string + +const ( + // ApplicationTypeDesktop ... + ApplicationTypeDesktop ApplicationType = "Desktop" + // ApplicationTypeRemoteApp ... + ApplicationTypeRemoteApp ApplicationType = "RemoteApp" +) + +// PossibleApplicationTypeValues returns an array of possible values for the ApplicationType const type. +func PossibleApplicationTypeValues() []ApplicationType { + return []ApplicationType{ApplicationTypeDesktop, ApplicationTypeRemoteApp} +} + +// CommandLineSetting enumerates the values for command line setting. +type CommandLineSetting string + +const ( + // Allow ... + Allow CommandLineSetting = "Allow" + // DoNotAllow ... + DoNotAllow CommandLineSetting = "DoNotAllow" + // Require ... + Require CommandLineSetting = "Require" +) + +// PossibleCommandLineSettingValues returns an array of possible values for the CommandLineSetting const type. +func PossibleCommandLineSettingValues() []CommandLineSetting { + return []CommandLineSetting{Allow, DoNotAllow, Require} +} + +// HostPoolType enumerates the values for host pool type. +type HostPoolType string + +const ( + // Personal ... + Personal HostPoolType = "Personal" + // Pooled ... + Pooled HostPoolType = "Pooled" +) + +// PossibleHostPoolTypeValues returns an array of possible values for the HostPoolType const type. +func PossibleHostPoolTypeValues() []HostPoolType { + return []HostPoolType{Personal, Pooled} +} + +// LoadBalancerType enumerates the values for load balancer type. +type LoadBalancerType string + +const ( + // BreadthFirst ... + BreadthFirst LoadBalancerType = "BreadthFirst" + // DepthFirst ... + DepthFirst LoadBalancerType = "DepthFirst" + // Persistent ... + Persistent LoadBalancerType = "Persistent" +) + +// PossibleLoadBalancerTypeValues returns an array of possible values for the LoadBalancerType const type. +func PossibleLoadBalancerTypeValues() []LoadBalancerType { + return []LoadBalancerType{BreadthFirst, DepthFirst, Persistent} +} + +// PersonalDesktopAssignmentType enumerates the values for personal desktop assignment type. +type PersonalDesktopAssignmentType string + +const ( + // Automatic ... + Automatic PersonalDesktopAssignmentType = "Automatic" + // Direct ... + Direct PersonalDesktopAssignmentType = "Direct" +) + +// PossiblePersonalDesktopAssignmentTypeValues returns an array of possible values for the PersonalDesktopAssignmentType const type. +func PossiblePersonalDesktopAssignmentTypeValues() []PersonalDesktopAssignmentType { + return []PersonalDesktopAssignmentType{Automatic, Direct} +} + +// RegistrationTokenOperation enumerates the values for registration token operation. +type RegistrationTokenOperation string + +const ( + // Delete ... + Delete RegistrationTokenOperation = "Delete" + // None ... + None RegistrationTokenOperation = "None" + // Update ... + Update RegistrationTokenOperation = "Update" +) + +// PossibleRegistrationTokenOperationValues returns an array of possible values for the RegistrationTokenOperation const type. +func PossibleRegistrationTokenOperationValues() []RegistrationTokenOperation { + return []RegistrationTokenOperation{Delete, None, Update} +} + +// SessionState enumerates the values for session state. +type SessionState string + +const ( + // Active ... + Active SessionState = "Active" + // Disconnected ... + Disconnected SessionState = "Disconnected" + // LogOff ... + LogOff SessionState = "LogOff" + // Pending ... + Pending SessionState = "Pending" + // Unknown ... + Unknown SessionState = "Unknown" + // UserProfileDiskMounted ... + UserProfileDiskMounted SessionState = "UserProfileDiskMounted" +) + +// PossibleSessionStateValues returns an array of possible values for the SessionState const type. +func PossibleSessionStateValues() []SessionState { + return []SessionState{Active, Disconnected, LogOff, Pending, Unknown, UserProfileDiskMounted} +} + +// Status enumerates the values for status. +type Status string + +const ( + // StatusAvailable ... + StatusAvailable Status = "Available" + // StatusDisconnected ... + StatusDisconnected Status = "Disconnected" + // StatusShutdown ... + StatusShutdown Status = "Shutdown" + // StatusUnavailable ... + StatusUnavailable Status = "Unavailable" + // StatusUpgradeFailed ... + StatusUpgradeFailed Status = "UpgradeFailed" + // StatusUpgrading ... + StatusUpgrading Status = "Upgrading" +) + +// PossibleStatusValues returns an array of possible values for the Status const type. +func PossibleStatusValues() []Status { + return []Status{StatusAvailable, StatusDisconnected, StatusShutdown, StatusUnavailable, StatusUpgradeFailed, StatusUpgrading} +} + +// UpdateState enumerates the values for update state. +type UpdateState string + +const ( + // UpdateStateFailed ... + UpdateStateFailed UpdateState = "Failed" + // UpdateStateInitial ... + UpdateStateInitial UpdateState = "Initial" + // UpdateStatePending ... + UpdateStatePending UpdateState = "Pending" + // UpdateStateStarted ... + UpdateStateStarted UpdateState = "Started" + // UpdateStateSucceeded ... + UpdateStateSucceeded UpdateState = "Succeeded" +) + +// PossibleUpdateStateValues returns an array of possible values for the UpdateState const type. +func PossibleUpdateStateValues() []UpdateState { + return []UpdateState{UpdateStateFailed, UpdateStateInitial, UpdateStatePending, UpdateStateStarted, UpdateStateSucceeded} +} + +// Application schema for Application properties. +type Application struct { + autorest.Response `json:"-"` + // ApplicationProperties - Detailed properties for Application + *ApplicationProperties `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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Application. +func (a Application) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if a.ApplicationProperties != nil { + objectMap["properties"] = a.ApplicationProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Application struct. +func (a *Application) 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 applicationProperties ApplicationProperties + err = json.Unmarshal(*v, &applicationProperties) + if err != nil { + return err + } + a.ApplicationProperties = &applicationProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + a.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + a.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + a.Type = &typeVar + } + } + } + + return nil +} + +// ApplicationGroup represents a ApplicationGroup definition. +type ApplicationGroup struct { + autorest.Response `json:"-"` + // ApplicationGroupProperties - Detailed properties for ApplicationGroup + *ApplicationGroupProperties `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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ApplicationGroup. +func (ag ApplicationGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ag.ApplicationGroupProperties != nil { + objectMap["properties"] = ag.ApplicationGroupProperties + } + if ag.Tags != nil { + objectMap["tags"] = ag.Tags + } + if ag.Location != nil { + objectMap["location"] = ag.Location + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ApplicationGroup struct. +func (ag *ApplicationGroup) 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 applicationGroupProperties ApplicationGroupProperties + err = json.Unmarshal(*v, &applicationGroupProperties) + if err != nil { + return err + } + ag.ApplicationGroupProperties = &applicationGroupProperties + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + ag.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + ag.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ag.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ag.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ag.Type = &typeVar + } + } + } + + return nil +} + +// ApplicationGroupList list of ApplicationGroup definitions. +type ApplicationGroupList struct { + autorest.Response `json:"-"` + // Value - List of ApplicationGroup definitions. + Value *[]ApplicationGroup `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to the next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// ApplicationGroupListIterator provides access to a complete listing of ApplicationGroup values. +type ApplicationGroupListIterator struct { + i int + page ApplicationGroupListPage +} + +// 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 *ApplicationGroupListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGroupListIterator.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 *ApplicationGroupListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ApplicationGroupListIterator) 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 ApplicationGroupListIterator) Response() ApplicationGroupList { + 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 ApplicationGroupListIterator) Value() ApplicationGroup { + if !iter.page.NotDone() { + return ApplicationGroup{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ApplicationGroupListIterator type. +func NewApplicationGroupListIterator(page ApplicationGroupListPage) ApplicationGroupListIterator { + return ApplicationGroupListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (agl ApplicationGroupList) IsEmpty() bool { + return agl.Value == nil || len(*agl.Value) == 0 +} + +// applicationGroupListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (agl ApplicationGroupList) applicationGroupListPreparer(ctx context.Context) (*http.Request, error) { + if agl.NextLink == nil || len(to.String(agl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(agl.NextLink))) +} + +// ApplicationGroupListPage contains a page of ApplicationGroup values. +type ApplicationGroupListPage struct { + fn func(context.Context, ApplicationGroupList) (ApplicationGroupList, error) + agl ApplicationGroupList +} + +// 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 *ApplicationGroupListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationGroupListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.agl) + if err != nil { + return err + } + page.agl = next + 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 *ApplicationGroupListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ApplicationGroupListPage) NotDone() bool { + return !page.agl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ApplicationGroupListPage) Response() ApplicationGroupList { + return page.agl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ApplicationGroupListPage) Values() []ApplicationGroup { + if page.agl.IsEmpty() { + return nil + } + return *page.agl.Value +} + +// Creates a new instance of the ApplicationGroupListPage type. +func NewApplicationGroupListPage(getNextPage func(context.Context, ApplicationGroupList) (ApplicationGroupList, error)) ApplicationGroupListPage { + return ApplicationGroupListPage{fn: getNextPage} +} + +// ApplicationGroupPatch applicationGroup properties that can be patched. +type ApplicationGroupPatch struct { + // Tags - tags to be updated + Tags interface{} `json:"tags,omitempty"` + // ApplicationGroupPatchProperties - ApplicationGroup properties that can be patched. + *ApplicationGroupPatchProperties `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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ApplicationGroupPatch. +func (agp ApplicationGroupPatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if agp.Tags != nil { + objectMap["tags"] = agp.Tags + } + if agp.ApplicationGroupPatchProperties != nil { + objectMap["properties"] = agp.ApplicationGroupPatchProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ApplicationGroupPatch struct. +func (agp *ApplicationGroupPatch) 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 interface{} + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + agp.Tags = tags + } + case "properties": + if v != nil { + var applicationGroupPatchProperties ApplicationGroupPatchProperties + err = json.Unmarshal(*v, &applicationGroupPatchProperties) + if err != nil { + return err + } + agp.ApplicationGroupPatchProperties = &applicationGroupPatchProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + agp.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + agp.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + agp.Type = &typeVar + } + } + } + + return nil +} + +// ApplicationGroupPatchProperties applicationGroup properties that can be patched. +type ApplicationGroupPatchProperties struct { + // Description - Description of ApplicationGroup. + Description *string `json:"description,omitempty"` + // FriendlyName - Friendly name of ApplicationGroup. + FriendlyName *string `json:"friendlyName,omitempty"` +} + +// ApplicationGroupProperties schema for ApplicationGroup properties. +type ApplicationGroupProperties struct { + // Description - Description of ApplicationGroup. + Description *string `json:"description,omitempty"` + // FriendlyName - Friendly name of ApplicationGroup. + FriendlyName *string `json:"friendlyName,omitempty"` + // HostPoolArmPath - HostPool arm path of ApplicationGroup. + HostPoolArmPath *string `json:"hostPoolArmPath,omitempty"` + // WorkspaceArmPath - READ-ONLY; Workspace arm path of ApplicationGroup. + WorkspaceArmPath *string `json:"workspaceArmPath,omitempty"` + // ApplicationGroupType - Resource Type of ApplicationGroup. Possible values include: 'ApplicationGroupTypeRemoteApp', 'ApplicationGroupTypeDesktop' + ApplicationGroupType ApplicationGroupType `json:"applicationGroupType,omitempty"` +} + +// ApplicationList list of Application definitions. +type ApplicationList struct { + autorest.Response `json:"-"` + // Value - List of Application definitions. + Value *[]Application `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to the next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// ApplicationListIterator provides access to a complete listing of Application values. +type ApplicationListIterator struct { + i int + page ApplicationListPage +} + +// 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 *ApplicationListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationListIterator.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 *ApplicationListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ApplicationListIterator) 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 ApplicationListIterator) Response() ApplicationList { + 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 ApplicationListIterator) Value() Application { + if !iter.page.NotDone() { + return Application{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ApplicationListIterator type. +func NewApplicationListIterator(page ApplicationListPage) ApplicationListIterator { + return ApplicationListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (al ApplicationList) IsEmpty() bool { + return al.Value == nil || len(*al.Value) == 0 +} + +// applicationListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (al ApplicationList) applicationListPreparer(ctx context.Context) (*http.Request, error) { + if al.NextLink == nil || len(to.String(al.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(al.NextLink))) +} + +// ApplicationListPage contains a page of Application values. +type ApplicationListPage struct { + fn func(context.Context, ApplicationList) (ApplicationList, error) + al ApplicationList +} + +// 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 *ApplicationListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.al) + if err != nil { + return err + } + page.al = next + 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 *ApplicationListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ApplicationListPage) NotDone() bool { + return !page.al.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ApplicationListPage) Response() ApplicationList { + return page.al +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ApplicationListPage) Values() []Application { + if page.al.IsEmpty() { + return nil + } + return *page.al.Value +} + +// Creates a new instance of the ApplicationListPage type. +func NewApplicationListPage(getNextPage func(context.Context, ApplicationList) (ApplicationList, error)) ApplicationListPage { + return ApplicationListPage{fn: getNextPage} +} + +// ApplicationPatch application properties that can be patched. +type ApplicationPatch struct { + // Tags - tags to be updated + Tags interface{} `json:"tags,omitempty"` + // ApplicationPatchProperties - Detailed properties for Application + *ApplicationPatchProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ApplicationPatch. +func (ap ApplicationPatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ap.Tags != nil { + objectMap["tags"] = ap.Tags + } + if ap.ApplicationPatchProperties != nil { + objectMap["properties"] = ap.ApplicationPatchProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ApplicationPatch struct. +func (ap *ApplicationPatch) 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 interface{} + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + ap.Tags = tags + } + case "properties": + if v != nil { + var applicationPatchProperties ApplicationPatchProperties + err = json.Unmarshal(*v, &applicationPatchProperties) + if err != nil { + return err + } + ap.ApplicationPatchProperties = &applicationPatchProperties + } + } + } + + return nil +} + +// ApplicationPatchProperties application properties that can be patched. +type ApplicationPatchProperties struct { + // Description - Description of Application. + Description *string `json:"description,omitempty"` + // FriendlyName - Friendly name of Application. + FriendlyName *string `json:"friendlyName,omitempty"` + // FilePath - Specifies a path for the executable file for the application. + FilePath *string `json:"filePath,omitempty"` + // CommandLineSetting - Specifies whether this published application can be launched with command line arguments provided by the client, command line arguments specified at publish time, or no command line arguments at all. Possible values include: 'DoNotAllow', 'Allow', 'Require' + CommandLineSetting CommandLineSetting `json:"commandLineSetting,omitempty"` + // CommandLineArguments - Command Line Arguments for Application. + CommandLineArguments *string `json:"commandLineArguments,omitempty"` + // ShowInPortal - Specifies whether to show the RemoteApp program in the RD Web Access server. + ShowInPortal *bool `json:"showInPortal,omitempty"` + // IconPath - Path to icon. + IconPath *string `json:"iconPath,omitempty"` + // IconIndex - Index of the icon. + IconIndex *int32 `json:"iconIndex,omitempty"` +} + +// ApplicationProperties schema for Application properties. +type ApplicationProperties struct { + // Description - Description of Application. + Description *string `json:"description,omitempty"` + // FriendlyName - Friendly name of Application. + FriendlyName *string `json:"friendlyName,omitempty"` + // FilePath - Specifies a path for the executable file for the application. + FilePath *string `json:"filePath,omitempty"` + // CommandLineSetting - Specifies whether this published application can be launched with command line arguments provided by the client, command line arguments specified at publish time, or no command line arguments at all. Possible values include: 'DoNotAllow', 'Allow', 'Require' + CommandLineSetting CommandLineSetting `json:"commandLineSetting,omitempty"` + // CommandLineArguments - Command Line Arguments for Application. + CommandLineArguments *string `json:"commandLineArguments,omitempty"` + // ShowInPortal - Specifies whether to show the RemoteApp program in the RD Web Access server. + ShowInPortal *bool `json:"showInPortal,omitempty"` + // IconPath - Path to icon. + IconPath *string `json:"iconPath,omitempty"` + // IconIndex - Index of the icon. + IconIndex *int32 `json:"iconIndex,omitempty"` + // IconHash - READ-ONLY; Hash of the icon. + IconHash *string `json:"iconHash,omitempty"` + // IconContent - READ-ONLY; the icon a 64 bit string as a byte array. + IconContent *[]byte `json:"iconContent,omitempty"` +} + +// AzureEntityResource the resource model definition for a 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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// CloudError error response of an operation failure +type CloudError struct { + // Code - Error code + Code *string `json:"code,omitempty"` + // Message - Error message indicating why the operation failed. + Message *string `json:"message,omitempty"` +} + +// Desktop schema for Desktop properties. +type Desktop struct { + autorest.Response `json:"-"` + // DesktopProperties - Detailed properties for Desktop + *DesktopProperties `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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Desktop. +func (d Desktop) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if d.DesktopProperties != nil { + objectMap["properties"] = d.DesktopProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Desktop struct. +func (d *Desktop) 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 desktopProperties DesktopProperties + err = json.Unmarshal(*v, &desktopProperties) + if err != nil { + return err + } + d.DesktopProperties = &desktopProperties + } + 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 "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + d.Type = &typeVar + } + } + } + + return nil +} + +// DesktopList list of Desktop definitions. +type DesktopList struct { + autorest.Response `json:"-"` + // Value - List of Desktop definitions. + Value *[]Desktop `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to the next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// DesktopPatch desktop properties that can be patched. +type DesktopPatch struct { + // Tags - tags to be updated + Tags interface{} `json:"tags,omitempty"` + // DesktopPatchProperties - Detailed properties for Desktop + *DesktopPatchProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for DesktopPatch. +func (dp DesktopPatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dp.Tags != nil { + objectMap["tags"] = dp.Tags + } + if dp.DesktopPatchProperties != nil { + objectMap["properties"] = dp.DesktopPatchProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DesktopPatch struct. +func (dp *DesktopPatch) 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 interface{} + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + dp.Tags = tags + } + case "properties": + if v != nil { + var desktopPatchProperties DesktopPatchProperties + err = json.Unmarshal(*v, &desktopPatchProperties) + if err != nil { + return err + } + dp.DesktopPatchProperties = &desktopPatchProperties + } + } + } + + return nil +} + +// DesktopPatchProperties desktop properties that can be patched. +type DesktopPatchProperties struct { + // Description - Description of Desktop. + Description *string `json:"description,omitempty"` + // FriendlyName - Friendly name of Desktop. + FriendlyName *string `json:"friendlyName,omitempty"` +} + +// DesktopProperties schema for Desktop properties. +type DesktopProperties struct { + // Description - Description of Desktop. + Description *string `json:"description,omitempty"` + // FriendlyName - Friendly name of Desktop. + FriendlyName *string `json:"friendlyName,omitempty"` + // IconHash - READ-ONLY; Hash of the icon. + IconHash *string `json:"iconHash,omitempty"` + // IconContent - READ-ONLY; The icon a 64 bit string as a byte array. + IconContent *[]byte `json:"iconContent,omitempty"` +} + +// HostPool represents a HostPool definition. +type HostPool struct { + autorest.Response `json:"-"` + // HostPoolProperties - Detailed properties for HostPool + *HostPoolProperties `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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for HostPool. +func (hp HostPool) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if hp.HostPoolProperties != nil { + objectMap["properties"] = hp.HostPoolProperties + } + if hp.Tags != nil { + objectMap["tags"] = hp.Tags + } + if hp.Location != nil { + objectMap["location"] = hp.Location + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for HostPool struct. +func (hp *HostPool) 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 hostPoolProperties HostPoolProperties + err = json.Unmarshal(*v, &hostPoolProperties) + if err != nil { + return err + } + hp.HostPoolProperties = &hostPoolProperties + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + hp.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + hp.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + hp.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + hp.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + hp.Type = &typeVar + } + } + } + + return nil +} + +// HostPoolList list of HostPool definitions. +type HostPoolList struct { + autorest.Response `json:"-"` + // Value - List of HostPool definitions. + Value *[]HostPool `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to the next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// HostPoolListIterator provides access to a complete listing of HostPool values. +type HostPoolListIterator struct { + i int + page HostPoolListPage +} + +// 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 *HostPoolListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/HostPoolListIterator.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 *HostPoolListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter HostPoolListIterator) 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 HostPoolListIterator) Response() HostPoolList { + 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 HostPoolListIterator) Value() HostPool { + if !iter.page.NotDone() { + return HostPool{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the HostPoolListIterator type. +func NewHostPoolListIterator(page HostPoolListPage) HostPoolListIterator { + return HostPoolListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (hpl HostPoolList) IsEmpty() bool { + return hpl.Value == nil || len(*hpl.Value) == 0 +} + +// hostPoolListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (hpl HostPoolList) hostPoolListPreparer(ctx context.Context) (*http.Request, error) { + if hpl.NextLink == nil || len(to.String(hpl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(hpl.NextLink))) +} + +// HostPoolListPage contains a page of HostPool values. +type HostPoolListPage struct { + fn func(context.Context, HostPoolList) (HostPoolList, error) + hpl HostPoolList +} + +// 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 *HostPoolListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/HostPoolListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.hpl) + if err != nil { + return err + } + page.hpl = next + 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 *HostPoolListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page HostPoolListPage) NotDone() bool { + return !page.hpl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page HostPoolListPage) Response() HostPoolList { + return page.hpl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page HostPoolListPage) Values() []HostPool { + if page.hpl.IsEmpty() { + return nil + } + return *page.hpl.Value +} + +// Creates a new instance of the HostPoolListPage type. +func NewHostPoolListPage(getNextPage func(context.Context, HostPoolList) (HostPoolList, error)) HostPoolListPage { + return HostPoolListPage{fn: getNextPage} +} + +// HostPoolPatch hostPool properties that can be patched. +type HostPoolPatch struct { + // Tags - tags to be updated + Tags interface{} `json:"tags,omitempty"` + // HostPoolPatchProperties - HostPool properties that can be patched. + *HostPoolPatchProperties `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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for HostPoolPatch. +func (hpp HostPoolPatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if hpp.Tags != nil { + objectMap["tags"] = hpp.Tags + } + if hpp.HostPoolPatchProperties != nil { + objectMap["properties"] = hpp.HostPoolPatchProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for HostPoolPatch struct. +func (hpp *HostPoolPatch) 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 interface{} + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + hpp.Tags = tags + } + case "properties": + if v != nil { + var hostPoolPatchProperties HostPoolPatchProperties + err = json.Unmarshal(*v, &hostPoolPatchProperties) + if err != nil { + return err + } + hpp.HostPoolPatchProperties = &hostPoolPatchProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + hpp.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + hpp.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + hpp.Type = &typeVar + } + } + } + + return nil +} + +// HostPoolPatchProperties properties of HostPool. +type HostPoolPatchProperties struct { + // FriendlyName - Friendly name of HostPool. + FriendlyName *string `json:"friendlyName,omitempty"` + // Description - Description of HostPool. + Description *string `json:"description,omitempty"` + // CustomRdpProperty - Custom rdp property of HostPool. + CustomRdpProperty *string `json:"customRdpProperty,omitempty"` + // MaxSessionLimit - The max session limit of HostPool. + MaxSessionLimit *int32 `json:"maxSessionLimit,omitempty"` + // PersonalDesktopAssignmentType - PersonalDesktopAssignment type for HostPool. Possible values include: 'Automatic', 'Direct' + PersonalDesktopAssignmentType PersonalDesktopAssignmentType `json:"personalDesktopAssignmentType,omitempty"` + // LoadBalancerType - The type of the load balancer. Possible values include: 'BreadthFirst', 'DepthFirst', 'Persistent' + LoadBalancerType LoadBalancerType `json:"loadBalancerType,omitempty"` + // Ring - The ring number of HostPool. + Ring *int32 `json:"ring,omitempty"` + // ValidationEnvironment - Is validation environment. + ValidationEnvironment *bool `json:"validationEnvironment,omitempty"` + // RegistrationInfo - The registration info of HostPool. + RegistrationInfo *RegistrationInfoPatch `json:"registrationInfo,omitempty"` + // SsoContext - Path to keyvault containing ssoContext secret. + SsoContext *string `json:"ssoContext,omitempty"` +} + +// HostPoolProperties properties of HostPool. +type HostPoolProperties struct { + // FriendlyName - Friendly name of HostPool. + FriendlyName *string `json:"friendlyName,omitempty"` + // Description - Description of HostPool. + Description *string `json:"description,omitempty"` + // HostPoolType - HostPool type for desktop. Possible values include: 'Personal', 'Pooled' + HostPoolType HostPoolType `json:"hostPoolType,omitempty"` + // PersonalDesktopAssignmentType - PersonalDesktopAssignment type for HostPool. Possible values include: 'Automatic', 'Direct' + PersonalDesktopAssignmentType PersonalDesktopAssignmentType `json:"personalDesktopAssignmentType,omitempty"` + // CustomRdpProperty - Custom rdp property of HostPool. + CustomRdpProperty *string `json:"customRdpProperty,omitempty"` + // MaxSessionLimit - The max session limit of HostPool. + MaxSessionLimit *int32 `json:"maxSessionLimit,omitempty"` + // LoadBalancerType - The type of the load balancer. Possible values include: 'BreadthFirst', 'DepthFirst', 'Persistent' + LoadBalancerType LoadBalancerType `json:"loadBalancerType,omitempty"` + // Ring - The ring number of HostPool. + Ring *int32 `json:"ring,omitempty"` + // ValidationEnvironment - Is validation environment. + ValidationEnvironment *bool `json:"validationEnvironment,omitempty"` + // RegistrationInfo - The registration info of HostPool. + RegistrationInfo *RegistrationInfo `json:"registrationInfo,omitempty"` + // VMTemplate - VM template for sessionhosts configuration within hostpool. + VMTemplate *string `json:"vmTemplate,omitempty"` + // ApplicationGroupReferences - READ-ONLY; List of applicationGroup links. + ApplicationGroupReferences *[]string `json:"applicationGroupReferences,omitempty"` + // SsoContext - Path to keyvault containing ssoContext secret. + SsoContext *string `json:"ssoContext,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; 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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// RegistrationInfo represents a RegistrationInfo definition. +type RegistrationInfo struct { + // ExpirationTime - Expiration time of registration token. + ExpirationTime *date.Time `json:"expirationTime,omitempty"` + // Token - The registration token base64 encoded string. + Token *string `json:"token,omitempty"` + // RegistrationTokenOperation - The type of resetting the token. Possible values include: 'Delete', 'None', 'Update' + RegistrationTokenOperation RegistrationTokenOperation `json:"registrationTokenOperation,omitempty"` +} + +// RegistrationInfoPatch represents a RegistrationInfo definition. +type RegistrationInfoPatch struct { + // ExpirationTime - Expiration time of registration token. + ExpirationTime *date.Time `json:"expirationTime,omitempty"` + // RegistrationTokenOperation - The type of resetting the token. Possible values include: 'Delete', 'None', 'Update' + RegistrationTokenOperation RegistrationTokenOperation `json:"registrationTokenOperation,omitempty"` +} + +// Resource ... +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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// ResourceProviderOperation supported operation of this resource provider. +type ResourceProviderOperation struct { + // Name - Operation name, in format of {provider}/{resource}/{operation} + Name *string `json:"name,omitempty"` + // Display - Display metadata associated with the operation. + Display *ResourceProviderOperationDisplay `json:"display,omitempty"` +} + +// ResourceProviderOperationDisplay display metadata associated with the operation. +type ResourceProviderOperationDisplay struct { + // Provider - Resource provider: Microsoft Desktop Virtualization. + Provider *string `json:"provider,omitempty"` + // Resource - Resource on which the operation is performed. + Resource *string `json:"resource,omitempty"` + // Operation - Type of operation: get, read, delete, etc. + Operation *string `json:"operation,omitempty"` + // Description - Description of this operation. + Description *string `json:"description,omitempty"` +} + +// ResourceProviderOperationList result of the request to list operations. +type ResourceProviderOperationList struct { + autorest.Response `json:"-"` + // Value - List of operations supported by this resource provider. + Value *[]ResourceProviderOperation `json:"value,omitempty"` +} + +// SendMessage represents message sent to a UserSession. +type SendMessage struct { + // MessageTitle - Title of message. + MessageTitle *string `json:"messageTitle,omitempty"` + // MessageBody - Body of message. + MessageBody *string `json:"messageBody,omitempty"` +} + +// SessionHost represents a SessionHost definition. +type SessionHost struct { + autorest.Response `json:"-"` + // SessionHostProperties - Detailed properties for SessionHost + *SessionHostProperties `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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SessionHost. +func (sh SessionHost) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sh.SessionHostProperties != nil { + objectMap["properties"] = sh.SessionHostProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SessionHost struct. +func (sh *SessionHost) 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 sessionHostProperties SessionHostProperties + err = json.Unmarshal(*v, &sessionHostProperties) + if err != nil { + return err + } + sh.SessionHostProperties = &sessionHostProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sh.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sh.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sh.Type = &typeVar + } + } + } + + return nil +} + +// SessionHostList list of SessionHost definitions. +type SessionHostList struct { + autorest.Response `json:"-"` + // Value - List of SessionHost definitions. + Value *[]SessionHost `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to the next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// SessionHostListIterator provides access to a complete listing of SessionHost values. +type SessionHostListIterator struct { + i int + page SessionHostListPage +} + +// 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 *SessionHostListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SessionHostListIterator.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 *SessionHostListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SessionHostListIterator) 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 SessionHostListIterator) Response() SessionHostList { + 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 SessionHostListIterator) Value() SessionHost { + if !iter.page.NotDone() { + return SessionHost{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the SessionHostListIterator type. +func NewSessionHostListIterator(page SessionHostListPage) SessionHostListIterator { + return SessionHostListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (shl SessionHostList) IsEmpty() bool { + return shl.Value == nil || len(*shl.Value) == 0 +} + +// sessionHostListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (shl SessionHostList) sessionHostListPreparer(ctx context.Context) (*http.Request, error) { + if shl.NextLink == nil || len(to.String(shl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(shl.NextLink))) +} + +// SessionHostListPage contains a page of SessionHost values. +type SessionHostListPage struct { + fn func(context.Context, SessionHostList) (SessionHostList, error) + shl SessionHostList +} + +// 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 *SessionHostListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SessionHostListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.shl) + if err != nil { + return err + } + page.shl = next + 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 *SessionHostListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SessionHostListPage) NotDone() bool { + return !page.shl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SessionHostListPage) Response() SessionHostList { + return page.shl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SessionHostListPage) Values() []SessionHost { + if page.shl.IsEmpty() { + return nil + } + return *page.shl.Value +} + +// Creates a new instance of the SessionHostListPage type. +func NewSessionHostListPage(getNextPage func(context.Context, SessionHostList) (SessionHostList, error)) SessionHostListPage { + return SessionHostListPage{fn: getNextPage} +} + +// SessionHostPatch sessionHost properties that can be patched. +type SessionHostPatch struct { + // SessionHostPatchProperties - Detailed properties for SessionHost + *SessionHostPatchProperties `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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SessionHostPatch. +func (shp SessionHostPatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if shp.SessionHostPatchProperties != nil { + objectMap["properties"] = shp.SessionHostPatchProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SessionHostPatch struct. +func (shp *SessionHostPatch) 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 sessionHostPatchProperties SessionHostPatchProperties + err = json.Unmarshal(*v, &sessionHostPatchProperties) + if err != nil { + return err + } + shp.SessionHostPatchProperties = &sessionHostPatchProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + shp.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + shp.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + shp.Type = &typeVar + } + } + } + + return nil +} + +// SessionHostPatchProperties sessionHost properties that can be patched. +type SessionHostPatchProperties struct { + // AllowNewSession - Allow a new session. + AllowNewSession *bool `json:"allowNewSession,omitempty"` + // AssignedUser - User assigned to SessionHost. + AssignedUser *string `json:"assignedUser,omitempty"` +} + +// SessionHostProperties schema for SessionHost properties. +type SessionHostProperties struct { + // LastHeartBeat - Last heart beat from SessionHost. + LastHeartBeat *date.Time `json:"lastHeartBeat,omitempty"` + // Sessions - Number of sessions on SessionHost. + Sessions *int32 `json:"sessions,omitempty"` + // AgentVersion - Version of agent on SessionHost. + AgentVersion *string `json:"agentVersion,omitempty"` + // AllowNewSession - Allow a new session. + AllowNewSession *bool `json:"allowNewSession,omitempty"` + // AssignedUser - User assigned to SessionHost. + AssignedUser *string `json:"assignedUser,omitempty"` + // Status - Status for a SessionHost. Possible values include: 'StatusAvailable', 'StatusUnavailable', 'StatusShutdown', 'StatusDisconnected', 'StatusUpgrading', 'StatusUpgradeFailed' + Status Status `json:"status,omitempty"` + // StatusTimestamp - READ-ONLY; The timestamp of the status. + StatusTimestamp *date.Time `json:"statusTimestamp,omitempty"` + // OsVersion - The version of the OS on the session host. + OsVersion *string `json:"osVersion,omitempty"` + // SxSStackVersion - The version of the side by side stack on the session host. + SxSStackVersion *string `json:"sxSStackVersion,omitempty"` + // UpdateState - Update state of a SessionHost. Possible values include: 'UpdateStateInitial', 'UpdateStatePending', 'UpdateStateStarted', 'UpdateStateSucceeded', 'UpdateStateFailed' + UpdateState UpdateState `json:"updateState,omitempty"` + // LastUpdateTime - READ-ONLY; The timestamp of the last update. + LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"` + // UpdateErrorMessage - The error message. + UpdateErrorMessage *string `json:"updateErrorMessage,omitempty"` +} + +// StartMenuItem represents a StartMenuItem definition. +type StartMenuItem struct { + // StartMenuItemProperties - Detailed properties for StartMenuItem + *StartMenuItemProperties `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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for StartMenuItem. +func (smi StartMenuItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if smi.StartMenuItemProperties != nil { + objectMap["properties"] = smi.StartMenuItemProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for StartMenuItem struct. +func (smi *StartMenuItem) 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 startMenuItemProperties StartMenuItemProperties + err = json.Unmarshal(*v, &startMenuItemProperties) + if err != nil { + return err + } + smi.StartMenuItemProperties = &startMenuItemProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + smi.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + smi.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + smi.Type = &typeVar + } + } + } + + return nil +} + +// StartMenuItemList list of StartMenuItem definitions. +type StartMenuItemList struct { + autorest.Response `json:"-"` + // Value - List of StartMenuItem definitions. + Value *[]StartMenuItem `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to the next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// StartMenuItemListIterator provides access to a complete listing of StartMenuItem values. +type StartMenuItemListIterator struct { + i int + page StartMenuItemListPage +} + +// 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 *StartMenuItemListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StartMenuItemListIterator.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 *StartMenuItemListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter StartMenuItemListIterator) 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 StartMenuItemListIterator) Response() StartMenuItemList { + 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 StartMenuItemListIterator) Value() StartMenuItem { + if !iter.page.NotDone() { + return StartMenuItem{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the StartMenuItemListIterator type. +func NewStartMenuItemListIterator(page StartMenuItemListPage) StartMenuItemListIterator { + return StartMenuItemListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (smil StartMenuItemList) IsEmpty() bool { + return smil.Value == nil || len(*smil.Value) == 0 +} + +// startMenuItemListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (smil StartMenuItemList) startMenuItemListPreparer(ctx context.Context) (*http.Request, error) { + if smil.NextLink == nil || len(to.String(smil.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(smil.NextLink))) +} + +// StartMenuItemListPage contains a page of StartMenuItem values. +type StartMenuItemListPage struct { + fn func(context.Context, StartMenuItemList) (StartMenuItemList, error) + smil StartMenuItemList +} + +// 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 *StartMenuItemListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StartMenuItemListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.smil) + if err != nil { + return err + } + page.smil = next + 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 *StartMenuItemListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page StartMenuItemListPage) NotDone() bool { + return !page.smil.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page StartMenuItemListPage) Response() StartMenuItemList { + return page.smil +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page StartMenuItemListPage) Values() []StartMenuItem { + if page.smil.IsEmpty() { + return nil + } + return *page.smil.Value +} + +// Creates a new instance of the StartMenuItemListPage type. +func NewStartMenuItemListPage(getNextPage func(context.Context, StartMenuItemList) (StartMenuItemList, error)) StartMenuItemListPage { + return StartMenuItemListPage{fn: getNextPage} +} + +// StartMenuItemProperties schema for StartMenuItem properties. +type StartMenuItemProperties struct { + // AppAlias - Alias of StartMenuItem. + AppAlias *string `json:"appAlias,omitempty"` + // FriendlyName - Friendly name of StartMenuItem. + FriendlyName *string `json:"friendlyName,omitempty"` + // FilePath - Path to the file of StartMenuItem. + FilePath *string `json:"filePath,omitempty"` + // CommandLineArguments - Command line arguments for StartMenuItem. + CommandLineArguments *string `json:"commandLineArguments,omitempty"` + // IconPath - Path to the icon. + IconPath *string `json:"iconPath,omitempty"` + // IconIndex - Index of the icon. + IconIndex *int32 `json:"iconIndex,omitempty"` +} + +// TrackedResource the resource model definition for a ARM tracked top level resource +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. Ex- 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) +} + +// UserSession represents a UserSession definition. +type UserSession struct { + autorest.Response `json:"-"` + // UserSessionProperties - Detailed properties for UserSession + *UserSessionProperties `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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for UserSession. +func (us UserSession) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if us.UserSessionProperties != nil { + objectMap["properties"] = us.UserSessionProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for UserSession struct. +func (us *UserSession) 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 userSessionProperties UserSessionProperties + err = json.Unmarshal(*v, &userSessionProperties) + if err != nil { + return err + } + us.UserSessionProperties = &userSessionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + us.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + us.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + us.Type = &typeVar + } + } + } + + return nil +} + +// UserSessionList list of UserSession definitions. +type UserSessionList struct { + autorest.Response `json:"-"` + // Value - List of UserSession definitions. + Value *[]UserSession `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to the next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// UserSessionListIterator provides access to a complete listing of UserSession values. +type UserSessionListIterator struct { + i int + page UserSessionListPage +} + +// 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 *UserSessionListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UserSessionListIterator.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 *UserSessionListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter UserSessionListIterator) 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 UserSessionListIterator) Response() UserSessionList { + 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 UserSessionListIterator) Value() UserSession { + if !iter.page.NotDone() { + return UserSession{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the UserSessionListIterator type. +func NewUserSessionListIterator(page UserSessionListPage) UserSessionListIterator { + return UserSessionListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (usl UserSessionList) IsEmpty() bool { + return usl.Value == nil || len(*usl.Value) == 0 +} + +// userSessionListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (usl UserSessionList) userSessionListPreparer(ctx context.Context) (*http.Request, error) { + if usl.NextLink == nil || len(to.String(usl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(usl.NextLink))) +} + +// UserSessionListPage contains a page of UserSession values. +type UserSessionListPage struct { + fn func(context.Context, UserSessionList) (UserSessionList, error) + usl UserSessionList +} + +// 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 *UserSessionListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UserSessionListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.usl) + if err != nil { + return err + } + page.usl = next + 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 *UserSessionListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page UserSessionListPage) NotDone() bool { + return !page.usl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page UserSessionListPage) Response() UserSessionList { + return page.usl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page UserSessionListPage) Values() []UserSession { + if page.usl.IsEmpty() { + return nil + } + return *page.usl.Value +} + +// Creates a new instance of the UserSessionListPage type. +func NewUserSessionListPage(getNextPage func(context.Context, UserSessionList) (UserSessionList, error)) UserSessionListPage { + return UserSessionListPage{fn: getNextPage} +} + +// UserSessionProperties schema for UserSession properties. +type UserSessionProperties struct { + // UserPrincipalName - The user principal name. + UserPrincipalName *string `json:"userPrincipalName,omitempty"` + // ApplicationType - Application type of application. Possible values include: 'ApplicationTypeRemoteApp', 'ApplicationTypeDesktop' + ApplicationType ApplicationType `json:"applicationType,omitempty"` + // SessionState - State of user session. Possible values include: 'Unknown', 'Active', 'Disconnected', 'Pending', 'LogOff', 'UserProfileDiskMounted' + SessionState SessionState `json:"sessionState,omitempty"` + // ActiveDirectoryUserName - The active directory user name. + ActiveDirectoryUserName *string `json:"activeDirectoryUserName,omitempty"` + // CreateTime - The timestamp of the user session create. + CreateTime *date.Time `json:"createTime,omitempty"` +} + +// Workspace represents a Workspace definition. +type Workspace struct { + autorest.Response `json:"-"` + // WorkspaceProperties - Detailed properties for Workspace + *WorkspaceProperties `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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Workspace. +func (w Workspace) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if w.WorkspaceProperties != nil { + objectMap["properties"] = w.WorkspaceProperties + } + if w.Tags != nil { + objectMap["tags"] = w.Tags + } + if w.Location != nil { + objectMap["location"] = w.Location + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Workspace struct. +func (w *Workspace) 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 workspaceProperties WorkspaceProperties + err = json.Unmarshal(*v, &workspaceProperties) + if err != nil { + return err + } + w.WorkspaceProperties = &workspaceProperties + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + w.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + w.Location = &location + } + 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 + } + } + } + + return nil +} + +// WorkspaceList list of Workspace definitions. +type WorkspaceList struct { + autorest.Response `json:"-"` + // Value - List of Workspace definitions. + Value *[]Workspace `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to the next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// WorkspaceListIterator provides access to a complete listing of Workspace values. +type WorkspaceListIterator struct { + i int + page WorkspaceListPage +} + +// 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 *WorkspaceListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceListIterator.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 *WorkspaceListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter WorkspaceListIterator) 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 WorkspaceListIterator) Response() WorkspaceList { + 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 WorkspaceListIterator) Value() Workspace { + if !iter.page.NotDone() { + return Workspace{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the WorkspaceListIterator type. +func NewWorkspaceListIterator(page WorkspaceListPage) WorkspaceListIterator { + return WorkspaceListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (wl WorkspaceList) IsEmpty() bool { + return wl.Value == nil || len(*wl.Value) == 0 +} + +// workspaceListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (wl WorkspaceList) workspaceListPreparer(ctx context.Context) (*http.Request, error) { + if wl.NextLink == nil || len(to.String(wl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(wl.NextLink))) +} + +// WorkspaceListPage contains a page of Workspace values. +type WorkspaceListPage struct { + fn func(context.Context, WorkspaceList) (WorkspaceList, error) + wl WorkspaceList +} + +// 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 *WorkspaceListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspaceListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.wl) + if err != nil { + return err + } + page.wl = next + 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 *WorkspaceListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page WorkspaceListPage) NotDone() bool { + return !page.wl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page WorkspaceListPage) Response() WorkspaceList { + return page.wl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page WorkspaceListPage) Values() []Workspace { + if page.wl.IsEmpty() { + return nil + } + return *page.wl.Value +} + +// Creates a new instance of the WorkspaceListPage type. +func NewWorkspaceListPage(getNextPage func(context.Context, WorkspaceList) (WorkspaceList, error)) WorkspaceListPage { + return WorkspaceListPage{fn: getNextPage} +} + +// WorkspacePatch workspace properties that can be patched. +type WorkspacePatch struct { + // Tags - tags to be updated + Tags interface{} `json:"tags,omitempty"` + // WorkspacePatchProperties - Detailed properties for Workspace + *WorkspacePatchProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for WorkspacePatch. +func (wp WorkspacePatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wp.Tags != nil { + objectMap["tags"] = wp.Tags + } + if wp.WorkspacePatchProperties != nil { + objectMap["properties"] = wp.WorkspacePatchProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for WorkspacePatch struct. +func (wp *WorkspacePatch) 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 interface{} + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + wp.Tags = tags + } + case "properties": + if v != nil { + var workspacePatchProperties WorkspacePatchProperties + err = json.Unmarshal(*v, &workspacePatchProperties) + if err != nil { + return err + } + wp.WorkspacePatchProperties = &workspacePatchProperties + } + } + } + + return nil +} + +// WorkspacePatchProperties workspace properties that can be patched. +type WorkspacePatchProperties struct { + // Description - Description of Workspace. + Description *string `json:"description,omitempty"` + // FriendlyName - Friendly name of Workspace. + FriendlyName *string `json:"friendlyName,omitempty"` + // ApplicationGroupReferences - List of applicationGroup links. + ApplicationGroupReferences *[]string `json:"applicationGroupReferences,omitempty"` +} + +// WorkspaceProperties schema for Workspace properties. +type WorkspaceProperties struct { + // Description - Description of Workspace. + Description *string `json:"description,omitempty"` + // FriendlyName - Friendly name of Workspace. + FriendlyName *string `json:"friendlyName,omitempty"` + // ApplicationGroupReferences - List of applicationGroup resource Ids. + ApplicationGroupReferences *[]string `json:"applicationGroupReferences,omitempty"` +} diff --git a/services/preview/desktopvirtualization/mgmt/2019-12-10-preview/desktopvirtualization/operations.go b/services/preview/desktopvirtualization/mgmt/2019-12-10-preview/desktopvirtualization/operations.go new file mode 100644 index 000000000000..905999816ee2 --- /dev/null +++ b/services/preview/desktopvirtualization/mgmt/2019-12-10-preview/desktopvirtualization/operations.go @@ -0,0 +1,109 @@ +package desktopvirtualization + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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 Desktopvirtualization 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 list all of the available operations the Desktop Virtualization resource provider supports. +func (client OperationsClient) List(ctx context.Context) (result ResourceProviderOperationList, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.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) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.OperationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.OperationsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.OperationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2019-12-10-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.DesktopVirtualization/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 ResourceProviderOperationList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/desktopvirtualization/mgmt/2019-12-10-preview/desktopvirtualization/sessionhosts.go b/services/preview/desktopvirtualization/mgmt/2019-12-10-preview/desktopvirtualization/sessionhosts.go new file mode 100644 index 000000000000..a7be37c78e90 --- /dev/null +++ b/services/preview/desktopvirtualization/mgmt/2019-12-10-preview/desktopvirtualization/sessionhosts.go @@ -0,0 +1,461 @@ +package desktopvirtualization + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// SessionHostsClient is the client for the SessionHosts methods of the Desktopvirtualization service. +type SessionHostsClient struct { + BaseClient +} + +// NewSessionHostsClient creates an instance of the SessionHostsClient client. +func NewSessionHostsClient(subscriptionID string) SessionHostsClient { + return NewSessionHostsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewSessionHostsClientWithBaseURI creates an instance of the SessionHostsClient 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 NewSessionHostsClientWithBaseURI(baseURI string, subscriptionID string) SessionHostsClient { + return SessionHostsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Delete remove a SessionHost. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// hostPoolName - the name of the host pool within the specified resource group +// sessionHostName - the name of the session host within the specified host pool +// force - force flag to force sessionHost deletion even when userSession exists. +func (client SessionHostsClient) Delete(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string, force *bool) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SessionHostsClient.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: 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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: hostPoolName, + Constraints: []validation.Constraint{{Target: "hostPoolName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "hostPoolName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: sessionHostName, + Constraints: []validation.Constraint{{Target: "sessionHostName", Name: validation.MaxLength, Rule: 48, Chain: nil}, + {Target: "sessionHostName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.SessionHostsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, hostPoolName, sessionHostName, force) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.SessionHostsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "desktopvirtualization.SessionHostsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.SessionHostsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client SessionHostsClient) DeletePreparer(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string, force *bool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "hostPoolName": autorest.Encode("path", hostPoolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sessionHostName": autorest.Encode("path", sessionHostName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-10-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if force != nil { + queryParameters["force"] = autorest.Encode("query", *force) + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}", 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 SessionHostsClient) 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 SessionHostsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get a session host. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// hostPoolName - the name of the host pool within the specified resource group +// sessionHostName - the name of the session host within the specified host pool +func (client SessionHostsClient) Get(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string) (result SessionHost, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SessionHostsClient.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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: hostPoolName, + Constraints: []validation.Constraint{{Target: "hostPoolName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "hostPoolName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: sessionHostName, + Constraints: []validation.Constraint{{Target: "sessionHostName", Name: validation.MaxLength, Rule: 48, Chain: nil}, + {Target: "sessionHostName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.SessionHostsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, hostPoolName, sessionHostName) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.SessionHostsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.SessionHostsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.SessionHostsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client SessionHostsClient) GetPreparer(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "hostPoolName": autorest.Encode("path", hostPoolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sessionHostName": autorest.Encode("path", sessionHostName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-10-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.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}", 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 SessionHostsClient) 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 SessionHostsClient) GetResponder(resp *http.Response) (result SessionHost, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List list sessionHosts. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// hostPoolName - the name of the host pool within the specified resource group +func (client SessionHostsClient) List(ctx context.Context, resourceGroupName string, hostPoolName string) (result SessionHostListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SessionHostsClient.List") + defer func() { + sc := -1 + if result.shl.Response.Response != nil { + sc = result.shl.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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: hostPoolName, + Constraints: []validation.Constraint{{Target: "hostPoolName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "hostPoolName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.SessionHostsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, hostPoolName) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.SessionHostsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.shl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.SessionHostsClient", "List", resp, "Failure sending request") + return + } + + result.shl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.SessionHostsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client SessionHostsClient) ListPreparer(ctx context.Context, resourceGroupName string, hostPoolName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "hostPoolName": autorest.Encode("path", hostPoolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-10-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.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts", 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 SessionHostsClient) 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 SessionHostsClient) ListResponder(resp *http.Response) (result SessionHostList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 SessionHostsClient) listNextResults(ctx context.Context, lastResults SessionHostList) (result SessionHostList, err error) { + req, err := lastResults.sessionHostListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "desktopvirtualization.SessionHostsClient", "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, "desktopvirtualization.SessionHostsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.SessionHostsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client SessionHostsClient) ListComplete(ctx context.Context, resourceGroupName string, hostPoolName string) (result SessionHostListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SessionHostsClient.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, hostPoolName) + return +} + +// Update update a session host. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// hostPoolName - the name of the host pool within the specified resource group +// sessionHostName - the name of the session host within the specified host pool +// sessionHost - object containing SessionHost definitions. +func (client SessionHostsClient) Update(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string, sessionHost *SessionHostPatch) (result SessionHost, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SessionHostsClient.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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: hostPoolName, + Constraints: []validation.Constraint{{Target: "hostPoolName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "hostPoolName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: sessionHostName, + Constraints: []validation.Constraint{{Target: "sessionHostName", Name: validation.MaxLength, Rule: 48, Chain: nil}, + {Target: "sessionHostName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.SessionHostsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, hostPoolName, sessionHostName, sessionHost) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.SessionHostsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.SessionHostsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.SessionHostsClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client SessionHostsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string, sessionHost *SessionHostPatch) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "hostPoolName": autorest.Encode("path", hostPoolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sessionHostName": autorest.Encode("path", sessionHostName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-10-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.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if sessionHost != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(sessionHost)) + } + 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 SessionHostsClient) 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 SessionHostsClient) UpdateResponder(resp *http.Response) (result SessionHost, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/desktopvirtualization/mgmt/2019-12-10-preview/desktopvirtualization/startmenuitems.go b/services/preview/desktopvirtualization/mgmt/2019-12-10-preview/desktopvirtualization/startmenuitems.go new file mode 100644 index 000000000000..e3ee5e6e6824 --- /dev/null +++ b/services/preview/desktopvirtualization/mgmt/2019-12-10-preview/desktopvirtualization/startmenuitems.go @@ -0,0 +1,170 @@ +package desktopvirtualization + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// StartMenuItemsClient is the client for the StartMenuItems methods of the Desktopvirtualization service. +type StartMenuItemsClient struct { + BaseClient +} + +// NewStartMenuItemsClient creates an instance of the StartMenuItemsClient client. +func NewStartMenuItemsClient(subscriptionID string) StartMenuItemsClient { + return NewStartMenuItemsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewStartMenuItemsClientWithBaseURI creates an instance of the StartMenuItemsClient 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 NewStartMenuItemsClientWithBaseURI(baseURI string, subscriptionID string) StartMenuItemsClient { + return StartMenuItemsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List list start menu items in the given application group. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// applicationGroupName - the name of the application group +func (client StartMenuItemsClient) List(ctx context.Context, resourceGroupName string, applicationGroupName string) (result StartMenuItemListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StartMenuItemsClient.List") + defer func() { + sc := -1 + if result.smil.Response.Response != nil { + sc = result.smil.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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: applicationGroupName, + Constraints: []validation.Constraint{{Target: "applicationGroupName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "applicationGroupName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.StartMenuItemsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, applicationGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.StartMenuItemsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.smil.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.StartMenuItemsClient", "List", resp, "Failure sending request") + return + } + + result.smil, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.StartMenuItemsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client StartMenuItemsClient) ListPreparer(ctx context.Context, resourceGroupName string, applicationGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "applicationGroupName": autorest.Encode("path", applicationGroupName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-10-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.DesktopVirtualization/applicationGroups/{applicationGroupName}/startMenuItems", 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 StartMenuItemsClient) 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 StartMenuItemsClient) ListResponder(resp *http.Response) (result StartMenuItemList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 StartMenuItemsClient) listNextResults(ctx context.Context, lastResults StartMenuItemList) (result StartMenuItemList, err error) { + req, err := lastResults.startMenuItemListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "desktopvirtualization.StartMenuItemsClient", "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, "desktopvirtualization.StartMenuItemsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.StartMenuItemsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client StartMenuItemsClient) ListComplete(ctx context.Context, resourceGroupName string, applicationGroupName string) (result StartMenuItemListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StartMenuItemsClient.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, applicationGroupName) + return +} diff --git a/services/preview/desktopvirtualization/mgmt/2019-12-10-preview/desktopvirtualization/usersessions.go b/services/preview/desktopvirtualization/mgmt/2019-12-10-preview/desktopvirtualization/usersessions.go new file mode 100644 index 000000000000..7b666e87a1a8 --- /dev/null +++ b/services/preview/desktopvirtualization/mgmt/2019-12-10-preview/desktopvirtualization/usersessions.go @@ -0,0 +1,709 @@ +package desktopvirtualization + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// UserSessionsClient is the client for the UserSessions methods of the Desktopvirtualization service. +type UserSessionsClient struct { + BaseClient +} + +// NewUserSessionsClient creates an instance of the UserSessionsClient client. +func NewUserSessionsClient(subscriptionID string) UserSessionsClient { + return NewUserSessionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewUserSessionsClientWithBaseURI creates an instance of the UserSessionsClient 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 NewUserSessionsClientWithBaseURI(baseURI string, subscriptionID string) UserSessionsClient { + return UserSessionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Delete remove a userSession. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// hostPoolName - the name of the host pool within the specified resource group +// sessionHostName - the name of the session host within the specified host pool +// userSessionID - the name of the user session within the specified session host +// force - force flag to login off userSession. +func (client UserSessionsClient) Delete(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string, userSessionID string, force *bool) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UserSessionsClient.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: 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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: hostPoolName, + Constraints: []validation.Constraint{{Target: "hostPoolName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "hostPoolName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: sessionHostName, + Constraints: []validation.Constraint{{Target: "sessionHostName", Name: validation.MaxLength, Rule: 48, Chain: nil}, + {Target: "sessionHostName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: userSessionID, + Constraints: []validation.Constraint{{Target: "userSessionID", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "userSessionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.UserSessionsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, hostPoolName, sessionHostName, userSessionID, force) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.UserSessionsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "desktopvirtualization.UserSessionsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.UserSessionsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client UserSessionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string, userSessionID string, force *bool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "hostPoolName": autorest.Encode("path", hostPoolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sessionHostName": autorest.Encode("path", sessionHostName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "userSessionId": autorest.Encode("path", userSessionID), + } + + const APIVersion = "2019-12-10-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if force != nil { + queryParameters["force"] = autorest.Encode("query", *force) + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/userSessions/{userSessionId}", 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 UserSessionsClient) 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 UserSessionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Disconnect disconnect a userSession. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// hostPoolName - the name of the host pool within the specified resource group +// sessionHostName - the name of the session host within the specified host pool +// userSessionID - the name of the user session within the specified session host +func (client UserSessionsClient) Disconnect(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string, userSessionID string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UserSessionsClient.Disconnect") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: hostPoolName, + Constraints: []validation.Constraint{{Target: "hostPoolName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "hostPoolName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: sessionHostName, + Constraints: []validation.Constraint{{Target: "sessionHostName", Name: validation.MaxLength, Rule: 48, Chain: nil}, + {Target: "sessionHostName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: userSessionID, + Constraints: []validation.Constraint{{Target: "userSessionID", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "userSessionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.UserSessionsClient", "Disconnect", err.Error()) + } + + req, err := client.DisconnectPreparer(ctx, resourceGroupName, hostPoolName, sessionHostName, userSessionID) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.UserSessionsClient", "Disconnect", nil, "Failure preparing request") + return + } + + resp, err := client.DisconnectSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "desktopvirtualization.UserSessionsClient", "Disconnect", resp, "Failure sending request") + return + } + + result, err = client.DisconnectResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.UserSessionsClient", "Disconnect", resp, "Failure responding to request") + } + + return +} + +// DisconnectPreparer prepares the Disconnect request. +func (client UserSessionsClient) DisconnectPreparer(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string, userSessionID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "hostPoolName": autorest.Encode("path", hostPoolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sessionHostName": autorest.Encode("path", sessionHostName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "userSessionId": autorest.Encode("path", userSessionID), + } + + const APIVersion = "2019-12-10-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.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/userSessions/{userSessionId}/disconnect", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DisconnectSender sends the Disconnect request. The method will close the +// http.Response Body if it receives an error. +func (client UserSessionsClient) DisconnectSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DisconnectResponder handles the response to the Disconnect request. The method always +// closes the http.Response Body. +func (client UserSessionsClient) DisconnectResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get a userSession. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// hostPoolName - the name of the host pool within the specified resource group +// sessionHostName - the name of the session host within the specified host pool +// userSessionID - the name of the user session within the specified session host +func (client UserSessionsClient) Get(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string, userSessionID string) (result UserSession, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UserSessionsClient.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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: hostPoolName, + Constraints: []validation.Constraint{{Target: "hostPoolName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "hostPoolName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: sessionHostName, + Constraints: []validation.Constraint{{Target: "sessionHostName", Name: validation.MaxLength, Rule: 48, Chain: nil}, + {Target: "sessionHostName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: userSessionID, + Constraints: []validation.Constraint{{Target: "userSessionID", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "userSessionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.UserSessionsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, hostPoolName, sessionHostName, userSessionID) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.UserSessionsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.UserSessionsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.UserSessionsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client UserSessionsClient) GetPreparer(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string, userSessionID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "hostPoolName": autorest.Encode("path", hostPoolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sessionHostName": autorest.Encode("path", sessionHostName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "userSessionId": autorest.Encode("path", userSessionID), + } + + const APIVersion = "2019-12-10-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.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/userSessions/{userSessionId}", 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 UserSessionsClient) 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 UserSessionsClient) GetResponder(resp *http.Response) (result UserSession, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List list userSessions. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// hostPoolName - the name of the host pool within the specified resource group +// sessionHostName - the name of the session host within the specified host pool +func (client UserSessionsClient) List(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string) (result UserSessionListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UserSessionsClient.List") + defer func() { + sc := -1 + if result.usl.Response.Response != nil { + sc = result.usl.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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: hostPoolName, + Constraints: []validation.Constraint{{Target: "hostPoolName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "hostPoolName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: sessionHostName, + Constraints: []validation.Constraint{{Target: "sessionHostName", Name: validation.MaxLength, Rule: 48, Chain: nil}, + {Target: "sessionHostName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.UserSessionsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, hostPoolName, sessionHostName) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.UserSessionsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.usl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.UserSessionsClient", "List", resp, "Failure sending request") + return + } + + result.usl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.UserSessionsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client UserSessionsClient) ListPreparer(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "hostPoolName": autorest.Encode("path", hostPoolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sessionHostName": autorest.Encode("path", sessionHostName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-10-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.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/userSessions", 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 UserSessionsClient) 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 UserSessionsClient) ListResponder(resp *http.Response) (result UserSessionList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 UserSessionsClient) listNextResults(ctx context.Context, lastResults UserSessionList) (result UserSessionList, err error) { + req, err := lastResults.userSessionListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "desktopvirtualization.UserSessionsClient", "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, "desktopvirtualization.UserSessionsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.UserSessionsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client UserSessionsClient) ListComplete(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string) (result UserSessionListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UserSessionsClient.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, hostPoolName, sessionHostName) + return +} + +// ListByHostPool list userSessions. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// hostPoolName - the name of the host pool within the specified resource group +// filter - oData filter expression. Valid properties for filtering are userprincipalname and sessionstate. +func (client UserSessionsClient) ListByHostPool(ctx context.Context, resourceGroupName string, hostPoolName string, filter string) (result UserSessionListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UserSessionsClient.ListByHostPool") + defer func() { + sc := -1 + if result.usl.Response.Response != nil { + sc = result.usl.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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: hostPoolName, + Constraints: []validation.Constraint{{Target: "hostPoolName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "hostPoolName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.UserSessionsClient", "ListByHostPool", err.Error()) + } + + result.fn = client.listByHostPoolNextResults + req, err := client.ListByHostPoolPreparer(ctx, resourceGroupName, hostPoolName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.UserSessionsClient", "ListByHostPool", nil, "Failure preparing request") + return + } + + resp, err := client.ListByHostPoolSender(req) + if err != nil { + result.usl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.UserSessionsClient", "ListByHostPool", resp, "Failure sending request") + return + } + + result.usl, err = client.ListByHostPoolResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.UserSessionsClient", "ListByHostPool", resp, "Failure responding to request") + } + + return +} + +// ListByHostPoolPreparer prepares the ListByHostPool request. +func (client UserSessionsClient) ListByHostPoolPreparer(ctx context.Context, resourceGroupName string, hostPoolName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "hostPoolName": autorest.Encode("path", hostPoolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-10-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.DesktopVirtualization/hostPools/{hostPoolName}/userSessions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByHostPoolSender sends the ListByHostPool request. The method will close the +// http.Response Body if it receives an error. +func (client UserSessionsClient) ListByHostPoolSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByHostPoolResponder handles the response to the ListByHostPool request. The method always +// closes the http.Response Body. +func (client UserSessionsClient) ListByHostPoolResponder(resp *http.Response) (result UserSessionList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByHostPoolNextResults retrieves the next set of results, if any. +func (client UserSessionsClient) listByHostPoolNextResults(ctx context.Context, lastResults UserSessionList) (result UserSessionList, err error) { + req, err := lastResults.userSessionListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "desktopvirtualization.UserSessionsClient", "listByHostPoolNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByHostPoolSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "desktopvirtualization.UserSessionsClient", "listByHostPoolNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByHostPoolResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.UserSessionsClient", "listByHostPoolNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByHostPoolComplete enumerates all values, automatically crossing page boundaries as required. +func (client UserSessionsClient) ListByHostPoolComplete(ctx context.Context, resourceGroupName string, hostPoolName string, filter string) (result UserSessionListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UserSessionsClient.ListByHostPool") + 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.ListByHostPool(ctx, resourceGroupName, hostPoolName, filter) + return +} + +// SendMessageMethod send a message to a user. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// hostPoolName - the name of the host pool within the specified resource group +// sessionHostName - the name of the session host within the specified host pool +// userSessionID - the name of the user session within the specified session host +// sendMessage - object containing message includes title and message body +func (client UserSessionsClient) SendMessageMethod(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string, userSessionID string, sendMessage *SendMessage) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UserSessionsClient.SendMessageMethod") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: hostPoolName, + Constraints: []validation.Constraint{{Target: "hostPoolName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "hostPoolName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: sessionHostName, + Constraints: []validation.Constraint{{Target: "sessionHostName", Name: validation.MaxLength, Rule: 48, Chain: nil}, + {Target: "sessionHostName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: userSessionID, + Constraints: []validation.Constraint{{Target: "userSessionID", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "userSessionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.UserSessionsClient", "SendMessageMethod", err.Error()) + } + + req, err := client.SendMessageMethodPreparer(ctx, resourceGroupName, hostPoolName, sessionHostName, userSessionID, sendMessage) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.UserSessionsClient", "SendMessageMethod", nil, "Failure preparing request") + return + } + + resp, err := client.SendMessageMethodSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "desktopvirtualization.UserSessionsClient", "SendMessageMethod", resp, "Failure sending request") + return + } + + result, err = client.SendMessageMethodResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.UserSessionsClient", "SendMessageMethod", resp, "Failure responding to request") + } + + return +} + +// SendMessageMethodPreparer prepares the SendMessageMethod request. +func (client UserSessionsClient) SendMessageMethodPreparer(ctx context.Context, resourceGroupName string, hostPoolName string, sessionHostName string, userSessionID string, sendMessage *SendMessage) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "hostPoolName": autorest.Encode("path", hostPoolName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "sessionHostName": autorest.Encode("path", sessionHostName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "userSessionId": autorest.Encode("path", userSessionID), + } + + const APIVersion = "2019-12-10-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.DesktopVirtualization/hostPools/{hostPoolName}/sessionHosts/{sessionHostName}/userSessions/{userSessionId}/sendMessage", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if sendMessage != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(sendMessage)) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SendMessageMethodSender sends the SendMessageMethod request. The method will close the +// http.Response Body if it receives an error. +func (client UserSessionsClient) SendMessageMethodSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// SendMessageMethodResponder handles the response to the SendMessageMethod request. The method always +// closes the http.Response Body. +func (client UserSessionsClient) SendMessageMethodResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/services/preview/desktopvirtualization/mgmt/2019-12-10-preview/desktopvirtualization/version.go b/services/preview/desktopvirtualization/mgmt/2019-12-10-preview/desktopvirtualization/version.go new file mode 100644 index 000000000000..f71bab4e24cc --- /dev/null +++ b/services/preview/desktopvirtualization/mgmt/2019-12-10-preview/desktopvirtualization/version.go @@ -0,0 +1,30 @@ +package desktopvirtualization + +import "github.com/Azure/azure-sdk-for-go/version" + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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() + " desktopvirtualization/2019-12-10-preview" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/services/preview/desktopvirtualization/mgmt/2019-12-10-preview/desktopvirtualization/workspaces.go b/services/preview/desktopvirtualization/mgmt/2019-12-10-preview/desktopvirtualization/workspaces.go new file mode 100644 index 000000000000..8f60bc27549b --- /dev/null +++ b/services/preview/desktopvirtualization/mgmt/2019-12-10-preview/desktopvirtualization/workspaces.go @@ -0,0 +1,644 @@ +package desktopvirtualization + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// WorkspacesClient is the client for the Workspaces methods of the Desktopvirtualization service. +type WorkspacesClient struct { + BaseClient +} + +// NewWorkspacesClient creates an instance of the WorkspacesClient client. +func NewWorkspacesClient(subscriptionID string) WorkspacesClient { + return NewWorkspacesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWorkspacesClientWithBaseURI creates an instance of the WorkspacesClient 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 NewWorkspacesClientWithBaseURI(baseURI string, subscriptionID string) WorkspacesClient { + return WorkspacesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create or update a workspace. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +// workspace - object containing Workspace definitions. +func (client WorkspacesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, workspace Workspace) (result Workspace, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.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: 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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.WorkspacesClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, workspaceName, workspace) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.WorkspacesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.WorkspacesClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.WorkspacesClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client WorkspacesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, workspaceName string, workspace Workspace) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-12-10-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.DesktopVirtualization/workspaces/{workspaceName}", pathParameters), + autorest.WithJSON(workspace), + 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 WorkspacesClient) 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 WorkspacesClient) CreateOrUpdateResponder(resp *http.Response) (result Workspace, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete remove a workspace. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +func (client WorkspacesClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.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: 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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.WorkspacesClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.WorkspacesClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "desktopvirtualization.WorkspacesClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.WorkspacesClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client WorkspacesClient) DeletePreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-12-10-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.DesktopVirtualization/workspaces/{workspaceName}", 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 WorkspacesClient) 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 WorkspacesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get a workspace. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +func (client WorkspacesClient) Get(ctx context.Context, resourceGroupName string, workspaceName string) (result Workspace, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.WorkspacesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.WorkspacesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.WorkspacesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.WorkspacesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client WorkspacesClient) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-12-10-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.DesktopVirtualization/workspaces/{workspaceName}", 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 WorkspacesClient) 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 WorkspacesClient) GetResponder(resp *http.Response) (result Workspace, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByResourceGroup list workspaces. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +func (client WorkspacesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result WorkspaceListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.wl.Response.Response != nil { + sc = result.wl.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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.WorkspacesClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.WorkspacesClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.wl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.WorkspacesClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.wl, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.WorkspacesClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client WorkspacesClient) 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 = "2019-12-10-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.DesktopVirtualization/workspaces", 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 WorkspacesClient) 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 WorkspacesClient) ListByResourceGroupResponder(resp *http.Response) (result WorkspaceList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 WorkspacesClient) listByResourceGroupNextResults(ctx context.Context, lastResults WorkspaceList) (result WorkspaceList, err error) { + req, err := lastResults.workspaceListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "desktopvirtualization.WorkspacesClient", "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, "desktopvirtualization.WorkspacesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.WorkspacesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client WorkspacesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result WorkspaceListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.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 list workspaces in subscription. +func (client WorkspacesClient) ListBySubscription(ctx context.Context) (result WorkspaceListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.ListBySubscription") + defer func() { + sc := -1 + if result.wl.Response.Response != nil { + sc = result.wl.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("desktopvirtualization.WorkspacesClient", "ListBySubscription", err.Error()) + } + + result.fn = client.listBySubscriptionNextResults + req, err := client.ListBySubscriptionPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.WorkspacesClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.wl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.WorkspacesClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result.wl, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.WorkspacesClient", "ListBySubscription", resp, "Failure responding to request") + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client WorkspacesClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-12-10-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DesktopVirtualization/workspaces", 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 WorkspacesClient) 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 WorkspacesClient) ListBySubscriptionResponder(resp *http.Response) (result WorkspaceList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 WorkspacesClient) listBySubscriptionNextResults(ctx context.Context, lastResults WorkspaceList) (result WorkspaceList, err error) { + req, err := lastResults.workspaceListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "desktopvirtualization.WorkspacesClient", "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, "desktopvirtualization.WorkspacesClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.WorkspacesClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client WorkspacesClient) ListBySubscriptionComplete(ctx context.Context) (result WorkspaceListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.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 update a workspace. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace +// workspace - object containing Workspace definitions. +func (client WorkspacesClient) Update(ctx context.Context, resourceGroupName string, workspaceName string, workspace *WorkspacePatch) (result Workspace, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("desktopvirtualization.WorkspacesClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, workspaceName, workspace) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.WorkspacesClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "desktopvirtualization.WorkspacesClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "desktopvirtualization.WorkspacesClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client WorkspacesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, workspaceName string, workspace *WorkspacePatch) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-12-10-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.DesktopVirtualization/workspaces/{workspaceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if workspace != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(workspace)) + } + 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 WorkspacesClient) 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 WorkspacesClient) UpdateResponder(resp *http.Response) (result Workspace, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/digitaltwins/mgmt/2020-03-01-preview/digitaltwins/digitaltwinsapi/interfaces.go b/services/preview/digitaltwins/mgmt/2020-03-01-preview/digitaltwins/digitaltwinsapi/interfaces.go index 6206795991a2..680cbef794e5 100644 --- a/services/preview/digitaltwins/mgmt/2020-03-01-preview/digitaltwins/digitaltwinsapi/interfaces.go +++ b/services/preview/digitaltwins/mgmt/2020-03-01-preview/digitaltwins/digitaltwinsapi/interfaces.go @@ -48,23 +48,6 @@ type EndpointClientAPI interface { var _ EndpointClientAPI = (*digitaltwins.EndpointClient)(nil) -// IoTHubClientAPI contains the set of methods on the IoTHubClient type. -type IoTHubClientAPI interface { - CreateOrUpdate(ctx context.Context, scope string, integrationResourceName string, iotHubDescription digitaltwins.IntegrationResource) (result digitaltwins.IntegrationResource, err error) - Delete(ctx context.Context, scope string, integrationResourceName string) (result digitaltwins.IoTHubDeleteFuture, err error) - Get(ctx context.Context, scope string, integrationResourceName string) (result digitaltwins.IntegrationResource, err error) -} - -var _ IoTHubClientAPI = (*digitaltwins.IoTHubClient)(nil) - -// IoTHubsClientAPI contains the set of methods on the IoTHubsClient type. -type IoTHubsClientAPI interface { - List(ctx context.Context, resourceGroupName string, resourceName string) (result digitaltwins.IntegrationResourceListResultPage, err error) - ListComplete(ctx context.Context, resourceGroupName string, resourceName string) (result digitaltwins.IntegrationResourceListResultIterator, err error) -} - -var _ IoTHubsClientAPI = (*digitaltwins.IoTHubsClient)(nil) - // OperationsClientAPI contains the set of methods on the OperationsClient type. type OperationsClientAPI interface { List(ctx context.Context) (result digitaltwins.OperationListResultPage, err error) diff --git a/services/preview/digitaltwins/mgmt/2020-03-01-preview/digitaltwins/iothub.go b/services/preview/digitaltwins/mgmt/2020-03-01-preview/digitaltwins/iothub.go deleted file mode 100644 index 05e0190ef324..000000000000 --- a/services/preview/digitaltwins/mgmt/2020-03-01-preview/digitaltwins/iothub.go +++ /dev/null @@ -1,278 +0,0 @@ -package digitaltwins - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// 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" - "github.com/satori/go.uuid" - "net/http" -) - -// IoTHubClient is the azure Digital Twins Client for managing DigitalTwinsInstance -type IoTHubClient struct { - BaseClient -} - -// NewIoTHubClient creates an instance of the IoTHubClient client. -func NewIoTHubClient(subscriptionID uuid.UUID) 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 uuid.UUID) IoTHubClient { - return IoTHubClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// CreateOrUpdate creates or Updates an IoTHub Integration with DigitalTwinsInstances. -// Parameters: -// scope - the scope of the Digital Twins Integration. The scope has to be an IoTHub resource. For example, -// /{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IoTHubs/{resourceName}. -// integrationResourceName - name of IoTHub and DigitalTwinsInstance integration instance. -// iotHubDescription - the IoTHub metadata. -func (client IoTHubClient) CreateOrUpdate(ctx context.Context, scope string, integrationResourceName string, iotHubDescription IntegrationResource) (result IntegrationResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IoTHubClient.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: integrationResourceName, - Constraints: []validation.Constraint{{Target: "integrationResourceName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "integrationResourceName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("digitaltwins.IoTHubClient", "CreateOrUpdate", err.Error()) - } - - req, err := client.CreateOrUpdatePreparer(ctx, scope, integrationResourceName, iotHubDescription) - if err != nil { - err = autorest.NewErrorWithError(err, "digitaltwins.IoTHubClient", "CreateOrUpdate", nil, "Failure preparing request") - return - } - - resp, err := client.CreateOrUpdateSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "digitaltwins.IoTHubClient", "CreateOrUpdate", resp, "Failure sending request") - return - } - - result, err = client.CreateOrUpdateResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "digitaltwins.IoTHubClient", "CreateOrUpdate", resp, "Failure responding to request") - } - - return -} - -// CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client IoTHubClient) CreateOrUpdatePreparer(ctx context.Context, scope string, integrationResourceName string, iotHubDescription IntegrationResource) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "integrationResourceName": autorest.Encode("path", integrationResourceName), - "scope": autorest.Encode("path", scope), - } - - preparer := autorest.CreatePreparer( - autorest.AsContentType("application/json; charset=utf-8"), - autorest.AsPut(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/{scope}/providers/Microsoft.DigitalTwins/integrationResources/{integrationResourceName}", pathParameters), - autorest.WithJSON(iotHubDescription)) - 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 IoTHubClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always -// closes the http.Response Body. -func (client IoTHubClient) CreateOrUpdateResponder(resp *http.Response) (result IntegrationResource, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Delete deletes a DigitalTwinsInstance link with IoTHub. -// Parameters: -// scope - the scope of the Digital Twins Integration. The scope has to be an IoTHub resource. For example, -// /{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IoTHubs/{resourceName}. -// integrationResourceName - name of IoTHub and DigitalTwinsInstance integration instance. -func (client IoTHubClient) Delete(ctx context.Context, scope string, integrationResourceName string) (result IoTHubDeleteFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IoTHubClient.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: integrationResourceName, - Constraints: []validation.Constraint{{Target: "integrationResourceName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "integrationResourceName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("digitaltwins.IoTHubClient", "Delete", err.Error()) - } - - req, err := client.DeletePreparer(ctx, scope, integrationResourceName) - if err != nil { - err = autorest.NewErrorWithError(err, "digitaltwins.IoTHubClient", "Delete", nil, "Failure preparing request") - return - } - - result, err = client.DeleteSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "digitaltwins.IoTHubClient", "Delete", result.Response(), "Failure sending request") - return - } - - return -} - -// DeletePreparer prepares the Delete request. -func (client IoTHubClient) DeletePreparer(ctx context.Context, scope string, integrationResourceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "integrationResourceName": autorest.Encode("path", integrationResourceName), - "scope": autorest.Encode("path", scope), - } - - preparer := autorest.CreatePreparer( - autorest.AsDelete(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/{scope}/providers/Microsoft.DigitalTwins/integrationResources/{integrationResourceName}", pathParameters)) - 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 IoTHubClient) DeleteSender(req *http.Request) (future IoTHubDeleteFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if err != nil { - return - } - future.Future, err = azure.NewFutureFromResponse(resp) - return -} - -// DeleteResponder handles the response to the Delete request. The method always -// closes the http.Response Body. -func (client IoTHubClient) DeleteResponder(resp *http.Response) (result IntegrationResource, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Get gets properties of an IoTHub Integration. -// Parameters: -// scope - the scope of the Digital Twins Integration. The scope has to be an IoTHub resource. For example, -// /{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IoTHubs/{resourceName}. -// integrationResourceName - name of IoTHub and DigitalTwinsInstance integration instance. -func (client IoTHubClient) Get(ctx context.Context, scope string, integrationResourceName string) (result IntegrationResource, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IoTHubClient.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: integrationResourceName, - Constraints: []validation.Constraint{{Target: "integrationResourceName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "integrationResourceName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("digitaltwins.IoTHubClient", "Get", err.Error()) - } - - req, err := client.GetPreparer(ctx, scope, integrationResourceName) - if err != nil { - err = autorest.NewErrorWithError(err, "digitaltwins.IoTHubClient", "Get", nil, "Failure preparing request") - return - } - - resp, err := client.GetSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "digitaltwins.IoTHubClient", "Get", resp, "Failure sending request") - return - } - - result, err = client.GetResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "digitaltwins.IoTHubClient", "Get", resp, "Failure responding to request") - } - - return -} - -// GetPreparer prepares the Get request. -func (client IoTHubClient) GetPreparer(ctx context.Context, scope string, integrationResourceName string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "integrationResourceName": autorest.Encode("path", integrationResourceName), - "scope": autorest.Encode("path", scope), - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/{scope}/providers/Microsoft.DigitalTwins/integrationResources/{integrationResourceName}", pathParameters)) - 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 IoTHubClient) GetSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetResponder handles the response to the Get request. The method always -// closes the http.Response Body. -func (client IoTHubClient) GetResponder(resp *http.Response) (result IntegrationResource, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/services/preview/digitaltwins/mgmt/2020-03-01-preview/digitaltwins/iothubs.go b/services/preview/digitaltwins/mgmt/2020-03-01-preview/digitaltwins/iothubs.go deleted file mode 100644 index 642de380b822..000000000000 --- a/services/preview/digitaltwins/mgmt/2020-03-01-preview/digitaltwins/iothubs.go +++ /dev/null @@ -1,168 +0,0 @@ -package digitaltwins - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// 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" - "github.com/satori/go.uuid" - "net/http" -) - -// IoTHubsClient is the azure Digital Twins Client for managing DigitalTwinsInstance -type IoTHubsClient struct { - BaseClient -} - -// NewIoTHubsClient creates an instance of the IoTHubsClient client. -func NewIoTHubsClient(subscriptionID uuid.UUID) IoTHubsClient { - return NewIoTHubsClientWithBaseURI(DefaultBaseURI, subscriptionID) -} - -// NewIoTHubsClientWithBaseURI creates an instance of the IoTHubsClient 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 NewIoTHubsClientWithBaseURI(baseURI string, subscriptionID uuid.UUID) IoTHubsClient { - return IoTHubsClient{NewWithBaseURI(baseURI, subscriptionID)} -} - -// List get DigitalTwinsInstance IoTHubs. -// Parameters: -// resourceGroupName - the name of the resource group that contains the DigitalTwinsInstance. -// resourceName - the name of the DigitalTwinsInstance. -func (client IoTHubsClient) List(ctx context.Context, resourceGroupName string, resourceName string) (result IntegrationResourceListResultPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IoTHubsClient.List") - defer func() { - sc := -1 - if result.irlr.Response.Response != nil { - sc = result.irlr.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - if err := validation.Validate([]validation.Validation{ - {TargetValue: resourceGroupName, - Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, - {TargetValue: resourceName, - Constraints: []validation.Constraint{{Target: "resourceName", Name: validation.MaxLength, Rule: 64, Chain: nil}, - {Target: "resourceName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { - return result, validation.NewError("digitaltwins.IoTHubsClient", "List", err.Error()) - } - - result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, resourceName) - if err != nil { - err = autorest.NewErrorWithError(err, "digitaltwins.IoTHubsClient", "List", nil, "Failure preparing request") - return - } - - resp, err := client.ListSender(req) - if err != nil { - result.irlr.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "digitaltwins.IoTHubsClient", "List", resp, "Failure sending request") - return - } - - result.irlr, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "digitaltwins.IoTHubsClient", "List", resp, "Failure responding to request") - } - - return -} - -// ListPreparer prepares the List request. -func (client IoTHubsClient) 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 = "2020-03-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.DigitalTwins/digitalTwinsInstances/{resourceName}/integrationResources", 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 IoTHubsClient) 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 IoTHubsClient) ListResponder(resp *http.Response) (result IntegrationResourceListResult, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - 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 IoTHubsClient) listNextResults(ctx context.Context, lastResults IntegrationResourceListResult) (result IntegrationResourceListResult, err error) { - req, err := lastResults.integrationResourceListResultPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "digitaltwins.IoTHubsClient", "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, "digitaltwins.IoTHubsClient", "listNextResults", resp, "Failure sending next results request") - } - result, err = client.ListResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "digitaltwins.IoTHubsClient", "listNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client IoTHubsClient) ListComplete(ctx context.Context, resourceGroupName string, resourceName string) (result IntegrationResourceListResultIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IoTHubsClient.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, resourceName) - return -} diff --git a/services/preview/digitaltwins/mgmt/2020-03-01-preview/digitaltwins/models.go b/services/preview/digitaltwins/mgmt/2020-03-01-preview/digitaltwins/models.go index bad1a959f190..c22967727acd 100644 --- a/services/preview/digitaltwins/mgmt/2020-03-01-preview/digitaltwins/models.go +++ b/services/preview/digitaltwins/mgmt/2020-03-01-preview/digitaltwins/models.go @@ -71,27 +71,6 @@ func PossibleEndpointTypeValues() []EndpointType { return []EndpointType{EndpointTypeDigitalTwinsEndpointResourceProperties, EndpointTypeEventGrid, EndpointTypeEventHub, EndpointTypeServiceBus} } -// IntegrationResourceState enumerates the values for integration resource state. -type IntegrationResourceState string - -const ( - // IntegrationResourceStateCanceled ... - IntegrationResourceStateCanceled IntegrationResourceState = "Canceled" - // IntegrationResourceStateDeleting ... - IntegrationResourceStateDeleting IntegrationResourceState = "Deleting" - // IntegrationResourceStateFailed ... - IntegrationResourceStateFailed IntegrationResourceState = "Failed" - // IntegrationResourceStateProvisioning ... - IntegrationResourceStateProvisioning IntegrationResourceState = "Provisioning" - // IntegrationResourceStateSucceeded ... - IntegrationResourceStateSucceeded IntegrationResourceState = "Succeeded" -) - -// PossibleIntegrationResourceStateValues returns an array of possible values for the IntegrationResourceState const type. -func PossibleIntegrationResourceStateValues() []IntegrationResourceState { - return []IntegrationResourceState{IntegrationResourceStateCanceled, IntegrationResourceStateDeleting, IntegrationResourceStateFailed, IntegrationResourceStateProvisioning, IntegrationResourceStateSucceeded} -} - // ProvisioningState enumerates the values for provisioning state. type ProvisioningState string @@ -221,7 +200,7 @@ type Description struct { Location *string `json:"location,omitempty"` // Tags - The resource tags. Tags map[string]*string `json:"tags"` - // Sku - The resource sku. + // Sku - This property is reserved for future use, and will be ignored/omitted Sku *SkuInfo `json:"sku,omitempty"` } @@ -988,350 +967,6 @@ type ExternalResource struct { Type *string `json:"type,omitempty"` } -// IntegrationResource ioTHub integration resource. -type IntegrationResource struct { - autorest.Response `json:"-"` - // IntegrationResourceProperties - IoTHub integration resource properties. - *IntegrationResourceProperties `json:"properties,omitempty"` - // ID - READ-ONLY; The resource identifier. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Extension resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The resource type. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for IntegrationResource. -func (ir IntegrationResource) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ir.IntegrationResourceProperties != nil { - objectMap["properties"] = ir.IntegrationResourceProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for IntegrationResource struct. -func (ir *IntegrationResource) 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 integrationResourceProperties IntegrationResourceProperties - err = json.Unmarshal(*v, &integrationResourceProperties) - if err != nil { - return err - } - ir.IntegrationResourceProperties = &integrationResourceProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ir.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ir.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ir.Type = &typeVar - } - } - } - - return nil -} - -// IntegrationResourceListResult a list of DigitalTwinsInstance IoTHubs with a next link. -type IntegrationResourceListResult struct { - autorest.Response `json:"-"` - // NextLink - The link used to get the next page of DigitalTwinsInstance IoTHubs. - NextLink *string `json:"nextLink,omitempty"` - // Value - A list of DigitalTwinsInstance IoTHubs. - Value *[]IntegrationResource `json:"value,omitempty"` -} - -// IntegrationResourceListResultIterator provides access to a complete listing of IntegrationResource -// values. -type IntegrationResourceListResultIterator struct { - i int - page IntegrationResourceListResultPage -} - -// 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 *IntegrationResourceListResultIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationResourceListResultIterator.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 *IntegrationResourceListResultIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter IntegrationResourceListResultIterator) 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 IntegrationResourceListResultIterator) Response() IntegrationResourceListResult { - 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 IntegrationResourceListResultIterator) Value() IntegrationResource { - if !iter.page.NotDone() { - return IntegrationResource{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the IntegrationResourceListResultIterator type. -func NewIntegrationResourceListResultIterator(page IntegrationResourceListResultPage) IntegrationResourceListResultIterator { - return IntegrationResourceListResultIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (irlr IntegrationResourceListResult) IsEmpty() bool { - return irlr.Value == nil || len(*irlr.Value) == 0 -} - -// integrationResourceListResultPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (irlr IntegrationResourceListResult) integrationResourceListResultPreparer(ctx context.Context) (*http.Request, error) { - if irlr.NextLink == nil || len(to.String(irlr.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(irlr.NextLink))) -} - -// IntegrationResourceListResultPage contains a page of IntegrationResource values. -type IntegrationResourceListResultPage struct { - fn func(context.Context, IntegrationResourceListResult) (IntegrationResourceListResult, error) - irlr IntegrationResourceListResult -} - -// 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 *IntegrationResourceListResultPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/IntegrationResourceListResultPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - next, err := page.fn(ctx, page.irlr) - if err != nil { - return err - } - page.irlr = next - 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 *IntegrationResourceListResultPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page IntegrationResourceListResultPage) NotDone() bool { - return !page.irlr.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page IntegrationResourceListResultPage) Response() IntegrationResourceListResult { - return page.irlr -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page IntegrationResourceListResultPage) Values() []IntegrationResource { - if page.irlr.IsEmpty() { - return nil - } - return *page.irlr.Value -} - -// Creates a new instance of the IntegrationResourceListResultPage type. -func NewIntegrationResourceListResultPage(getNextPage func(context.Context, IntegrationResourceListResult) (IntegrationResourceListResult, error)) IntegrationResourceListResultPage { - return IntegrationResourceListResultPage{fn: getNextPage} -} - -// IntegrationResourceProperties properties related to the IoTHub DigitalTwinsInstance Integration -// Resource. -type IntegrationResourceProperties struct { - // ResourceID - Fully qualified resource identifier of the DigitalTwins Azure resource. - ResourceID *string `json:"resourceId,omitempty"` - // CreatedTime - READ-ONLY; Time when the IoTHub was added to DigitalTwinsInstance. - CreatedTime *date.Time `json:"createdTime,omitempty"` - // ProvisioningState - READ-ONLY; DigitalTwinsInstance - IoTHub link state. Possible values include: 'IntegrationResourceStateProvisioning', 'IntegrationResourceStateDeleting', 'IntegrationResourceStateSucceeded', 'IntegrationResourceStateFailed', 'IntegrationResourceStateCanceled' - ProvisioningState IntegrationResourceState `json:"provisioningState,omitempty"` -} - -// IntegrationResourceState1 properties related to the IoTHub DigitalTwinsInstance Integration Resource. -type IntegrationResourceState1 struct { - // ProvisioningState - READ-ONLY; DigitalTwinsInstance - IoTHub link state. Possible values include: 'IntegrationResourceStateProvisioning', 'IntegrationResourceStateDeleting', 'IntegrationResourceStateSucceeded', 'IntegrationResourceStateFailed', 'IntegrationResourceStateCanceled' - ProvisioningState IntegrationResourceState `json:"provisioningState,omitempty"` -} - -// IntegrationResourceUpdateInfo ioTHub integration resource. -type IntegrationResourceUpdateInfo struct { - // IntegrationResourceUpdateProperties - IoTHub integration resource properties to be updated. - *IntegrationResourceUpdateProperties `json:"properties,omitempty"` - // ID - READ-ONLY; The resource identifier. - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Extension resource name. - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; The resource type. - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for IntegrationResourceUpdateInfo. -func (irui IntegrationResourceUpdateInfo) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if irui.IntegrationResourceUpdateProperties != nil { - objectMap["properties"] = irui.IntegrationResourceUpdateProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for IntegrationResourceUpdateInfo struct. -func (irui *IntegrationResourceUpdateInfo) 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 integrationResourceUpdateProperties IntegrationResourceUpdateProperties - err = json.Unmarshal(*v, &integrationResourceUpdateProperties) - if err != nil { - return err - } - irui.IntegrationResourceUpdateProperties = &integrationResourceUpdateProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - irui.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - irui.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - irui.Type = &typeVar - } - } - } - - return nil -} - -// IntegrationResourceUpdateProperties updatable properties related to the IoTHub DigitalTwinsInstance -// Integration Resource. -type IntegrationResourceUpdateProperties struct { - // ProvisioningState - READ-ONLY; DigitalTwinsInstance - IoTHub link state. Possible values include: 'IntegrationResourceStateProvisioning', 'IntegrationResourceStateDeleting', 'IntegrationResourceStateSucceeded', 'IntegrationResourceStateFailed', 'IntegrationResourceStateCanceled' - ProvisioningState IntegrationResourceState `json:"provisioningState,omitempty"` -} - -// IoTHubDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. -type IoTHubDeleteFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *IoTHubDeleteFuture) Result(client IoTHubClient) (ir IntegrationResource, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "digitaltwins.IoTHubDeleteFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("digitaltwins.IoTHubDeleteFuture") - return - } - sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) - if ir.Response.Response, err = future.GetResult(sender); err == nil && ir.Response.Response.StatusCode != http.StatusNoContent { - ir, err = client.DeleteResponder(ir.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "digitaltwins.IoTHubDeleteFuture", "Result", ir.Response.Response, "Failure responding to request") - } - } - return -} - // Operation digitalTwins service REST API operation type Operation struct { // Name - READ-ONLY; Operation name: {provider}/{resource}/{read | write | action | delete} @@ -1538,7 +1173,7 @@ type Resource struct { Location *string `json:"location,omitempty"` // Tags - The resource tags. Tags map[string]*string `json:"tags"` - // Sku - The resource sku. + // Sku - This property is reserved for future use, and will be ignored/omitted Sku *SkuInfo `json:"sku,omitempty"` } diff --git a/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/clusters.go b/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/clusters.go index 88b782f28bc7..c9fe0d61f28d 100644 --- a/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/clusters.go +++ b/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/clusters.go @@ -213,10 +213,11 @@ func (client ClustersClient) GetResponder(resp *http.Response) (result Cluster, return } -// ListAvailableClusters list the quantity of available pre-provisioned Event Hubs Clusters, indexed by Azure region. -func (client ClustersClient) ListAvailableClusters(ctx context.Context) (result AvailableClustersList, err error) { +// ListAvailableClusterRegion list the quantity of available pre-provisioned Event Hubs Clusters, indexed by Azure +// region. +func (client ClustersClient) ListAvailableClusterRegion(ctx context.Context) (result AvailableClustersList, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.ListAvailableClusters") + ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.ListAvailableClusterRegion") defer func() { sc := -1 if result.Response.Response != nil { @@ -225,29 +226,29 @@ func (client ClustersClient) ListAvailableClusters(ctx context.Context) (result tracing.EndSpan(ctx, sc, err) }() } - req, err := client.ListAvailableClustersPreparer(ctx) + req, err := client.ListAvailableClusterRegionPreparer(ctx) if err != nil { - err = autorest.NewErrorWithError(err, "eventhub.ClustersClient", "ListAvailableClusters", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "eventhub.ClustersClient", "ListAvailableClusterRegion", nil, "Failure preparing request") return } - resp, err := client.ListAvailableClustersSender(req) + resp, err := client.ListAvailableClusterRegionSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "eventhub.ClustersClient", "ListAvailableClusters", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "eventhub.ClustersClient", "ListAvailableClusterRegion", resp, "Failure sending request") return } - result, err = client.ListAvailableClustersResponder(resp) + result, err = client.ListAvailableClusterRegionResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "eventhub.ClustersClient", "ListAvailableClusters", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "eventhub.ClustersClient", "ListAvailableClusterRegion", resp, "Failure responding to request") } return } -// ListAvailableClustersPreparer prepares the ListAvailableClusters request. -func (client ClustersClient) ListAvailableClustersPreparer(ctx context.Context) (*http.Request, error) { +// ListAvailableClusterRegionPreparer prepares the ListAvailableClusterRegion request. +func (client ClustersClient) ListAvailableClusterRegionPreparer(ctx context.Context) (*http.Request, error) { pathParameters := map[string]interface{}{ "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -265,15 +266,15 @@ func (client ClustersClient) ListAvailableClustersPreparer(ctx context.Context) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// ListAvailableClustersSender sends the ListAvailableClusters request. The method will close the +// ListAvailableClusterRegionSender sends the ListAvailableClusterRegion request. The method will close the // http.Response Body if it receives an error. -func (client ClustersClient) ListAvailableClustersSender(req *http.Request) (*http.Response, error) { +func (client ClustersClient) ListAvailableClusterRegionSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } -// ListAvailableClustersResponder handles the response to the ListAvailableClusters request. The method always +// ListAvailableClusterRegionResponder handles the response to the ListAvailableClusterRegion request. The method always // closes the http.Response Body. -func (client ClustersClient) ListAvailableClustersResponder(resp *http.Response) (result AvailableClustersList, err error) { +func (client ClustersClient) ListAvailableClusterRegionResponder(resp *http.Response) (result AvailableClustersList, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -284,7 +285,7 @@ func (client ClustersClient) ListAvailableClustersResponder(resp *http.Response) return } -// ListByResourceGroup lists the available Event Hubs Clusters within an ARM resource group. +// ListByResourceGroup lists the available Event Hubs Clusters within an ARM resource group // Parameters: // resourceGroupName - name of the resource group within the azure subscription. func (client ClustersClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ClusterListResultPage, err error) { @@ -582,7 +583,8 @@ func (client ClustersClient) PatchResponder(resp *http.Response) (result Cluster // Parameters: // resourceGroupName - name of the resource group within the azure subscription. // clusterName - the name of the Event Hubs Cluster. -func (client ClustersClient) Put(ctx context.Context, resourceGroupName string, clusterName string) (result ClustersPutFuture, err error) { +// parameters - parameters for creating a eventhub cluster resource. +func (client ClustersClient) Put(ctx context.Context, resourceGroupName string, clusterName string, parameters Cluster) (result ClustersPutFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.Put") defer func() { @@ -599,11 +601,19 @@ func (client ClustersClient) Put(ctx context.Context, resourceGroupName string, {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, {TargetValue: clusterName, Constraints: []validation.Constraint{{Target: "clusterName", Name: validation.MaxLength, Rule: 50, Chain: nil}, - {Target: "clusterName", Name: validation.MinLength, Rule: 6, Chain: nil}}}}); err != nil { + {Target: "clusterName", Name: validation.MinLength, Rule: 6, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Sku", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Sku.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.Sku.Capacity", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Sku.Capacity", Name: validation.InclusiveMaximum, Rule: int64(32), Chain: nil}, + {Target: "parameters.Sku.Capacity", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, + }}, + }}}}}); err != nil { return result, validation.NewError("eventhub.ClustersClient", "Put", err.Error()) } - req, err := client.PutPreparer(ctx, resourceGroupName, clusterName) + req, err := client.PutPreparer(ctx, resourceGroupName, clusterName, parameters) if err != nil { err = autorest.NewErrorWithError(err, "eventhub.ClustersClient", "Put", nil, "Failure preparing request") return @@ -619,7 +629,7 @@ func (client ClustersClient) Put(ctx context.Context, resourceGroupName string, } // PutPreparer prepares the Put request. -func (client ClustersClient) PutPreparer(ctx context.Context, resourceGroupName string, clusterName string) (*http.Request, error) { +func (client ClustersClient) PutPreparer(ctx context.Context, resourceGroupName string, clusterName string, parameters Cluster) (*http.Request, error) { pathParameters := map[string]interface{}{ "clusterName": autorest.Encode("path", clusterName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -632,9 +642,11 @@ func (client ClustersClient) PutPreparer(ctx context.Context, resourceGroupName } preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.EventHub/clusters/{clusterName}", pathParameters), + autorest.WithJSON(parameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } diff --git a/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/eventhubapi/interfaces.go b/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/eventhubapi/interfaces.go index 57846b59b37b..6969c624a7c4 100644 --- a/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/eventhubapi/interfaces.go +++ b/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/eventhubapi/interfaces.go @@ -27,12 +27,12 @@ import ( type ClustersClientAPI interface { Delete(ctx context.Context, resourceGroupName string, clusterName string) (result eventhub.ClustersDeleteFuture, err error) Get(ctx context.Context, resourceGroupName string, clusterName string) (result eventhub.Cluster, err error) - ListAvailableClusters(ctx context.Context) (result eventhub.AvailableClustersList, err error) + ListAvailableClusterRegion(ctx context.Context) (result eventhub.AvailableClustersList, err error) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result eventhub.ClusterListResultPage, err error) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result eventhub.ClusterListResultIterator, err error) ListNamespaces(ctx context.Context, resourceGroupName string, clusterName string) (result eventhub.EHNamespaceIDListResult, err error) Patch(ctx context.Context, resourceGroupName string, clusterName string, parameters eventhub.Cluster) (result eventhub.ClustersPatchFuture, err error) - Put(ctx context.Context, resourceGroupName string, clusterName string) (result eventhub.ClustersPutFuture, err error) + Put(ctx context.Context, resourceGroupName string, clusterName string, parameters eventhub.Cluster) (result eventhub.ClustersPutFuture, err error) } var _ ClustersClientAPI = (*eventhub.ClustersClient)(nil) diff --git a/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/models.go b/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/models.go index 9b6d4d5bffd5..bd8f2e0f10f7 100644 --- a/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/models.go +++ b/services/preview/eventhub/mgmt/2018-01-01-preview/eventhub/models.go @@ -1051,10 +1051,10 @@ func NewClusterListResultPage(getNextPage func(context.Context, ClusterListResul // ClusterProperties event Hubs Cluster properties supplied in responses in List or Get operations. type ClusterProperties struct { - // Created - READ-ONLY; The UTC time when the Event Hubs Cluster was created. - Created *string `json:"created,omitempty"` - // Updated - READ-ONLY; The UTC time when the Event Hubs Cluster was last updated. - Updated *string `json:"updated,omitempty"` + // CreatedAt - READ-ONLY; The UTC time when the Event Hubs Cluster was created. + CreatedAt *string `json:"createdAt,omitempty"` + // UpdatedAt - READ-ONLY; The UTC time when the Event Hubs Cluster was last updated. + UpdatedAt *string `json:"updatedAt,omitempty"` // MetricID - READ-ONLY; The metric ID of the cluster resource. Provided by the service and not modifiable by the user. MetricID *string `json:"metricId,omitempty"` // Status - READ-ONLY; Status of the Cluster resource @@ -1775,7 +1775,7 @@ type EHNamespaceProperties struct { // Encryption properties to configure Encryption type Encryption struct { // KeyVaultProperties - Properties of KeyVault - KeyVaultProperties *KeyVaultProperties `json:"keyVaultProperties,omitempty"` + KeyVaultProperties *[]KeyVaultProperties `json:"keyVaultProperties,omitempty"` // KeySource - Enumerates the possible value of keySource for Encryption. Possible values include: 'MicrosoftKeyVault' KeySource KeySource `json:"keySource,omitempty"` } @@ -2034,6 +2034,8 @@ type KeyVaultProperties struct { KeyName *string `json:"keyName,omitempty"` // KeyVaultURI - Uri of KeyVault KeyVaultURI *string `json:"keyVaultUri,omitempty"` + // KeyVersion - Key Version + KeyVersion *string `json:"keyVersion,omitempty"` } // ListResult the result of the List EventHubs operation. diff --git a/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/hdinsightapi/interfaces.go b/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/hdinsightapi/interfaces.go index a3cad5a86b28..2e352f40c421 100644 --- a/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/hdinsightapi/interfaces.go +++ b/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/hdinsightapi/interfaces.go @@ -109,3 +109,11 @@ type OperationsClientAPI interface { } var _ OperationsClientAPI = (*hdinsight.OperationsClient)(nil) + +// VirtualMachinesClientAPI contains the set of methods on the VirtualMachinesClient type. +type VirtualMachinesClientAPI interface { + ListHosts(ctx context.Context, resourceGroupName string, clusterName string) (result hdinsight.HostInfoListResult, err error) + RestartHosts(ctx context.Context, resourceGroupName string, clusterName string, hosts []string) (result hdinsight.VirtualMachinesRestartHostsFuture, err error) +} + +var _ VirtualMachinesClientAPI = (*hdinsight.VirtualMachinesClient)(nil) diff --git a/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/models.go b/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/models.go index 804440086344..7c710ded6949 100644 --- a/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/models.go +++ b/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/models.go @@ -1373,6 +1373,19 @@ type HardwareProfile struct { VMSize *string `json:"vmSize,omitempty"` } +// HostInfo the cluster host information. +type HostInfo struct { + // Name - The host name + Name *string `json:"name,omitempty"` +} + +// HostInfoListResult result of the request to list cluster hosts +type HostInfoListResult struct { + autorest.Response `json:"-"` + // Value - The list of cluster hosts. + Value *[]HostInfo `json:"value,omitempty"` +} + // KafkaRestProperties the kafka rest proxy configuration which contains AAD security group information. type KafkaRestProperties struct { // ClientGroupInfo - The information of AAD security group. @@ -2183,6 +2196,29 @@ func (vs VersionSpec) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// VirtualMachinesRestartHostsFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type VirtualMachinesRestartHostsFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *VirtualMachinesRestartHostsFuture) 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, "hdinsight.VirtualMachinesRestartHostsFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("hdinsight.VirtualMachinesRestartHostsFuture") + return + } + ar.Response = future.Response() + return +} + // VirtualNetworkProfile the virtual network properties. type VirtualNetworkProfile struct { // ID - The ID of the virtual network. diff --git a/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/virtualmachines.go b/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/virtualmachines.go new file mode 100644 index 000000000000..5c0002f7ba58 --- /dev/null +++ b/services/preview/hdinsight/mgmt/2018-06-01-preview/hdinsight/virtualmachines.go @@ -0,0 +1,203 @@ +package hdinsight + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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 hDInsight Management Client +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)} +} + +// ListHosts lists the HDInsight clusters hosts +// Parameters: +// resourceGroupName - the name of the resource group. +// clusterName - the name of the cluster. +func (client VirtualMachinesClient) ListHosts(ctx context.Context, resourceGroupName string, clusterName string) (result HostInfoListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.ListHosts") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListHostsPreparer(ctx, resourceGroupName, clusterName) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.VirtualMachinesClient", "ListHosts", nil, "Failure preparing request") + return + } + + resp, err := client.ListHostsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "hdinsight.VirtualMachinesClient", "ListHosts", resp, "Failure sending request") + return + } + + result, err = client.ListHostsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.VirtualMachinesClient", "ListHosts", resp, "Failure responding to request") + } + + return +} + +// ListHostsPreparer prepares the ListHosts request. +func (client VirtualMachinesClient) ListHostsPreparer(ctx context.Context, resourceGroupName string, clusterName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-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.HDInsight/clusters/{clusterName}/listHosts", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListHostsSender sends the ListHosts request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachinesClient) ListHostsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListHostsResponder handles the response to the ListHosts request. The method always +// closes the http.Response Body. +func (client VirtualMachinesClient) ListHostsResponder(resp *http.Response) (result HostInfoListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RestartHosts restarts the specified HDInsight cluster hosts. +// Parameters: +// resourceGroupName - the name of the resource group. +// clusterName - the name of the cluster. +// hosts - the list of hosts to restart +func (client VirtualMachinesClient) RestartHosts(ctx context.Context, resourceGroupName string, clusterName string, hosts []string) (result VirtualMachinesRestartHostsFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.RestartHosts") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: hosts, + Constraints: []validation.Constraint{{Target: "hosts", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("hdinsight.VirtualMachinesClient", "RestartHosts", err.Error()) + } + + req, err := client.RestartHostsPreparer(ctx, resourceGroupName, clusterName, hosts) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.VirtualMachinesClient", "RestartHosts", nil, "Failure preparing request") + return + } + + result, err = client.RestartHostsSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "hdinsight.VirtualMachinesClient", "RestartHosts", result.Response(), "Failure sending request") + return + } + + return +} + +// RestartHostsPreparer prepares the RestartHosts request. +func (client VirtualMachinesClient) RestartHostsPreparer(ctx context.Context, resourceGroupName string, clusterName string, hosts []string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2018-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.HDInsight/clusters/{clusterName}/restartHosts", pathParameters), + autorest.WithJSON(hosts), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RestartHostsSender sends the RestartHosts request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachinesClient) RestartHostsSender(req *http.Request) (future VirtualMachinesRestartHostsFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// RestartHostsResponder handles the response to the RestartHosts request. The method always +// closes the http.Response Body. +func (client VirtualMachinesClient) RestartHostsResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/services/preview/healthcareapis/mgmt/2018-08-20-preview/healthcareapis/services.go b/services/preview/healthcareapis/mgmt/2018-08-20-preview/healthcareapis/services.go index 3b158d0b59f4..8f22ad12aadd 100644 --- a/services/preview/healthcareapis/mgmt/2018-08-20-preview/healthcareapis/services.go +++ b/services/preview/healthcareapis/mgmt/2018-08-20-preview/healthcareapis/services.go @@ -151,13 +151,12 @@ func (client ServicesClient) CreateOrUpdate(ctx context.Context, resourceGroupNa {Target: "resourceName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, {TargetValue: serviceDescription, Constraints: []validation.Constraint{{Target: "serviceDescription.Properties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "serviceDescription.Properties.AccessPolicies", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "serviceDescription.Properties.CosmosDbConfiguration", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "serviceDescription.Properties.CosmosDbConfiguration.OfferThroughput", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "serviceDescription.Properties.CosmosDbConfiguration.OfferThroughput", Name: validation.InclusiveMaximum, Rule: int64(10000), Chain: nil}, - {Target: "serviceDescription.Properties.CosmosDbConfiguration.OfferThroughput", Name: validation.InclusiveMinimum, Rule: int64(400), Chain: nil}, - }}, + Chain: []validation.Constraint{{Target: "serviceDescription.Properties.CosmosDbConfiguration", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "serviceDescription.Properties.CosmosDbConfiguration.OfferThroughput", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "serviceDescription.Properties.CosmosDbConfiguration.OfferThroughput", Name: validation.InclusiveMaximum, Rule: int64(10000), Chain: nil}, + {Target: "serviceDescription.Properties.CosmosDbConfiguration.OfferThroughput", Name: validation.InclusiveMinimum, Rule: int64(400), Chain: nil}, }}, + }}, {Target: "serviceDescription.Properties.CorsConfiguration", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "serviceDescription.Properties.CorsConfiguration.MaxAge", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "serviceDescription.Properties.CorsConfiguration.MaxAge", Name: validation.InclusiveMaximum, Rule: int64(99999), Chain: nil}, diff --git a/services/preview/kubernetesconfiguration/mgmt/2019-11-01-preview/kubernetesconfiguration/kubernetesconfigurationapi/interfaces.go b/services/preview/kubernetesconfiguration/mgmt/2019-11-01-preview/kubernetesconfiguration/kubernetesconfigurationapi/interfaces.go index c766da0b3d8f..1d29d509e643 100644 --- a/services/preview/kubernetesconfiguration/mgmt/2019-11-01-preview/kubernetesconfiguration/kubernetesconfigurationapi/interfaces.go +++ b/services/preview/kubernetesconfiguration/mgmt/2019-11-01-preview/kubernetesconfiguration/kubernetesconfigurationapi/interfaces.go @@ -24,19 +24,19 @@ import ( // SourceControlConfigurationsClientAPI contains the set of methods on the SourceControlConfigurationsClient type. type SourceControlConfigurationsClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, sourceControlConfigurationName string, APIVersion string, sourceControlConfiguration kubernetesconfiguration.SourceControlConfiguration) (result kubernetesconfiguration.SourceControlConfiguration, err error) - Delete(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, sourceControlConfigurationName string, APIVersion string) (result kubernetesconfiguration.SourceControlConfigurationsDeleteFuture, err error) - Get(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, sourceControlConfigurationName string, APIVersion string) (result kubernetesconfiguration.SourceControlConfiguration, err error) - List(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, APIVersion string) (result kubernetesconfiguration.SourceControlConfigurationListPage, err error) - ListComplete(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, APIVersion string) (result kubernetesconfiguration.SourceControlConfigurationListIterator, err error) + CreateOrUpdate(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, sourceControlConfigurationName string, sourceControlConfiguration kubernetesconfiguration.SourceControlConfiguration) (result kubernetesconfiguration.SourceControlConfiguration, err error) + Delete(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, sourceControlConfigurationName string) (result kubernetesconfiguration.SourceControlConfigurationsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, sourceControlConfigurationName string) (result kubernetesconfiguration.SourceControlConfiguration, err error) + List(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string) (result kubernetesconfiguration.SourceControlConfigurationListPage, err error) + ListComplete(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string) (result kubernetesconfiguration.SourceControlConfigurationListIterator, err error) } var _ SourceControlConfigurationsClientAPI = (*kubernetesconfiguration.SourceControlConfigurationsClient)(nil) // OperationsClientAPI contains the set of methods on the OperationsClient type. type OperationsClientAPI interface { - List(ctx context.Context, APIVersion string) (result kubernetesconfiguration.ResourceProviderOperationListPage, err error) - ListComplete(ctx context.Context, APIVersion string) (result kubernetesconfiguration.ResourceProviderOperationListIterator, err error) + List(ctx context.Context) (result kubernetesconfiguration.ResourceProviderOperationListPage, err error) + ListComplete(ctx context.Context) (result kubernetesconfiguration.ResourceProviderOperationListIterator, err error) } var _ OperationsClientAPI = (*kubernetesconfiguration.OperationsClient)(nil) diff --git a/services/preview/kubernetesconfiguration/mgmt/2019-11-01-preview/kubernetesconfiguration/models.go b/services/preview/kubernetesconfiguration/mgmt/2019-11-01-preview/kubernetesconfiguration/models.go index 22b9fe00964e..60c0ada68b1e 100644 --- a/services/preview/kubernetesconfiguration/mgmt/2019-11-01-preview/kubernetesconfiguration/models.go +++ b/services/preview/kubernetesconfiguration/mgmt/2019-11-01-preview/kubernetesconfiguration/models.go @@ -37,6 +37,10 @@ type ComplianceState string const ( // Compliant ... Compliant ComplianceState = "Compliant" + // Failed ... + Failed ComplianceState = "Failed" + // Installed ... + Installed ComplianceState = "Installed" // Noncompliant ... Noncompliant ComplianceState = "Noncompliant" // Pending ... @@ -45,7 +49,7 @@ const ( // PossibleComplianceStateValues returns an array of possible values for the ComplianceState const type. func PossibleComplianceStateValues() []ComplianceState { - return []ComplianceState{Compliant, Noncompliant, Pending} + return []ComplianceState{Compliant, Failed, Installed, Noncompliant, Pending} } // EnableHelmOperator enumerates the values for enable helm operator. @@ -112,26 +116,26 @@ func PossibleOperatorTypeValues() []OperatorType { type ProvisioningState string const ( - // Accepted ... - Accepted ProvisioningState = "Accepted" - // Deleting ... - Deleting ProvisioningState = "Deleting" - // Failed ... - Failed ProvisioningState = "Failed" - // Running ... - Running ProvisioningState = "Running" - // Succeeded ... - Succeeded ProvisioningState = "Succeeded" + // ProvisioningStateAccepted ... + ProvisioningStateAccepted ProvisioningState = "Accepted" + // ProvisioningStateDeleting ... + ProvisioningStateDeleting ProvisioningState = "Deleting" + // ProvisioningStateFailed ... + ProvisioningStateFailed ProvisioningState = "Failed" + // ProvisioningStateRunning ... + ProvisioningStateRunning ProvisioningState = "Running" + // ProvisioningStateSucceeded ... + ProvisioningStateSucceeded ProvisioningState = "Succeeded" ) // PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. func PossibleProvisioningStateValues() []ProvisioningState { - return []ProvisioningState{Accepted, Deleting, Failed, Running, Succeeded} + return []ProvisioningState{ProvisioningStateAccepted, ProvisioningStateDeleting, ProvisioningStateFailed, ProvisioningStateRunning, ProvisioningStateSucceeded} } // ComplianceStatus compliance Status details type ComplianceStatus struct { - // ComplianceState - READ-ONLY; The compliance state of the configuration. Possible values include: 'Pending', 'Compliant', 'Noncompliant' + // ComplianceState - READ-ONLY; The compliance state of the configuration. Possible values include: 'Pending', 'Compliant', 'Noncompliant', 'Installed', 'Failed' ComplianceState ComplianceState `json:"complianceState,omitempty"` // LastConfigApplied - Datetime the configuration was last applied. LastConfigApplied *date.Time `json:"lastConfigApplied,omitempty"` @@ -599,7 +603,7 @@ type SourceControlConfigurationProperties struct { EnableHelmOperator EnableHelmOperator `json:"enableHelmOperator,omitempty"` // HelmOperatorProperties - Properties for Helm operator. HelmOperatorProperties *HelmOperatorProperties `json:"helmOperatorProperties,omitempty"` - // ProvisioningState - READ-ONLY; The provisioning state of the resource provider. Possible values include: 'Accepted', 'Deleting', 'Running', 'Succeeded', 'Failed' + // ProvisioningState - READ-ONLY; The provisioning state of the resource provider. Possible values include: 'ProvisioningStateAccepted', 'ProvisioningStateDeleting', 'ProvisioningStateRunning', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed' ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` // ComplianceStatus - READ-ONLY; Compliance Status of the Configuration ComplianceStatus *ComplianceStatus `json:"complianceStatus,omitempty"` diff --git a/services/preview/kubernetesconfiguration/mgmt/2019-11-01-preview/kubernetesconfiguration/operations.go b/services/preview/kubernetesconfiguration/mgmt/2019-11-01-preview/kubernetesconfiguration/operations.go index 3c511341bf23..84569b22fef8 100644 --- a/services/preview/kubernetesconfiguration/mgmt/2019-11-01-preview/kubernetesconfiguration/operations.go +++ b/services/preview/kubernetesconfiguration/mgmt/2019-11-01-preview/kubernetesconfiguration/operations.go @@ -43,9 +43,7 @@ func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) Opera } // List list all the available operations the KubernetesConfiguration resource provider supports. -// Parameters: -// APIVersion - the API version to be used with the HTTP request. -func (client OperationsClient) List(ctx context.Context, APIVersion string) (result ResourceProviderOperationListPage, err error) { +func (client OperationsClient) List(ctx context.Context) (result ResourceProviderOperationListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") defer func() { @@ -57,7 +55,7 @@ func (client OperationsClient) List(ctx context.Context, APIVersion string) (res }() } result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, APIVersion) + req, err := client.ListPreparer(ctx) if err != nil { err = autorest.NewErrorWithError(err, "kubernetesconfiguration.OperationsClient", "List", nil, "Failure preparing request") return @@ -79,7 +77,8 @@ func (client OperationsClient) List(ctx context.Context, APIVersion string) (res } // ListPreparer prepares the List request. -func (client OperationsClient) ListPreparer(ctx context.Context, APIVersion string) (*http.Request, error) { +func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2019-11-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -133,7 +132,7 @@ func (client OperationsClient) listNextResults(ctx context.Context, lastResults } // ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client OperationsClient) ListComplete(ctx context.Context, APIVersion string) (result ResourceProviderOperationListIterator, err error) { +func (client OperationsClient) ListComplete(ctx context.Context) (result ResourceProviderOperationListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") defer func() { @@ -144,6 +143,6 @@ func (client OperationsClient) ListComplete(ctx context.Context, APIVersion stri tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.List(ctx, APIVersion) + result.page, err = client.List(ctx) return } diff --git a/services/preview/kubernetesconfiguration/mgmt/2019-11-01-preview/kubernetesconfiguration/sourcecontrolconfigurations.go b/services/preview/kubernetesconfiguration/mgmt/2019-11-01-preview/kubernetesconfiguration/sourcecontrolconfigurations.go index c5e98f5f294f..338eda712a67 100644 --- a/services/preview/kubernetesconfiguration/mgmt/2019-11-01-preview/kubernetesconfiguration/sourcecontrolconfigurations.go +++ b/services/preview/kubernetesconfiguration/mgmt/2019-11-01-preview/kubernetesconfiguration/sourcecontrolconfigurations.go @@ -52,9 +52,8 @@ func NewSourceControlConfigurationsClientWithBaseURI(baseURI string, subscriptio // connectedClusters (for OnPrem K8S clusters). // clusterName - the name of the kubernetes cluster. // sourceControlConfigurationName - name of the Source Control Configuration. -// APIVersion - the API version to be used with the HTTP request. // sourceControlConfiguration - properties necessary to Create KubernetesConfiguration. -func (client SourceControlConfigurationsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, sourceControlConfigurationName string, APIVersion string, sourceControlConfiguration SourceControlConfiguration) (result SourceControlConfiguration, err error) { +func (client SourceControlConfigurationsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, sourceControlConfigurationName string, sourceControlConfiguration SourceControlConfiguration) (result SourceControlConfiguration, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/SourceControlConfigurationsClient.CreateOrUpdate") defer func() { @@ -65,7 +64,7 @@ func (client SourceControlConfigurationsClient) CreateOrUpdate(ctx context.Conte tracing.EndSpan(ctx, sc, err) }() } - req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName, sourceControlConfigurationName, APIVersion, sourceControlConfiguration) + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName, sourceControlConfigurationName, sourceControlConfiguration) if err != nil { err = autorest.NewErrorWithError(err, "kubernetesconfiguration.SourceControlConfigurationsClient", "CreateOrUpdate", nil, "Failure preparing request") return @@ -87,7 +86,7 @@ func (client SourceControlConfigurationsClient) CreateOrUpdate(ctx context.Conte } // CreateOrUpdatePreparer prepares the CreateOrUpdate request. -func (client SourceControlConfigurationsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, sourceControlConfigurationName string, APIVersion string, sourceControlConfiguration SourceControlConfiguration) (*http.Request, error) { +func (client SourceControlConfigurationsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, sourceControlConfigurationName string, sourceControlConfiguration SourceControlConfiguration) (*http.Request, error) { pathParameters := map[string]interface{}{ "clusterName": autorest.Encode("path", clusterName), "clusterResourceName": autorest.Encode("path", clusterResourceName), @@ -97,6 +96,7 @@ func (client SourceControlConfigurationsClient) CreateOrUpdatePreparer(ctx conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } + const APIVersion = "2019-11-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -140,8 +140,7 @@ func (client SourceControlConfigurationsClient) CreateOrUpdateResponder(resp *ht // connectedClusters (for OnPrem K8S clusters). // clusterName - the name of the kubernetes cluster. // sourceControlConfigurationName - name of the Source Control Configuration. -// APIVersion - the API version to be used with the HTTP request. -func (client SourceControlConfigurationsClient) Delete(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, sourceControlConfigurationName string, APIVersion string) (result SourceControlConfigurationsDeleteFuture, err error) { +func (client SourceControlConfigurationsClient) Delete(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, sourceControlConfigurationName string) (result SourceControlConfigurationsDeleteFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/SourceControlConfigurationsClient.Delete") defer func() { @@ -152,7 +151,7 @@ func (client SourceControlConfigurationsClient) Delete(ctx context.Context, reso tracing.EndSpan(ctx, sc, err) }() } - req, err := client.DeletePreparer(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName, sourceControlConfigurationName, APIVersion) + req, err := client.DeletePreparer(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName, sourceControlConfigurationName) if err != nil { err = autorest.NewErrorWithError(err, "kubernetesconfiguration.SourceControlConfigurationsClient", "Delete", nil, "Failure preparing request") return @@ -168,7 +167,7 @@ func (client SourceControlConfigurationsClient) Delete(ctx context.Context, reso } // DeletePreparer prepares the Delete request. -func (client SourceControlConfigurationsClient) DeletePreparer(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, sourceControlConfigurationName string, APIVersion string) (*http.Request, error) { +func (client SourceControlConfigurationsClient) DeletePreparer(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, sourceControlConfigurationName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "clusterName": autorest.Encode("path", clusterName), "clusterResourceName": autorest.Encode("path", clusterResourceName), @@ -178,6 +177,7 @@ func (client SourceControlConfigurationsClient) DeletePreparer(ctx context.Conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } + const APIVersion = "2019-11-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -223,8 +223,7 @@ func (client SourceControlConfigurationsClient) DeleteResponder(resp *http.Respo // connectedClusters (for OnPrem K8S clusters). // clusterName - the name of the kubernetes cluster. // sourceControlConfigurationName - name of the Source Control Configuration. -// APIVersion - the API version to be used with the HTTP request. -func (client SourceControlConfigurationsClient) Get(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, sourceControlConfigurationName string, APIVersion string) (result SourceControlConfiguration, err error) { +func (client SourceControlConfigurationsClient) Get(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, sourceControlConfigurationName string) (result SourceControlConfiguration, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/SourceControlConfigurationsClient.Get") defer func() { @@ -235,7 +234,7 @@ func (client SourceControlConfigurationsClient) Get(ctx context.Context, resourc tracing.EndSpan(ctx, sc, err) }() } - req, err := client.GetPreparer(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName, sourceControlConfigurationName, APIVersion) + req, err := client.GetPreparer(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName, sourceControlConfigurationName) if err != nil { err = autorest.NewErrorWithError(err, "kubernetesconfiguration.SourceControlConfigurationsClient", "Get", nil, "Failure preparing request") return @@ -257,7 +256,7 @@ func (client SourceControlConfigurationsClient) Get(ctx context.Context, resourc } // GetPreparer prepares the Get request. -func (client SourceControlConfigurationsClient) GetPreparer(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, sourceControlConfigurationName string, APIVersion string) (*http.Request, error) { +func (client SourceControlConfigurationsClient) GetPreparer(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, sourceControlConfigurationName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "clusterName": autorest.Encode("path", clusterName), "clusterResourceName": autorest.Encode("path", clusterResourceName), @@ -267,6 +266,7 @@ func (client SourceControlConfigurationsClient) GetPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } + const APIVersion = "2019-11-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -306,8 +306,7 @@ func (client SourceControlConfigurationsClient) GetResponder(resp *http.Response // clusterResourceName - the Kubernetes cluster resource name - either managedClusters (for AKS clusters) or // connectedClusters (for OnPrem K8S clusters). // clusterName - the name of the kubernetes cluster. -// APIVersion - the API version to be used with the HTTP request. -func (client SourceControlConfigurationsClient) List(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, APIVersion string) (result SourceControlConfigurationListPage, err error) { +func (client SourceControlConfigurationsClient) List(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string) (result SourceControlConfigurationListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/SourceControlConfigurationsClient.List") defer func() { @@ -319,7 +318,7 @@ func (client SourceControlConfigurationsClient) List(ctx context.Context, resour }() } result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName, APIVersion) + req, err := client.ListPreparer(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName) if err != nil { err = autorest.NewErrorWithError(err, "kubernetesconfiguration.SourceControlConfigurationsClient", "List", nil, "Failure preparing request") return @@ -341,7 +340,7 @@ func (client SourceControlConfigurationsClient) List(ctx context.Context, resour } // ListPreparer prepares the List request. -func (client SourceControlConfigurationsClient) ListPreparer(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, APIVersion string) (*http.Request, error) { +func (client SourceControlConfigurationsClient) ListPreparer(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "clusterName": autorest.Encode("path", clusterName), "clusterResourceName": autorest.Encode("path", clusterResourceName), @@ -350,6 +349,7 @@ func (client SourceControlConfigurationsClient) ListPreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } + const APIVersion = "2019-11-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -403,7 +403,7 @@ func (client SourceControlConfigurationsClient) listNextResults(ctx context.Cont } // ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client SourceControlConfigurationsClient) ListComplete(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string, APIVersion string) (result SourceControlConfigurationListIterator, err error) { +func (client SourceControlConfigurationsClient) ListComplete(ctx context.Context, resourceGroupName string, clusterRp string, clusterResourceName string, clusterName string) (result SourceControlConfigurationListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/SourceControlConfigurationsClient.List") defer func() { @@ -414,6 +414,6 @@ func (client SourceControlConfigurationsClient) ListComplete(ctx context.Context tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.List(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName, APIVersion) + result.page, err = client.List(ctx, resourceGroupName, clusterRp, clusterResourceName, clusterName) return } diff --git a/services/preview/migrate/mgmt/2020-01-01/migrate/client.go b/services/preview/migrate/mgmt/2020-01-01/migrate/client.go index 7ccf933714de..97c899aa439c 100644 --- a/services/preview/migrate/mgmt/2020-01-01/migrate/client.go +++ b/services/preview/migrate/mgmt/2020-01-01/migrate/client.go @@ -1,6 +1,6 @@ -// Package migrate implements the Azure ARM Migrate service API version v1. -// +// Package migrate implements the Azure ARM Migrate service API version 2020-01-01. // +// Discover your workloads for Azure. package migrate // Copyright (c) Microsoft and contributors. All rights reserved. diff --git a/services/preview/migrate/mgmt/2020-01-01/migrate/hypervcluster.go b/services/preview/migrate/mgmt/2020-01-01/migrate/hypervcluster.go index 277242d2510b..c3fca5995d3f 100644 --- a/services/preview/migrate/mgmt/2020-01-01/migrate/hypervcluster.go +++ b/services/preview/migrate/mgmt/2020-01-01/migrate/hypervcluster.go @@ -25,7 +25,7 @@ import ( "net/http" ) -// HyperVClusterClient is the client for the HyperVCluster methods of the Migrate service. +// HyperVClusterClient is the discover your workloads for Azure. type HyperVClusterClient struct { BaseClient } diff --git a/services/preview/migrate/mgmt/2020-01-01/migrate/hypervhost.go b/services/preview/migrate/mgmt/2020-01-01/migrate/hypervhost.go index 40bf16808f37..307e2ad281b5 100644 --- a/services/preview/migrate/mgmt/2020-01-01/migrate/hypervhost.go +++ b/services/preview/migrate/mgmt/2020-01-01/migrate/hypervhost.go @@ -25,7 +25,7 @@ import ( "net/http" ) -// HyperVHostClient is the client for the HyperVHost methods of the Migrate service. +// HyperVHostClient is the discover your workloads for Azure. type HyperVHostClient struct { BaseClient } diff --git a/services/preview/migrate/mgmt/2020-01-01/migrate/hypervjobs.go b/services/preview/migrate/mgmt/2020-01-01/migrate/hypervjobs.go index dcb1603c12ed..d24ef243e284 100644 --- a/services/preview/migrate/mgmt/2020-01-01/migrate/hypervjobs.go +++ b/services/preview/migrate/mgmt/2020-01-01/migrate/hypervjobs.go @@ -25,7 +25,7 @@ import ( "net/http" ) -// HyperVJobsClient is the client for the HyperVJobs methods of the Migrate service. +// HyperVJobsClient is the discover your workloads for Azure. type HyperVJobsClient struct { BaseClient } diff --git a/services/preview/migrate/mgmt/2020-01-01/migrate/hypervmachines.go b/services/preview/migrate/mgmt/2020-01-01/migrate/hypervmachines.go index 7625cece6830..71546a6ec48c 100644 --- a/services/preview/migrate/mgmt/2020-01-01/migrate/hypervmachines.go +++ b/services/preview/migrate/mgmt/2020-01-01/migrate/hypervmachines.go @@ -25,7 +25,7 @@ import ( "net/http" ) -// HyperVMachinesClient is the client for the HyperVMachines methods of the Migrate service. +// HyperVMachinesClient is the discover your workloads for Azure. type HyperVMachinesClient struct { BaseClient } diff --git a/services/preview/migrate/mgmt/2020-01-01/migrate/hypervoperationsstatus.go b/services/preview/migrate/mgmt/2020-01-01/migrate/hypervoperationsstatus.go index 646a20a84cb9..5a0d10fc61f4 100644 --- a/services/preview/migrate/mgmt/2020-01-01/migrate/hypervoperationsstatus.go +++ b/services/preview/migrate/mgmt/2020-01-01/migrate/hypervoperationsstatus.go @@ -25,7 +25,7 @@ import ( "net/http" ) -// HyperVOperationsStatusClient is the client for the HyperVOperationsStatus methods of the Migrate service. +// HyperVOperationsStatusClient is the discover your workloads for Azure. type HyperVOperationsStatusClient struct { BaseClient } diff --git a/services/preview/migrate/mgmt/2020-01-01/migrate/hypervrunasaccounts.go b/services/preview/migrate/mgmt/2020-01-01/migrate/hypervrunasaccounts.go index 18c2dd2353bf..4ec69191bd44 100644 --- a/services/preview/migrate/mgmt/2020-01-01/migrate/hypervrunasaccounts.go +++ b/services/preview/migrate/mgmt/2020-01-01/migrate/hypervrunasaccounts.go @@ -25,7 +25,7 @@ import ( "net/http" ) -// HyperVRunAsAccountsClient is the client for the HyperVRunAsAccounts methods of the Migrate service. +// HyperVRunAsAccountsClient is the discover your workloads for Azure. type HyperVRunAsAccountsClient struct { BaseClient } diff --git a/services/preview/migrate/mgmt/2020-01-01/migrate/hypervsites.go b/services/preview/migrate/mgmt/2020-01-01/migrate/hypervsites.go index e30b37e8eb35..64dc5ef498e1 100644 --- a/services/preview/migrate/mgmt/2020-01-01/migrate/hypervsites.go +++ b/services/preview/migrate/mgmt/2020-01-01/migrate/hypervsites.go @@ -25,7 +25,7 @@ import ( "net/http" ) -// HyperVSitesClient is the client for the HyperVSites methods of the Migrate service. +// HyperVSitesClient is the discover your workloads for Azure. type HyperVSitesClient struct { BaseClient } diff --git a/services/preview/migrate/mgmt/2020-01-01/migrate/jobs.go b/services/preview/migrate/mgmt/2020-01-01/migrate/jobs.go index dfc983148b25..f1ebe783e7c7 100644 --- a/services/preview/migrate/mgmt/2020-01-01/migrate/jobs.go +++ b/services/preview/migrate/mgmt/2020-01-01/migrate/jobs.go @@ -25,7 +25,7 @@ import ( "net/http" ) -// JobsClient is the client for the Jobs methods of the Migrate service. +// JobsClient is the discover your workloads for Azure. type JobsClient struct { BaseClient } diff --git a/services/preview/migrate/mgmt/2020-01-01/migrate/machines.go b/services/preview/migrate/mgmt/2020-01-01/migrate/machines.go index 955ef0f37b98..572c8abe095b 100644 --- a/services/preview/migrate/mgmt/2020-01-01/migrate/machines.go +++ b/services/preview/migrate/mgmt/2020-01-01/migrate/machines.go @@ -25,7 +25,7 @@ import ( "net/http" ) -// MachinesClient is the client for the Machines methods of the Migrate service. +// MachinesClient is the discover your workloads for Azure. type MachinesClient struct { BaseClient } diff --git a/services/preview/migrate/mgmt/2020-01-01/migrate/migrateapi/interfaces.go b/services/preview/migrate/mgmt/2020-01-01/migrate/migrateapi/interfaces.go index 5e786ff7452c..b38add3218fa 100644 --- a/services/preview/migrate/mgmt/2020-01-01/migrate/migrateapi/interfaces.go +++ b/services/preview/migrate/mgmt/2020-01-01/migrate/migrateapi/interfaces.go @@ -151,3 +151,11 @@ type VMwareOperationsStatusClientAPI interface { } var _ VMwareOperationsStatusClientAPI = (*migrate.VMwareOperationsStatusClient)(nil) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context, APIVersion string) (result migrate.OperationResultListPage, err error) + ListComplete(ctx context.Context, APIVersion string) (result migrate.OperationResultListIterator, err error) +} + +var _ OperationsClientAPI = (*migrate.OperationsClient)(nil) diff --git a/services/preview/migrate/mgmt/2020-01-01/migrate/models.go b/services/preview/migrate/mgmt/2020-01-01/migrate/models.go index 408a010aa295..9cc1134a98de 100644 --- a/services/preview/migrate/mgmt/2020-01-01/migrate/models.go +++ b/services/preview/migrate/mgmt/2020-01-01/migrate/models.go @@ -1471,6 +1471,174 @@ type OperatingSystemConfiguration struct { Bitness Bitness `json:"bitness,omitempty"` } +// Operation a REST API operation supported by the provider. +type Operation struct { + // Name - READ-ONLY; Name of the operation. + Name *string `json:"name,omitempty"` + // Display - Displayable properties of the operation. + Display *OperationDisplay `json:"display,omitempty"` + // Origin - READ-ONLY; Origin of the operation. + Origin *string `json:"origin,omitempty"` +} + +// OperationDisplay displayable properties of the operation. +type OperationDisplay struct { + // Provider - READ-ONLY; Provider of the operation. + Provider *string `json:"provider,omitempty"` + // Resource - READ-ONLY; Resource operated on by the operation. + Resource *string `json:"resource,omitempty"` + // Operation - READ-ONLY; Operation Type. + Operation *string `json:"operation,omitempty"` + // Description - READ-ONLY; Description of the operation. + Description *string `json:"description,omitempty"` +} + +// OperationResultList list of API operations. +type OperationResultList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of operations. + Value *[]Operation `json:"value,omitempty"` + // NextLink - READ-ONLY; Value of next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// OperationResultListIterator provides access to a complete listing of Operation values. +type OperationResultListIterator struct { + i int + page OperationResultListPage +} + +// 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 *OperationResultListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationResultListIterator.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 *OperationResultListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter OperationResultListIterator) 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 OperationResultListIterator) Response() OperationResultList { + 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 OperationResultListIterator) Value() Operation { + if !iter.page.NotDone() { + return Operation{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the OperationResultListIterator type. +func NewOperationResultListIterator(page OperationResultListPage) OperationResultListIterator { + return OperationResultListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (orl OperationResultList) IsEmpty() bool { + return orl.Value == nil || len(*orl.Value) == 0 +} + +// operationResultListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (orl OperationResultList) operationResultListPreparer(ctx context.Context) (*http.Request, error) { + if orl.NextLink == nil || len(to.String(orl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(orl.NextLink))) +} + +// OperationResultListPage contains a page of Operation values. +type OperationResultListPage struct { + fn func(context.Context, OperationResultList) (OperationResultList, error) + orl OperationResultList +} + +// 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 *OperationResultListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationResultListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.orl) + if err != nil { + return err + } + page.orl = next + 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 *OperationResultListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page OperationResultListPage) NotDone() bool { + return !page.orl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page OperationResultListPage) Response() OperationResultList { + return page.orl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page OperationResultListPage) Values() []Operation { + if page.orl.IsEmpty() { + return nil + } + return *page.orl.Value +} + +// Creates a new instance of the OperationResultListPage type. +func NewOperationResultListPage(getNextPage func(context.Context, OperationResultList) (OperationResultList, error)) OperationResultListPage { + return OperationResultListPage{fn: getNextPage} +} + // OperationStatus operation status REST resource. type OperationStatus struct { autorest.Response `json:"-"` diff --git a/services/preview/migrate/mgmt/2020-01-01/migrate/operations.go b/services/preview/migrate/mgmt/2020-01-01/migrate/operations.go new file mode 100644 index 000000000000..2e29028f4a3f --- /dev/null +++ b/services/preview/migrate/mgmt/2020-01-01/migrate/operations.go @@ -0,0 +1,148 @@ +package migrate + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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 discover your workloads for Azure. +type OperationsClient struct { + BaseClient +} + +// NewOperationsClient creates an instance of the OperationsClient client. +func NewOperationsClient() OperationsClient { + return NewOperationsClientWithBaseURI(DefaultBaseURI) +} + +// 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) OperationsClient { + return OperationsClient{NewWithBaseURI(baseURI)} +} + +// List sends the list request. +// Parameters: +// APIVersion - the API version to use for this operation. +func (client OperationsClient) List(ctx context.Context, APIVersion string) (result OperationResultListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.orl.Response.Response != nil { + sc = result.orl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, APIVersion) + if err != nil { + err = autorest.NewErrorWithError(err, "migrate.OperationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.orl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "migrate.OperationsClient", "List", resp, "Failure sending request") + return + } + + result.orl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "migrate.OperationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client OperationsClient) ListPreparer(ctx context.Context, APIVersion string) (*http.Request, error) { + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.OffAzure/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 OperationResultList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 OperationResultList) (result OperationResultList, err error) { + req, err := lastResults.operationResultListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "migrate.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, "migrate.OperationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "migrate.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, APIVersion string) (result OperationResultListIterator, 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, APIVersion) + return +} diff --git a/services/preview/migrate/mgmt/2020-01-01/migrate/runasaccounts.go b/services/preview/migrate/mgmt/2020-01-01/migrate/runasaccounts.go index 791a05619f79..ff113d3d6e55 100644 --- a/services/preview/migrate/mgmt/2020-01-01/migrate/runasaccounts.go +++ b/services/preview/migrate/mgmt/2020-01-01/migrate/runasaccounts.go @@ -25,7 +25,7 @@ import ( "net/http" ) -// RunAsAccountsClient is the client for the RunAsAccounts methods of the Migrate service. +// RunAsAccountsClient is the discover your workloads for Azure. type RunAsAccountsClient struct { BaseClient } diff --git a/services/preview/migrate/mgmt/2020-01-01/migrate/sites.go b/services/preview/migrate/mgmt/2020-01-01/migrate/sites.go index cfd4fcd73dab..68c46d18a711 100644 --- a/services/preview/migrate/mgmt/2020-01-01/migrate/sites.go +++ b/services/preview/migrate/mgmt/2020-01-01/migrate/sites.go @@ -25,7 +25,7 @@ import ( "net/http" ) -// SitesClient is the client for the Sites methods of the Migrate service. +// SitesClient is the discover your workloads for Azure. type SitesClient struct { BaseClient } diff --git a/services/preview/migrate/mgmt/2020-01-01/migrate/vcenter.go b/services/preview/migrate/mgmt/2020-01-01/migrate/vcenter.go index c0aeade7f8dd..ca2c6504cfa7 100644 --- a/services/preview/migrate/mgmt/2020-01-01/migrate/vcenter.go +++ b/services/preview/migrate/mgmt/2020-01-01/migrate/vcenter.go @@ -25,7 +25,7 @@ import ( "net/http" ) -// VCenterClient is the client for the VCenter methods of the Migrate service. +// VCenterClient is the discover your workloads for Azure. type VCenterClient struct { BaseClient } diff --git a/services/preview/migrate/mgmt/2020-01-01/migrate/version.go b/services/preview/migrate/mgmt/2020-01-01/migrate/version.go index 713bed196819..745aff7b0abc 100644 --- a/services/preview/migrate/mgmt/2020-01-01/migrate/version.go +++ b/services/preview/migrate/mgmt/2020-01-01/migrate/version.go @@ -21,7 +21,7 @@ import "github.com/Azure/azure-sdk-for-go/version" // UserAgent returns the UserAgent string to use when sending http.Requests. func UserAgent() string { - return "Azure-SDK-For-Go/" + Version() + " migrate/v1" + return "Azure-SDK-For-Go/" + Version() + " migrate/2020-01-01" } // Version returns the semantic version (see http://semver.org) of the client. diff --git a/services/preview/migrate/mgmt/2020-01-01/migrate/vmwareoperationsstatus.go b/services/preview/migrate/mgmt/2020-01-01/migrate/vmwareoperationsstatus.go index f400ac6ad670..fa71b7a8dc02 100644 --- a/services/preview/migrate/mgmt/2020-01-01/migrate/vmwareoperationsstatus.go +++ b/services/preview/migrate/mgmt/2020-01-01/migrate/vmwareoperationsstatus.go @@ -25,7 +25,7 @@ import ( "net/http" ) -// VMwareOperationsStatusClient is the client for the VMwareOperationsStatus methods of the Migrate service. +// VMwareOperationsStatusClient is the discover your workloads for Azure. type VMwareOperationsStatusClient struct { BaseClient } diff --git a/services/preview/mixedreality/mgmt/2020-05-01-preview/mixedreality/client.go b/services/preview/mixedreality/mgmt/2020-05-01-preview/mixedreality/client.go new file mode 100644 index 000000000000..ba1e0ae38998 --- /dev/null +++ b/services/preview/mixedreality/mgmt/2020-05-01-preview/mixedreality/client.go @@ -0,0 +1,145 @@ +// Package mixedreality implements the Azure ARM Mixedreality service API version . +// +// Mixed Reality Client +package mixedreality + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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 Mixedreality + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Mixedreality. +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, + } +} + +// CheckNameAvailabilityLocal check Name Availability for local uniqueness +// Parameters: +// location - the location in which uniqueness will be verified. +// checkNameAvailability - check Name Availability Request. +func (client BaseClient) CheckNameAvailabilityLocal(ctx context.Context, location string, checkNameAvailability CheckNameAvailabilityRequest) (result CheckNameAvailabilityResponse, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CheckNameAvailabilityLocal") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: location, + Constraints: []validation.Constraint{{Target: "location", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "location", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "location", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: checkNameAvailability, + Constraints: []validation.Constraint{{Target: "checkNameAvailability.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "checkNameAvailability.Type", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("mixedreality.BaseClient", "CheckNameAvailabilityLocal", err.Error()) + } + + req, err := client.CheckNameAvailabilityLocalPreparer(ctx, location, checkNameAvailability) + if err != nil { + err = autorest.NewErrorWithError(err, "mixedreality.BaseClient", "CheckNameAvailabilityLocal", nil, "Failure preparing request") + return + } + + resp, err := client.CheckNameAvailabilityLocalSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "mixedreality.BaseClient", "CheckNameAvailabilityLocal", resp, "Failure sending request") + return + } + + result, err = client.CheckNameAvailabilityLocalResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "mixedreality.BaseClient", "CheckNameAvailabilityLocal", resp, "Failure responding to request") + } + + return +} + +// CheckNameAvailabilityLocalPreparer prepares the CheckNameAvailabilityLocal request. +func (client BaseClient) CheckNameAvailabilityLocalPreparer(ctx context.Context, location string, checkNameAvailability CheckNameAvailabilityRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-05-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.MixedReality/locations/{location}/checkNameAvailability", pathParameters), + autorest.WithJSON(checkNameAvailability), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CheckNameAvailabilityLocalSender sends the CheckNameAvailabilityLocal request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) CheckNameAvailabilityLocalSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CheckNameAvailabilityLocalResponder handles the response to the CheckNameAvailabilityLocal request. The method always +// closes the http.Response Body. +func (client BaseClient) CheckNameAvailabilityLocalResponder(resp *http.Response) (result CheckNameAvailabilityResponse, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/mixedreality/mgmt/2020-05-01-preview/mixedreality/mixedrealityapi/interfaces.go b/services/preview/mixedreality/mgmt/2020-05-01-preview/mixedreality/mixedrealityapi/interfaces.go new file mode 100644 index 000000000000..dc8ef5c72d48 --- /dev/null +++ b/services/preview/mixedreality/mgmt/2020-05-01-preview/mixedreality/mixedrealityapi/interfaces.go @@ -0,0 +1,71 @@ +package mixedrealityapi + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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/mixedreality/mgmt/2020-05-01-preview/mixedreality" + "github.com/Azure/go-autorest/autorest" +) + +// BaseClientAPI contains the set of methods on the BaseClient type. +type BaseClientAPI interface { + CheckNameAvailabilityLocal(ctx context.Context, location string, checkNameAvailability mixedreality.CheckNameAvailabilityRequest) (result mixedreality.CheckNameAvailabilityResponse, err error) +} + +var _ BaseClientAPI = (*mixedreality.BaseClient)(nil) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result mixedreality.OperationPagePage, err error) + ListComplete(ctx context.Context) (result mixedreality.OperationPageIterator, err error) +} + +var _ OperationsClientAPI = (*mixedreality.OperationsClient)(nil) + +// SpatialAnchorsAccountsClientAPI contains the set of methods on the SpatialAnchorsAccountsClient type. +type SpatialAnchorsAccountsClientAPI interface { + Create(ctx context.Context, resourceGroupName string, accountName string, spatialAnchorsAccount mixedreality.SpatialAnchorsAccount) (result mixedreality.SpatialAnchorsAccount, err error) + Delete(ctx context.Context, resourceGroupName string, accountName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, accountName string) (result mixedreality.SpatialAnchorsAccount, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result mixedreality.SpatialAnchorsAccountPagePage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result mixedreality.SpatialAnchorsAccountPageIterator, err error) + ListBySubscription(ctx context.Context) (result mixedreality.SpatialAnchorsAccountPagePage, err error) + ListBySubscriptionComplete(ctx context.Context) (result mixedreality.SpatialAnchorsAccountPageIterator, err error) + ListKeys(ctx context.Context, resourceGroupName string, accountName string) (result mixedreality.AccountKeys, err error) + RegenerateKeys(ctx context.Context, resourceGroupName string, accountName string, regenerate mixedreality.AccountKeyRegenerateRequest) (result mixedreality.AccountKeys, err error) + Update(ctx context.Context, resourceGroupName string, accountName string, spatialAnchorsAccount mixedreality.SpatialAnchorsAccount) (result mixedreality.SpatialAnchorsAccount, err error) +} + +var _ SpatialAnchorsAccountsClientAPI = (*mixedreality.SpatialAnchorsAccountsClient)(nil) + +// RemoteRenderingAccountsClientAPI contains the set of methods on the RemoteRenderingAccountsClient type. +type RemoteRenderingAccountsClientAPI interface { + Create(ctx context.Context, resourceGroupName string, accountName string, remoteRenderingAccount mixedreality.RemoteRenderingAccount) (result mixedreality.RemoteRenderingAccount, err error) + Delete(ctx context.Context, resourceGroupName string, accountName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, accountName string) (result mixedreality.RemoteRenderingAccount, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result mixedreality.RemoteRenderingAccountPagePage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result mixedreality.RemoteRenderingAccountPageIterator, err error) + ListBySubscription(ctx context.Context) (result mixedreality.RemoteRenderingAccountPagePage, err error) + ListBySubscriptionComplete(ctx context.Context) (result mixedreality.RemoteRenderingAccountPageIterator, err error) + ListKeys(ctx context.Context, resourceGroupName string, accountName string) (result mixedreality.AccountKeys, err error) + RegenerateKeys(ctx context.Context, resourceGroupName string, accountName string, regenerate mixedreality.AccountKeyRegenerateRequest) (result mixedreality.AccountKeys, err error) + Update(ctx context.Context, resourceGroupName string, accountName string, remoteRenderingAccount mixedreality.RemoteRenderingAccount) (result mixedreality.RemoteRenderingAccount, err error) +} + +var _ RemoteRenderingAccountsClientAPI = (*mixedreality.RemoteRenderingAccountsClient)(nil) diff --git a/services/preview/mixedreality/mgmt/2020-05-01-preview/mixedreality/models.go b/services/preview/mixedreality/mgmt/2020-05-01-preview/mixedreality/models.go new file mode 100644 index 000000000000..89b3e96b9ed5 --- /dev/null +++ b/services/preview/mixedreality/mgmt/2020-05-01-preview/mixedreality/models.go @@ -0,0 +1,1025 @@ +package mixedreality + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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/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/mixedreality/mgmt/2020-05-01-preview/mixedreality" + +// NameAvailability enumerates the values for name availability. +type NameAvailability string + +const ( + // False ... + False NameAvailability = "false" + // True ... + True NameAvailability = "true" +) + +// PossibleNameAvailabilityValues returns an array of possible values for the NameAvailability const type. +func PossibleNameAvailabilityValues() []NameAvailability { + return []NameAvailability{False, True} +} + +// NameUnavailableReason enumerates the values for name unavailable reason. +type NameUnavailableReason string + +const ( + // AlreadyExists ... + AlreadyExists NameUnavailableReason = "AlreadyExists" + // Invalid ... + Invalid NameUnavailableReason = "Invalid" +) + +// PossibleNameUnavailableReasonValues returns an array of possible values for the NameUnavailableReason const type. +func PossibleNameUnavailableReasonValues() []NameUnavailableReason { + return []NameUnavailableReason{AlreadyExists, Invalid} +} + +// ResourceIdentityType enumerates the values for resource identity type. +type ResourceIdentityType string + +const ( + // SystemAssigned ... + SystemAssigned ResourceIdentityType = "SystemAssigned" +) + +// PossibleResourceIdentityTypeValues returns an array of possible values for the ResourceIdentityType const type. +func PossibleResourceIdentityTypeValues() []ResourceIdentityType { + return []ResourceIdentityType{SystemAssigned} +} + +// SkuTier enumerates the values for sku tier. +type SkuTier string + +const ( + // Basic ... + Basic SkuTier = "Basic" + // Free ... + Free SkuTier = "Free" + // Premium ... + Premium SkuTier = "Premium" + // Standard ... + Standard SkuTier = "Standard" +) + +// PossibleSkuTierValues returns an array of possible values for the SkuTier const type. +func PossibleSkuTierValues() []SkuTier { + return []SkuTier{Basic, Free, Premium, Standard} +} + +// AccountKeyRegenerateRequest request for account key regeneration +type AccountKeyRegenerateRequest struct { + // Serial - serial of key to be regenerated + Serial *int32 `json:"serial,omitempty"` +} + +// AccountKeys developer Keys of account +type AccountKeys struct { + autorest.Response `json:"-"` + // PrimaryKey - READ-ONLY; value of primary key. + PrimaryKey *string `json:"primaryKey,omitempty"` + // SecondaryKey - READ-ONLY; value of secondary key. + SecondaryKey *string `json:"secondaryKey,omitempty"` +} + +// AccountProperties common Properties shared by Mixed Reality Accounts +type AccountProperties struct { + // AccountID - READ-ONLY; unique id of certain account. + AccountID *string `json:"accountId,omitempty"` + // AccountDomain - READ-ONLY; Correspond domain name of certain Spatial Anchors Account + AccountDomain *string `json:"accountDomain,omitempty"` +} + +// AzureEntityResource the resource model definition for a 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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// CheckNameAvailabilityRequest check Name Availability Request +type CheckNameAvailabilityRequest struct { + // Name - Resource Name To Verify + Name *string `json:"name,omitempty"` + // Type - Fully qualified resource type which includes provider namespace + Type *string `json:"type,omitempty"` +} + +// CheckNameAvailabilityResponse check Name Availability Response +type CheckNameAvailabilityResponse struct { + autorest.Response `json:"-"` + // NameAvailable - if name Available. Possible values include: 'True', 'False' + NameAvailable NameAvailability `json:"nameAvailable,omitempty"` + // Reason - Resource Name To Verify. Possible values include: 'Invalid', 'AlreadyExists' + Reason NameUnavailableReason `json:"reason,omitempty"` + // Message - detail message + Message *string `json:"message,omitempty"` +} + +// CloudError an Error response. +type CloudError struct { + Error *CloudErrorBody `json:"error,omitempty"` +} + +// CloudErrorBody an error response from Azure. +type CloudErrorBody struct { + // Code - An identifier for the error. Codes are invariant and are intended to be consumed programmatically. + Code *string `json:"code,omitempty"` + // Message - A message describing the error, intended to be suitable for displaying in a user interface. + Message *string `json:"message,omitempty"` + // Target - The target of the particular error. For example, the name of the property in error. + Target *string `json:"target,omitempty"` + // Details - A list of additional details about the error. + Details *[]CloudErrorBody `json:"details,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: 'SystemAssigned' + Type ResourceIdentityType `json:"type,omitempty"` +} + +// Operation REST API operation +type Operation struct { + // Name - Operation name: {provider}/{resource}/{operation} + Name *string `json:"name,omitempty"` + // Display - The object that represents the operation. + Display *OperationDisplay `json:"display,omitempty"` +} + +// OperationDisplay the object that represents the operation. +type OperationDisplay struct { + // Provider - Service provider: Microsoft.ResourceProvider + Provider *string `json:"provider,omitempty"` + // Resource - Resource on which the operation is performed: Profile, endpoint, etc. + Resource *string `json:"resource,omitempty"` + // Operation - Operation type: Read, write, delete, etc. + Operation *string `json:"operation,omitempty"` + // Description - Description of operation + Description *string `json:"description,omitempty"` +} + +// OperationPage result of the request to list Resource Provider operations. It contains a list of +// operations and a URL link to get the next set of results. +type OperationPage struct { + autorest.Response `json:"-"` + // Value - List of operations supported by the Resource Provider. + Value *[]Operation `json:"value,omitempty"` + // NextLink - URL to get the next set of operation list results if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// OperationPageIterator provides access to a complete listing of Operation values. +type OperationPageIterator struct { + i int + page OperationPagePage +} + +// 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 *OperationPageIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationPageIterator.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 *OperationPageIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter OperationPageIterator) 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 OperationPageIterator) Response() OperationPage { + 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 OperationPageIterator) Value() Operation { + if !iter.page.NotDone() { + return Operation{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the OperationPageIterator type. +func NewOperationPageIterator(page OperationPagePage) OperationPageIterator { + return OperationPageIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (op OperationPage) IsEmpty() bool { + return op.Value == nil || len(*op.Value) == 0 +} + +// operationPagePreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (op OperationPage) operationPagePreparer(ctx context.Context) (*http.Request, error) { + if op.NextLink == nil || len(to.String(op.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(op.NextLink))) +} + +// OperationPagePage contains a page of Operation values. +type OperationPagePage struct { + fn func(context.Context, OperationPage) (OperationPage, error) + op OperationPage +} + +// 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 *OperationPagePage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationPagePage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.op) + if err != nil { + return err + } + page.op = next + 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 *OperationPagePage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page OperationPagePage) NotDone() bool { + return !page.op.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page OperationPagePage) Response() OperationPage { + return page.op +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page OperationPagePage) Values() []Operation { + if page.op.IsEmpty() { + return nil + } + return *page.op.Value +} + +// Creates a new instance of the OperationPagePage type. +func NewOperationPagePage(getNextPage func(context.Context, OperationPage) (OperationPage, error)) OperationPagePage { + return OperationPagePage{fn: getNextPage} +} + +// 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 ARM proxy resource. It will have everything other than +// required location and tags +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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// RemoteRenderingAccount remoteRenderingAccount Response. +type RemoteRenderingAccount struct { + autorest.Response `json:"-"` + Identity *RemoteRenderingAccountIdentity `json:"identity,omitempty"` + // AccountProperties - Property bag. + *AccountProperties `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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for RemoteRenderingAccount. +func (rra RemoteRenderingAccount) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rra.Identity != nil { + objectMap["identity"] = rra.Identity + } + if rra.AccountProperties != nil { + objectMap["properties"] = rra.AccountProperties + } + if rra.Tags != nil { + objectMap["tags"] = rra.Tags + } + if rra.Location != nil { + objectMap["location"] = rra.Location + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for RemoteRenderingAccount struct. +func (rra *RemoteRenderingAccount) 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 RemoteRenderingAccountIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + rra.Identity = &identity + } + case "properties": + if v != nil { + var accountProperties AccountProperties + err = json.Unmarshal(*v, &accountProperties) + if err != nil { + return err + } + rra.AccountProperties = &accountProperties + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + rra.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + rra.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rra.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rra.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rra.Type = &typeVar + } + } + } + + return nil +} + +// RemoteRenderingAccountIdentity ... +type RemoteRenderingAccountIdentity 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: 'SystemAssigned' + Type ResourceIdentityType `json:"type,omitempty"` +} + +// RemoteRenderingAccountPage result of the request to get resource collection. It contains a list of +// resources and a URL link to get the next set of results. +type RemoteRenderingAccountPage struct { + autorest.Response `json:"-"` + // Value - List of resources supported by the Resource Provider. + Value *[]RemoteRenderingAccount `json:"value,omitempty"` + // NextLink - URL to get the next set of resource list results if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// RemoteRenderingAccountPageIterator provides access to a complete listing of RemoteRenderingAccount +// values. +type RemoteRenderingAccountPageIterator struct { + i int + page RemoteRenderingAccountPagePage +} + +// 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 *RemoteRenderingAccountPageIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RemoteRenderingAccountPageIterator.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 *RemoteRenderingAccountPageIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter RemoteRenderingAccountPageIterator) 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 RemoteRenderingAccountPageIterator) Response() RemoteRenderingAccountPage { + 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 RemoteRenderingAccountPageIterator) Value() RemoteRenderingAccount { + if !iter.page.NotDone() { + return RemoteRenderingAccount{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the RemoteRenderingAccountPageIterator type. +func NewRemoteRenderingAccountPageIterator(page RemoteRenderingAccountPagePage) RemoteRenderingAccountPageIterator { + return RemoteRenderingAccountPageIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rrap RemoteRenderingAccountPage) IsEmpty() bool { + return rrap.Value == nil || len(*rrap.Value) == 0 +} + +// remoteRenderingAccountPagePreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rrap RemoteRenderingAccountPage) remoteRenderingAccountPagePreparer(ctx context.Context) (*http.Request, error) { + if rrap.NextLink == nil || len(to.String(rrap.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rrap.NextLink))) +} + +// RemoteRenderingAccountPagePage contains a page of RemoteRenderingAccount values. +type RemoteRenderingAccountPagePage struct { + fn func(context.Context, RemoteRenderingAccountPage) (RemoteRenderingAccountPage, error) + rrap RemoteRenderingAccountPage +} + +// 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 *RemoteRenderingAccountPagePage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RemoteRenderingAccountPagePage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.rrap) + if err != nil { + return err + } + page.rrap = next + 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 *RemoteRenderingAccountPagePage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page RemoteRenderingAccountPagePage) NotDone() bool { + return !page.rrap.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page RemoteRenderingAccountPagePage) Response() RemoteRenderingAccountPage { + return page.rrap +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page RemoteRenderingAccountPagePage) Values() []RemoteRenderingAccount { + if page.rrap.IsEmpty() { + return nil + } + return *page.rrap.Value +} + +// Creates a new instance of the RemoteRenderingAccountPagePage type. +func NewRemoteRenderingAccountPagePage(getNextPage func(context.Context, RemoteRenderingAccountPage) (RemoteRenderingAccountPage, error)) RemoteRenderingAccountPagePage { + return RemoteRenderingAccountPagePage{fn: getNextPage} +} + +// Resource ... +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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// 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. Ex- 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: 'SystemAssigned' + Type ResourceIdentityType `json:"type,omitempty"` +} + +// 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: 'Free', 'Basic', 'Standard', 'Premium' + 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"` +} + +// 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: 'Free', 'Basic', 'Standard', 'Premium' + 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"` +} + +// SpatialAnchorsAccount spatialAnchorsAccount Response. +type SpatialAnchorsAccount struct { + autorest.Response `json:"-"` + // AccountProperties - Property bag. + *AccountProperties `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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SpatialAnchorsAccount. +func (saa SpatialAnchorsAccount) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if saa.AccountProperties != nil { + objectMap["properties"] = saa.AccountProperties + } + if saa.Tags != nil { + objectMap["tags"] = saa.Tags + } + if saa.Location != nil { + objectMap["location"] = saa.Location + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SpatialAnchorsAccount struct. +func (saa *SpatialAnchorsAccount) 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 accountProperties AccountProperties + err = json.Unmarshal(*v, &accountProperties) + if err != nil { + return err + } + saa.AccountProperties = &accountProperties + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + saa.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + saa.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + saa.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + saa.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + saa.Type = &typeVar + } + } + } + + return nil +} + +// SpatialAnchorsAccountPage result of the request to get resource collection. It contains a list of +// resources and a URL link to get the next set of results. +type SpatialAnchorsAccountPage struct { + autorest.Response `json:"-"` + // Value - List of resources supported by the Resource Provider. + Value *[]SpatialAnchorsAccount `json:"value,omitempty"` + // NextLink - URL to get the next set of resource list results if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// SpatialAnchorsAccountPageIterator provides access to a complete listing of SpatialAnchorsAccount values. +type SpatialAnchorsAccountPageIterator struct { + i int + page SpatialAnchorsAccountPagePage +} + +// 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 *SpatialAnchorsAccountPageIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SpatialAnchorsAccountPageIterator.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 *SpatialAnchorsAccountPageIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SpatialAnchorsAccountPageIterator) 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 SpatialAnchorsAccountPageIterator) Response() SpatialAnchorsAccountPage { + 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 SpatialAnchorsAccountPageIterator) Value() SpatialAnchorsAccount { + if !iter.page.NotDone() { + return SpatialAnchorsAccount{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the SpatialAnchorsAccountPageIterator type. +func NewSpatialAnchorsAccountPageIterator(page SpatialAnchorsAccountPagePage) SpatialAnchorsAccountPageIterator { + return SpatialAnchorsAccountPageIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (saap SpatialAnchorsAccountPage) IsEmpty() bool { + return saap.Value == nil || len(*saap.Value) == 0 +} + +// spatialAnchorsAccountPagePreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (saap SpatialAnchorsAccountPage) spatialAnchorsAccountPagePreparer(ctx context.Context) (*http.Request, error) { + if saap.NextLink == nil || len(to.String(saap.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(saap.NextLink))) +} + +// SpatialAnchorsAccountPagePage contains a page of SpatialAnchorsAccount values. +type SpatialAnchorsAccountPagePage struct { + fn func(context.Context, SpatialAnchorsAccountPage) (SpatialAnchorsAccountPage, error) + saap SpatialAnchorsAccountPage +} + +// 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 *SpatialAnchorsAccountPagePage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SpatialAnchorsAccountPagePage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.saap) + if err != nil { + return err + } + page.saap = next + 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 *SpatialAnchorsAccountPagePage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SpatialAnchorsAccountPagePage) NotDone() bool { + return !page.saap.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SpatialAnchorsAccountPagePage) Response() SpatialAnchorsAccountPage { + return page.saap +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SpatialAnchorsAccountPagePage) Values() []SpatialAnchorsAccount { + if page.saap.IsEmpty() { + return nil + } + return *page.saap.Value +} + +// Creates a new instance of the SpatialAnchorsAccountPagePage type. +func NewSpatialAnchorsAccountPagePage(getNextPage func(context.Context, SpatialAnchorsAccountPage) (SpatialAnchorsAccountPage, error)) SpatialAnchorsAccountPagePage { + return SpatialAnchorsAccountPagePage{fn: getNextPage} +} + +// TrackedResource the resource model definition for a ARM tracked top level resource +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. Ex- 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) +} diff --git a/services/preview/mixedreality/mgmt/2020-05-01-preview/mixedreality/operations.go b/services/preview/mixedreality/mgmt/2020-05-01-preview/mixedreality/operations.go new file mode 100644 index 000000000000..5cb9a54cb8d6 --- /dev/null +++ b/services/preview/mixedreality/mgmt/2020-05-01-preview/mixedreality/operations.go @@ -0,0 +1,147 @@ +package mixedreality + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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 mixed Reality Client +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 exposing Available Operations +func (client OperationsClient) List(ctx context.Context) (result OperationPagePage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.op.Response.Response != nil { + sc = result.op.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "mixedreality.OperationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.op.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "mixedreality.OperationsClient", "List", resp, "Failure sending request") + return + } + + result.op, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "mixedreality.OperationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.MixedReality/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 OperationPage, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 OperationPage) (result OperationPage, err error) { + req, err := lastResults.operationPagePreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "mixedreality.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, "mixedreality.OperationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "mixedreality.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 OperationPageIterator, 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/mixedreality/mgmt/2020-05-01-preview/mixedreality/remoterenderingaccounts.go b/services/preview/mixedreality/mgmt/2020-05-01-preview/mixedreality/remoterenderingaccounts.go new file mode 100644 index 000000000000..f3f0f745a4f4 --- /dev/null +++ b/services/preview/mixedreality/mgmt/2020-05-01-preview/mixedreality/remoterenderingaccounts.go @@ -0,0 +1,809 @@ +package mixedreality + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// RemoteRenderingAccountsClient is the mixed Reality Client +type RemoteRenderingAccountsClient struct { + BaseClient +} + +// NewRemoteRenderingAccountsClient creates an instance of the RemoteRenderingAccountsClient client. +func NewRemoteRenderingAccountsClient(subscriptionID string) RemoteRenderingAccountsClient { + return NewRemoteRenderingAccountsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewRemoteRenderingAccountsClientWithBaseURI creates an instance of the RemoteRenderingAccountsClient 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 NewRemoteRenderingAccountsClientWithBaseURI(baseURI string, subscriptionID string) RemoteRenderingAccountsClient { + return RemoteRenderingAccountsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create creating or Updating a Remote Rendering Account. +// Parameters: +// resourceGroupName - name of an Azure resource group. +// accountName - name of an Mixed Reality Account. +// remoteRenderingAccount - remote Rendering Account parameter. +func (client RemoteRenderingAccountsClient) Create(ctx context.Context, resourceGroupName string, accountName string, remoteRenderingAccount RemoteRenderingAccount) (result RemoteRenderingAccount, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RemoteRenderingAccountsClient.Create") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: 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: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("mixedreality.RemoteRenderingAccountsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, accountName, remoteRenderingAccount) + if err != nil { + err = autorest.NewErrorWithError(err, "mixedreality.RemoteRenderingAccountsClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "mixedreality.RemoteRenderingAccountsClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "mixedreality.RemoteRenderingAccountsClient", "Create", resp, "Failure responding to request") + } + + return +} + +// CreatePreparer prepares the Create request. +func (client RemoteRenderingAccountsClient) CreatePreparer(ctx context.Context, resourceGroupName string, accountName string, remoteRenderingAccount RemoteRenderingAccount) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-06-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.MixedReality/remoteRenderingAccounts/{accountName}", pathParameters), + autorest.WithJSON(remoteRenderingAccount), + 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 RemoteRenderingAccountsClient) CreateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client RemoteRenderingAccountsClient) CreateResponder(resp *http.Response) (result RemoteRenderingAccount, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete a Remote Rendering Account. +// Parameters: +// resourceGroupName - name of an Azure resource group. +// accountName - name of an Mixed Reality Account. +func (client RemoteRenderingAccountsClient) Delete(ctx context.Context, resourceGroupName string, accountName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RemoteRenderingAccountsClient.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}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("mixedreality.RemoteRenderingAccountsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "mixedreality.RemoteRenderingAccountsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "mixedreality.RemoteRenderingAccountsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "mixedreality.RemoteRenderingAccountsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client RemoteRenderingAccountsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-06-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.MixedReality/remoteRenderingAccounts/{accountName}", 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 RemoteRenderingAccountsClient) 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 RemoteRenderingAccountsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieve a Remote Rendering Account. +// Parameters: +// resourceGroupName - name of an Azure resource group. +// accountName - name of an Mixed Reality Account. +func (client RemoteRenderingAccountsClient) Get(ctx context.Context, resourceGroupName string, accountName string) (result RemoteRenderingAccount, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RemoteRenderingAccountsClient.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}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("mixedreality.RemoteRenderingAccountsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "mixedreality.RemoteRenderingAccountsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "mixedreality.RemoteRenderingAccountsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "mixedreality.RemoteRenderingAccountsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client RemoteRenderingAccountsClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-06-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.MixedReality/remoteRenderingAccounts/{accountName}", 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 RemoteRenderingAccountsClient) 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 RemoteRenderingAccountsClient) GetResponder(resp *http.Response) (result RemoteRenderingAccount, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByResourceGroup list Resources by Resource Group +// Parameters: +// resourceGroupName - name of an Azure resource group. +func (client RemoteRenderingAccountsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result RemoteRenderingAccountPagePage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RemoteRenderingAccountsClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.rrap.Response.Response != nil { + sc = result.rrap.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("mixedreality.RemoteRenderingAccountsClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "mixedreality.RemoteRenderingAccountsClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.rrap.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "mixedreality.RemoteRenderingAccountsClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.rrap, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "mixedreality.RemoteRenderingAccountsClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client RemoteRenderingAccountsClient) 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 = "2020-04-06-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.MixedReality/remoteRenderingAccounts", 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 RemoteRenderingAccountsClient) 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 RemoteRenderingAccountsClient) ListByResourceGroupResponder(resp *http.Response) (result RemoteRenderingAccountPage, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 RemoteRenderingAccountsClient) listByResourceGroupNextResults(ctx context.Context, lastResults RemoteRenderingAccountPage) (result RemoteRenderingAccountPage, err error) { + req, err := lastResults.remoteRenderingAccountPagePreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "mixedreality.RemoteRenderingAccountsClient", "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, "mixedreality.RemoteRenderingAccountsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "mixedreality.RemoteRenderingAccountsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client RemoteRenderingAccountsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result RemoteRenderingAccountPageIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RemoteRenderingAccountsClient.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 list Remote Rendering Accounts by Subscription +func (client RemoteRenderingAccountsClient) ListBySubscription(ctx context.Context) (result RemoteRenderingAccountPagePage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RemoteRenderingAccountsClient.ListBySubscription") + defer func() { + sc := -1 + if result.rrap.Response.Response != nil { + sc = result.rrap.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listBySubscriptionNextResults + req, err := client.ListBySubscriptionPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "mixedreality.RemoteRenderingAccountsClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.rrap.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "mixedreality.RemoteRenderingAccountsClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result.rrap, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "mixedreality.RemoteRenderingAccountsClient", "ListBySubscription", resp, "Failure responding to request") + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client RemoteRenderingAccountsClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-06-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.MixedReality/remoteRenderingAccounts", 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 RemoteRenderingAccountsClient) 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 RemoteRenderingAccountsClient) ListBySubscriptionResponder(resp *http.Response) (result RemoteRenderingAccountPage, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 RemoteRenderingAccountsClient) listBySubscriptionNextResults(ctx context.Context, lastResults RemoteRenderingAccountPage) (result RemoteRenderingAccountPage, err error) { + req, err := lastResults.remoteRenderingAccountPagePreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "mixedreality.RemoteRenderingAccountsClient", "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, "mixedreality.RemoteRenderingAccountsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "mixedreality.RemoteRenderingAccountsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client RemoteRenderingAccountsClient) ListBySubscriptionComplete(ctx context.Context) (result RemoteRenderingAccountPageIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RemoteRenderingAccountsClient.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 +} + +// ListKeys list Both of the 2 Keys of a Remote Rendering Account +// Parameters: +// resourceGroupName - name of an Azure resource group. +// accountName - name of an Mixed Reality Account. +func (client RemoteRenderingAccountsClient) ListKeys(ctx context.Context, resourceGroupName string, accountName string) (result AccountKeys, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RemoteRenderingAccountsClient.ListKeys") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: 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: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("mixedreality.RemoteRenderingAccountsClient", "ListKeys", err.Error()) + } + + req, err := client.ListKeysPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "mixedreality.RemoteRenderingAccountsClient", "ListKeys", nil, "Failure preparing request") + return + } + + resp, err := client.ListKeysSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "mixedreality.RemoteRenderingAccountsClient", "ListKeys", resp, "Failure sending request") + return + } + + result, err = client.ListKeysResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "mixedreality.RemoteRenderingAccountsClient", "ListKeys", resp, "Failure responding to request") + } + + return +} + +// ListKeysPreparer prepares the ListKeys request. +func (client RemoteRenderingAccountsClient) ListKeysPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-06-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.MixedReality/remoteRenderingAccounts/{accountName}/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 RemoteRenderingAccountsClient) 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 RemoteRenderingAccountsClient) ListKeysResponder(resp *http.Response) (result AccountKeys, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RegenerateKeys regenerate specified Key of a Remote Rendering Account +// Parameters: +// resourceGroupName - name of an Azure resource group. +// accountName - name of an Mixed Reality Account. +// regenerate - required information for key regeneration. +func (client RemoteRenderingAccountsClient) RegenerateKeys(ctx context.Context, resourceGroupName string, accountName string, regenerate AccountKeyRegenerateRequest) (result AccountKeys, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RemoteRenderingAccountsClient.RegenerateKeys") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: 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: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("mixedreality.RemoteRenderingAccountsClient", "RegenerateKeys", err.Error()) + } + + req, err := client.RegenerateKeysPreparer(ctx, resourceGroupName, accountName, regenerate) + if err != nil { + err = autorest.NewErrorWithError(err, "mixedreality.RemoteRenderingAccountsClient", "RegenerateKeys", nil, "Failure preparing request") + return + } + + resp, err := client.RegenerateKeysSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "mixedreality.RemoteRenderingAccountsClient", "RegenerateKeys", resp, "Failure sending request") + return + } + + result, err = client.RegenerateKeysResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "mixedreality.RemoteRenderingAccountsClient", "RegenerateKeys", resp, "Failure responding to request") + } + + return +} + +// RegenerateKeysPreparer prepares the RegenerateKeys request. +func (client RemoteRenderingAccountsClient) RegenerateKeysPreparer(ctx context.Context, resourceGroupName string, accountName string, regenerate AccountKeyRegenerateRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-06-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.MixedReality/remoteRenderingAccounts/{accountName}/regenerateKeys", pathParameters), + autorest.WithJSON(regenerate), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RegenerateKeysSender sends the RegenerateKeys request. The method will close the +// http.Response Body if it receives an error. +func (client RemoteRenderingAccountsClient) RegenerateKeysSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// RegenerateKeysResponder handles the response to the RegenerateKeys request. The method always +// closes the http.Response Body. +func (client RemoteRenderingAccountsClient) RegenerateKeysResponder(resp *http.Response) (result AccountKeys, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update updating a Remote Rendering Account +// Parameters: +// resourceGroupName - name of an Azure resource group. +// accountName - name of an Mixed Reality Account. +// remoteRenderingAccount - remote Rendering Account parameter. +func (client RemoteRenderingAccountsClient) Update(ctx context.Context, resourceGroupName string, accountName string, remoteRenderingAccount RemoteRenderingAccount) (result RemoteRenderingAccount, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RemoteRenderingAccountsClient.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: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("mixedreality.RemoteRenderingAccountsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, accountName, remoteRenderingAccount) + if err != nil { + err = autorest.NewErrorWithError(err, "mixedreality.RemoteRenderingAccountsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "mixedreality.RemoteRenderingAccountsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "mixedreality.RemoteRenderingAccountsClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client RemoteRenderingAccountsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, remoteRenderingAccount RemoteRenderingAccount) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-04-06-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.MixedReality/remoteRenderingAccounts/{accountName}", pathParameters), + autorest.WithJSON(remoteRenderingAccount), + 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 RemoteRenderingAccountsClient) 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 RemoteRenderingAccountsClient) UpdateResponder(resp *http.Response) (result RemoteRenderingAccount, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/mixedreality/mgmt/2020-05-01-preview/mixedreality/spatialanchorsaccounts.go b/services/preview/mixedreality/mgmt/2020-05-01-preview/mixedreality/spatialanchorsaccounts.go new file mode 100644 index 000000000000..c45483242d6b --- /dev/null +++ b/services/preview/mixedreality/mgmt/2020-05-01-preview/mixedreality/spatialanchorsaccounts.go @@ -0,0 +1,809 @@ +package mixedreality + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// SpatialAnchorsAccountsClient is the mixed Reality Client +type SpatialAnchorsAccountsClient struct { + BaseClient +} + +// NewSpatialAnchorsAccountsClient creates an instance of the SpatialAnchorsAccountsClient client. +func NewSpatialAnchorsAccountsClient(subscriptionID string) SpatialAnchorsAccountsClient { + return NewSpatialAnchorsAccountsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewSpatialAnchorsAccountsClientWithBaseURI creates an instance of the SpatialAnchorsAccountsClient 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 NewSpatialAnchorsAccountsClientWithBaseURI(baseURI string, subscriptionID string) SpatialAnchorsAccountsClient { + return SpatialAnchorsAccountsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create creating or Updating a Spatial Anchors Account. +// Parameters: +// resourceGroupName - name of an Azure resource group. +// accountName - name of an Mixed Reality Account. +// spatialAnchorsAccount - spatial Anchors Account parameter. +func (client SpatialAnchorsAccountsClient) Create(ctx context.Context, resourceGroupName string, accountName string, spatialAnchorsAccount SpatialAnchorsAccount) (result SpatialAnchorsAccount, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SpatialAnchorsAccountsClient.Create") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: 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: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("mixedreality.SpatialAnchorsAccountsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, accountName, spatialAnchorsAccount) + if err != nil { + err = autorest.NewErrorWithError(err, "mixedreality.SpatialAnchorsAccountsClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "mixedreality.SpatialAnchorsAccountsClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "mixedreality.SpatialAnchorsAccountsClient", "Create", resp, "Failure responding to request") + } + + return +} + +// CreatePreparer prepares the Create request. +func (client SpatialAnchorsAccountsClient) CreatePreparer(ctx context.Context, resourceGroupName string, accountName string, spatialAnchorsAccount SpatialAnchorsAccount) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-05-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.MixedReality/spatialAnchorsAccounts/{accountName}", pathParameters), + autorest.WithJSON(spatialAnchorsAccount), + 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 SpatialAnchorsAccountsClient) CreateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client SpatialAnchorsAccountsClient) CreateResponder(resp *http.Response) (result SpatialAnchorsAccount, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete a Spatial Anchors Account. +// Parameters: +// resourceGroupName - name of an Azure resource group. +// accountName - name of an Mixed Reality Account. +func (client SpatialAnchorsAccountsClient) Delete(ctx context.Context, resourceGroupName string, accountName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SpatialAnchorsAccountsClient.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}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("mixedreality.SpatialAnchorsAccountsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "mixedreality.SpatialAnchorsAccountsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "mixedreality.SpatialAnchorsAccountsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "mixedreality.SpatialAnchorsAccountsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client SpatialAnchorsAccountsClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-05-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.MixedReality/spatialAnchorsAccounts/{accountName}", 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 SpatialAnchorsAccountsClient) 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 SpatialAnchorsAccountsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieve a Spatial Anchors Account. +// Parameters: +// resourceGroupName - name of an Azure resource group. +// accountName - name of an Mixed Reality Account. +func (client SpatialAnchorsAccountsClient) Get(ctx context.Context, resourceGroupName string, accountName string) (result SpatialAnchorsAccount, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SpatialAnchorsAccountsClient.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}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("mixedreality.SpatialAnchorsAccountsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "mixedreality.SpatialAnchorsAccountsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "mixedreality.SpatialAnchorsAccountsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "mixedreality.SpatialAnchorsAccountsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client SpatialAnchorsAccountsClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts/{accountName}", 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 SpatialAnchorsAccountsClient) 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 SpatialAnchorsAccountsClient) GetResponder(resp *http.Response) (result SpatialAnchorsAccount, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByResourceGroup list Resources by Resource Group +// Parameters: +// resourceGroupName - name of an Azure resource group. +func (client SpatialAnchorsAccountsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result SpatialAnchorsAccountPagePage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SpatialAnchorsAccountsClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.saap.Response.Response != nil { + sc = result.saap.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("mixedreality.SpatialAnchorsAccountsClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "mixedreality.SpatialAnchorsAccountsClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.saap.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "mixedreality.SpatialAnchorsAccountsClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.saap, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "mixedreality.SpatialAnchorsAccountsClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client SpatialAnchorsAccountsClient) 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 = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.MixedReality/spatialAnchorsAccounts", 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 SpatialAnchorsAccountsClient) 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 SpatialAnchorsAccountsClient) ListByResourceGroupResponder(resp *http.Response) (result SpatialAnchorsAccountPage, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 SpatialAnchorsAccountsClient) listByResourceGroupNextResults(ctx context.Context, lastResults SpatialAnchorsAccountPage) (result SpatialAnchorsAccountPage, err error) { + req, err := lastResults.spatialAnchorsAccountPagePreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "mixedreality.SpatialAnchorsAccountsClient", "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, "mixedreality.SpatialAnchorsAccountsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "mixedreality.SpatialAnchorsAccountsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client SpatialAnchorsAccountsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result SpatialAnchorsAccountPageIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SpatialAnchorsAccountsClient.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 list Spatial Anchors Accounts by Subscription +func (client SpatialAnchorsAccountsClient) ListBySubscription(ctx context.Context) (result SpatialAnchorsAccountPagePage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SpatialAnchorsAccountsClient.ListBySubscription") + defer func() { + sc := -1 + if result.saap.Response.Response != nil { + sc = result.saap.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listBySubscriptionNextResults + req, err := client.ListBySubscriptionPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "mixedreality.SpatialAnchorsAccountsClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.saap.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "mixedreality.SpatialAnchorsAccountsClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result.saap, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "mixedreality.SpatialAnchorsAccountsClient", "ListBySubscription", resp, "Failure responding to request") + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client SpatialAnchorsAccountsClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.MixedReality/spatialAnchorsAccounts", 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 SpatialAnchorsAccountsClient) 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 SpatialAnchorsAccountsClient) ListBySubscriptionResponder(resp *http.Response) (result SpatialAnchorsAccountPage, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 SpatialAnchorsAccountsClient) listBySubscriptionNextResults(ctx context.Context, lastResults SpatialAnchorsAccountPage) (result SpatialAnchorsAccountPage, err error) { + req, err := lastResults.spatialAnchorsAccountPagePreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "mixedreality.SpatialAnchorsAccountsClient", "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, "mixedreality.SpatialAnchorsAccountsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "mixedreality.SpatialAnchorsAccountsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client SpatialAnchorsAccountsClient) ListBySubscriptionComplete(ctx context.Context) (result SpatialAnchorsAccountPageIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SpatialAnchorsAccountsClient.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 +} + +// ListKeys list Both of the 2 Keys of a Spatial Anchors Account +// Parameters: +// resourceGroupName - name of an Azure resource group. +// accountName - name of an Mixed Reality Account. +func (client SpatialAnchorsAccountsClient) ListKeys(ctx context.Context, resourceGroupName string, accountName string) (result AccountKeys, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SpatialAnchorsAccountsClient.ListKeys") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: 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: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("mixedreality.SpatialAnchorsAccountsClient", "ListKeys", err.Error()) + } + + req, err := client.ListKeysPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "mixedreality.SpatialAnchorsAccountsClient", "ListKeys", nil, "Failure preparing request") + return + } + + resp, err := client.ListKeysSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "mixedreality.SpatialAnchorsAccountsClient", "ListKeys", resp, "Failure sending request") + return + } + + result, err = client.ListKeysResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "mixedreality.SpatialAnchorsAccountsClient", "ListKeys", resp, "Failure responding to request") + } + + return +} + +// ListKeysPreparer prepares the ListKeys request. +func (client SpatialAnchorsAccountsClient) ListKeysPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-05-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.MixedReality/spatialAnchorsAccounts/{accountName}/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 SpatialAnchorsAccountsClient) 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 SpatialAnchorsAccountsClient) ListKeysResponder(resp *http.Response) (result AccountKeys, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RegenerateKeys regenerate specified Key of a Spatial Anchors Account +// Parameters: +// resourceGroupName - name of an Azure resource group. +// accountName - name of an Mixed Reality Account. +// regenerate - required information for key regeneration. +func (client SpatialAnchorsAccountsClient) RegenerateKeys(ctx context.Context, resourceGroupName string, accountName string, regenerate AccountKeyRegenerateRequest) (result AccountKeys, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SpatialAnchorsAccountsClient.RegenerateKeys") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: 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: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("mixedreality.SpatialAnchorsAccountsClient", "RegenerateKeys", err.Error()) + } + + req, err := client.RegenerateKeysPreparer(ctx, resourceGroupName, accountName, regenerate) + if err != nil { + err = autorest.NewErrorWithError(err, "mixedreality.SpatialAnchorsAccountsClient", "RegenerateKeys", nil, "Failure preparing request") + return + } + + resp, err := client.RegenerateKeysSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "mixedreality.SpatialAnchorsAccountsClient", "RegenerateKeys", resp, "Failure sending request") + return + } + + result, err = client.RegenerateKeysResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "mixedreality.SpatialAnchorsAccountsClient", "RegenerateKeys", resp, "Failure responding to request") + } + + return +} + +// RegenerateKeysPreparer prepares the RegenerateKeys request. +func (client SpatialAnchorsAccountsClient) RegenerateKeysPreparer(ctx context.Context, resourceGroupName string, accountName string, regenerate AccountKeyRegenerateRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-05-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.MixedReality/spatialAnchorsAccounts/{accountName}/regenerateKeys", pathParameters), + autorest.WithJSON(regenerate), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RegenerateKeysSender sends the RegenerateKeys request. The method will close the +// http.Response Body if it receives an error. +func (client SpatialAnchorsAccountsClient) RegenerateKeysSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// RegenerateKeysResponder handles the response to the RegenerateKeys request. The method always +// closes the http.Response Body. +func (client SpatialAnchorsAccountsClient) RegenerateKeysResponder(resp *http.Response) (result AccountKeys, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update updating a Spatial Anchors Account +// Parameters: +// resourceGroupName - name of an Azure resource group. +// accountName - name of an Mixed Reality Account. +// spatialAnchorsAccount - spatial Anchors Account parameter. +func (client SpatialAnchorsAccountsClient) Update(ctx context.Context, resourceGroupName string, accountName string, spatialAnchorsAccount SpatialAnchorsAccount) (result SpatialAnchorsAccount, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SpatialAnchorsAccountsClient.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: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "accountName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("mixedreality.SpatialAnchorsAccountsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, accountName, spatialAnchorsAccount) + if err != nil { + err = autorest.NewErrorWithError(err, "mixedreality.SpatialAnchorsAccountsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "mixedreality.SpatialAnchorsAccountsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "mixedreality.SpatialAnchorsAccountsClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client SpatialAnchorsAccountsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, spatialAnchorsAccount SpatialAnchorsAccount) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-05-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.MixedReality/spatialAnchorsAccounts/{accountName}", pathParameters), + autorest.WithJSON(spatialAnchorsAccount), + 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 SpatialAnchorsAccountsClient) 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 SpatialAnchorsAccountsClient) UpdateResponder(resp *http.Response) (result SpatialAnchorsAccount, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/mixedreality/mgmt/2020-05-01-preview/mixedreality/version.go b/services/preview/mixedreality/mgmt/2020-05-01-preview/mixedreality/version.go new file mode 100644 index 000000000000..00d880fab256 --- /dev/null +++ b/services/preview/mixedreality/mgmt/2020-05-01-preview/mixedreality/version.go @@ -0,0 +1,30 @@ +package mixedreality + +import "github.com/Azure/azure-sdk-for-go/version" + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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() + " mixedreality/2020-05-01-preview" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/availableservicetiers.go b/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/availableservicetiers.go new file mode 100644 index 000000000000..9479e119a488 --- /dev/null +++ b/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/availableservicetiers.go @@ -0,0 +1,134 @@ +package operationalinsights + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// AvailableServiceTiersClient is the operational Insights Client +type AvailableServiceTiersClient struct { + BaseClient +} + +// NewAvailableServiceTiersClient creates an instance of the AvailableServiceTiersClient client. +func NewAvailableServiceTiersClient(subscriptionID string) AvailableServiceTiersClient { + return NewAvailableServiceTiersClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewAvailableServiceTiersClientWithBaseURI creates an instance of the AvailableServiceTiersClient 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 NewAvailableServiceTiersClientWithBaseURI(baseURI string, subscriptionID string) AvailableServiceTiersClient { + return AvailableServiceTiersClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListByWorkspace gets the available service tiers for the workspace. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace. +func (client AvailableServiceTiersClient) ListByWorkspace(ctx context.Context, resourceGroupName string, workspaceName string) (result ListAvailableServiceTier, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AvailableServiceTiersClient.ListByWorkspace") + defer func() { + 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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 4, Chain: nil}, + {Target: "workspaceName", Name: validation.Pattern, Rule: `^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("operationalinsights.AvailableServiceTiersClient", "ListByWorkspace", err.Error()) + } + + req, err := client.ListByWorkspacePreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.AvailableServiceTiersClient", "ListByWorkspace", nil, "Failure preparing request") + return + } + + resp, err := client.ListByWorkspaceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "operationalinsights.AvailableServiceTiersClient", "ListByWorkspace", resp, "Failure sending request") + return + } + + result, err = client.ListByWorkspaceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.AvailableServiceTiersClient", "ListByWorkspace", resp, "Failure responding to request") + } + + return +} + +// ListByWorkspacePreparer prepares the ListByWorkspace request. +func (client AvailableServiceTiersClient) ListByWorkspacePreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-03-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.OperationalInsights/workspaces/{workspaceName}/availableServiceTiers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByWorkspaceSender sends the ListByWorkspace request. The method will close the +// http.Response Body if it receives an error. +func (client AvailableServiceTiersClient) ListByWorkspaceSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByWorkspaceResponder handles the response to the ListByWorkspace request. The method always +// closes the http.Response Body. +func (client AvailableServiceTiersClient) ListByWorkspaceResponder(resp *http.Response) (result ListAvailableServiceTier, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/client.go b/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/client.go new file mode 100644 index 000000000000..c1f4a6a3b76d --- /dev/null +++ b/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/client.go @@ -0,0 +1,52 @@ +// Package operationalinsights implements the Azure ARM Operationalinsights service API version 2020-03-01-preview. +// +// Operational Insights Client +package operationalinsights + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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 Operationalinsights + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Operationalinsights. +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/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/clusters.go b/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/clusters.go new file mode 100644 index 000000000000..aa939c730360 --- /dev/null +++ b/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/clusters.go @@ -0,0 +1,633 @@ +package operationalinsights + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// ClustersClient is the operational Insights Client +type ClustersClient struct { + BaseClient +} + +// NewClustersClient creates an instance of the ClustersClient client. +func NewClustersClient(subscriptionID string) ClustersClient { + return NewClustersClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewClustersClientWithBaseURI creates an instance of the ClustersClient 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 NewClustersClientWithBaseURI(baseURI string, subscriptionID string) ClustersClient { + return ClustersClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create or update a Log Analytics cluster. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterName - the name of the Log Analytics cluster. +// parameters - the parameters required to create or update a Log Analytics cluster. +func (client ClustersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, parameters Cluster) (result ClustersCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.CreateOrUpdate") + 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: clusterName, + Constraints: []validation.Constraint{{Target: "clusterName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "clusterName", Name: validation.MinLength, Rule: 4, Chain: nil}, + {Target: "clusterName", Name: validation.Pattern, Rule: `^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("operationalinsights.ClustersClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, clusterName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.ClustersClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.ClustersClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ClustersClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, clusterName string, parameters Cluster) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-03-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.OperationalInsights/clusters/{clusterName}", pathParameters), + autorest.WithJSON(parameters), + 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 ClustersClient) CreateOrUpdateSender(req *http.Request) (future ClustersCreateOrUpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client ClustersClient) CreateOrUpdateResponder(resp *http.Response) (result Cluster, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a cluster instance. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterName - name of the Log Analytics Cluster. +func (client ClustersClient) Delete(ctx context.Context, resourceGroupName string, clusterName string) (result ClustersDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.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}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("operationalinsights.ClustersClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, clusterName) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.ClustersClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.ClustersClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ClustersClient) DeletePreparer(ctx context.Context, resourceGroupName string, clusterName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-03-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.OperationalInsights/clusters/{clusterName}", 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 ClustersClient) DeleteSender(req *http.Request) (future ClustersDeleteFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ClustersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets a Log Analytics cluster instance. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterName - name of the Log Analytics Cluster. +func (client ClustersClient) Get(ctx context.Context, resourceGroupName string, clusterName string) (result Cluster, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("operationalinsights.ClustersClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, clusterName) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.ClustersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "operationalinsights.ClustersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.ClustersClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client ClustersClient) GetPreparer(ctx context.Context, resourceGroupName string, clusterName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-03-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.OperationalInsights/clusters/{clusterName}", 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 ClustersClient) 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 ClustersClient) GetResponder(resp *http.Response) (result Cluster, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets the Log Analytics clusters in a subscription. +func (client ClustersClient) List(ctx context.Context) (result ClusterListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.List") + defer func() { + sc := -1 + if result.clr.Response.Response != nil { + sc = result.clr.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("operationalinsights.ClustersClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.ClustersClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.clr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "operationalinsights.ClustersClient", "List", resp, "Failure sending request") + return + } + + result.clr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.ClustersClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client ClustersClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-03-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/clusters", 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 ClustersClient) 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 ClustersClient) ListResponder(resp *http.Response) (result ClusterListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 ClustersClient) listNextResults(ctx context.Context, lastResults ClusterListResult) (result ClusterListResult, err error) { + req, err := lastResults.clusterListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "operationalinsights.ClustersClient", "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, "operationalinsights.ClustersClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.ClustersClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ClustersClient) ListComplete(ctx context.Context) (result ClusterListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.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 gets Log Analytics clusters in a resource group. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +func (client ClustersClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ClusterListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.clr.Response.Response != nil { + sc = result.clr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("operationalinsights.ClustersClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.ClustersClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.clr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "operationalinsights.ClustersClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.clr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.ClustersClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client ClustersClient) 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 = "2020-03-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.OperationalInsights/clusters", 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 ClustersClient) 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 ClustersClient) ListByResourceGroupResponder(resp *http.Response) (result ClusterListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 ClustersClient) listByResourceGroupNextResults(ctx context.Context, lastResults ClusterListResult) (result ClusterListResult, err error) { + req, err := lastResults.clusterListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "operationalinsights.ClustersClient", "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, "operationalinsights.ClustersClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.ClustersClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client ClustersClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ClusterListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.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 updates a Log Analytics cluster. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// clusterName - name of the Log Analytics Cluster. +// parameters - the parameters required to patch a Log Analytics cluster. +func (client ClustersClient) Update(ctx context.Context, resourceGroupName string, clusterName string, parameters ClusterPatch) (result Cluster, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClustersClient.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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("operationalinsights.ClustersClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, clusterName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.ClustersClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "operationalinsights.ClustersClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.ClustersClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ClustersClient) UpdatePreparer(ctx context.Context, resourceGroupName string, clusterName string, parameters ClusterPatch) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "clusterName": autorest.Encode("path", clusterName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-03-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.OperationalInsights/clusters/{clusterName}", pathParameters), + autorest.WithJSON(parameters), + 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 ClustersClient) 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 ClustersClient) UpdateResponder(resp *http.Response) (result Cluster, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/dataexports.go b/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/dataexports.go new file mode 100644 index 000000000000..4f747562d86f --- /dev/null +++ b/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/dataexports.go @@ -0,0 +1,420 @@ +package operationalinsights + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// DataExportsClient is the operational Insights Client +type DataExportsClient struct { + BaseClient +} + +// NewDataExportsClient creates an instance of the DataExportsClient client. +func NewDataExportsClient(subscriptionID string) DataExportsClient { + return NewDataExportsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDataExportsClientWithBaseURI creates an instance of the DataExportsClient 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 NewDataExportsClientWithBaseURI(baseURI string, subscriptionID string) DataExportsClient { + return DataExportsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create or update a data export. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace. +// dataExportName - the data export rule name. +// parameters - the parameters required to create or update a data export. +func (client DataExportsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, dataExportName string, parameters DataExport) (result DataExportsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataExportsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 4, Chain: nil}, + {Target: "workspaceName", Name: validation.Pattern, Rule: `^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$`, Chain: nil}}}, + {TargetValue: dataExportName, + Constraints: []validation.Constraint{{Target: "dataExportName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "dataExportName", Name: validation.MinLength, Rule: 4, Chain: nil}, + {Target: "dataExportName", Name: validation.Pattern, Rule: `^[A-Za-z][A-Za-z0-9-]+[A-Za-z0-9]$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.DataExportProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DataExportProperties.Destination", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.DataExportProperties.Destination.ResourceID", Name: validation.Null, Rule: true, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("operationalinsights.DataExportsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, workspaceName, dataExportName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.DataExportsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.DataExportsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client DataExportsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, workspaceName string, dataExportName string, parameters DataExport) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "dataExportName": autorest.Encode("path", dataExportName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-03-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.OperationalInsights/workspaces/{workspaceName}/dataExports/{dataExportName}", pathParameters), + autorest.WithJSON(parameters), + 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 DataExportsClient) CreateOrUpdateSender(req *http.Request) (future DataExportsCreateOrUpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client DataExportsClient) CreateOrUpdateResponder(resp *http.Response) (result DataExport, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the specified data export in a given workspace.. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace. +// dataExportName - the data export rule name. +func (client DataExportsClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, dataExportName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataExportsClient.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: 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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 4, Chain: nil}, + {Target: "workspaceName", Name: validation.Pattern, Rule: `^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("operationalinsights.DataExportsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, workspaceName, dataExportName) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.DataExportsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "operationalinsights.DataExportsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.DataExportsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client DataExportsClient) DeletePreparer(ctx context.Context, resourceGroupName string, workspaceName string, dataExportName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "dataExportName": autorest.Encode("path", dataExportName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-03-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.OperationalInsights/workspaces/{workspaceName}/dataExports/{dataExportName}", 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 DataExportsClient) 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 DataExportsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets a data export instance. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace. +// dataExportName - the data export rule name. +func (client DataExportsClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, dataExportName string) (result DataExport, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataExportsClient.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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 4, Chain: nil}, + {Target: "workspaceName", Name: validation.Pattern, Rule: `^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("operationalinsights.DataExportsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName, dataExportName) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.DataExportsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "operationalinsights.DataExportsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.DataExportsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client DataExportsClient) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string, dataExportName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "dataExportName": autorest.Encode("path", dataExportName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-03-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.OperationalInsights/workspaces/{workspaceName}/dataExports/{dataExportName}", 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 DataExportsClient) 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 DataExportsClient) GetResponder(resp *http.Response) (result DataExport, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNotFound), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByWorkspace lists the data export instances within a workspace. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace. +func (client DataExportsClient) ListByWorkspace(ctx context.Context, resourceGroupName string, workspaceName string) (result DataExportListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataExportsClient.ListByWorkspace") + defer func() { + 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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 4, Chain: nil}, + {Target: "workspaceName", Name: validation.Pattern, Rule: `^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("operationalinsights.DataExportsClient", "ListByWorkspace", err.Error()) + } + + req, err := client.ListByWorkspacePreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.DataExportsClient", "ListByWorkspace", nil, "Failure preparing request") + return + } + + resp, err := client.ListByWorkspaceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "operationalinsights.DataExportsClient", "ListByWorkspace", resp, "Failure sending request") + return + } + + result, err = client.ListByWorkspaceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.DataExportsClient", "ListByWorkspace", resp, "Failure responding to request") + } + + return +} + +// ListByWorkspacePreparer prepares the ListByWorkspace request. +func (client DataExportsClient) ListByWorkspacePreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-03-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.OperationalInsights/workspaces/{workspaceName}/dataExports", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByWorkspaceSender sends the ListByWorkspace request. The method will close the +// http.Response Body if it receives an error. +func (client DataExportsClient) ListByWorkspaceSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByWorkspaceResponder handles the response to the ListByWorkspace request. The method always +// closes the http.Response Body. +func (client DataExportsClient) ListByWorkspaceResponder(resp *http.Response) (result DataExportListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/datasources.go b/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/datasources.go new file mode 100644 index 000000000000..e146b5d71bc8 --- /dev/null +++ b/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/datasources.go @@ -0,0 +1,457 @@ +package operationalinsights + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// DataSourcesClient is the operational Insights Client +type DataSourcesClient struct { + BaseClient +} + +// NewDataSourcesClient creates an instance of the DataSourcesClient client. +func NewDataSourcesClient(subscriptionID string) DataSourcesClient { + return NewDataSourcesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDataSourcesClientWithBaseURI creates an instance of the DataSourcesClient 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 NewDataSourcesClientWithBaseURI(baseURI string, subscriptionID string) DataSourcesClient { + return DataSourcesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create or update a data source. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace. +// dataSourceName - the name of the datasource resource. +// parameters - the parameters required to create or update a datasource. +func (client DataSourcesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, dataSourceName string, parameters DataSource) (result DataSource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataSourcesClient.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}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 4, Chain: nil}, + {Target: "workspaceName", Name: validation.Pattern, Rule: `^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Properties", Name: validation.Null, Rule: true, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("operationalinsights.DataSourcesClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, workspaceName, dataSourceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.DataSourcesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "operationalinsights.DataSourcesClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.DataSourcesClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client DataSourcesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, workspaceName string, dataSourceName string, parameters DataSource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "dataSourceName": autorest.Encode("path", dataSourceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-03-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.OperationalInsights/workspaces/{workspaceName}/dataSources/{dataSourceName}", pathParameters), + autorest.WithJSON(parameters), + 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 DataSourcesClient) 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 DataSourcesClient) CreateOrUpdateResponder(resp *http.Response) (result DataSource, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a data source instance. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace. +// dataSourceName - name of the datasource. +func (client DataSourcesClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, dataSourceName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataSourcesClient.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}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 4, Chain: nil}, + {Target: "workspaceName", Name: validation.Pattern, Rule: `^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$`, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("operationalinsights.DataSourcesClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, workspaceName, dataSourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.DataSourcesClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "operationalinsights.DataSourcesClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.DataSourcesClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client DataSourcesClient) DeletePreparer(ctx context.Context, resourceGroupName string, workspaceName string, dataSourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "dataSourceName": autorest.Encode("path", dataSourceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-03-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.OperationalInsights/workspaces/{workspaceName}/dataSources/{dataSourceName}", 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 DataSourcesClient) 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 DataSourcesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets a datasource instance. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace. +// dataSourceName - name of the datasource +func (client DataSourcesClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, dataSourceName string) (result DataSource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataSourcesClient.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}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 4, Chain: nil}, + {Target: "workspaceName", Name: validation.Pattern, Rule: `^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$`, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("operationalinsights.DataSourcesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName, dataSourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.DataSourcesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "operationalinsights.DataSourcesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.DataSourcesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client DataSourcesClient) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string, dataSourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "dataSourceName": autorest.Encode("path", dataSourceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-03-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.OperationalInsights/workspaces/{workspaceName}/dataSources/{dataSourceName}", 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 DataSourcesClient) 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 DataSourcesClient) GetResponder(resp *http.Response) (result DataSource, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByWorkspace gets the first page of data source instances in a workspace with the link to the next page. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace. +// filter - the filter to apply on the operation. +// skiptoken - starting point of the collection of data source instances. +func (client DataSourcesClient) ListByWorkspace(ctx context.Context, resourceGroupName string, workspaceName string, filter string, skiptoken string) (result DataSourceListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataSourcesClient.ListByWorkspace") + defer func() { + sc := -1 + if result.dslr.Response.Response != nil { + sc = result.dslr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: 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: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 4, Chain: nil}, + {Target: "workspaceName", Name: validation.Pattern, Rule: `^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$`, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("operationalinsights.DataSourcesClient", "ListByWorkspace", err.Error()) + } + + result.fn = client.listByWorkspaceNextResults + req, err := client.ListByWorkspacePreparer(ctx, resourceGroupName, workspaceName, filter, skiptoken) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.DataSourcesClient", "ListByWorkspace", nil, "Failure preparing request") + return + } + + resp, err := client.ListByWorkspaceSender(req) + if err != nil { + result.dslr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "operationalinsights.DataSourcesClient", "ListByWorkspace", resp, "Failure sending request") + return + } + + result.dslr, err = client.ListByWorkspaceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.DataSourcesClient", "ListByWorkspace", resp, "Failure responding to request") + } + + return +} + +// ListByWorkspacePreparer prepares the ListByWorkspace request. +func (client DataSourcesClient) ListByWorkspacePreparer(ctx context.Context, resourceGroupName string, workspaceName string, filter string, skiptoken string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-03-01-preview" + queryParameters := map[string]interface{}{ + "$filter": autorest.Encode("query", filter), + "api-version": APIVersion, + } + if len(skiptoken) > 0 { + queryParameters["$skiptoken"] = autorest.Encode("query", skiptoken) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/dataSources", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByWorkspaceSender sends the ListByWorkspace request. The method will close the +// http.Response Body if it receives an error. +func (client DataSourcesClient) ListByWorkspaceSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByWorkspaceResponder handles the response to the ListByWorkspace request. The method always +// closes the http.Response Body. +func (client DataSourcesClient) ListByWorkspaceResponder(resp *http.Response) (result DataSourceListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByWorkspaceNextResults retrieves the next set of results, if any. +func (client DataSourcesClient) listByWorkspaceNextResults(ctx context.Context, lastResults DataSourceListResult) (result DataSourceListResult, err error) { + req, err := lastResults.dataSourceListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "operationalinsights.DataSourcesClient", "listByWorkspaceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByWorkspaceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "operationalinsights.DataSourcesClient", "listByWorkspaceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByWorkspaceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.DataSourcesClient", "listByWorkspaceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByWorkspaceComplete enumerates all values, automatically crossing page boundaries as required. +func (client DataSourcesClient) ListByWorkspaceComplete(ctx context.Context, resourceGroupName string, workspaceName string, filter string, skiptoken string) (result DataSourceListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataSourcesClient.ListByWorkspace") + 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.ListByWorkspace(ctx, resourceGroupName, workspaceName, filter, skiptoken) + return +} diff --git a/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/deletedworkspaces.go b/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/deletedworkspaces.go new file mode 100644 index 000000000000..1dd1a74653db --- /dev/null +++ b/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/deletedworkspaces.go @@ -0,0 +1,205 @@ +package operationalinsights + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// DeletedWorkspacesClient is the operational Insights Client +type DeletedWorkspacesClient struct { + BaseClient +} + +// NewDeletedWorkspacesClient creates an instance of the DeletedWorkspacesClient client. +func NewDeletedWorkspacesClient(subscriptionID string) DeletedWorkspacesClient { + return NewDeletedWorkspacesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDeletedWorkspacesClientWithBaseURI creates an instance of the DeletedWorkspacesClient 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 NewDeletedWorkspacesClientWithBaseURI(baseURI string, subscriptionID string) DeletedWorkspacesClient { + return DeletedWorkspacesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List gets recently deleted workspaces in a subscription, available for recovery. +func (client DeletedWorkspacesClient) List(ctx context.Context) (result WorkspaceListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DeletedWorkspacesClient.List") + defer func() { + 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}}}}); err != nil { + return result, validation.NewError("operationalinsights.DeletedWorkspacesClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.DeletedWorkspacesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "operationalinsights.DeletedWorkspacesClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.DeletedWorkspacesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client DeletedWorkspacesClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-03-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/deletedWorkspaces", 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 DeletedWorkspacesClient) 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 DeletedWorkspacesClient) ListResponder(resp *http.Response) (result WorkspaceListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByResourceGroup gets recently deleted workspaces in a resource group, available for recovery. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +func (client DeletedWorkspacesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result WorkspaceListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DeletedWorkspacesClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("operationalinsights.DeletedWorkspacesClient", "ListByResourceGroup", err.Error()) + } + + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.DeletedWorkspacesClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "operationalinsights.DeletedWorkspacesClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.DeletedWorkspacesClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client DeletedWorkspacesClient) 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 = "2020-03-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.OperationalInsights/deletedWorkspaces", 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 DeletedWorkspacesClient) 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 DeletedWorkspacesClient) ListByResourceGroupResponder(resp *http.Response) (result WorkspaceListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/gateways.go b/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/gateways.go new file mode 100644 index 000000000000..f617a98efedf --- /dev/null +++ b/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/gateways.go @@ -0,0 +1,134 @@ +package operationalinsights + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// GatewaysClient is the operational Insights Client +type GatewaysClient struct { + BaseClient +} + +// NewGatewaysClient creates an instance of the GatewaysClient client. +func NewGatewaysClient(subscriptionID string) GatewaysClient { + return NewGatewaysClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewGatewaysClientWithBaseURI creates an instance of the GatewaysClient 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 NewGatewaysClientWithBaseURI(baseURI string, subscriptionID string) GatewaysClient { + return GatewaysClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Delete delete a Log Analytics gateway. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace. +// gatewayID - the Log Analytics gateway Id. +func (client GatewaysClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, gatewayID string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GatewaysClient.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: 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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 4, Chain: nil}, + {Target: "workspaceName", Name: validation.Pattern, Rule: `^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("operationalinsights.GatewaysClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, workspaceName, gatewayID) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.GatewaysClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "operationalinsights.GatewaysClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.GatewaysClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client GatewaysClient) DeletePreparer(ctx context.Context, resourceGroupName string, workspaceName string, gatewayID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "gatewayId": autorest.Encode("path", gatewayID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-03-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.OperationalInsights/workspaces/{workspaceName}/gateways/{gatewayId}", 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 GatewaysClient) 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 GatewaysClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/intelligencepacks.go b/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/intelligencepacks.go new file mode 100644 index 000000000000..2d7e2e2c2424 --- /dev/null +++ b/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/intelligencepacks.go @@ -0,0 +1,316 @@ +package operationalinsights + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// IntelligencePacksClient is the operational Insights Client +type IntelligencePacksClient struct { + BaseClient +} + +// NewIntelligencePacksClient creates an instance of the IntelligencePacksClient client. +func NewIntelligencePacksClient(subscriptionID string) IntelligencePacksClient { + return NewIntelligencePacksClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewIntelligencePacksClientWithBaseURI creates an instance of the IntelligencePacksClient 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 NewIntelligencePacksClientWithBaseURI(baseURI string, subscriptionID string) IntelligencePacksClient { + return IntelligencePacksClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Disable disables an intelligence pack for a given workspace. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace. +// intelligencePackName - the name of the intelligence pack to be disabled. +func (client IntelligencePacksClient) Disable(ctx context.Context, resourceGroupName string, workspaceName string, intelligencePackName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntelligencePacksClient.Disable") + 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: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 4, Chain: nil}, + {Target: "workspaceName", Name: validation.Pattern, Rule: `^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$`, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("operationalinsights.IntelligencePacksClient", "Disable", err.Error()) + } + + req, err := client.DisablePreparer(ctx, resourceGroupName, workspaceName, intelligencePackName) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.IntelligencePacksClient", "Disable", nil, "Failure preparing request") + return + } + + resp, err := client.DisableSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "operationalinsights.IntelligencePacksClient", "Disable", resp, "Failure sending request") + return + } + + result, err = client.DisableResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.IntelligencePacksClient", "Disable", resp, "Failure responding to request") + } + + return +} + +// DisablePreparer prepares the Disable request. +func (client IntelligencePacksClient) DisablePreparer(ctx context.Context, resourceGroupName string, workspaceName string, intelligencePackName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "intelligencePackName": autorest.Encode("path", intelligencePackName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-03-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.OperationalInsights/workspaces/{workspaceName}/intelligencePacks/{intelligencePackName}/Disable", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DisableSender sends the Disable request. The method will close the +// http.Response Body if it receives an error. +func (client IntelligencePacksClient) DisableSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DisableResponder handles the response to the Disable request. The method always +// closes the http.Response Body. +func (client IntelligencePacksClient) DisableResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Enable enables an intelligence pack for a given workspace. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace. +// intelligencePackName - the name of the intelligence pack to be enabled. +func (client IntelligencePacksClient) Enable(ctx context.Context, resourceGroupName string, workspaceName string, intelligencePackName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntelligencePacksClient.Enable") + 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: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 4, Chain: nil}, + {Target: "workspaceName", Name: validation.Pattern, Rule: `^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$`, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("operationalinsights.IntelligencePacksClient", "Enable", err.Error()) + } + + req, err := client.EnablePreparer(ctx, resourceGroupName, workspaceName, intelligencePackName) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.IntelligencePacksClient", "Enable", nil, "Failure preparing request") + return + } + + resp, err := client.EnableSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "operationalinsights.IntelligencePacksClient", "Enable", resp, "Failure sending request") + return + } + + result, err = client.EnableResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.IntelligencePacksClient", "Enable", resp, "Failure responding to request") + } + + return +} + +// EnablePreparer prepares the Enable request. +func (client IntelligencePacksClient) EnablePreparer(ctx context.Context, resourceGroupName string, workspaceName string, intelligencePackName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "intelligencePackName": autorest.Encode("path", intelligencePackName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-03-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.OperationalInsights/workspaces/{workspaceName}/intelligencePacks/{intelligencePackName}/Enable", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// EnableSender sends the Enable request. The method will close the +// http.Response Body if it receives an error. +func (client IntelligencePacksClient) EnableSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// EnableResponder handles the response to the Enable request. The method always +// closes the http.Response Body. +func (client IntelligencePacksClient) EnableResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// List lists all the intelligence packs possible and whether they are enabled or disabled for a given workspace. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace. +func (client IntelligencePacksClient) List(ctx context.Context, resourceGroupName string, workspaceName string) (result ListIntelligencePack, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IntelligencePacksClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: 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: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 4, Chain: nil}, + {Target: "workspaceName", Name: validation.Pattern, Rule: `^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$`, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("operationalinsights.IntelligencePacksClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.IntelligencePacksClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "operationalinsights.IntelligencePacksClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.IntelligencePacksClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client IntelligencePacksClient) ListPreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-03-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.OperationalInsights/workspaces/{workspaceName}/intelligencePacks", 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 IntelligencePacksClient) 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 IntelligencePacksClient) ListResponder(resp *http.Response) (result ListIntelligencePack, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/linkedservices.go b/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/linkedservices.go new file mode 100644 index 000000000000..8efdc334dc98 --- /dev/null +++ b/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/linkedservices.go @@ -0,0 +1,414 @@ +package operationalinsights + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// LinkedServicesClient is the operational Insights Client +type LinkedServicesClient struct { + BaseClient +} + +// NewLinkedServicesClient creates an instance of the LinkedServicesClient client. +func NewLinkedServicesClient(subscriptionID string) LinkedServicesClient { + return NewLinkedServicesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewLinkedServicesClientWithBaseURI creates an instance of the LinkedServicesClient 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 NewLinkedServicesClientWithBaseURI(baseURI string, subscriptionID string) LinkedServicesClient { + return LinkedServicesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create or update a linked service. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace. +// linkedServiceName - name of the linkedServices resource +// parameters - the parameters required to create or update a linked service. +func (client LinkedServicesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, linkedServiceName string, parameters LinkedService) (result LinkedServicesCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LinkedServicesClient.CreateOrUpdate") + 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: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 4, Chain: nil}, + {Target: "workspaceName", Name: validation.Pattern, Rule: `^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.LinkedServiceProperties", Name: validation.Null, Rule: true, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("operationalinsights.LinkedServicesClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, workspaceName, linkedServiceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.LinkedServicesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.LinkedServicesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client LinkedServicesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, workspaceName string, linkedServiceName string, parameters LinkedService) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "linkedServiceName": autorest.Encode("path", linkedServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-03-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.OperationalInsights/workspaces/{workspaceName}/linkedServices/{linkedServiceName}", pathParameters), + autorest.WithJSON(parameters), + 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 LinkedServicesClient) CreateOrUpdateSender(req *http.Request) (future LinkedServicesCreateOrUpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client LinkedServicesClient) CreateOrUpdateResponder(resp *http.Response) (result LinkedService, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a linked service instance. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace. +// linkedServiceName - name of the linked service. +func (client LinkedServicesClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, linkedServiceName string) (result LinkedServicesDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LinkedServicesClient.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}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 4, Chain: nil}, + {Target: "workspaceName", Name: validation.Pattern, Rule: `^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$`, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("operationalinsights.LinkedServicesClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, workspaceName, linkedServiceName) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.LinkedServicesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.LinkedServicesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client LinkedServicesClient) DeletePreparer(ctx context.Context, resourceGroupName string, workspaceName string, linkedServiceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "linkedServiceName": autorest.Encode("path", linkedServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-03-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.OperationalInsights/workspaces/{workspaceName}/linkedServices/{linkedServiceName}", 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 LinkedServicesClient) DeleteSender(req *http.Request) (future LinkedServicesDeleteFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client LinkedServicesClient) DeleteResponder(resp *http.Response) (result LinkedService, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets a linked service instance. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace. +// linkedServiceName - name of the linked service. +func (client LinkedServicesClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, linkedServiceName string) (result LinkedService, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LinkedServicesClient.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}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 4, Chain: nil}, + {Target: "workspaceName", Name: validation.Pattern, Rule: `^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$`, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("operationalinsights.LinkedServicesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName, linkedServiceName) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.LinkedServicesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "operationalinsights.LinkedServicesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.LinkedServicesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client LinkedServicesClient) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string, linkedServiceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "linkedServiceName": autorest.Encode("path", linkedServiceName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-03-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.OperationalInsights/workspaces/{workspaceName}/linkedServices/{linkedServiceName}", 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 LinkedServicesClient) 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 LinkedServicesClient) GetResponder(resp *http.Response) (result LinkedService, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByWorkspace gets the linked services instances in a workspace. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace. +func (client LinkedServicesClient) ListByWorkspace(ctx context.Context, resourceGroupName string, workspaceName string) (result LinkedServiceListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LinkedServicesClient.ListByWorkspace") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: 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: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 4, Chain: nil}, + {Target: "workspaceName", Name: validation.Pattern, Rule: `^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$`, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("operationalinsights.LinkedServicesClient", "ListByWorkspace", err.Error()) + } + + req, err := client.ListByWorkspacePreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.LinkedServicesClient", "ListByWorkspace", nil, "Failure preparing request") + return + } + + resp, err := client.ListByWorkspaceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "operationalinsights.LinkedServicesClient", "ListByWorkspace", resp, "Failure sending request") + return + } + + result, err = client.ListByWorkspaceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.LinkedServicesClient", "ListByWorkspace", resp, "Failure responding to request") + } + + return +} + +// ListByWorkspacePreparer prepares the ListByWorkspace request. +func (client LinkedServicesClient) ListByWorkspacePreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-03-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.OperationalInsights/workspaces/{workspaceName}/linkedServices", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByWorkspaceSender sends the ListByWorkspace request. The method will close the +// http.Response Body if it receives an error. +func (client LinkedServicesClient) ListByWorkspaceSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByWorkspaceResponder handles the response to the ListByWorkspace request. The method always +// closes the http.Response Body. +func (client LinkedServicesClient) ListByWorkspaceResponder(resp *http.Response) (result LinkedServiceListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/linkedstorageaccounts.go b/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/linkedstorageaccounts.go new file mode 100644 index 000000000000..dfd1aebd3dc2 --- /dev/null +++ b/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/linkedstorageaccounts.go @@ -0,0 +1,416 @@ +package operationalinsights + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// LinkedStorageAccountsClient is the operational Insights Client +type LinkedStorageAccountsClient struct { + BaseClient +} + +// NewLinkedStorageAccountsClient creates an instance of the LinkedStorageAccountsClient client. +func NewLinkedStorageAccountsClient(subscriptionID string) LinkedStorageAccountsClient { + return NewLinkedStorageAccountsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewLinkedStorageAccountsClientWithBaseURI creates an instance of the LinkedStorageAccountsClient 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 NewLinkedStorageAccountsClientWithBaseURI(baseURI string, subscriptionID string) LinkedStorageAccountsClient { + return LinkedStorageAccountsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create or Update a link relation between current workspace and a group of storage accounts of a +// specific data source type. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace. +// dataSourceType - linked storage accounts type. +// parameters - the parameters required to create or update linked storage accounts. +func (client LinkedStorageAccountsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, dataSourceType DataSourceType, parameters LinkedStorageAccountsResource) (result LinkedStorageAccountsResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LinkedStorageAccountsClient.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}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 4, Chain: nil}, + {Target: "workspaceName", Name: validation.Pattern, Rule: `^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.LinkedStorageAccountsProperties", Name: validation.Null, Rule: true, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("operationalinsights.LinkedStorageAccountsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, workspaceName, dataSourceType, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.LinkedStorageAccountsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "operationalinsights.LinkedStorageAccountsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.LinkedStorageAccountsClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client LinkedStorageAccountsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, workspaceName string, dataSourceType DataSourceType, parameters LinkedStorageAccountsResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "dataSourceType": autorest.Encode("path", dataSourceType), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-03-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.OperationalInsights/workspaces/{workspaceName}/linkedStorageAccounts/{dataSourceType}", pathParameters), + autorest.WithJSON(parameters), + 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 LinkedStorageAccountsClient) 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 LinkedStorageAccountsClient) CreateOrUpdateResponder(resp *http.Response) (result LinkedStorageAccountsResource, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes all linked storage accounts of a specific data source type associated with the specified workspace. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace. +// dataSourceType - linked storage accounts type. +func (client LinkedStorageAccountsClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, dataSourceType DataSourceType) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LinkedStorageAccountsClient.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}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 4, Chain: nil}, + {Target: "workspaceName", Name: validation.Pattern, Rule: `^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$`, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("operationalinsights.LinkedStorageAccountsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, workspaceName, dataSourceType) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.LinkedStorageAccountsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "operationalinsights.LinkedStorageAccountsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.LinkedStorageAccountsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client LinkedStorageAccountsClient) DeletePreparer(ctx context.Context, resourceGroupName string, workspaceName string, dataSourceType DataSourceType) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "dataSourceType": autorest.Encode("path", dataSourceType), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-03-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.OperationalInsights/workspaces/{workspaceName}/linkedStorageAccounts/{dataSourceType}", 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 LinkedStorageAccountsClient) 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 LinkedStorageAccountsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets all linked storage account of a specific data source type associated with the specified workspace. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace. +// dataSourceType - linked storage accounts type. +func (client LinkedStorageAccountsClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, dataSourceType DataSourceType) (result LinkedStorageAccountsResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LinkedStorageAccountsClient.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}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 4, Chain: nil}, + {Target: "workspaceName", Name: validation.Pattern, Rule: `^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$`, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("operationalinsights.LinkedStorageAccountsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName, dataSourceType) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.LinkedStorageAccountsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "operationalinsights.LinkedStorageAccountsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.LinkedStorageAccountsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client LinkedStorageAccountsClient) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string, dataSourceType DataSourceType) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "dataSourceType": autorest.Encode("path", dataSourceType), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-03-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.OperationalInsights/workspaces/{workspaceName}/linkedStorageAccounts/{dataSourceType}", 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 LinkedStorageAccountsClient) 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 LinkedStorageAccountsClient) GetResponder(resp *http.Response) (result LinkedStorageAccountsResource, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByWorkspace gets all linked storage accounts associated with the specified workspace, storage accounts will be +// sorted by their data source type. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace. +func (client LinkedStorageAccountsClient) ListByWorkspace(ctx context.Context, resourceGroupName string, workspaceName string) (result LinkedStorageAccountsListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LinkedStorageAccountsClient.ListByWorkspace") + defer func() { + 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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 4, Chain: nil}, + {Target: "workspaceName", Name: validation.Pattern, Rule: `^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("operationalinsights.LinkedStorageAccountsClient", "ListByWorkspace", err.Error()) + } + + req, err := client.ListByWorkspacePreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.LinkedStorageAccountsClient", "ListByWorkspace", nil, "Failure preparing request") + return + } + + resp, err := client.ListByWorkspaceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "operationalinsights.LinkedStorageAccountsClient", "ListByWorkspace", resp, "Failure sending request") + return + } + + result, err = client.ListByWorkspaceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.LinkedStorageAccountsClient", "ListByWorkspace", resp, "Failure responding to request") + } + + return +} + +// ListByWorkspacePreparer prepares the ListByWorkspace request. +func (client LinkedStorageAccountsClient) ListByWorkspacePreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-03-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.OperationalInsights/workspaces/{workspaceName}/linkedStorageAccounts", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByWorkspaceSender sends the ListByWorkspace request. The method will close the +// http.Response Body if it receives an error. +func (client LinkedStorageAccountsClient) ListByWorkspaceSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByWorkspaceResponder handles the response to the ListByWorkspace request. The method always +// closes the http.Response Body. +func (client LinkedStorageAccountsClient) ListByWorkspaceResponder(resp *http.Response) (result LinkedStorageAccountsListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/managementgroups.go b/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/managementgroups.go new file mode 100644 index 000000000000..ca3a8bc11c08 --- /dev/null +++ b/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/managementgroups.go @@ -0,0 +1,134 @@ +package operationalinsights + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// ManagementGroupsClient is the operational Insights Client +type ManagementGroupsClient struct { + BaseClient +} + +// NewManagementGroupsClient creates an instance of the ManagementGroupsClient client. +func NewManagementGroupsClient(subscriptionID string) ManagementGroupsClient { + return NewManagementGroupsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewManagementGroupsClientWithBaseURI creates an instance of the ManagementGroupsClient 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 NewManagementGroupsClientWithBaseURI(baseURI string, subscriptionID string) ManagementGroupsClient { + return ManagementGroupsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List gets a list of management groups connected to a workspace. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace. +func (client ManagementGroupsClient) List(ctx context.Context, resourceGroupName string, workspaceName string) (result WorkspaceListManagementGroupsResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ManagementGroupsClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: 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: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 4, Chain: nil}, + {Target: "workspaceName", Name: validation.Pattern, Rule: `^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$`, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("operationalinsights.ManagementGroupsClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.ManagementGroupsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "operationalinsights.ManagementGroupsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.ManagementGroupsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client ManagementGroupsClient) ListPreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-03-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.OperationalInsights/workspaces/{workspaceName}/managementGroups", 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 ManagementGroupsClient) 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 ManagementGroupsClient) ListResponder(resp *http.Response) (result WorkspaceListManagementGroupsResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/models.go b/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/models.go new file mode 100644 index 000000000000..3ab344260a51 --- /dev/null +++ b/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/models.go @@ -0,0 +1,2905 @@ +package operationalinsights + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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/operationalinsights/mgmt/2020-03-01-preview/operationalinsights" + +// ClusterEntityStatus enumerates the values for cluster entity status. +type ClusterEntityStatus string + +const ( + // Canceled ... + Canceled ClusterEntityStatus = "Canceled" + // Creating ... + Creating ClusterEntityStatus = "Creating" + // Deleting ... + Deleting ClusterEntityStatus = "Deleting" + // Failed ... + Failed ClusterEntityStatus = "Failed" + // ProvisioningAccount ... + ProvisioningAccount ClusterEntityStatus = "ProvisioningAccount" + // Succeeded ... + Succeeded ClusterEntityStatus = "Succeeded" + // Updating ... + Updating ClusterEntityStatus = "Updating" +) + +// PossibleClusterEntityStatusValues returns an array of possible values for the ClusterEntityStatus const type. +func PossibleClusterEntityStatusValues() []ClusterEntityStatus { + return []ClusterEntityStatus{Canceled, Creating, Deleting, Failed, ProvisioningAccount, Succeeded, Updating} +} + +// ClusterSkuNameEnum enumerates the values for cluster sku name enum. +type ClusterSkuNameEnum string + +const ( + // CapacityReservation ... + CapacityReservation ClusterSkuNameEnum = "CapacityReservation" +) + +// PossibleClusterSkuNameEnumValues returns an array of possible values for the ClusterSkuNameEnum const type. +func PossibleClusterSkuNameEnumValues() []ClusterSkuNameEnum { + return []ClusterSkuNameEnum{CapacityReservation} +} + +// DataIngestionStatus enumerates the values for data ingestion status. +type DataIngestionStatus string + +const ( + // ApproachingQuota ... + ApproachingQuota DataIngestionStatus = "ApproachingQuota" + // ForceOff ... + ForceOff DataIngestionStatus = "ForceOff" + // ForceOn ... + ForceOn DataIngestionStatus = "ForceOn" + // OverQuota ... + OverQuota DataIngestionStatus = "OverQuota" + // RespectQuota ... + RespectQuota DataIngestionStatus = "RespectQuota" + // SubscriptionSuspended ... + SubscriptionSuspended DataIngestionStatus = "SubscriptionSuspended" +) + +// PossibleDataIngestionStatusValues returns an array of possible values for the DataIngestionStatus const type. +func PossibleDataIngestionStatusValues() []DataIngestionStatus { + return []DataIngestionStatus{ApproachingQuota, ForceOff, ForceOn, OverQuota, RespectQuota, SubscriptionSuspended} +} + +// DataSourceKind enumerates the values for data source kind. +type DataSourceKind string + +const ( + // ApplicationInsights ... + ApplicationInsights DataSourceKind = "ApplicationInsights" + // AzureActivityLog ... + AzureActivityLog DataSourceKind = "AzureActivityLog" + // AzureAuditLog ... + AzureAuditLog DataSourceKind = "AzureAuditLog" + // ChangeTrackingContentLocation ... + ChangeTrackingContentLocation DataSourceKind = "ChangeTrackingContentLocation" + // ChangeTrackingCustomPath ... + ChangeTrackingCustomPath DataSourceKind = "ChangeTrackingCustomPath" + // ChangeTrackingDataTypeConfiguration ... + ChangeTrackingDataTypeConfiguration DataSourceKind = "ChangeTrackingDataTypeConfiguration" + // ChangeTrackingDefaultRegistry ... + ChangeTrackingDefaultRegistry DataSourceKind = "ChangeTrackingDefaultRegistry" + // ChangeTrackingLinuxPath ... + ChangeTrackingLinuxPath DataSourceKind = "ChangeTrackingLinuxPath" + // ChangeTrackingPath ... + ChangeTrackingPath DataSourceKind = "ChangeTrackingPath" + // ChangeTrackingRegistry ... + ChangeTrackingRegistry DataSourceKind = "ChangeTrackingRegistry" + // ChangeTrackingServices ... + ChangeTrackingServices DataSourceKind = "ChangeTrackingServices" + // CustomLog ... + CustomLog DataSourceKind = "CustomLog" + // CustomLogCollection ... + CustomLogCollection DataSourceKind = "CustomLogCollection" + // DNSAnalytics ... + DNSAnalytics DataSourceKind = "DnsAnalytics" + // GenericDataSource ... + GenericDataSource DataSourceKind = "GenericDataSource" + // IISLogs ... + IISLogs DataSourceKind = "IISLogs" + // ImportComputerGroup ... + ImportComputerGroup DataSourceKind = "ImportComputerGroup" + // Itsm ... + Itsm DataSourceKind = "Itsm" + // LinuxChangeTrackingPath ... + LinuxChangeTrackingPath DataSourceKind = "LinuxChangeTrackingPath" + // LinuxPerformanceCollection ... + LinuxPerformanceCollection DataSourceKind = "LinuxPerformanceCollection" + // LinuxPerformanceObject ... + LinuxPerformanceObject DataSourceKind = "LinuxPerformanceObject" + // LinuxSyslog ... + LinuxSyslog DataSourceKind = "LinuxSyslog" + // LinuxSyslogCollection ... + LinuxSyslogCollection DataSourceKind = "LinuxSyslogCollection" + // NetworkMonitoring ... + NetworkMonitoring DataSourceKind = "NetworkMonitoring" + // Office365 ... + Office365 DataSourceKind = "Office365" + // SecurityCenterSecurityWindowsBaselineConfiguration ... + SecurityCenterSecurityWindowsBaselineConfiguration DataSourceKind = "SecurityCenterSecurityWindowsBaselineConfiguration" + // SecurityEventCollectionConfiguration ... + SecurityEventCollectionConfiguration DataSourceKind = "SecurityEventCollectionConfiguration" + // SecurityInsightsSecurityEventCollectionConfiguration ... + SecurityInsightsSecurityEventCollectionConfiguration DataSourceKind = "SecurityInsightsSecurityEventCollectionConfiguration" + // SecurityWindowsBaselineConfiguration ... + SecurityWindowsBaselineConfiguration DataSourceKind = "SecurityWindowsBaselineConfiguration" + // SQLDataClassification ... + SQLDataClassification DataSourceKind = "SqlDataClassification" + // WindowsEvent ... + WindowsEvent DataSourceKind = "WindowsEvent" + // WindowsPerformanceCounter ... + WindowsPerformanceCounter DataSourceKind = "WindowsPerformanceCounter" + // WindowsTelemetry ... + WindowsTelemetry DataSourceKind = "WindowsTelemetry" +) + +// PossibleDataSourceKindValues returns an array of possible values for the DataSourceKind const type. +func PossibleDataSourceKindValues() []DataSourceKind { + return []DataSourceKind{ApplicationInsights, AzureActivityLog, AzureAuditLog, ChangeTrackingContentLocation, ChangeTrackingCustomPath, ChangeTrackingDataTypeConfiguration, ChangeTrackingDefaultRegistry, ChangeTrackingLinuxPath, ChangeTrackingPath, ChangeTrackingRegistry, ChangeTrackingServices, CustomLog, CustomLogCollection, DNSAnalytics, GenericDataSource, IISLogs, ImportComputerGroup, Itsm, LinuxChangeTrackingPath, LinuxPerformanceCollection, LinuxPerformanceObject, LinuxSyslog, LinuxSyslogCollection, NetworkMonitoring, Office365, SecurityCenterSecurityWindowsBaselineConfiguration, SecurityEventCollectionConfiguration, SecurityInsightsSecurityEventCollectionConfiguration, SecurityWindowsBaselineConfiguration, SQLDataClassification, WindowsEvent, WindowsPerformanceCounter, WindowsTelemetry} +} + +// DataSourceType enumerates the values for data source type. +type DataSourceType string + +const ( + // AzureWatson ... + AzureWatson DataSourceType = "AzureWatson" + // CustomLogs ... + CustomLogs DataSourceType = "CustomLogs" +) + +// PossibleDataSourceTypeValues returns an array of possible values for the DataSourceType const type. +func PossibleDataSourceTypeValues() []DataSourceType { + return []DataSourceType{AzureWatson, CustomLogs} +} + +// IdentityType enumerates the values for identity type. +type IdentityType string + +const ( + // None ... + None IdentityType = "None" + // SystemAssigned ... + SystemAssigned IdentityType = "SystemAssigned" +) + +// PossibleIdentityTypeValues returns an array of possible values for the IdentityType const type. +func PossibleIdentityTypeValues() []IdentityType { + return []IdentityType{None, SystemAssigned} +} + +// LinkedServiceEntityStatus enumerates the values for linked service entity status. +type LinkedServiceEntityStatus string + +const ( + // LinkedServiceEntityStatusDeleting ... + LinkedServiceEntityStatusDeleting LinkedServiceEntityStatus = "Deleting" + // LinkedServiceEntityStatusProvisioningAccount ... + LinkedServiceEntityStatusProvisioningAccount LinkedServiceEntityStatus = "ProvisioningAccount" + // LinkedServiceEntityStatusSucceeded ... + LinkedServiceEntityStatusSucceeded LinkedServiceEntityStatus = "Succeeded" + // LinkedServiceEntityStatusUpdating ... + LinkedServiceEntityStatusUpdating LinkedServiceEntityStatus = "Updating" +) + +// PossibleLinkedServiceEntityStatusValues returns an array of possible values for the LinkedServiceEntityStatus const type. +func PossibleLinkedServiceEntityStatusValues() []LinkedServiceEntityStatus { + return []LinkedServiceEntityStatus{LinkedServiceEntityStatusDeleting, LinkedServiceEntityStatusProvisioningAccount, LinkedServiceEntityStatusSucceeded, LinkedServiceEntityStatusUpdating} +} + +// PublicNetworkAccessType enumerates the values for public network access type. +type PublicNetworkAccessType string + +const ( + // Disabled Disables public connectivity to Log Analytics through public DNS. + Disabled PublicNetworkAccessType = "Disabled" + // Enabled Enables connectivity to Log Analytics through public DNS. + Enabled PublicNetworkAccessType = "Enabled" +) + +// PossiblePublicNetworkAccessTypeValues returns an array of possible values for the PublicNetworkAccessType const type. +func PossiblePublicNetworkAccessTypeValues() []PublicNetworkAccessType { + return []PublicNetworkAccessType{Disabled, Enabled} +} + +// PurgeState enumerates the values for purge state. +type PurgeState string + +const ( + // Completed ... + Completed PurgeState = "completed" + // Pending ... + Pending PurgeState = "pending" +) + +// PossiblePurgeStateValues returns an array of possible values for the PurgeState const type. +func PossiblePurgeStateValues() []PurgeState { + return []PurgeState{Completed, Pending} +} + +// SearchSortEnum enumerates the values for search sort enum. +type SearchSortEnum string + +const ( + // Asc ... + Asc SearchSortEnum = "asc" + // Desc ... + Desc SearchSortEnum = "desc" +) + +// PossibleSearchSortEnumValues returns an array of possible values for the SearchSortEnum const type. +func PossibleSearchSortEnumValues() []SearchSortEnum { + return []SearchSortEnum{Asc, Desc} +} + +// SkuNameEnum enumerates the values for sku name enum. +type SkuNameEnum string + +const ( + // SkuNameEnumCapacityReservation ... + SkuNameEnumCapacityReservation SkuNameEnum = "CapacityReservation" + // SkuNameEnumFree ... + SkuNameEnumFree SkuNameEnum = "Free" + // SkuNameEnumPerGB2018 ... + SkuNameEnumPerGB2018 SkuNameEnum = "PerGB2018" + // SkuNameEnumPerNode ... + SkuNameEnumPerNode SkuNameEnum = "PerNode" + // SkuNameEnumPremium ... + SkuNameEnumPremium SkuNameEnum = "Premium" + // SkuNameEnumStandalone ... + SkuNameEnumStandalone SkuNameEnum = "Standalone" + // SkuNameEnumStandard ... + SkuNameEnumStandard SkuNameEnum = "Standard" +) + +// PossibleSkuNameEnumValues returns an array of possible values for the SkuNameEnum const type. +func PossibleSkuNameEnumValues() []SkuNameEnum { + return []SkuNameEnum{SkuNameEnumCapacityReservation, SkuNameEnumFree, SkuNameEnumPerGB2018, SkuNameEnumPerNode, SkuNameEnumPremium, SkuNameEnumStandalone, SkuNameEnumStandard} +} + +// StorageInsightState enumerates the values for storage insight state. +type StorageInsightState string + +const ( + // ERROR ... + ERROR StorageInsightState = "ERROR" + // OK ... + OK StorageInsightState = "OK" +) + +// PossibleStorageInsightStateValues returns an array of possible values for the StorageInsightState const type. +func PossibleStorageInsightStateValues() []StorageInsightState { + return []StorageInsightState{ERROR, OK} +} + +// Type enumerates the values for type. +type Type string + +const ( + // TypeEventHub ... + TypeEventHub Type = "EventHub" + // TypeStorageAccount ... + TypeStorageAccount Type = "StorageAccount" +) + +// PossibleTypeValues returns an array of possible values for the Type const type. +func PossibleTypeValues() []Type { + return []Type{TypeEventHub, TypeStorageAccount} +} + +// WorkspaceEntityStatus enumerates the values for workspace entity status. +type WorkspaceEntityStatus string + +const ( + // WorkspaceEntityStatusCanceled ... + WorkspaceEntityStatusCanceled WorkspaceEntityStatus = "Canceled" + // WorkspaceEntityStatusCreating ... + WorkspaceEntityStatusCreating WorkspaceEntityStatus = "Creating" + // WorkspaceEntityStatusDeleting ... + WorkspaceEntityStatusDeleting WorkspaceEntityStatus = "Deleting" + // WorkspaceEntityStatusFailed ... + WorkspaceEntityStatusFailed WorkspaceEntityStatus = "Failed" + // WorkspaceEntityStatusProvisioningAccount ... + WorkspaceEntityStatusProvisioningAccount WorkspaceEntityStatus = "ProvisioningAccount" + // WorkspaceEntityStatusSucceeded ... + WorkspaceEntityStatusSucceeded WorkspaceEntityStatus = "Succeeded" + // WorkspaceEntityStatusUpdating ... + WorkspaceEntityStatusUpdating WorkspaceEntityStatus = "Updating" +) + +// PossibleWorkspaceEntityStatusValues returns an array of possible values for the WorkspaceEntityStatus const type. +func PossibleWorkspaceEntityStatusValues() []WorkspaceEntityStatus { + return []WorkspaceEntityStatus{WorkspaceEntityStatusCanceled, WorkspaceEntityStatusCreating, WorkspaceEntityStatusDeleting, WorkspaceEntityStatusFailed, WorkspaceEntityStatusProvisioningAccount, WorkspaceEntityStatusSucceeded, WorkspaceEntityStatusUpdating} +} + +// WorkspaceSkuNameEnum enumerates the values for workspace sku name enum. +type WorkspaceSkuNameEnum string + +const ( + // WorkspaceSkuNameEnumCapacityReservation ... + WorkspaceSkuNameEnumCapacityReservation WorkspaceSkuNameEnum = "CapacityReservation" + // WorkspaceSkuNameEnumFree ... + WorkspaceSkuNameEnumFree WorkspaceSkuNameEnum = "Free" + // WorkspaceSkuNameEnumPerGB2018 ... + WorkspaceSkuNameEnumPerGB2018 WorkspaceSkuNameEnum = "PerGB2018" + // WorkspaceSkuNameEnumPerNode ... + WorkspaceSkuNameEnumPerNode WorkspaceSkuNameEnum = "PerNode" + // WorkspaceSkuNameEnumPremium ... + WorkspaceSkuNameEnumPremium WorkspaceSkuNameEnum = "Premium" + // WorkspaceSkuNameEnumStandalone ... + WorkspaceSkuNameEnumStandalone WorkspaceSkuNameEnum = "Standalone" + // WorkspaceSkuNameEnumStandard ... + WorkspaceSkuNameEnumStandard WorkspaceSkuNameEnum = "Standard" +) + +// PossibleWorkspaceSkuNameEnumValues returns an array of possible values for the WorkspaceSkuNameEnum const type. +func PossibleWorkspaceSkuNameEnumValues() []WorkspaceSkuNameEnum { + return []WorkspaceSkuNameEnum{WorkspaceSkuNameEnumCapacityReservation, WorkspaceSkuNameEnumFree, WorkspaceSkuNameEnumPerGB2018, WorkspaceSkuNameEnumPerNode, WorkspaceSkuNameEnumPremium, WorkspaceSkuNameEnumStandalone, WorkspaceSkuNameEnumStandard} +} + +// AvailableServiceTier service Tier details. +type AvailableServiceTier struct { + // ServiceTier - READ-ONLY; The name of the Service Tier. Possible values include: 'SkuNameEnumFree', 'SkuNameEnumStandard', 'SkuNameEnumPremium', 'SkuNameEnumPerNode', 'SkuNameEnumPerGB2018', 'SkuNameEnumStandalone', 'SkuNameEnumCapacityReservation' + ServiceTier SkuNameEnum `json:"serviceTier,omitempty"` + // Enabled - READ-ONLY; True if the Service Tier is enabled for the workspace. + Enabled *bool `json:"enabled,omitempty"` + // MinimumRetention - READ-ONLY; The minimum retention for the Service Tier, in days. + MinimumRetention *int64 `json:"minimumRetention,omitempty"` + // MaximumRetention - READ-ONLY; The maximum retention for the Service Tier, in days. + MaximumRetention *int64 `json:"maximumRetention,omitempty"` + // DefaultRetention - READ-ONLY; The default retention for the Service Tier, in days. + DefaultRetention *int64 `json:"defaultRetention,omitempty"` + // CapacityReservationLevel - READ-ONLY; The capacity reservation level in GB per day. Returned for the Capacity Reservation Service Tier. + CapacityReservationLevel *int64 `json:"capacityReservationLevel,omitempty"` + // LastSkuUpdate - READ-ONLY; Time when the sku was last updated for the workspace. Returned for the Capacity Reservation Service Tier. + LastSkuUpdate *string `json:"lastSkuUpdate,omitempty"` +} + +// AzureEntityResource the resource model definition for a 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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// Cluster the top level Log Analytics cluster resource container. +type Cluster struct { + autorest.Response `json:"-"` + // Identity - The identity of the resource. + Identity *Identity `json:"identity,omitempty"` + // Sku - The sku properties. + Sku *ClusterSku `json:"sku,omitempty"` + // ClusterProperties - Log Analytics cluster properties. + *ClusterProperties `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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Cluster. +func (c Cluster) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if c.Identity != nil { + objectMap["identity"] = c.Identity + } + if c.Sku != nil { + objectMap["sku"] = c.Sku + } + if c.ClusterProperties != nil { + objectMap["properties"] = c.ClusterProperties + } + if c.Tags != nil { + objectMap["tags"] = c.Tags + } + if c.Location != nil { + objectMap["location"] = c.Location + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Cluster struct. +func (c *Cluster) 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 Identity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + c.Identity = &identity + } + case "sku": + if v != nil { + var sku ClusterSku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + c.Sku = &sku + } + case "properties": + if v != nil { + var clusterProperties ClusterProperties + err = json.Unmarshal(*v, &clusterProperties) + if err != nil { + return err + } + c.ClusterProperties = &clusterProperties + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + c.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + c.Location = &location + } + 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 "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + c.Type = &typeVar + } + } + } + + return nil +} + +// ClusterErrorResponse error response indicates that the service is not able to process the incoming +// request. The reason is provided in the error message. +type ClusterErrorResponse struct { + // Error - The details of the error. + Error *ErrorResponse `json:"error,omitempty"` +} + +// ClusterListResult the list clusters operation response. +type ClusterListResult struct { + autorest.Response `json:"-"` + // NextLink - The link used to get the next page of recommendations. + NextLink *string `json:"nextLink,omitempty"` + // Value - A list of Log Analytics clusters. + Value *[]Cluster `json:"value,omitempty"` +} + +// ClusterListResultIterator provides access to a complete listing of Cluster values. +type ClusterListResultIterator struct { + i int + page ClusterListResultPage +} + +// 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 *ClusterListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClusterListResultIterator.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 *ClusterListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ClusterListResultIterator) 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 ClusterListResultIterator) Response() ClusterListResult { + 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 ClusterListResultIterator) Value() Cluster { + if !iter.page.NotDone() { + return Cluster{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ClusterListResultIterator type. +func NewClusterListResultIterator(page ClusterListResultPage) ClusterListResultIterator { + return ClusterListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (clr ClusterListResult) IsEmpty() bool { + return clr.Value == nil || len(*clr.Value) == 0 +} + +// clusterListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (clr ClusterListResult) clusterListResultPreparer(ctx context.Context) (*http.Request, error) { + if clr.NextLink == nil || len(to.String(clr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(clr.NextLink))) +} + +// ClusterListResultPage contains a page of Cluster values. +type ClusterListResultPage struct { + fn func(context.Context, ClusterListResult) (ClusterListResult, error) + clr ClusterListResult +} + +// 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 *ClusterListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ClusterListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.clr) + if err != nil { + return err + } + page.clr = next + 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 *ClusterListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ClusterListResultPage) NotDone() bool { + return !page.clr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ClusterListResultPage) Response() ClusterListResult { + return page.clr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ClusterListResultPage) Values() []Cluster { + if page.clr.IsEmpty() { + return nil + } + return *page.clr.Value +} + +// Creates a new instance of the ClusterListResultPage type. +func NewClusterListResultPage(getNextPage func(context.Context, ClusterListResult) (ClusterListResult, error)) ClusterListResultPage { + return ClusterListResultPage{fn: getNextPage} +} + +// ClusterPatch the top level Log Analytics cluster resource container. +type ClusterPatch struct { + // ClusterPatchProperties - Log Analytics cluster properties. + *ClusterPatchProperties `json:"properties,omitempty"` + // Sku - The sku properties. + Sku *ClusterSku `json:"sku,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for ClusterPatch. +func (cp ClusterPatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cp.ClusterPatchProperties != nil { + objectMap["properties"] = cp.ClusterPatchProperties + } + if cp.Sku != nil { + objectMap["sku"] = cp.Sku + } + if cp.Tags != nil { + objectMap["tags"] = cp.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ClusterPatch struct. +func (cp *ClusterPatch) 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 clusterPatchProperties ClusterPatchProperties + err = json.Unmarshal(*v, &clusterPatchProperties) + if err != nil { + return err + } + cp.ClusterPatchProperties = &clusterPatchProperties + } + case "sku": + if v != nil { + var sku ClusterSku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + cp.Sku = &sku + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + cp.Tags = tags + } + } + } + + return nil +} + +// ClusterPatchProperties log Analytics cluster patch properties. +type ClusterPatchProperties struct { + // KeyVaultProperties - The associated key properties. + KeyVaultProperties *KeyVaultProperties `json:"keyVaultProperties,omitempty"` +} + +// ClusterProperties cluster properties. +type ClusterProperties struct { + // NextLink - The link used to get the next page of recommendations. + NextLink *string `json:"nextLink,omitempty"` + // ClusterID - READ-ONLY; The ID associated with the cluster. + ClusterID *string `json:"clusterId,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state of the cluster. Possible values include: 'Creating', 'Succeeded', 'Failed', 'Canceled', 'Deleting', 'ProvisioningAccount', 'Updating' + ProvisioningState ClusterEntityStatus `json:"provisioningState,omitempty"` + // KeyVaultProperties - The associated key properties. + KeyVaultProperties *KeyVaultProperties `json:"keyVaultProperties,omitempty"` +} + +// ClustersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ClustersCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ClustersCreateOrUpdateFuture) Result(client ClustersClient) (c Cluster, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.ClustersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("operationalinsights.ClustersCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if c.Response.Response, err = future.GetResult(sender); err == nil && c.Response.Response.StatusCode != http.StatusNoContent { + c, err = client.CreateOrUpdateResponder(c.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.ClustersCreateOrUpdateFuture", "Result", c.Response.Response, "Failure responding to request") + } + } + return +} + +// ClustersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ClustersDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *ClustersDeleteFuture) Result(client ClustersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.ClustersDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("operationalinsights.ClustersDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ClusterSku the cluster sku definition. +type ClusterSku struct { + // Capacity - The capacity value + Capacity *int64 `json:"capacity,omitempty"` + // Name - The name of the SKU. Possible values include: 'CapacityReservation' + Name ClusterSkuNameEnum `json:"name,omitempty"` +} + +// CoreSummary the core summary of a search. +type CoreSummary struct { + // Status - The status of a core summary. + Status *string `json:"status,omitempty"` + // NumberOfDocuments - The number of documents of a core summary. + NumberOfDocuments *int64 `json:"numberOfDocuments,omitempty"` +} + +// DataExport the top level data export resource container. +type DataExport struct { + autorest.Response `json:"-"` + // DataExportProperties - data export properties. + *DataExportProperties `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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for DataExport. +func (de DataExport) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if de.DataExportProperties != nil { + objectMap["properties"] = de.DataExportProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DataExport struct. +func (de *DataExport) 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 dataExportProperties DataExportProperties + err = json.Unmarshal(*v, &dataExportProperties) + if err != nil { + return err + } + de.DataExportProperties = &dataExportProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + de.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + de.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + de.Type = &typeVar + } + } + } + + return nil +} + +// DataExportErrorResponse error response indicates that the service is not able to process the incoming +// request. The reason is provided in the error message. +type DataExportErrorResponse struct { + // Error - The details of the error. + Error *ErrorResponse `json:"error,omitempty"` +} + +// DataExportListResult result of the request to list data exports. +type DataExportListResult struct { + autorest.Response `json:"-"` + // Value - List of data export instances within a workspace.. + Value *[]DataExport `json:"value,omitempty"` +} + +// DataExportProperties data Export properties. +type DataExportProperties struct { + // DataExportID - The data export rule ID. + DataExportID *string `json:"dataExportId,omitempty"` + // AllTables - When ‘true’, all workspace's tables are exported. + AllTables *bool `json:"allTables,omitempty"` + // TableNames - An array of tables to export, for example: [“Heartbeat, SecurityEvent”]. + TableNames *[]string `json:"tableNames,omitempty"` + // Destination - destination properties. + *Destination `json:"destination,omitempty"` + // Enable - Active when enabled. + Enable *bool `json:"enable,omitempty"` + // CreatedDate - The latest data export rule modification time. + CreatedDate *string `json:"createdDate,omitempty"` + // LastModifiedDate - Date and time when the export was last modified. + LastModifiedDate *string `json:"lastModifiedDate,omitempty"` +} + +// MarshalJSON is the custom marshaler for DataExportProperties. +func (dep DataExportProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dep.DataExportID != nil { + objectMap["dataExportId"] = dep.DataExportID + } + if dep.AllTables != nil { + objectMap["allTables"] = dep.AllTables + } + if dep.TableNames != nil { + objectMap["tableNames"] = dep.TableNames + } + if dep.Destination != nil { + objectMap["destination"] = dep.Destination + } + if dep.Enable != nil { + objectMap["enable"] = dep.Enable + } + if dep.CreatedDate != nil { + objectMap["createdDate"] = dep.CreatedDate + } + if dep.LastModifiedDate != nil { + objectMap["lastModifiedDate"] = dep.LastModifiedDate + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DataExportProperties struct. +func (dep *DataExportProperties) 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 "dataExportId": + if v != nil { + var dataExportID string + err = json.Unmarshal(*v, &dataExportID) + if err != nil { + return err + } + dep.DataExportID = &dataExportID + } + case "allTables": + if v != nil { + var allTables bool + err = json.Unmarshal(*v, &allTables) + if err != nil { + return err + } + dep.AllTables = &allTables + } + case "tableNames": + if v != nil { + var tableNames []string + err = json.Unmarshal(*v, &tableNames) + if err != nil { + return err + } + dep.TableNames = &tableNames + } + case "destination": + if v != nil { + var destination Destination + err = json.Unmarshal(*v, &destination) + if err != nil { + return err + } + dep.Destination = &destination + } + case "enable": + if v != nil { + var enable bool + err = json.Unmarshal(*v, &enable) + if err != nil { + return err + } + dep.Enable = &enable + } + case "createdDate": + if v != nil { + var createdDate string + err = json.Unmarshal(*v, &createdDate) + if err != nil { + return err + } + dep.CreatedDate = &createdDate + } + case "lastModifiedDate": + if v != nil { + var lastModifiedDate string + err = json.Unmarshal(*v, &lastModifiedDate) + if err != nil { + return err + } + dep.LastModifiedDate = &lastModifiedDate + } + } + } + + return nil +} + +// DataExportsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type DataExportsCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *DataExportsCreateOrUpdateFuture) Result(client DataExportsClient) (de DataExport, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.DataExportsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("operationalinsights.DataExportsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if de.Response.Response, err = future.GetResult(sender); err == nil && de.Response.Response.StatusCode != http.StatusNoContent { + de, err = client.CreateOrUpdateResponder(de.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.DataExportsCreateOrUpdateFuture", "Result", de.Response.Response, "Failure responding to request") + } + } + return +} + +// DataSource datasources under OMS Workspace. +type DataSource struct { + autorest.Response `json:"-"` + // Properties - The data source properties in raw json format, each kind of data source have it's own schema. + Properties interface{} `json:"properties,omitempty"` + // ETag - The ETag of the data source. + ETag *string `json:"eTag,omitempty"` + // Kind - Possible values include: 'WindowsEvent', 'WindowsPerformanceCounter', 'IISLogs', 'LinuxSyslog', 'LinuxSyslogCollection', 'LinuxPerformanceObject', 'LinuxPerformanceCollection', 'CustomLog', 'CustomLogCollection', 'AzureAuditLog', 'AzureActivityLog', 'GenericDataSource', 'ChangeTrackingCustomPath', 'ChangeTrackingPath', 'ChangeTrackingServices', 'ChangeTrackingDataTypeConfiguration', 'ChangeTrackingDefaultRegistry', 'ChangeTrackingRegistry', 'ChangeTrackingLinuxPath', 'LinuxChangeTrackingPath', 'ChangeTrackingContentLocation', 'WindowsTelemetry', 'Office365', 'SecurityWindowsBaselineConfiguration', 'SecurityCenterSecurityWindowsBaselineConfiguration', 'SecurityEventCollectionConfiguration', 'SecurityInsightsSecurityEventCollectionConfiguration', 'ImportComputerGroup', 'NetworkMonitoring', 'Itsm', 'DNSAnalytics', 'ApplicationInsights', 'SQLDataClassification' + Kind DataSourceKind `json:"kind,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // 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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for DataSource. +func (ds DataSource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ds.Properties != nil { + objectMap["properties"] = ds.Properties + } + if ds.ETag != nil { + objectMap["eTag"] = ds.ETag + } + if ds.Kind != "" { + objectMap["kind"] = ds.Kind + } + if ds.Tags != nil { + objectMap["tags"] = ds.Tags + } + return json.Marshal(objectMap) +} + +// DataSourceFilter dataSource filter. Right now, only filter by kind is supported. +type DataSourceFilter struct { + // Kind - Possible values include: 'WindowsEvent', 'WindowsPerformanceCounter', 'IISLogs', 'LinuxSyslog', 'LinuxSyslogCollection', 'LinuxPerformanceObject', 'LinuxPerformanceCollection', 'CustomLog', 'CustomLogCollection', 'AzureAuditLog', 'AzureActivityLog', 'GenericDataSource', 'ChangeTrackingCustomPath', 'ChangeTrackingPath', 'ChangeTrackingServices', 'ChangeTrackingDataTypeConfiguration', 'ChangeTrackingDefaultRegistry', 'ChangeTrackingRegistry', 'ChangeTrackingLinuxPath', 'LinuxChangeTrackingPath', 'ChangeTrackingContentLocation', 'WindowsTelemetry', 'Office365', 'SecurityWindowsBaselineConfiguration', 'SecurityCenterSecurityWindowsBaselineConfiguration', 'SecurityEventCollectionConfiguration', 'SecurityInsightsSecurityEventCollectionConfiguration', 'ImportComputerGroup', 'NetworkMonitoring', 'Itsm', 'DNSAnalytics', 'ApplicationInsights', 'SQLDataClassification' + Kind DataSourceKind `json:"kind,omitempty"` +} + +// DataSourceListResult the list data source by workspace operation response. +type DataSourceListResult struct { + autorest.Response `json:"-"` + // Value - A list of datasources. + Value *[]DataSource `json:"value,omitempty"` + // NextLink - The link (url) to the next page of datasources. + NextLink *string `json:"nextLink,omitempty"` +} + +// DataSourceListResultIterator provides access to a complete listing of DataSource values. +type DataSourceListResultIterator struct { + i int + page DataSourceListResultPage +} + +// 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 *DataSourceListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataSourceListResultIterator.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 *DataSourceListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DataSourceListResultIterator) 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 DataSourceListResultIterator) Response() DataSourceListResult { + 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 DataSourceListResultIterator) Value() DataSource { + if !iter.page.NotDone() { + return DataSource{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the DataSourceListResultIterator type. +func NewDataSourceListResultIterator(page DataSourceListResultPage) DataSourceListResultIterator { + return DataSourceListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (dslr DataSourceListResult) IsEmpty() bool { + return dslr.Value == nil || len(*dslr.Value) == 0 +} + +// dataSourceListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (dslr DataSourceListResult) dataSourceListResultPreparer(ctx context.Context) (*http.Request, error) { + if dslr.NextLink == nil || len(to.String(dslr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(dslr.NextLink))) +} + +// DataSourceListResultPage contains a page of DataSource values. +type DataSourceListResultPage struct { + fn func(context.Context, DataSourceListResult) (DataSourceListResult, error) + dslr DataSourceListResult +} + +// 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 *DataSourceListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DataSourceListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.dslr) + if err != nil { + return err + } + page.dslr = next + 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 *DataSourceListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DataSourceListResultPage) NotDone() bool { + return !page.dslr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DataSourceListResultPage) Response() DataSourceListResult { + return page.dslr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DataSourceListResultPage) Values() []DataSource { + if page.dslr.IsEmpty() { + return nil + } + return *page.dslr.Value +} + +// Creates a new instance of the DataSourceListResultPage type. +func NewDataSourceListResultPage(getNextPage func(context.Context, DataSourceListResult) (DataSourceListResult, error)) DataSourceListResultPage { + return DataSourceListResultPage{fn: getNextPage} +} + +// Destination destination properties. +type Destination struct { + // ResourceID - The destination resource ID. This can be copied from the Properties entry of the destination resource in Azure. + ResourceID *string `json:"resourceId,omitempty"` + // Type - READ-ONLY; The type of the destination resource. Possible values include: 'TypeStorageAccount', 'TypeEventHub' + Type Type `json:"type,omitempty"` + // DestinationMetaData - destination meta data. + *DestinationMetaData `json:"metaData,omitempty"` +} + +// MarshalJSON is the custom marshaler for Destination. +func (d Destination) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if d.ResourceID != nil { + objectMap["resourceId"] = d.ResourceID + } + if d.DestinationMetaData != nil { + objectMap["metaData"] = d.DestinationMetaData + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Destination struct. +func (d *Destination) 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 "resourceId": + if v != nil { + var resourceID string + err = json.Unmarshal(*v, &resourceID) + if err != nil { + return err + } + d.ResourceID = &resourceID + } + case "type": + if v != nil { + var typeVar Type + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + d.Type = typeVar + } + case "metaData": + if v != nil { + var destinationMetaData DestinationMetaData + err = json.Unmarshal(*v, &destinationMetaData) + if err != nil { + return err + } + d.DestinationMetaData = &destinationMetaData + } + } + } + + return nil +} + +// DestinationMetaData destination meta data. +type DestinationMetaData struct { + // EventHubName - Optional. Allows to define an Event Hub name. Not applicable when destination is Storage Account. + EventHubName *string `json:"eventHubName,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"` +} + +// ErrorContract contains details when the response code indicates an error. +type ErrorContract struct { + // Error - The details of the error. + Error *ErrorResponse `json:"error,omitempty"` +} + +// ErrorResponse the resource management error response. +type ErrorResponse 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 *[]ErrorResponse `json:"details,omitempty"` + // AdditionalInfo - READ-ONLY; The error additional info. + AdditionalInfo *[]ErrorAdditionalInfo `json:"additionalInfo,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: 'SystemAssigned', 'None' + Type IdentityType `json:"type,omitempty"` +} + +// IntelligencePack intelligence Pack containing a string name and boolean indicating if it's enabled. +type IntelligencePack struct { + // Name - The name of the intelligence pack. + Name *string `json:"name,omitempty"` + // Enabled - The enabled boolean for the intelligence pack. + Enabled *bool `json:"enabled,omitempty"` + // DisplayName - The display name of the intelligence pack. + DisplayName *string `json:"displayName,omitempty"` +} + +// KeyVaultProperties the key vault properties. +type KeyVaultProperties struct { + // KeyVaultURI - The Key Vault uri which holds they key associated with the Log Analytics cluster. + KeyVaultURI *string `json:"keyVaultUri,omitempty"` + // KeyName - The name of the key associated with the Log Analytics cluster. + KeyName *string `json:"keyName,omitempty"` + // KeyVersion - The version of the key associated with the Log Analytics cluster. + KeyVersion *string `json:"keyVersion,omitempty"` +} + +// LinkedService the top level Linked service resource container. +type LinkedService struct { + autorest.Response `json:"-"` + // LinkedServiceProperties - The properties of the linked service. + *LinkedServiceProperties `json:"properties,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // 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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for LinkedService. +func (ls LinkedService) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ls.LinkedServiceProperties != nil { + objectMap["properties"] = ls.LinkedServiceProperties + } + if ls.Tags != nil { + objectMap["tags"] = ls.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for LinkedService struct. +func (ls *LinkedService) 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 linkedServiceProperties LinkedServiceProperties + err = json.Unmarshal(*v, &linkedServiceProperties) + if err != nil { + return err + } + ls.LinkedServiceProperties = &linkedServiceProperties + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + ls.Tags = tags + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ls.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ls.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ls.Type = &typeVar + } + } + } + + return nil +} + +// LinkedServiceListResult the list linked service operation response. +type LinkedServiceListResult struct { + autorest.Response `json:"-"` + // Value - The list of linked service instances + Value *[]LinkedService `json:"value,omitempty"` +} + +// LinkedServiceProperties linked service properties. +type LinkedServiceProperties struct { + // ResourceID - The resource id of the resource that will be linked to the workspace. This should be used for linking resources which require read access + ResourceID *string `json:"resourceId,omitempty"` + // WriteAccessResourceID - The resource id of the resource that will be linked to the workspace. This should be used for linking resources which require write access + WriteAccessResourceID *string `json:"writeAccessResourceId,omitempty"` + // ProvisioningState - The provisioning state of the linked service. Possible values include: 'LinkedServiceEntityStatusSucceeded', 'LinkedServiceEntityStatusDeleting', 'LinkedServiceEntityStatusProvisioningAccount', 'LinkedServiceEntityStatusUpdating' + ProvisioningState LinkedServiceEntityStatus `json:"provisioningState,omitempty"` +} + +// LinkedServicesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type LinkedServicesCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *LinkedServicesCreateOrUpdateFuture) Result(client LinkedServicesClient) (ls LinkedService, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.LinkedServicesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("operationalinsights.LinkedServicesCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if ls.Response.Response, err = future.GetResult(sender); err == nil && ls.Response.Response.StatusCode != http.StatusNoContent { + ls, err = client.CreateOrUpdateResponder(ls.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.LinkedServicesCreateOrUpdateFuture", "Result", ls.Response.Response, "Failure responding to request") + } + } + return +} + +// LinkedServicesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type LinkedServicesDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *LinkedServicesDeleteFuture) Result(client LinkedServicesClient) (ls LinkedService, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.LinkedServicesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("operationalinsights.LinkedServicesDeleteFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if ls.Response.Response, err = future.GetResult(sender); err == nil && ls.Response.Response.StatusCode != http.StatusNoContent { + ls, err = client.DeleteResponder(ls.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.LinkedServicesDeleteFuture", "Result", ls.Response.Response, "Failure responding to request") + } + } + return +} + +// LinkedStorageAccountsListResult the list linked storage accounts service operation response. +type LinkedStorageAccountsListResult struct { + autorest.Response `json:"-"` + // Value - A list of linked storage accounts instances. + Value *[]LinkedStorageAccountsResource `json:"value,omitempty"` +} + +// LinkedStorageAccountsProperties linked storage accounts properties. +type LinkedStorageAccountsProperties struct { + // DataSourceType - READ-ONLY; Linked storage accounts type. Possible values include: 'CustomLogs', 'AzureWatson' + DataSourceType DataSourceType `json:"dataSourceType,omitempty"` + // StorageAccountIds - Linked storage accounts resources ids. + StorageAccountIds *[]string `json:"storageAccountIds,omitempty"` +} + +// LinkedStorageAccountsResource linked storage accounts top level resource container. +type LinkedStorageAccountsResource struct { + autorest.Response `json:"-"` + // LinkedStorageAccountsProperties - Linked storage accounts properties. + *LinkedStorageAccountsProperties `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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for LinkedStorageAccountsResource. +func (lsar LinkedStorageAccountsResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lsar.LinkedStorageAccountsProperties != nil { + objectMap["properties"] = lsar.LinkedStorageAccountsProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for LinkedStorageAccountsResource struct. +func (lsar *LinkedStorageAccountsResource) 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 linkedStorageAccountsProperties LinkedStorageAccountsProperties + err = json.Unmarshal(*v, &linkedStorageAccountsProperties) + if err != nil { + return err + } + lsar.LinkedStorageAccountsProperties = &linkedStorageAccountsProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + lsar.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + lsar.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + lsar.Type = &typeVar + } + } + } + + return nil +} + +// ListAvailableServiceTier ... +type ListAvailableServiceTier struct { + autorest.Response `json:"-"` + Value *[]AvailableServiceTier `json:"value,omitempty"` +} + +// ListIntelligencePack ... +type ListIntelligencePack struct { + autorest.Response `json:"-"` + Value *[]IntelligencePack `json:"value,omitempty"` +} + +// ManagementGroup a management group that is connected to a workspace +type ManagementGroup struct { + // ManagementGroupProperties - The properties of the management group. + *ManagementGroupProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ManagementGroup. +func (mg ManagementGroup) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mg.ManagementGroupProperties != nil { + objectMap["properties"] = mg.ManagementGroupProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ManagementGroup struct. +func (mg *ManagementGroup) 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 managementGroupProperties ManagementGroupProperties + err = json.Unmarshal(*v, &managementGroupProperties) + if err != nil { + return err + } + mg.ManagementGroupProperties = &managementGroupProperties + } + } + } + + return nil +} + +// ManagementGroupProperties management group properties. +type ManagementGroupProperties struct { + // ServerCount - The number of servers connected to the management group. + ServerCount *int32 `json:"serverCount,omitempty"` + // IsGateway - Gets or sets a value indicating whether the management group is a gateway. + IsGateway *bool `json:"isGateway,omitempty"` + // Name - The name of the management group. + Name *string `json:"name,omitempty"` + // ID - The unique ID of the management group. + ID *string `json:"id,omitempty"` + // Created - The datetime that the management group was created. + Created *date.Time `json:"created,omitempty"` + // DataReceived - The last datetime that the management group received data. + DataReceived *date.Time `json:"dataReceived,omitempty"` + // Version - The version of System Center that is managing the management group. + Version *string `json:"version,omitempty"` + // Sku - The SKU of System Center that is managing the management group. + Sku *string `json:"sku,omitempty"` +} + +// MetricName the name of a metric. +type MetricName struct { + // Value - The system name of the metric. + Value *string `json:"value,omitempty"` + // LocalizedValue - The localized name of the metric. + LocalizedValue *string `json:"localizedValue,omitempty"` +} + +// Operation supported operation of OperationalInsights resource provider. +type Operation struct { + // Name - Operation name: {provider}/{resource}/{operation} + Name *string `json:"name,omitempty"` + // Display - Display metadata associated with the operation. + Display *OperationDisplay `json:"display,omitempty"` +} + +// OperationDisplay display metadata associated with the operation. +type OperationDisplay struct { + // Provider - Service provider: Microsoft OperationsManagement. + Provider *string `json:"provider,omitempty"` + // Resource - Resource on which the operation is performed etc. + Resource *string `json:"resource,omitempty"` + // Operation - Type of operation: get, read, delete, etc. + Operation *string `json:"operation,omitempty"` + // Description - Description of operation + Description *string `json:"description,omitempty"` +} + +// OperationListResult result of the request to list solution operations. +type OperationListResult struct { + autorest.Response `json:"-"` + // Value - List of solution operations supported by the OperationsManagement 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"` +} + +// 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 +} + +// 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.NextLink == nil || len(to.String(olr.NextLink)) < 1 { + 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) + }() + } + next, err := page.fn(ctx, page.olr) + if err != nil { + return err + } + page.olr = next + 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(getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { + return OperationListResultPage{fn: getNextPage} +} + +// OperationStatus the status of operation. +type OperationStatus struct { + autorest.Response `json:"-"` + // ID - The operation Id. + ID *string `json:"id,omitempty"` + // Name - The operation name. + Name *string `json:"name,omitempty"` + // StartTime - The start time of the operation. + StartTime *string `json:"startTime,omitempty"` + // EndTime - The end time of the operation. + EndTime *string `json:"endTime,omitempty"` + // Status - The status of the operation. + Status *string `json:"status,omitempty"` + // Error - The error detail of the operation if any. + Error *ErrorResponse `json:"error,omitempty"` +} + +// PrivateLinkScopedResource the private link scope resource reference. +type PrivateLinkScopedResource struct { + // ResourceID - The full resource Id of the private link scope resource. + ResourceID *string `json:"resourceId,omitempty"` + // ScopeID - The private link scope unique Identifier. + ScopeID *string `json:"scopeId,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; 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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// Resource ... +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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// SavedSearch value object for saved search results. +type SavedSearch struct { + autorest.Response `json:"-"` + // ETag - The ETag of the saved search. + ETag *string `json:"eTag,omitempty"` + // SavedSearchProperties - The properties of the saved search. + *SavedSearchProperties `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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SavedSearch. +func (ss SavedSearch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ss.ETag != nil { + objectMap["eTag"] = ss.ETag + } + if ss.SavedSearchProperties != nil { + objectMap["properties"] = ss.SavedSearchProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SavedSearch struct. +func (ss *SavedSearch) 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 "eTag": + if v != nil { + var eTag string + err = json.Unmarshal(*v, &eTag) + if err != nil { + return err + } + ss.ETag = &eTag + } + case "properties": + if v != nil { + var savedSearchProperties SavedSearchProperties + err = json.Unmarshal(*v, &savedSearchProperties) + if err != nil { + return err + } + ss.SavedSearchProperties = &savedSearchProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ss.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ss.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ss.Type = &typeVar + } + } + } + + return nil +} + +// SavedSearchesListResult the saved search list operation response. +type SavedSearchesListResult struct { + autorest.Response `json:"-"` + // Value - The array of result values. + Value *[]SavedSearch `json:"value,omitempty"` +} + +// SavedSearchProperties value object for saved search results. +type SavedSearchProperties struct { + // Category - The category of the saved search. This helps the user to find a saved search faster. + Category *string `json:"category,omitempty"` + // DisplayName - Saved search display name. + DisplayName *string `json:"displayName,omitempty"` + // Query - The query expression for the saved search. + Query *string `json:"query,omitempty"` + // FunctionAlias - The function alias if query serves as a function. + FunctionAlias *string `json:"functionAlias,omitempty"` + // FunctionParameters - The optional function parameters if query serves as a function. Value should be in the following format: 'param-name1:type1 = default_value1, param-name2:type2 = default_value2'. For more examples and proper syntax please refer to https://docs.microsoft.com/en-us/azure/kusto/query/functions/user-defined-functions. + FunctionParameters *string `json:"functionParameters,omitempty"` + // Version - The version number of the query language. The current version is 2 and is the default. + Version *int64 `json:"version,omitempty"` + // Tags - The tags attached to the saved search. + Tags *[]Tag `json:"tags,omitempty"` +} + +// SearchGetSchemaResponse the get schema operation response. +type SearchGetSchemaResponse struct { + autorest.Response `json:"-"` + // Metadata - The metadata from search results. + Metadata *SearchMetadata `json:"metadata,omitempty"` + // Value - The array of result values. + Value *[]SearchSchemaValue `json:"value,omitempty"` +} + +// SearchMetadata metadata for search results. +type SearchMetadata struct { + // SearchID - The request id of the search. + SearchID *string `json:"requestId,omitempty"` + // ResultType - The search result type. + ResultType *string `json:"resultType,omitempty"` + // Total - The total number of search results. + Total *int64 `json:"total,omitempty"` + // Top - The number of top search results. + Top *int64 `json:"top,omitempty"` + // ID - The id of the search results request. + ID *string `json:"id,omitempty"` + // CoreSummaries - The core summaries. + CoreSummaries *[]CoreSummary `json:"coreSummaries,omitempty"` + // Status - The status of the search results. + Status *string `json:"status,omitempty"` + // StartTime - The start time for the search. + StartTime *date.Time `json:"startTime,omitempty"` + // LastUpdated - The time of last update. + LastUpdated *date.Time `json:"lastUpdated,omitempty"` + // ETag - The ETag of the search results. + ETag *string `json:"eTag,omitempty"` + // Sort - How the results are sorted. + Sort *[]SearchSort `json:"sort,omitempty"` + // RequestTime - The request time. + RequestTime *int64 `json:"requestTime,omitempty"` + // AggregatedValueField - The aggregated value field. + AggregatedValueField *string `json:"aggregatedValueField,omitempty"` + // AggregatedGroupingFields - The aggregated grouping fields. + AggregatedGroupingFields *string `json:"aggregatedGroupingFields,omitempty"` + // Sum - The sum of all aggregates returned in the result set. + Sum *int64 `json:"sum,omitempty"` + // Max - The max of all aggregates returned in the result set. + Max *int64 `json:"max,omitempty"` + // Schema - The schema. + Schema *SearchMetadataSchema `json:"schema,omitempty"` +} + +// SearchMetadataSchema schema metadata for search. +type SearchMetadataSchema struct { + // Name - The name of the metadata schema. + Name *string `json:"name,omitempty"` + // Version - The version of the metadata schema. + Version *int32 `json:"version,omitempty"` +} + +// SearchSchemaValue value object for schema results. +type SearchSchemaValue struct { + // Name - The name of the schema. + Name *string `json:"name,omitempty"` + // DisplayName - The display name of the schema. + DisplayName *string `json:"displayName,omitempty"` + // Type - The type. + Type *string `json:"type,omitempty"` + // Indexed - The boolean that indicates the field is searchable as free text. + Indexed *bool `json:"indexed,omitempty"` + // Stored - The boolean that indicates whether or not the field is stored. + Stored *bool `json:"stored,omitempty"` + // Facet - The boolean that indicates whether or not the field is a facet. + Facet *bool `json:"facet,omitempty"` + // OwnerType - The array of workflows containing the field. + OwnerType *[]string `json:"ownerType,omitempty"` +} + +// SearchSort the sort parameters for search. +type SearchSort struct { + // Name - The name of the field the search query is sorted on. + Name *string `json:"name,omitempty"` + // Order - The sort order of the search. Possible values include: 'Asc', 'Desc' + Order SearchSortEnum `json:"order,omitempty"` +} + +// SharedKeys the shared keys for a workspace. +type SharedKeys struct { + autorest.Response `json:"-"` + // PrimarySharedKey - The primary shared key of a workspace. + PrimarySharedKey *string `json:"primarySharedKey,omitempty"` + // SecondarySharedKey - The secondary shared key of a workspace. + SecondarySharedKey *string `json:"secondarySharedKey,omitempty"` +} + +// StorageAccount describes a storage account connection. +type StorageAccount struct { + // ID - The Azure Resource Manager ID of the storage account resource. + ID *string `json:"id,omitempty"` + // Key - The storage account key. + Key *string `json:"key,omitempty"` +} + +// StorageInsight the top level storage insight resource container. +type StorageInsight struct { + autorest.Response `json:"-"` + // StorageInsightProperties - Storage insight properties. + *StorageInsightProperties `json:"properties,omitempty"` + // ETag - The ETag of the storage insight. + ETag *string `json:"eTag,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // 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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for StorageInsight. +func (si StorageInsight) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if si.StorageInsightProperties != nil { + objectMap["properties"] = si.StorageInsightProperties + } + if si.ETag != nil { + objectMap["eTag"] = si.ETag + } + if si.Tags != nil { + objectMap["tags"] = si.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for StorageInsight struct. +func (si *StorageInsight) 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 storageInsightProperties StorageInsightProperties + err = json.Unmarshal(*v, &storageInsightProperties) + if err != nil { + return err + } + si.StorageInsightProperties = &storageInsightProperties + } + case "eTag": + if v != nil { + var eTag string + err = json.Unmarshal(*v, &eTag) + if err != nil { + return err + } + si.ETag = &eTag + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + si.Tags = tags + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + si.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + si.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + si.Type = &typeVar + } + } + } + + return nil +} + +// StorageInsightListResult the list storage insights operation response. +type StorageInsightListResult struct { + autorest.Response `json:"-"` + // Value - A list of storage insight items. + Value *[]StorageInsight `json:"value,omitempty"` + // OdataNextLink - The link (url) to the next page of results. + OdataNextLink *string `json:"@odata.nextLink,omitempty"` +} + +// StorageInsightListResultIterator provides access to a complete listing of StorageInsight values. +type StorageInsightListResultIterator struct { + i int + page StorageInsightListResultPage +} + +// 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 *StorageInsightListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageInsightListResultIterator.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 *StorageInsightListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter StorageInsightListResultIterator) 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 StorageInsightListResultIterator) Response() StorageInsightListResult { + 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 StorageInsightListResultIterator) Value() StorageInsight { + if !iter.page.NotDone() { + return StorageInsight{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the StorageInsightListResultIterator type. +func NewStorageInsightListResultIterator(page StorageInsightListResultPage) StorageInsightListResultIterator { + return StorageInsightListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (silr StorageInsightListResult) IsEmpty() bool { + return silr.Value == nil || len(*silr.Value) == 0 +} + +// storageInsightListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (silr StorageInsightListResult) storageInsightListResultPreparer(ctx context.Context) (*http.Request, error) { + if silr.OdataNextLink == nil || len(to.String(silr.OdataNextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(silr.OdataNextLink))) +} + +// StorageInsightListResultPage contains a page of StorageInsight values. +type StorageInsightListResultPage struct { + fn func(context.Context, StorageInsightListResult) (StorageInsightListResult, error) + silr StorageInsightListResult +} + +// 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 *StorageInsightListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageInsightListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.silr) + if err != nil { + return err + } + page.silr = next + 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 *StorageInsightListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page StorageInsightListResultPage) NotDone() bool { + return !page.silr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page StorageInsightListResultPage) Response() StorageInsightListResult { + return page.silr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page StorageInsightListResultPage) Values() []StorageInsight { + if page.silr.IsEmpty() { + return nil + } + return *page.silr.Value +} + +// Creates a new instance of the StorageInsightListResultPage type. +func NewStorageInsightListResultPage(getNextPage func(context.Context, StorageInsightListResult) (StorageInsightListResult, error)) StorageInsightListResultPage { + return StorageInsightListResultPage{fn: getNextPage} +} + +// StorageInsightProperties storage insight properties. +type StorageInsightProperties struct { + // Containers - The names of the blob containers that the workspace should read + Containers *[]string `json:"containers,omitempty"` + // Tables - The names of the Azure tables that the workspace should read + Tables *[]string `json:"tables,omitempty"` + // StorageAccount - The storage account connection details + StorageAccount *StorageAccount `json:"storageAccount,omitempty"` + // Status - READ-ONLY; The status of the storage insight + Status *StorageInsightStatus `json:"status,omitempty"` +} + +// StorageInsightStatus the status of the storage insight. +type StorageInsightStatus struct { + // State - The state of the storage insight connection to the workspace. Possible values include: 'OK', 'ERROR' + State StorageInsightState `json:"state,omitempty"` + // Description - Description of the state of the storage insight. + Description *string `json:"description,omitempty"` +} + +// Table workspace data table definition. +type Table struct { + autorest.Response `json:"-"` + // TableProperties - Table properties. + *TableProperties `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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Table. +func (t Table) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if t.TableProperties != nil { + objectMap["properties"] = t.TableProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Table struct. +func (t *Table) 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 tableProperties TableProperties + err = json.Unmarshal(*v, &tableProperties) + if err != nil { + return err + } + t.TableProperties = &tableProperties + } + 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 + } + } + } + + return nil +} + +// TableProperties table properties. +type TableProperties struct { + // RetentionInDays - The data table data retention in days, between 30 and 730. Setting this property to null will default to the workspace retention. + RetentionInDays *int32 `json:"retentionInDays,omitempty"` +} + +// TablesListResult the list tables operation response. +type TablesListResult struct { + autorest.Response `json:"-"` + // Value - A list of data tables. + Value *[]Table `json:"value,omitempty"` +} + +// Tag a tag of a saved search. +type Tag struct { + // Name - The tag name. + Name *string `json:"name,omitempty"` + // Value - The tag value. + Value *string `json:"value,omitempty"` +} + +// TrackedResource the resource model definition for a ARM tracked top level resource +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. Ex- 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) +} + +// UsageMetric a metric describing the usage of a resource. +type UsageMetric struct { + // Name - The name of the metric. + Name *MetricName `json:"name,omitempty"` + // Unit - The units used for the metric. + Unit *string `json:"unit,omitempty"` + // CurrentValue - The current value of the metric. + CurrentValue *float64 `json:"currentValue,omitempty"` + // Limit - The quota limit for the metric. + Limit *float64 `json:"limit,omitempty"` + // NextResetTime - The time that the metric's value will reset. + NextResetTime *date.Time `json:"nextResetTime,omitempty"` + // QuotaPeriod - The quota period that determines the length of time between value resets. + QuotaPeriod *string `json:"quotaPeriod,omitempty"` +} + +// Workspace the top level Workspace resource container. +type Workspace struct { + autorest.Response `json:"-"` + // WorkspaceProperties - Workspace properties. + *WorkspaceProperties `json:"properties,omitempty"` + // ETag - The ETag of the workspace. + ETag *string `json:"eTag,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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Workspace. +func (w Workspace) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if w.WorkspaceProperties != nil { + objectMap["properties"] = w.WorkspaceProperties + } + if w.ETag != nil { + objectMap["eTag"] = w.ETag + } + if w.Tags != nil { + objectMap["tags"] = w.Tags + } + if w.Location != nil { + objectMap["location"] = w.Location + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Workspace struct. +func (w *Workspace) 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 workspaceProperties WorkspaceProperties + err = json.Unmarshal(*v, &workspaceProperties) + if err != nil { + return err + } + w.WorkspaceProperties = &workspaceProperties + } + case "eTag": + if v != nil { + var eTag string + err = json.Unmarshal(*v, &eTag) + if err != nil { + return err + } + w.ETag = &eTag + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + w.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + w.Location = &location + } + 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 + } + } + } + + return nil +} + +// WorkspaceCapping the daily volume cap for ingestion. +type WorkspaceCapping struct { + // DailyQuotaGb - The workspace daily quota for ingestion. -1 means unlimited. + DailyQuotaGb *float64 `json:"dailyQuotaGb,omitempty"` + // QuotaNextResetTime - READ-ONLY; The time when the quota will be rest. + QuotaNextResetTime *string `json:"quotaNextResetTime,omitempty"` + // DataIngestionStatus - READ-ONLY; The status of data ingestion for this workspace. Possible values include: 'RespectQuota', 'ForceOn', 'ForceOff', 'OverQuota', 'SubscriptionSuspended', 'ApproachingQuota' + DataIngestionStatus DataIngestionStatus `json:"dataIngestionStatus,omitempty"` +} + +// WorkspaceListManagementGroupsResult the list workspace management groups operation response. +type WorkspaceListManagementGroupsResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of management groups attached to the workspace. + Value *[]ManagementGroup `json:"value,omitempty"` +} + +// WorkspaceListResult the list workspaces operation response. +type WorkspaceListResult struct { + autorest.Response `json:"-"` + // Value - A list of workspaces. + Value *[]Workspace `json:"value,omitempty"` +} + +// WorkspaceListUsagesResult the list workspace usages operation response. +type WorkspaceListUsagesResult struct { + autorest.Response `json:"-"` + // Value - Gets or sets a list of usage metrics for a workspace. + Value *[]UsageMetric `json:"value,omitempty"` +} + +// WorkspacePatch the top level Workspace resource container. +type WorkspacePatch struct { + // WorkspaceProperties - Workspace properties. + *WorkspaceProperties `json:"properties,omitempty"` + // Tags - Resource tags. Optional. + Tags map[string]*string `json:"tags"` + // 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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for WorkspacePatch. +func (wp WorkspacePatch) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wp.WorkspaceProperties != nil { + objectMap["properties"] = wp.WorkspaceProperties + } + if wp.Tags != nil { + objectMap["tags"] = wp.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for WorkspacePatch struct. +func (wp *WorkspacePatch) 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 workspaceProperties WorkspaceProperties + err = json.Unmarshal(*v, &workspaceProperties) + if err != nil { + return err + } + wp.WorkspaceProperties = &workspaceProperties + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + wp.Tags = tags + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + wp.Etag = &etag + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + wp.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + wp.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + wp.Type = &typeVar + } + } + } + + return nil +} + +// WorkspaceProperties workspace properties. +type WorkspaceProperties struct { + // ProvisioningState - The provisioning state of the workspace. Possible values include: 'WorkspaceEntityStatusCreating', 'WorkspaceEntityStatusSucceeded', 'WorkspaceEntityStatusFailed', 'WorkspaceEntityStatusCanceled', 'WorkspaceEntityStatusDeleting', 'WorkspaceEntityStatusProvisioningAccount', 'WorkspaceEntityStatusUpdating' + ProvisioningState WorkspaceEntityStatus `json:"provisioningState,omitempty"` + // CustomerID - READ-ONLY; This is a read-only property. Represents the ID associated with the workspace. + CustomerID *string `json:"customerId,omitempty"` + // Sku - The SKU of the workspace. + Sku *WorkspaceSku `json:"sku,omitempty"` + // RetentionInDays - The workspace data retention in days. -1 means Unlimited retention for the Unlimited Sku. 730 days is the maximum allowed for all other Skus. + RetentionInDays *int32 `json:"retentionInDays,omitempty"` + // WorkspaceCapping - The daily volume cap for ingestion. + WorkspaceCapping *WorkspaceCapping `json:"workspaceCapping,omitempty"` + // PublicNetworkAccessForIngestion - The network access type for accessing Log Analytics ingestion. Possible values include: 'Enabled', 'Disabled' + PublicNetworkAccessForIngestion PublicNetworkAccessType `json:"publicNetworkAccessForIngestion,omitempty"` + // PublicNetworkAccessForQuery - The network access type for accessing Log Analytics query. Possible values include: 'Enabled', 'Disabled' + PublicNetworkAccessForQuery PublicNetworkAccessType `json:"publicNetworkAccessForQuery,omitempty"` + // PrivateLinkScopedResources - READ-ONLY; List of linked private link scope resources. + PrivateLinkScopedResources *[]PrivateLinkScopedResource `json:"privateLinkScopedResources,omitempty"` +} + +// WorkspacePurgeBody describes the body of a purge request for an App Insights Workspace +type WorkspacePurgeBody struct { + // Table - Table from which to purge data. + Table *string `json:"table,omitempty"` + // Filters - The set of columns and filters (queries) to run over them to purge the resulting data. + Filters *[]WorkspacePurgeBodyFilters `json:"filters,omitempty"` +} + +// WorkspacePurgeBodyFilters user-defined filters to return data which will be purged from the table. +type WorkspacePurgeBodyFilters struct { + // Column - The column of the table over which the given query should run + Column *string `json:"column,omitempty"` + // Operator - A query operator to evaluate over the provided column and value(s). Supported operators are ==, =~, in, in~, >, >=, <, <=, between, and have the same behavior as they would in a KQL query. + Operator *string `json:"operator,omitempty"` + // Value - the value for the operator to function over. This can be a number (e.g., > 100), a string (timestamp >= '2017-09-01') or array of values. + Value interface{} `json:"value,omitempty"` + // Key - When filtering over custom dimensions, this key will be used as the name of the custom dimension. + Key *string `json:"key,omitempty"` +} + +// WorkspacePurgeResponse response containing operationId for a specific purge action. +type WorkspacePurgeResponse struct { + autorest.Response `json:"-"` + // OperationID - Id to use when querying for status for a particular purge operation. + OperationID *string `json:"operationId,omitempty"` +} + +// WorkspacePurgeStatusResponse response containing status for a specific purge operation. +type WorkspacePurgeStatusResponse struct { + autorest.Response `json:"-"` + // Status - Status of the operation represented by the requested Id. Possible values include: 'Pending', 'Completed' + Status PurgeState `json:"status,omitempty"` +} + +// WorkspacesCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type WorkspacesCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *WorkspacesCreateOrUpdateFuture) Result(client WorkspacesClient) (w Workspace, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.WorkspacesCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("operationalinsights.WorkspacesCreateOrUpdateFuture") + 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.CreateOrUpdateResponder(w.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.WorkspacesCreateOrUpdateFuture", "Result", w.Response.Response, "Failure responding to request") + } + } + return +} + +// WorkspacesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type WorkspacesDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *WorkspacesDeleteFuture) Result(client WorkspacesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.WorkspacesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("operationalinsights.WorkspacesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// WorkspaceSku the SKU (tier) of a workspace. +type WorkspaceSku struct { + // Name - The name of the SKU. Possible values include: 'WorkspaceSkuNameEnumFree', 'WorkspaceSkuNameEnumStandard', 'WorkspaceSkuNameEnumPremium', 'WorkspaceSkuNameEnumPerNode', 'WorkspaceSkuNameEnumPerGB2018', 'WorkspaceSkuNameEnumStandalone', 'WorkspaceSkuNameEnumCapacityReservation' + Name WorkspaceSkuNameEnum `json:"name,omitempty"` + // CapacityReservationLevel - The capacity reservation level for this workspace, when CapacityReservation sku is selected. + CapacityReservationLevel *int32 `json:"capacityReservationLevel,omitempty"` + // MaxCapacityReservationLevel - READ-ONLY; The maximum capacity reservation level available for this workspace, when CapacityReservation sku is selected. + MaxCapacityReservationLevel *int32 `json:"maxCapacityReservationLevel,omitempty"` + // LastSkuUpdate - READ-ONLY; The last time when the sku was updated. + LastSkuUpdate *string `json:"lastSkuUpdate,omitempty"` +} diff --git a/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/operationalinsightsapi/interfaces.go b/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/operationalinsightsapi/interfaces.go new file mode 100644 index 000000000000..ad9a4ad0ae2f --- /dev/null +++ b/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/operationalinsightsapi/interfaces.go @@ -0,0 +1,204 @@ +package operationalinsightsapi + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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/operationalinsights/mgmt/2020-03-01-preview/operationalinsights" + "github.com/Azure/go-autorest/autorest" +) + +// DataExportsClientAPI contains the set of methods on the DataExportsClient type. +type DataExportsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, dataExportName string, parameters operationalinsights.DataExport) (result operationalinsights.DataExportsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, workspaceName string, dataExportName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, workspaceName string, dataExportName string) (result operationalinsights.DataExport, err error) + ListByWorkspace(ctx context.Context, resourceGroupName string, workspaceName string) (result operationalinsights.DataExportListResult, err error) +} + +var _ DataExportsClientAPI = (*operationalinsights.DataExportsClient)(nil) + +// DataSourcesClientAPI contains the set of methods on the DataSourcesClient type. +type DataSourcesClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, dataSourceName string, parameters operationalinsights.DataSource) (result operationalinsights.DataSource, err error) + Delete(ctx context.Context, resourceGroupName string, workspaceName string, dataSourceName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, workspaceName string, dataSourceName string) (result operationalinsights.DataSource, err error) + ListByWorkspace(ctx context.Context, resourceGroupName string, workspaceName string, filter string, skiptoken string) (result operationalinsights.DataSourceListResultPage, err error) + ListByWorkspaceComplete(ctx context.Context, resourceGroupName string, workspaceName string, filter string, skiptoken string) (result operationalinsights.DataSourceListResultIterator, err error) +} + +var _ DataSourcesClientAPI = (*operationalinsights.DataSourcesClient)(nil) + +// IntelligencePacksClientAPI contains the set of methods on the IntelligencePacksClient type. +type IntelligencePacksClientAPI interface { + Disable(ctx context.Context, resourceGroupName string, workspaceName string, intelligencePackName string) (result autorest.Response, err error) + Enable(ctx context.Context, resourceGroupName string, workspaceName string, intelligencePackName string) (result autorest.Response, err error) + List(ctx context.Context, resourceGroupName string, workspaceName string) (result operationalinsights.ListIntelligencePack, err error) +} + +var _ IntelligencePacksClientAPI = (*operationalinsights.IntelligencePacksClient)(nil) + +// LinkedServicesClientAPI contains the set of methods on the LinkedServicesClient type. +type LinkedServicesClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, linkedServiceName string, parameters operationalinsights.LinkedService) (result operationalinsights.LinkedServicesCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, workspaceName string, linkedServiceName string) (result operationalinsights.LinkedServicesDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, workspaceName string, linkedServiceName string) (result operationalinsights.LinkedService, err error) + ListByWorkspace(ctx context.Context, resourceGroupName string, workspaceName string) (result operationalinsights.LinkedServiceListResult, err error) +} + +var _ LinkedServicesClientAPI = (*operationalinsights.LinkedServicesClient)(nil) + +// LinkedStorageAccountsClientAPI contains the set of methods on the LinkedStorageAccountsClient type. +type LinkedStorageAccountsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, dataSourceType operationalinsights.DataSourceType, parameters operationalinsights.LinkedStorageAccountsResource) (result operationalinsights.LinkedStorageAccountsResource, err error) + Delete(ctx context.Context, resourceGroupName string, workspaceName string, dataSourceType operationalinsights.DataSourceType) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, workspaceName string, dataSourceType operationalinsights.DataSourceType) (result operationalinsights.LinkedStorageAccountsResource, err error) + ListByWorkspace(ctx context.Context, resourceGroupName string, workspaceName string) (result operationalinsights.LinkedStorageAccountsListResult, err error) +} + +var _ LinkedStorageAccountsClientAPI = (*operationalinsights.LinkedStorageAccountsClient)(nil) + +// ManagementGroupsClientAPI contains the set of methods on the ManagementGroupsClient type. +type ManagementGroupsClientAPI interface { + List(ctx context.Context, resourceGroupName string, workspaceName string) (result operationalinsights.WorkspaceListManagementGroupsResult, err error) +} + +var _ ManagementGroupsClientAPI = (*operationalinsights.ManagementGroupsClient)(nil) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result operationalinsights.OperationListResultPage, err error) + ListComplete(ctx context.Context) (result operationalinsights.OperationListResultIterator, err error) +} + +var _ OperationsClientAPI = (*operationalinsights.OperationsClient)(nil) + +// OperationStatusesClientAPI contains the set of methods on the OperationStatusesClient type. +type OperationStatusesClientAPI interface { + Get(ctx context.Context, location string, asyncOperationID string) (result operationalinsights.OperationStatus, err error) +} + +var _ OperationStatusesClientAPI = (*operationalinsights.OperationStatusesClient)(nil) + +// SharedKeysClientAPI contains the set of methods on the SharedKeysClient type. +type SharedKeysClientAPI interface { + GetSharedKeys(ctx context.Context, resourceGroupName string, workspaceName string) (result operationalinsights.SharedKeys, err error) + Regenerate(ctx context.Context, resourceGroupName string, workspaceName string) (result operationalinsights.SharedKeys, err error) +} + +var _ SharedKeysClientAPI = (*operationalinsights.SharedKeysClient)(nil) + +// UsagesClientAPI contains the set of methods on the UsagesClient type. +type UsagesClientAPI interface { + List(ctx context.Context, resourceGroupName string, workspaceName string) (result operationalinsights.WorkspaceListUsagesResult, err error) +} + +var _ UsagesClientAPI = (*operationalinsights.UsagesClient)(nil) + +// WorkspacesClientAPI contains the set of methods on the WorkspacesClient type. +type WorkspacesClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, parameters operationalinsights.Workspace) (result operationalinsights.WorkspacesCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, workspaceName string, force *bool) (result operationalinsights.WorkspacesDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, workspaceName string) (result operationalinsights.Workspace, err error) + List(ctx context.Context) (result operationalinsights.WorkspaceListResult, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result operationalinsights.WorkspaceListResult, err error) + Update(ctx context.Context, resourceGroupName string, workspaceName string, parameters operationalinsights.WorkspacePatch) (result operationalinsights.Workspace, err error) +} + +var _ WorkspacesClientAPI = (*operationalinsights.WorkspacesClient)(nil) + +// DeletedWorkspacesClientAPI contains the set of methods on the DeletedWorkspacesClient type. +type DeletedWorkspacesClientAPI interface { + List(ctx context.Context) (result operationalinsights.WorkspaceListResult, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result operationalinsights.WorkspaceListResult, err error) +} + +var _ DeletedWorkspacesClientAPI = (*operationalinsights.DeletedWorkspacesClient)(nil) + +// ClustersClientAPI contains the set of methods on the ClustersClient type. +type ClustersClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, clusterName string, parameters operationalinsights.Cluster) (result operationalinsights.ClustersCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, clusterName string) (result operationalinsights.ClustersDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, clusterName string) (result operationalinsights.Cluster, err error) + List(ctx context.Context) (result operationalinsights.ClusterListResultPage, err error) + ListComplete(ctx context.Context) (result operationalinsights.ClusterListResultIterator, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result operationalinsights.ClusterListResultPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result operationalinsights.ClusterListResultIterator, err error) + Update(ctx context.Context, resourceGroupName string, clusterName string, parameters operationalinsights.ClusterPatch) (result operationalinsights.Cluster, err error) +} + +var _ ClustersClientAPI = (*operationalinsights.ClustersClient)(nil) + +// StorageInsightConfigsClientAPI contains the set of methods on the StorageInsightConfigsClient type. +type StorageInsightConfigsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, storageInsightName string, parameters operationalinsights.StorageInsight) (result operationalinsights.StorageInsight, err error) + Delete(ctx context.Context, resourceGroupName string, workspaceName string, storageInsightName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, workspaceName string, storageInsightName string) (result operationalinsights.StorageInsight, err error) + ListByWorkspace(ctx context.Context, resourceGroupName string, workspaceName string) (result operationalinsights.StorageInsightListResultPage, err error) + ListByWorkspaceComplete(ctx context.Context, resourceGroupName string, workspaceName string) (result operationalinsights.StorageInsightListResultIterator, err error) +} + +var _ StorageInsightConfigsClientAPI = (*operationalinsights.StorageInsightConfigsClient)(nil) + +// SavedSearchesClientAPI contains the set of methods on the SavedSearchesClient type. +type SavedSearchesClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, savedSearchID string, parameters operationalinsights.SavedSearch) (result operationalinsights.SavedSearch, err error) + Delete(ctx context.Context, resourceGroupName string, workspaceName string, savedSearchID string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, workspaceName string, savedSearchID string) (result operationalinsights.SavedSearch, err error) + ListByWorkspace(ctx context.Context, resourceGroupName string, workspaceName string) (result operationalinsights.SavedSearchesListResult, err error) +} + +var _ SavedSearchesClientAPI = (*operationalinsights.SavedSearchesClient)(nil) + +// AvailableServiceTiersClientAPI contains the set of methods on the AvailableServiceTiersClient type. +type AvailableServiceTiersClientAPI interface { + ListByWorkspace(ctx context.Context, resourceGroupName string, workspaceName string) (result operationalinsights.ListAvailableServiceTier, err error) +} + +var _ AvailableServiceTiersClientAPI = (*operationalinsights.AvailableServiceTiersClient)(nil) + +// GatewaysClientAPI contains the set of methods on the GatewaysClient type. +type GatewaysClientAPI interface { + Delete(ctx context.Context, resourceGroupName string, workspaceName string, gatewayID string) (result autorest.Response, err error) +} + +var _ GatewaysClientAPI = (*operationalinsights.GatewaysClient)(nil) + +// SchemaClientAPI contains the set of methods on the SchemaClient type. +type SchemaClientAPI interface { + Get(ctx context.Context, resourceGroupName string, workspaceName string) (result operationalinsights.SearchGetSchemaResponse, err error) +} + +var _ SchemaClientAPI = (*operationalinsights.SchemaClient)(nil) + +// WorkspacePurgeClientAPI contains the set of methods on the WorkspacePurgeClient type. +type WorkspacePurgeClientAPI interface { + GetPurgeStatus(ctx context.Context, resourceGroupName string, workspaceName string, purgeID string) (result operationalinsights.WorkspacePurgeStatusResponse, err error) + Purge(ctx context.Context, resourceGroupName string, workspaceName string, body operationalinsights.WorkspacePurgeBody) (result operationalinsights.WorkspacePurgeResponse, err error) +} + +var _ WorkspacePurgeClientAPI = (*operationalinsights.WorkspacePurgeClient)(nil) + +// TablesClientAPI contains the set of methods on the TablesClient type. +type TablesClientAPI interface { + Get(ctx context.Context, resourceGroupName string, workspaceName string, tableName string) (result operationalinsights.Table, err error) + ListByWorkspace(ctx context.Context, resourceGroupName string, workspaceName string) (result operationalinsights.TablesListResult, err error) + Update(ctx context.Context, resourceGroupName string, workspaceName string, tableName string, parameters operationalinsights.Table) (result operationalinsights.Table, err error) +} + +var _ TablesClientAPI = (*operationalinsights.TablesClient)(nil) diff --git a/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/operations.go b/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/operations.go new file mode 100644 index 000000000000..8eefe51bafba --- /dev/null +++ b/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/operations.go @@ -0,0 +1,147 @@ +package operationalinsights + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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 operational Insights Client +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 OperationalInsights 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, "operationalinsights.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, "operationalinsights.OperationsClient", "List", resp, "Failure sending request") + return + } + + result.olr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.OperationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2020-03-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.OperationalInsights/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, + client.ByInspecting(), + 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, "operationalinsights.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, "operationalinsights.OperationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.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/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/operationstatuses.go b/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/operationstatuses.go new file mode 100644 index 000000000000..927cd667e609 --- /dev/null +++ b/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/operationstatuses.go @@ -0,0 +1,126 @@ +package operationalinsights + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// OperationStatusesClient is the operational Insights Client +type OperationStatusesClient struct { + BaseClient +} + +// NewOperationStatusesClient creates an instance of the OperationStatusesClient client. +func NewOperationStatusesClient(subscriptionID string) OperationStatusesClient { + return NewOperationStatusesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewOperationStatusesClientWithBaseURI creates an instance of the OperationStatusesClient 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 NewOperationStatusesClientWithBaseURI(baseURI string, subscriptionID string) OperationStatusesClient { + return OperationStatusesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get get the status of a long running azure asynchronous operation. +// Parameters: +// location - the region name of operation. +// asyncOperationID - the operation Id. +func (client OperationStatusesClient) Get(ctx context.Context, location string, asyncOperationID string) (result OperationStatus, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationStatusesClient.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}}}}); err != nil { + return result, validation.NewError("operationalinsights.OperationStatusesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, location, asyncOperationID) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.OperationStatusesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "operationalinsights.OperationStatusesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.OperationStatusesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client OperationStatusesClient) GetPreparer(ctx context.Context, location string, asyncOperationID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "asyncOperationId": autorest.Encode("path", asyncOperationID), + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-03-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/locations/{location}/operationStatuses/{asyncOperationId}", 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 OperationStatusesClient) 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 OperationStatusesClient) GetResponder(resp *http.Response) (result OperationStatus, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/savedsearches.go b/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/savedsearches.go new file mode 100644 index 000000000000..dc5008c3716b --- /dev/null +++ b/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/savedsearches.go @@ -0,0 +1,417 @@ +package operationalinsights + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// SavedSearchesClient is the operational Insights Client +type SavedSearchesClient struct { + BaseClient +} + +// NewSavedSearchesClient creates an instance of the SavedSearchesClient client. +func NewSavedSearchesClient(subscriptionID string) SavedSearchesClient { + return NewSavedSearchesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewSavedSearchesClientWithBaseURI creates an instance of the SavedSearchesClient 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 NewSavedSearchesClientWithBaseURI(baseURI string, subscriptionID string) SavedSearchesClient { + return SavedSearchesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a saved search for a given workspace. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace. +// savedSearchID - the id of the saved search. +// parameters - the parameters required to save a search. +func (client SavedSearchesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, savedSearchID string, parameters SavedSearch) (result SavedSearch, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SavedSearchesClient.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: 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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 4, Chain: nil}, + {Target: "workspaceName", Name: validation.Pattern, Rule: `^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.SavedSearchProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.SavedSearchProperties.Category", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.SavedSearchProperties.DisplayName", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.SavedSearchProperties.Query", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("operationalinsights.SavedSearchesClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, workspaceName, savedSearchID, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.SavedSearchesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "operationalinsights.SavedSearchesClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.SavedSearchesClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client SavedSearchesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, workspaceName string, savedSearchID string, parameters SavedSearch) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "savedSearchId": autorest.Encode("path", savedSearchID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-03-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.OperationalInsights/workspaces/{workspaceName}/savedSearches/{savedSearchId}", pathParameters), + autorest.WithJSON(parameters), + 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 SavedSearchesClient) 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 SavedSearchesClient) CreateOrUpdateResponder(resp *http.Response) (result SavedSearch, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the specified saved search in a given workspace. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace. +// savedSearchID - the id of the saved search. +func (client SavedSearchesClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, savedSearchID string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SavedSearchesClient.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: 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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 4, Chain: nil}, + {Target: "workspaceName", Name: validation.Pattern, Rule: `^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("operationalinsights.SavedSearchesClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, workspaceName, savedSearchID) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.SavedSearchesClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "operationalinsights.SavedSearchesClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.SavedSearchesClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client SavedSearchesClient) DeletePreparer(ctx context.Context, resourceGroupName string, workspaceName string, savedSearchID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "savedSearchId": autorest.Encode("path", savedSearchID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-03-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.OperationalInsights/workspaces/{workspaceName}/savedSearches/{savedSearchId}", 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 SavedSearchesClient) 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 SavedSearchesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the specified saved search for a given workspace. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace. +// savedSearchID - the id of the saved search. +func (client SavedSearchesClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, savedSearchID string) (result SavedSearch, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SavedSearchesClient.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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 4, Chain: nil}, + {Target: "workspaceName", Name: validation.Pattern, Rule: `^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("operationalinsights.SavedSearchesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName, savedSearchID) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.SavedSearchesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "operationalinsights.SavedSearchesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.SavedSearchesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client SavedSearchesClient) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string, savedSearchID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "savedSearchId": autorest.Encode("path", savedSearchID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-03-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.OperationalInsights/workspaces/{workspaceName}/savedSearches/{savedSearchId}", 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 SavedSearchesClient) 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 SavedSearchesClient) GetResponder(resp *http.Response) (result SavedSearch, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByWorkspace gets the saved searches for a given Log Analytics Workspace +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace. +func (client SavedSearchesClient) ListByWorkspace(ctx context.Context, resourceGroupName string, workspaceName string) (result SavedSearchesListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SavedSearchesClient.ListByWorkspace") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: 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: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 4, Chain: nil}, + {Target: "workspaceName", Name: validation.Pattern, Rule: `^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$`, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("operationalinsights.SavedSearchesClient", "ListByWorkspace", err.Error()) + } + + req, err := client.ListByWorkspacePreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.SavedSearchesClient", "ListByWorkspace", nil, "Failure preparing request") + return + } + + resp, err := client.ListByWorkspaceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "operationalinsights.SavedSearchesClient", "ListByWorkspace", resp, "Failure sending request") + return + } + + result, err = client.ListByWorkspaceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.SavedSearchesClient", "ListByWorkspace", resp, "Failure responding to request") + } + + return +} + +// ListByWorkspacePreparer prepares the ListByWorkspace request. +func (client SavedSearchesClient) ListByWorkspacePreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-03-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.OperationalInsights/workspaces/{workspaceName}/savedSearches", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByWorkspaceSender sends the ListByWorkspace request. The method will close the +// http.Response Body if it receives an error. +func (client SavedSearchesClient) ListByWorkspaceSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByWorkspaceResponder handles the response to the ListByWorkspace request. The method always +// closes the http.Response Body. +func (client SavedSearchesClient) ListByWorkspaceResponder(resp *http.Response) (result SavedSearchesListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/schema.go b/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/schema.go new file mode 100644 index 000000000000..576a12d0b044 --- /dev/null +++ b/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/schema.go @@ -0,0 +1,133 @@ +package operationalinsights + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// SchemaClient is the operational Insights Client +type SchemaClient struct { + BaseClient +} + +// NewSchemaClient creates an instance of the SchemaClient client. +func NewSchemaClient(subscriptionID string) SchemaClient { + return NewSchemaClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewSchemaClientWithBaseURI creates an instance of the SchemaClient 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 NewSchemaClientWithBaseURI(baseURI string, subscriptionID string) SchemaClient { + return SchemaClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get gets the schema for a given workspace. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace. +func (client SchemaClient) Get(ctx context.Context, resourceGroupName string, workspaceName string) (result SearchGetSchemaResponse, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SchemaClient.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}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 4, Chain: nil}, + {Target: "workspaceName", Name: validation.Pattern, Rule: `^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$`, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("operationalinsights.SchemaClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.SchemaClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "operationalinsights.SchemaClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.SchemaClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client SchemaClient) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-03-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.OperationalInsights/workspaces/{workspaceName}/schema", 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 SchemaClient) 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 SchemaClient) GetResponder(resp *http.Response) (result SearchGetSchemaResponse, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/sharedkeys.go b/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/sharedkeys.go new file mode 100644 index 000000000000..161d8f3e3133 --- /dev/null +++ b/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/sharedkeys.go @@ -0,0 +1,224 @@ +package operationalinsights + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// SharedKeysClient is the operational Insights Client +type SharedKeysClient struct { + BaseClient +} + +// NewSharedKeysClient creates an instance of the SharedKeysClient client. +func NewSharedKeysClient(subscriptionID string) SharedKeysClient { + return NewSharedKeysClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewSharedKeysClientWithBaseURI creates an instance of the SharedKeysClient 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 NewSharedKeysClientWithBaseURI(baseURI string, subscriptionID string) SharedKeysClient { + return SharedKeysClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// GetSharedKeys gets the shared keys for a workspace. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace. +func (client SharedKeysClient) GetSharedKeys(ctx context.Context, resourceGroupName string, workspaceName string) (result SharedKeys, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SharedKeysClient.GetSharedKeys") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: 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: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 4, Chain: nil}, + {Target: "workspaceName", Name: validation.Pattern, Rule: `^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$`, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("operationalinsights.SharedKeysClient", "GetSharedKeys", err.Error()) + } + + req, err := client.GetSharedKeysPreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.SharedKeysClient", "GetSharedKeys", nil, "Failure preparing request") + return + } + + resp, err := client.GetSharedKeysSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "operationalinsights.SharedKeysClient", "GetSharedKeys", resp, "Failure sending request") + return + } + + result, err = client.GetSharedKeysResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.SharedKeysClient", "GetSharedKeys", resp, "Failure responding to request") + } + + return +} + +// GetSharedKeysPreparer prepares the GetSharedKeys request. +func (client SharedKeysClient) GetSharedKeysPreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-03-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.OperationalInsights/workspaces/{workspaceName}/sharedKeys", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSharedKeysSender sends the GetSharedKeys request. The method will close the +// http.Response Body if it receives an error. +func (client SharedKeysClient) GetSharedKeysSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetSharedKeysResponder handles the response to the GetSharedKeys request. The method always +// closes the http.Response Body. +func (client SharedKeysClient) GetSharedKeysResponder(resp *http.Response) (result SharedKeys, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Regenerate regenerates the shared keys for a Log Analytics Workspace. These keys are used to connect Microsoft +// Operational Insights agents to the workspace. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace. +func (client SharedKeysClient) Regenerate(ctx context.Context, resourceGroupName string, workspaceName string) (result SharedKeys, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SharedKeysClient.Regenerate") + defer func() { + 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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 4, Chain: nil}, + {Target: "workspaceName", Name: validation.Pattern, Rule: `^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("operationalinsights.SharedKeysClient", "Regenerate", err.Error()) + } + + req, err := client.RegeneratePreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.SharedKeysClient", "Regenerate", nil, "Failure preparing request") + return + } + + resp, err := client.RegenerateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "operationalinsights.SharedKeysClient", "Regenerate", resp, "Failure sending request") + return + } + + result, err = client.RegenerateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.SharedKeysClient", "Regenerate", resp, "Failure responding to request") + } + + return +} + +// RegeneratePreparer prepares the Regenerate request. +func (client SharedKeysClient) RegeneratePreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-03-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.OperationalInsights/workspaces/{workspaceName}/regenerateSharedKey", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RegenerateSender sends the Regenerate request. The method will close the +// http.Response Body if it receives an error. +func (client SharedKeysClient) RegenerateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// RegenerateResponder handles the response to the Regenerate request. The method always +// closes the http.Response Body. +func (client SharedKeysClient) RegenerateResponder(resp *http.Response) (result SharedKeys, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/storageinsightconfigs.go b/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/storageinsightconfigs.go new file mode 100644 index 000000000000..e9711137860c --- /dev/null +++ b/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/storageinsightconfigs.go @@ -0,0 +1,457 @@ +package operationalinsights + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// StorageInsightConfigsClient is the operational Insights Client +type StorageInsightConfigsClient struct { + BaseClient +} + +// NewStorageInsightConfigsClient creates an instance of the StorageInsightConfigsClient client. +func NewStorageInsightConfigsClient(subscriptionID string) StorageInsightConfigsClient { + return NewStorageInsightConfigsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewStorageInsightConfigsClientWithBaseURI creates an instance of the StorageInsightConfigsClient 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 NewStorageInsightConfigsClientWithBaseURI(baseURI string, subscriptionID string) StorageInsightConfigsClient { + return StorageInsightConfigsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create or update a storage insight. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace. +// storageInsightName - name of the storageInsightsConfigs resource +// parameters - the parameters required to create or update a storage insight. +func (client StorageInsightConfigsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, storageInsightName string, parameters StorageInsight) (result StorageInsight, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageInsightConfigsClient.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}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 4, Chain: nil}, + {Target: "workspaceName", Name: validation.Pattern, Rule: `^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.StorageInsightProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.StorageInsightProperties.StorageAccount", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.StorageInsightProperties.StorageAccount.ID", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.StorageInsightProperties.StorageAccount.Key", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("operationalinsights.StorageInsightConfigsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, workspaceName, storageInsightName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.StorageInsightConfigsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "operationalinsights.StorageInsightConfigsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.StorageInsightConfigsClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client StorageInsightConfigsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, workspaceName string, storageInsightName string, parameters StorageInsight) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "storageInsightName": autorest.Encode("path", storageInsightName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-03-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.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs/{storageInsightName}", pathParameters), + autorest.WithJSON(parameters), + 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 StorageInsightConfigsClient) 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 StorageInsightConfigsClient) CreateOrUpdateResponder(resp *http.Response) (result StorageInsight, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a storageInsightsConfigs resource +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace. +// storageInsightName - name of the storageInsightsConfigs resource +func (client StorageInsightConfigsClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, storageInsightName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageInsightConfigsClient.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}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 4, Chain: nil}, + {Target: "workspaceName", Name: validation.Pattern, Rule: `^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$`, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("operationalinsights.StorageInsightConfigsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, workspaceName, storageInsightName) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.StorageInsightConfigsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "operationalinsights.StorageInsightConfigsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.StorageInsightConfigsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client StorageInsightConfigsClient) DeletePreparer(ctx context.Context, resourceGroupName string, workspaceName string, storageInsightName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "storageInsightName": autorest.Encode("path", storageInsightName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-03-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.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs/{storageInsightName}", 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 StorageInsightConfigsClient) 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 StorageInsightConfigsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets a storage insight instance. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace. +// storageInsightName - name of the storageInsightsConfigs resource +func (client StorageInsightConfigsClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, storageInsightName string) (result StorageInsight, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageInsightConfigsClient.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}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 4, Chain: nil}, + {Target: "workspaceName", Name: validation.Pattern, Rule: `^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$`, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("operationalinsights.StorageInsightConfigsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName, storageInsightName) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.StorageInsightConfigsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "operationalinsights.StorageInsightConfigsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.StorageInsightConfigsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client StorageInsightConfigsClient) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string, storageInsightName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "storageInsightName": autorest.Encode("path", storageInsightName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-03-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.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs/{storageInsightName}", 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 StorageInsightConfigsClient) 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 StorageInsightConfigsClient) GetResponder(resp *http.Response) (result StorageInsight, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByWorkspace lists the storage insight instances within a workspace +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace. +func (client StorageInsightConfigsClient) ListByWorkspace(ctx context.Context, resourceGroupName string, workspaceName string) (result StorageInsightListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageInsightConfigsClient.ListByWorkspace") + defer func() { + sc := -1 + if result.silr.Response.Response != nil { + sc = result.silr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: 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: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 4, Chain: nil}, + {Target: "workspaceName", Name: validation.Pattern, Rule: `^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$`, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("operationalinsights.StorageInsightConfigsClient", "ListByWorkspace", err.Error()) + } + + result.fn = client.listByWorkspaceNextResults + req, err := client.ListByWorkspacePreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.StorageInsightConfigsClient", "ListByWorkspace", nil, "Failure preparing request") + return + } + + resp, err := client.ListByWorkspaceSender(req) + if err != nil { + result.silr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "operationalinsights.StorageInsightConfigsClient", "ListByWorkspace", resp, "Failure sending request") + return + } + + result.silr, err = client.ListByWorkspaceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.StorageInsightConfigsClient", "ListByWorkspace", resp, "Failure responding to request") + } + + return +} + +// ListByWorkspacePreparer prepares the ListByWorkspace request. +func (client StorageInsightConfigsClient) ListByWorkspacePreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-03-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.OperationalInsights/workspaces/{workspaceName}/storageInsightConfigs", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByWorkspaceSender sends the ListByWorkspace request. The method will close the +// http.Response Body if it receives an error. +func (client StorageInsightConfigsClient) ListByWorkspaceSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByWorkspaceResponder handles the response to the ListByWorkspace request. The method always +// closes the http.Response Body. +func (client StorageInsightConfigsClient) ListByWorkspaceResponder(resp *http.Response) (result StorageInsightListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByWorkspaceNextResults retrieves the next set of results, if any. +func (client StorageInsightConfigsClient) listByWorkspaceNextResults(ctx context.Context, lastResults StorageInsightListResult) (result StorageInsightListResult, err error) { + req, err := lastResults.storageInsightListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "operationalinsights.StorageInsightConfigsClient", "listByWorkspaceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByWorkspaceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "operationalinsights.StorageInsightConfigsClient", "listByWorkspaceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByWorkspaceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.StorageInsightConfigsClient", "listByWorkspaceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByWorkspaceComplete enumerates all values, automatically crossing page boundaries as required. +func (client StorageInsightConfigsClient) ListByWorkspaceComplete(ctx context.Context, resourceGroupName string, workspaceName string) (result StorageInsightListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StorageInsightConfigsClient.ListByWorkspace") + 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.ListByWorkspace(ctx, resourceGroupName, workspaceName) + return +} diff --git a/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/tables.go b/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/tables.go new file mode 100644 index 000000000000..9576746c40dd --- /dev/null +++ b/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/tables.go @@ -0,0 +1,320 @@ +package operationalinsights + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// TablesClient is the operational Insights Client +type TablesClient struct { + BaseClient +} + +// NewTablesClient creates an instance of the TablesClient client. +func NewTablesClient(subscriptionID string) TablesClient { + return NewTablesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewTablesClientWithBaseURI creates an instance of the TablesClient 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 NewTablesClientWithBaseURI(baseURI string, subscriptionID string) TablesClient { + return TablesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get gets a Log Analytics workspace table. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace. +// tableName - the name of the table. +func (client TablesClient) Get(ctx context.Context, resourceGroupName string, workspaceName string, tableName string) (result Table, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TablesClient.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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 4, Chain: nil}, + {Target: "workspaceName", Name: validation.Pattern, Rule: `^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("operationalinsights.TablesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName, tableName) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.TablesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "operationalinsights.TablesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.TablesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client TablesClient) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string, tableName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tableName": autorest.Encode("path", tableName), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-03-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.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}", 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 TablesClient) 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 TablesClient) GetResponder(resp *http.Response) (result Table, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByWorkspace gets all the tables for the specified Log Analytics workspace. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace. +func (client TablesClient) ListByWorkspace(ctx context.Context, resourceGroupName string, workspaceName string) (result TablesListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TablesClient.ListByWorkspace") + defer func() { + 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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 4, Chain: nil}, + {Target: "workspaceName", Name: validation.Pattern, Rule: `^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("operationalinsights.TablesClient", "ListByWorkspace", err.Error()) + } + + req, err := client.ListByWorkspacePreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.TablesClient", "ListByWorkspace", nil, "Failure preparing request") + return + } + + resp, err := client.ListByWorkspaceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "operationalinsights.TablesClient", "ListByWorkspace", resp, "Failure sending request") + return + } + + result, err = client.ListByWorkspaceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.TablesClient", "ListByWorkspace", resp, "Failure responding to request") + } + + return +} + +// ListByWorkspacePreparer prepares the ListByWorkspace request. +func (client TablesClient) ListByWorkspacePreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-03-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.OperationalInsights/workspaces/{workspaceName}/tables", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByWorkspaceSender sends the ListByWorkspace request. The method will close the +// http.Response Body if it receives an error. +func (client TablesClient) ListByWorkspaceSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByWorkspaceResponder handles the response to the ListByWorkspace request. The method always +// closes the http.Response Body. +func (client TablesClient) ListByWorkspaceResponder(resp *http.Response) (result TablesListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update updates a Log Analytics workspace table properties. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace. +// tableName - the name of the table. +// parameters - the parameters required to update table properties. +func (client TablesClient) Update(ctx context.Context, resourceGroupName string, workspaceName string, tableName string, parameters Table) (result Table, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TablesClient.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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 4, Chain: nil}, + {Target: "workspaceName", Name: validation.Pattern, Rule: `^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("operationalinsights.TablesClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, workspaceName, tableName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.TablesClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "operationalinsights.TablesClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.TablesClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client TablesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, workspaceName string, tableName string, parameters Table) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tableName": autorest.Encode("path", tableName), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-03-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.OperationalInsights/workspaces/{workspaceName}/tables/{tableName}", pathParameters), + autorest.WithJSON(parameters), + 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 TablesClient) 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 TablesClient) UpdateResponder(resp *http.Response) (result Table, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/usages.go b/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/usages.go new file mode 100644 index 000000000000..9e0ca518ad6e --- /dev/null +++ b/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/usages.go @@ -0,0 +1,133 @@ +package operationalinsights + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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 operational Insights Client +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)} +} + +// List gets a list of usage metrics for a workspace. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace. +func (client UsagesClient) List(ctx context.Context, resourceGroupName string, workspaceName string) (result WorkspaceListUsagesResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UsagesClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: 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: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 4, Chain: nil}, + {Target: "workspaceName", Name: validation.Pattern, Rule: `^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$`, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("operationalinsights.UsagesClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.UsagesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "operationalinsights.UsagesClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.UsagesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client UsagesClient) ListPreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-03-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.OperationalInsights/workspaces/{workspaceName}/usages", 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 UsagesClient) 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 UsagesClient) ListResponder(resp *http.Response) (result WorkspaceListUsagesResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/version.go b/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/version.go new file mode 100644 index 000000000000..d1385fe5cc8a --- /dev/null +++ b/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/version.go @@ -0,0 +1,30 @@ +package operationalinsights + +import "github.com/Azure/azure-sdk-for-go/version" + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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() + " operationalinsights/2020-03-01-preview" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/workspacepurge.go b/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/workspacepurge.go new file mode 100644 index 000000000000..4e6cbdab9636 --- /dev/null +++ b/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/workspacepurge.go @@ -0,0 +1,236 @@ +package operationalinsights + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// WorkspacePurgeClient is the operational Insights Client +type WorkspacePurgeClient struct { + BaseClient +} + +// NewWorkspacePurgeClient creates an instance of the WorkspacePurgeClient client. +func NewWorkspacePurgeClient(subscriptionID string) WorkspacePurgeClient { + return NewWorkspacePurgeClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWorkspacePurgeClientWithBaseURI creates an instance of the WorkspacePurgeClient 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 NewWorkspacePurgeClientWithBaseURI(baseURI string, subscriptionID string) WorkspacePurgeClient { + return WorkspacePurgeClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// GetPurgeStatus gets status of an ongoing purge operation. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace. +// purgeID - in a purge status request, this is the Id of the operation the status of which is returned. +func (client WorkspacePurgeClient) GetPurgeStatus(ctx context.Context, resourceGroupName string, workspaceName string, purgeID string) (result WorkspacePurgeStatusResponse, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacePurgeClient.GetPurgeStatus") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 4, Chain: nil}, + {Target: "workspaceName", Name: validation.Pattern, Rule: `^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("operationalinsights.WorkspacePurgeClient", "GetPurgeStatus", err.Error()) + } + + req, err := client.GetPurgeStatusPreparer(ctx, resourceGroupName, workspaceName, purgeID) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.WorkspacePurgeClient", "GetPurgeStatus", nil, "Failure preparing request") + return + } + + resp, err := client.GetPurgeStatusSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "operationalinsights.WorkspacePurgeClient", "GetPurgeStatus", resp, "Failure sending request") + return + } + + result, err = client.GetPurgeStatusResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.WorkspacePurgeClient", "GetPurgeStatus", resp, "Failure responding to request") + } + + return +} + +// GetPurgeStatusPreparer prepares the GetPurgeStatus request. +func (client WorkspacePurgeClient) GetPurgeStatusPreparer(ctx context.Context, resourceGroupName string, workspaceName string, purgeID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "purgeId": autorest.Encode("path", purgeID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-03-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.OperationalInsights/workspaces/{workspaceName}/operations/{purgeId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetPurgeStatusSender sends the GetPurgeStatus request. The method will close the +// http.Response Body if it receives an error. +func (client WorkspacePurgeClient) GetPurgeStatusSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetPurgeStatusResponder handles the response to the GetPurgeStatus request. The method always +// closes the http.Response Body. +func (client WorkspacePurgeClient) GetPurgeStatusResponder(resp *http.Response) (result WorkspacePurgeStatusResponse, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Purge purges data in an Log Analytics workspace by a set of user-defined filters. +// +// In order to manage system resources, purge requests are throttled at 50 requests per hour. You should batch the +// execution of purge requests by sending a single command whose predicate includes all user identities that require +// purging. Use the in operator to specify multiple identities. You should run the query prior to using for a purge +// request to verify that the results are expected. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace. +// body - describes the body of a request to purge data in a single table of an Log Analytics Workspace +func (client WorkspacePurgeClient) Purge(ctx context.Context, resourceGroupName string, workspaceName string, body WorkspacePurgeBody) (result WorkspacePurgeResponse, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacePurgeClient.Purge") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 4, Chain: nil}, + {Target: "workspaceName", Name: validation.Pattern, Rule: `^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$`, Chain: nil}}}, + {TargetValue: body, + Constraints: []validation.Constraint{{Target: "body.Table", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "body.Filters", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("operationalinsights.WorkspacePurgeClient", "Purge", err.Error()) + } + + req, err := client.PurgePreparer(ctx, resourceGroupName, workspaceName, body) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.WorkspacePurgeClient", "Purge", nil, "Failure preparing request") + return + } + + resp, err := client.PurgeSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "operationalinsights.WorkspacePurgeClient", "Purge", resp, "Failure sending request") + return + } + + result, err = client.PurgeResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.WorkspacePurgeClient", "Purge", resp, "Failure responding to request") + } + + return +} + +// PurgePreparer prepares the Purge request. +func (client WorkspacePurgeClient) PurgePreparer(ctx context.Context, resourceGroupName string, workspaceName string, body WorkspacePurgeBody) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-03-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.OperationalInsights/workspaces/{workspaceName}/purge", pathParameters), + autorest.WithJSON(body), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PurgeSender sends the Purge request. The method will close the +// http.Response Body if it receives an error. +func (client WorkspacePurgeClient) PurgeSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// PurgeResponder handles the response to the Purge request. The method always +// closes the http.Response Body. +func (client WorkspacePurgeClient) PurgeResponder(resp *http.Response) (result WorkspacePurgeResponse, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/workspaces.go b/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/workspaces.go new file mode 100644 index 000000000000..78cc84a3a6e5 --- /dev/null +++ b/services/preview/operationalinsights/mgmt/2020-03-01-preview/operationalinsights/workspaces.go @@ -0,0 +1,583 @@ +package operationalinsights + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// WorkspacesClient is the operational Insights Client +type WorkspacesClient struct { + BaseClient +} + +// NewWorkspacesClient creates an instance of the WorkspacesClient client. +func NewWorkspacesClient(subscriptionID string) WorkspacesClient { + return NewWorkspacesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWorkspacesClientWithBaseURI creates an instance of the WorkspacesClient 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 NewWorkspacesClientWithBaseURI(baseURI string, subscriptionID string) WorkspacesClient { + return WorkspacesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate create or update a workspace. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace. +// parameters - the parameters required to create or update a workspace. +func (client WorkspacesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, workspaceName string, parameters Workspace) (result WorkspacesCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.CreateOrUpdate") + 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: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 4, Chain: nil}, + {Target: "workspaceName", Name: validation.Pattern, Rule: `^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.WorkspaceProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.WorkspaceProperties.RetentionInDays", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.WorkspaceProperties.RetentionInDays", Name: validation.InclusiveMaximum, Rule: int64(730), Chain: nil}, + {Target: "parameters.WorkspaceProperties.RetentionInDays", Name: validation.InclusiveMinimum, Rule: int64(-1), Chain: nil}, + }}, + }}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("operationalinsights.WorkspacesClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, workspaceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.WorkspacesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.WorkspacesClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client WorkspacesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, workspaceName string, parameters Workspace) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-03-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.OperationalInsights/workspaces/{workspaceName}", pathParameters), + autorest.WithJSON(parameters), + 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 WorkspacesClient) CreateOrUpdateSender(req *http.Request) (future WorkspacesCreateOrUpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client WorkspacesClient) CreateOrUpdateResponder(resp *http.Response) (result Workspace, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a workspace resource. To recover the workspace, create it again with the same name, in the same +// subscription, resource group and location. The name is kept for 14 days and cannot be used for another workspace. To +// remove the workspace completely and release the name, use the force flag. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace. +// force - deletes the workspace without the recovery option. A workspace that was deleted with this flag +// cannot be recovered. +func (client WorkspacesClient) Delete(ctx context.Context, resourceGroupName string, workspaceName string, force *bool) (result WorkspacesDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.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}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 4, Chain: nil}, + {Target: "workspaceName", Name: validation.Pattern, Rule: `^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$`, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("operationalinsights.WorkspacesClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, workspaceName, force) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.WorkspacesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.WorkspacesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client WorkspacesClient) DeletePreparer(ctx context.Context, resourceGroupName string, workspaceName string, force *bool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-03-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if force != nil { + queryParameters["force"] = autorest.Encode("query", *force) + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}", 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 WorkspacesClient) DeleteSender(req *http.Request) (future WorkspacesDeleteFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client WorkspacesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets a workspace instance. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace. +func (client WorkspacesClient) Get(ctx context.Context, resourceGroupName string, workspaceName string) (result Workspace, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.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}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 4, Chain: nil}, + {Target: "workspaceName", Name: validation.Pattern, Rule: `^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$`, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("operationalinsights.WorkspacesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.WorkspacesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "operationalinsights.WorkspacesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.WorkspacesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client WorkspacesClient) GetPreparer(ctx context.Context, resourceGroupName string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-03-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.OperationalInsights/workspaces/{workspaceName}", 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 WorkspacesClient) 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 WorkspacesClient) GetResponder(resp *http.Response) (result Workspace, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets the workspaces in a subscription. +func (client WorkspacesClient) List(ctx context.Context) (result WorkspaceListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.List") + defer func() { + 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}}}}); err != nil { + return result, validation.NewError("operationalinsights.WorkspacesClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.WorkspacesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "operationalinsights.WorkspacesClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.WorkspacesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client WorkspacesClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-03-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.OperationalInsights/workspaces", 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 WorkspacesClient) 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 WorkspacesClient) ListResponder(resp *http.Response) (result WorkspaceListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByResourceGroup gets workspaces in a resource group. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +func (client WorkspacesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result WorkspaceListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: 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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("operationalinsights.WorkspacesClient", "ListByResourceGroup", err.Error()) + } + + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.WorkspacesClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "operationalinsights.WorkspacesClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.WorkspacesClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client WorkspacesClient) 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 = "2020-03-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.OperationalInsights/workspaces", 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 WorkspacesClient) 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 WorkspacesClient) ListByResourceGroupResponder(resp *http.Response) (result WorkspaceListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update updates a workspace. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// workspaceName - the name of the workspace. +// parameters - the parameters required to patch a workspace. +func (client WorkspacesClient) Update(ctx context.Context, resourceGroupName string, workspaceName string, parameters WorkspacePatch) (result Workspace, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkspacesClient.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: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 4, Chain: nil}, + {Target: "workspaceName", Name: validation.Pattern, Rule: `^[A-Za-z0-9][A-Za-z0-9-]+[A-Za-z0-9]$`, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("operationalinsights.WorkspacesClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, workspaceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.WorkspacesClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "operationalinsights.WorkspacesClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "operationalinsights.WorkspacesClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client WorkspacesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, workspaceName string, parameters WorkspacePatch) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2020-03-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.OperationalInsights/workspaces/{workspaceName}", pathParameters), + autorest.WithJSON(parameters), + 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 WorkspacesClient) 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 WorkspacesClient) UpdateResponder(resp *http.Response) (result Workspace, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/policyinsights/mgmt/2018-07-01-preview/policyinsights/client.go b/services/preview/policyinsights/mgmt/2018-07-01-preview/policyinsights/client.go index dba65fe987a4..f007719ab2f9 100644 --- a/services/preview/policyinsights/mgmt/2018-07-01-preview/policyinsights/client.go +++ b/services/preview/policyinsights/mgmt/2018-07-01-preview/policyinsights/client.go @@ -1,4 +1,4 @@ -// Package policyinsights implements the Azure ARM Policyinsights service API version . +// Package policyinsights implements the Azure ARM Policyinsights service API version 2018-07-01-preview. // // package policyinsights diff --git a/services/preview/policyinsights/mgmt/2018-07-01-preview/policyinsights/models.go b/services/preview/policyinsights/mgmt/2018-07-01-preview/policyinsights/models.go index 952d8d7c9f41..f5c14f9d34e8 100644 --- a/services/preview/policyinsights/mgmt/2018-07-01-preview/policyinsights/models.go +++ b/services/preview/policyinsights/mgmt/2018-07-01-preview/policyinsights/models.go @@ -621,10 +621,149 @@ type PolicyEventsQueryResults struct { OdataContext *string `json:"@odata.context,omitempty"` // OdataCount - OData entity count; represents the number of policy event records returned. OdataCount *int32 `json:"@odata.count,omitempty"` + // OdataNextLink - Odata next link; URL to get the next set of results. + OdataNextLink *string `json:"@odata.nextLink,omitempty"` // Value - Query results. Value *[]PolicyEvent `json:"value,omitempty"` } +// PolicyEventsQueryResultsIterator provides access to a complete listing of PolicyEvent values. +type PolicyEventsQueryResultsIterator struct { + i int + page PolicyEventsQueryResultsPage +} + +// 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 *PolicyEventsQueryResultsIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyEventsQueryResultsIterator.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 *PolicyEventsQueryResultsIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter PolicyEventsQueryResultsIterator) 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 PolicyEventsQueryResultsIterator) Response() PolicyEventsQueryResults { + 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 PolicyEventsQueryResultsIterator) Value() PolicyEvent { + if !iter.page.NotDone() { + return PolicyEvent{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the PolicyEventsQueryResultsIterator type. +func NewPolicyEventsQueryResultsIterator(page PolicyEventsQueryResultsPage) PolicyEventsQueryResultsIterator { + return PolicyEventsQueryResultsIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (peqr PolicyEventsQueryResults) IsEmpty() bool { + return peqr.Value == nil || len(*peqr.Value) == 0 +} + +// policyEventsQueryResultsPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (peqr PolicyEventsQueryResults) policyEventsQueryResultsPreparer(ctx context.Context) (*http.Request, error) { + if peqr.OdataNextLink == nil || len(to.String(peqr.OdataNextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(peqr.OdataNextLink))) +} + +// PolicyEventsQueryResultsPage contains a page of PolicyEvent values. +type PolicyEventsQueryResultsPage struct { + fn func(context.Context, PolicyEventsQueryResults) (PolicyEventsQueryResults, error) + peqr PolicyEventsQueryResults +} + +// 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 *PolicyEventsQueryResultsPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyEventsQueryResultsPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.peqr) + if err != nil { + return err + } + page.peqr = next + 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 *PolicyEventsQueryResultsPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page PolicyEventsQueryResultsPage) NotDone() bool { + return !page.peqr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page PolicyEventsQueryResultsPage) Response() PolicyEventsQueryResults { + return page.peqr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page PolicyEventsQueryResultsPage) Values() []PolicyEvent { + if page.peqr.IsEmpty() { + return nil + } + return *page.peqr.Value +} + +// Creates a new instance of the PolicyEventsQueryResultsPage type. +func NewPolicyEventsQueryResultsPage(getNextPage func(context.Context, PolicyEventsQueryResults) (PolicyEventsQueryResults, error)) PolicyEventsQueryResultsPage { + return PolicyEventsQueryResultsPage{fn: getNextPage} +} + // PolicyState policy state record. type PolicyState struct { // AdditionalProperties - Unmatched properties from the message are deserialized this collection @@ -1080,10 +1219,149 @@ type PolicyStatesQueryResults struct { OdataContext *string `json:"@odata.context,omitempty"` // OdataCount - OData entity count; represents the number of policy state records returned. OdataCount *int32 `json:"@odata.count,omitempty"` + // OdataNextLink - Odata next link; URL to get the next set of results. + OdataNextLink *string `json:"@odata.nextLink,omitempty"` // Value - Query results. Value *[]PolicyState `json:"value,omitempty"` } +// PolicyStatesQueryResultsIterator provides access to a complete listing of PolicyState values. +type PolicyStatesQueryResultsIterator struct { + i int + page PolicyStatesQueryResultsPage +} + +// 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 *PolicyStatesQueryResultsIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyStatesQueryResultsIterator.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 *PolicyStatesQueryResultsIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter PolicyStatesQueryResultsIterator) 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 PolicyStatesQueryResultsIterator) Response() PolicyStatesQueryResults { + 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 PolicyStatesQueryResultsIterator) Value() PolicyState { + if !iter.page.NotDone() { + return PolicyState{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the PolicyStatesQueryResultsIterator type. +func NewPolicyStatesQueryResultsIterator(page PolicyStatesQueryResultsPage) PolicyStatesQueryResultsIterator { + return PolicyStatesQueryResultsIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (psqr PolicyStatesQueryResults) IsEmpty() bool { + return psqr.Value == nil || len(*psqr.Value) == 0 +} + +// policyStatesQueryResultsPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (psqr PolicyStatesQueryResults) policyStatesQueryResultsPreparer(ctx context.Context) (*http.Request, error) { + if psqr.OdataNextLink == nil || len(to.String(psqr.OdataNextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(psqr.OdataNextLink))) +} + +// PolicyStatesQueryResultsPage contains a page of PolicyState values. +type PolicyStatesQueryResultsPage struct { + fn func(context.Context, PolicyStatesQueryResults) (PolicyStatesQueryResults, error) + psqr PolicyStatesQueryResults +} + +// 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 *PolicyStatesQueryResultsPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyStatesQueryResultsPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.psqr) + if err != nil { + return err + } + page.psqr = next + 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 *PolicyStatesQueryResultsPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page PolicyStatesQueryResultsPage) NotDone() bool { + return !page.psqr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page PolicyStatesQueryResultsPage) Response() PolicyStatesQueryResults { + return page.psqr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page PolicyStatesQueryResultsPage) Values() []PolicyState { + if page.psqr.IsEmpty() { + return nil + } + return *page.psqr.Value +} + +// Creates a new instance of the PolicyStatesQueryResultsPage type. +func NewPolicyStatesQueryResultsPage(getNextPage func(context.Context, PolicyStatesQueryResults) (PolicyStatesQueryResults, error)) PolicyStatesQueryResultsPage { + return PolicyStatesQueryResultsPage{fn: getNextPage} +} + // PolicyTrackedResource policy tracked resource record. type PolicyTrackedResource struct { // TrackedResourceID - READ-ONLY; The ID of the policy tracked resource. diff --git a/services/preview/policyinsights/mgmt/2018-07-01-preview/policyinsights/policyevents.go b/services/preview/policyinsights/mgmt/2018-07-01-preview/policyinsights/policyevents.go index a20596f95cc9..ca30ab113783 100644 --- a/services/preview/policyinsights/mgmt/2018-07-01-preview/policyinsights/policyevents.go +++ b/services/preview/policyinsights/mgmt/2018-07-01-preview/policyinsights/policyevents.go @@ -43,80 +43,6 @@ func NewPolicyEventsClientWithBaseURI(baseURI string) PolicyEventsClient { return PolicyEventsClient{NewWithBaseURI(baseURI)} } -// GetMetadata gets OData metadata XML document. -// Parameters: -// scope - a valid scope, i.e. management group, subscription, resource group, or resource ID. Scope used has -// no effect on metadata returned. -func (client PolicyEventsClient) GetMetadata(ctx context.Context, scope string) (result String, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/PolicyEventsClient.GetMetadata") - defer func() { - sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.GetMetadataPreparer(ctx, scope) - if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "GetMetadata", nil, "Failure preparing request") - return - } - - resp, err := client.GetMetadataSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "GetMetadata", resp, "Failure sending request") - return - } - - result, err = client.GetMetadataResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "GetMetadata", resp, "Failure responding to request") - } - - return -} - -// GetMetadataPreparer prepares the GetMetadata request. -func (client PolicyEventsClient) GetMetadataPreparer(ctx context.Context, scope string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "scope": scope, - } - - const APIVersion = "2018-04-04" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/{scope}/providers/Microsoft.PolicyInsights/policyEvents/$metadata", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// GetMetadataSender sends the GetMetadata request. The method will close the -// http.Response Body if it receives an error. -func (client PolicyEventsClient) GetMetadataSender(req *http.Request) (*http.Response, error) { - return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) -} - -// GetMetadataResponder handles the response to the GetMetadata request. The method always -// closes the http.Response Body. -func (client PolicyEventsClient) GetMetadataResponder(resp *http.Response) (result String, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result.Value), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - // ListQueryResultsForManagementGroup queries policy events for the resources under the management group. // Parameters: // managementGroupName - management group name. @@ -131,13 +57,15 @@ func (client PolicyEventsClient) GetMetadataResponder(resp *http.Response) (resu // specified, the service uses request time. // filter - oData filter expression. // apply - oData apply expression for aggregations. -func (client PolicyEventsClient) ListQueryResultsForManagementGroup(ctx context.Context, managementGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result PolicyEventsQueryResults, err error) { +// skipToken - skiptoken is only provided if a previous response returned a partial result as a part of +// nextLink element. +func (client PolicyEventsClient) ListQueryResultsForManagementGroup(ctx context.Context, managementGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result PolicyEventsQueryResultsPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PolicyEventsClient.ListQueryResultsForManagementGroup") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.peqr.Response.Response != nil { + sc = result.peqr.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -149,7 +77,8 @@ func (client PolicyEventsClient) ListQueryResultsForManagementGroup(ctx context. return result, validation.NewError("policyinsights.PolicyEventsClient", "ListQueryResultsForManagementGroup", err.Error()) } - req, err := client.ListQueryResultsForManagementGroupPreparer(ctx, managementGroupName, top, orderBy, selectParameter, from, toParameter, filter, apply) + result.fn = client.listQueryResultsForManagementGroupNextResults + req, err := client.ListQueryResultsForManagementGroupPreparer(ctx, managementGroupName, top, orderBy, selectParameter, from, toParameter, filter, apply, skipToken) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForManagementGroup", nil, "Failure preparing request") return @@ -157,12 +86,12 @@ func (client PolicyEventsClient) ListQueryResultsForManagementGroup(ctx context. resp, err := client.ListQueryResultsForManagementGroupSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} + result.peqr.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForManagementGroup", resp, "Failure sending request") return } - result, err = client.ListQueryResultsForManagementGroupResponder(resp) + result.peqr, err = client.ListQueryResultsForManagementGroupResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForManagementGroup", resp, "Failure responding to request") } @@ -171,14 +100,14 @@ func (client PolicyEventsClient) ListQueryResultsForManagementGroup(ctx context. } // ListQueryResultsForManagementGroupPreparer prepares the ListQueryResultsForManagementGroup request. -func (client PolicyEventsClient) ListQueryResultsForManagementGroupPreparer(ctx context.Context, managementGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (*http.Request, error) { +func (client PolicyEventsClient) ListQueryResultsForManagementGroupPreparer(ctx context.Context, managementGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (*http.Request, error) { pathParameters := map[string]interface{}{ "managementGroupName": autorest.Encode("path", managementGroupName), "managementGroupsNamespace": autorest.Encode("path", "Microsoft.Management"), "policyEventsResource": autorest.Encode("path", "default"), } - const APIVersion = "2018-04-04" + const APIVersion = "2018-07-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -203,6 +132,9 @@ func (client PolicyEventsClient) ListQueryResultsForManagementGroupPreparer(ctx if len(apply) > 0 { queryParameters["$apply"] = autorest.Encode("query", apply) } + if len(skipToken) > 0 { + queryParameters["$skiptoken"] = autorest.Encode("query", skipToken) + } preparer := autorest.CreatePreparer( autorest.AsPost(), @@ -231,6 +163,43 @@ func (client PolicyEventsClient) ListQueryResultsForManagementGroupResponder(res return } +// listQueryResultsForManagementGroupNextResults retrieves the next set of results, if any. +func (client PolicyEventsClient) listQueryResultsForManagementGroupNextResults(ctx context.Context, lastResults PolicyEventsQueryResults) (result PolicyEventsQueryResults, err error) { + req, err := lastResults.policyEventsQueryResultsPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "listQueryResultsForManagementGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListQueryResultsForManagementGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "listQueryResultsForManagementGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListQueryResultsForManagementGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "listQueryResultsForManagementGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListQueryResultsForManagementGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client PolicyEventsClient) ListQueryResultsForManagementGroupComplete(ctx context.Context, managementGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result PolicyEventsQueryResultsIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyEventsClient.ListQueryResultsForManagementGroup") + 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.ListQueryResultsForManagementGroup(ctx, managementGroupName, top, orderBy, selectParameter, from, toParameter, filter, apply, skipToken) + return +} + // ListQueryResultsForPolicyDefinition queries policy events for the subscription level policy definition. // Parameters: // subscriptionID - microsoft Azure subscription ID. @@ -246,13 +215,15 @@ func (client PolicyEventsClient) ListQueryResultsForManagementGroupResponder(res // specified, the service uses request time. // filter - oData filter expression. // apply - oData apply expression for aggregations. -func (client PolicyEventsClient) ListQueryResultsForPolicyDefinition(ctx context.Context, subscriptionID string, policyDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result PolicyEventsQueryResults, err error) { +// skipToken - skiptoken is only provided if a previous response returned a partial result as a part of +// nextLink element. +func (client PolicyEventsClient) ListQueryResultsForPolicyDefinition(ctx context.Context, subscriptionID string, policyDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result PolicyEventsQueryResultsPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PolicyEventsClient.ListQueryResultsForPolicyDefinition") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.peqr.Response.Response != nil { + sc = result.peqr.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -264,7 +235,8 @@ func (client PolicyEventsClient) ListQueryResultsForPolicyDefinition(ctx context return result, validation.NewError("policyinsights.PolicyEventsClient", "ListQueryResultsForPolicyDefinition", err.Error()) } - req, err := client.ListQueryResultsForPolicyDefinitionPreparer(ctx, subscriptionID, policyDefinitionName, top, orderBy, selectParameter, from, toParameter, filter, apply) + result.fn = client.listQueryResultsForPolicyDefinitionNextResults + req, err := client.ListQueryResultsForPolicyDefinitionPreparer(ctx, subscriptionID, policyDefinitionName, top, orderBy, selectParameter, from, toParameter, filter, apply, skipToken) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForPolicyDefinition", nil, "Failure preparing request") return @@ -272,12 +244,12 @@ func (client PolicyEventsClient) ListQueryResultsForPolicyDefinition(ctx context resp, err := client.ListQueryResultsForPolicyDefinitionSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} + result.peqr.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForPolicyDefinition", resp, "Failure sending request") return } - result, err = client.ListQueryResultsForPolicyDefinitionResponder(resp) + result.peqr, err = client.ListQueryResultsForPolicyDefinitionResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForPolicyDefinition", resp, "Failure responding to request") } @@ -286,7 +258,7 @@ func (client PolicyEventsClient) ListQueryResultsForPolicyDefinition(ctx context } // ListQueryResultsForPolicyDefinitionPreparer prepares the ListQueryResultsForPolicyDefinition request. -func (client PolicyEventsClient) ListQueryResultsForPolicyDefinitionPreparer(ctx context.Context, subscriptionID string, policyDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (*http.Request, error) { +func (client PolicyEventsClient) ListQueryResultsForPolicyDefinitionPreparer(ctx context.Context, subscriptionID string, policyDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (*http.Request, error) { pathParameters := map[string]interface{}{ "authorizationNamespace": autorest.Encode("path", "Microsoft.Authorization"), "policyDefinitionName": autorest.Encode("path", policyDefinitionName), @@ -294,7 +266,7 @@ func (client PolicyEventsClient) ListQueryResultsForPolicyDefinitionPreparer(ctx "subscriptionId": autorest.Encode("path", subscriptionID), } - const APIVersion = "2018-04-04" + const APIVersion = "2018-07-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -319,6 +291,9 @@ func (client PolicyEventsClient) ListQueryResultsForPolicyDefinitionPreparer(ctx if len(apply) > 0 { queryParameters["$apply"] = autorest.Encode("query", apply) } + if len(skipToken) > 0 { + queryParameters["$skiptoken"] = autorest.Encode("query", skipToken) + } preparer := autorest.CreatePreparer( autorest.AsPost(), @@ -347,6 +322,43 @@ func (client PolicyEventsClient) ListQueryResultsForPolicyDefinitionResponder(re return } +// listQueryResultsForPolicyDefinitionNextResults retrieves the next set of results, if any. +func (client PolicyEventsClient) listQueryResultsForPolicyDefinitionNextResults(ctx context.Context, lastResults PolicyEventsQueryResults) (result PolicyEventsQueryResults, err error) { + req, err := lastResults.policyEventsQueryResultsPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "listQueryResultsForPolicyDefinitionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListQueryResultsForPolicyDefinitionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "listQueryResultsForPolicyDefinitionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListQueryResultsForPolicyDefinitionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "listQueryResultsForPolicyDefinitionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListQueryResultsForPolicyDefinitionComplete enumerates all values, automatically crossing page boundaries as required. +func (client PolicyEventsClient) ListQueryResultsForPolicyDefinitionComplete(ctx context.Context, subscriptionID string, policyDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result PolicyEventsQueryResultsIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyEventsClient.ListQueryResultsForPolicyDefinition") + 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.ListQueryResultsForPolicyDefinition(ctx, subscriptionID, policyDefinitionName, top, orderBy, selectParameter, from, toParameter, filter, apply, skipToken) + return +} + // ListQueryResultsForPolicySetDefinition queries policy events for the subscription level policy set definition. // Parameters: // subscriptionID - microsoft Azure subscription ID. @@ -362,13 +374,15 @@ func (client PolicyEventsClient) ListQueryResultsForPolicyDefinitionResponder(re // specified, the service uses request time. // filter - oData filter expression. // apply - oData apply expression for aggregations. -func (client PolicyEventsClient) ListQueryResultsForPolicySetDefinition(ctx context.Context, subscriptionID string, policySetDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result PolicyEventsQueryResults, err error) { +// skipToken - skiptoken is only provided if a previous response returned a partial result as a part of +// nextLink element. +func (client PolicyEventsClient) ListQueryResultsForPolicySetDefinition(ctx context.Context, subscriptionID string, policySetDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result PolicyEventsQueryResultsPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PolicyEventsClient.ListQueryResultsForPolicySetDefinition") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.peqr.Response.Response != nil { + sc = result.peqr.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -380,7 +394,8 @@ func (client PolicyEventsClient) ListQueryResultsForPolicySetDefinition(ctx cont return result, validation.NewError("policyinsights.PolicyEventsClient", "ListQueryResultsForPolicySetDefinition", err.Error()) } - req, err := client.ListQueryResultsForPolicySetDefinitionPreparer(ctx, subscriptionID, policySetDefinitionName, top, orderBy, selectParameter, from, toParameter, filter, apply) + result.fn = client.listQueryResultsForPolicySetDefinitionNextResults + req, err := client.ListQueryResultsForPolicySetDefinitionPreparer(ctx, subscriptionID, policySetDefinitionName, top, orderBy, selectParameter, from, toParameter, filter, apply, skipToken) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForPolicySetDefinition", nil, "Failure preparing request") return @@ -388,12 +403,12 @@ func (client PolicyEventsClient) ListQueryResultsForPolicySetDefinition(ctx cont resp, err := client.ListQueryResultsForPolicySetDefinitionSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} + result.peqr.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForPolicySetDefinition", resp, "Failure sending request") return } - result, err = client.ListQueryResultsForPolicySetDefinitionResponder(resp) + result.peqr, err = client.ListQueryResultsForPolicySetDefinitionResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForPolicySetDefinition", resp, "Failure responding to request") } @@ -402,7 +417,7 @@ func (client PolicyEventsClient) ListQueryResultsForPolicySetDefinition(ctx cont } // ListQueryResultsForPolicySetDefinitionPreparer prepares the ListQueryResultsForPolicySetDefinition request. -func (client PolicyEventsClient) ListQueryResultsForPolicySetDefinitionPreparer(ctx context.Context, subscriptionID string, policySetDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (*http.Request, error) { +func (client PolicyEventsClient) ListQueryResultsForPolicySetDefinitionPreparer(ctx context.Context, subscriptionID string, policySetDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (*http.Request, error) { pathParameters := map[string]interface{}{ "authorizationNamespace": autorest.Encode("path", "Microsoft.Authorization"), "policyEventsResource": autorest.Encode("path", "default"), @@ -410,7 +425,7 @@ func (client PolicyEventsClient) ListQueryResultsForPolicySetDefinitionPreparer( "subscriptionId": autorest.Encode("path", subscriptionID), } - const APIVersion = "2018-04-04" + const APIVersion = "2018-07-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -435,6 +450,9 @@ func (client PolicyEventsClient) ListQueryResultsForPolicySetDefinitionPreparer( if len(apply) > 0 { queryParameters["$apply"] = autorest.Encode("query", apply) } + if len(skipToken) > 0 { + queryParameters["$skiptoken"] = autorest.Encode("query", skipToken) + } preparer := autorest.CreatePreparer( autorest.AsPost(), @@ -463,6 +481,43 @@ func (client PolicyEventsClient) ListQueryResultsForPolicySetDefinitionResponder return } +// listQueryResultsForPolicySetDefinitionNextResults retrieves the next set of results, if any. +func (client PolicyEventsClient) listQueryResultsForPolicySetDefinitionNextResults(ctx context.Context, lastResults PolicyEventsQueryResults) (result PolicyEventsQueryResults, err error) { + req, err := lastResults.policyEventsQueryResultsPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "listQueryResultsForPolicySetDefinitionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListQueryResultsForPolicySetDefinitionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "listQueryResultsForPolicySetDefinitionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListQueryResultsForPolicySetDefinitionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "listQueryResultsForPolicySetDefinitionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListQueryResultsForPolicySetDefinitionComplete enumerates all values, automatically crossing page boundaries as required. +func (client PolicyEventsClient) ListQueryResultsForPolicySetDefinitionComplete(ctx context.Context, subscriptionID string, policySetDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result PolicyEventsQueryResultsIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyEventsClient.ListQueryResultsForPolicySetDefinition") + 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.ListQueryResultsForPolicySetDefinition(ctx, subscriptionID, policySetDefinitionName, top, orderBy, selectParameter, from, toParameter, filter, apply, skipToken) + return +} + // ListQueryResultsForResource queries policy events for the resource. // Parameters: // resourceID - resource ID. @@ -477,13 +532,15 @@ func (client PolicyEventsClient) ListQueryResultsForPolicySetDefinitionResponder // specified, the service uses request time. // filter - oData filter expression. // apply - oData apply expression for aggregations. -func (client PolicyEventsClient) ListQueryResultsForResource(ctx context.Context, resourceID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result PolicyEventsQueryResults, err error) { +// skipToken - skiptoken is only provided if a previous response returned a partial result as a part of +// nextLink element. +func (client PolicyEventsClient) ListQueryResultsForResource(ctx context.Context, resourceID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result PolicyEventsQueryResultsPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PolicyEventsClient.ListQueryResultsForResource") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.peqr.Response.Response != nil { + sc = result.peqr.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -495,7 +552,8 @@ func (client PolicyEventsClient) ListQueryResultsForResource(ctx context.Context return result, validation.NewError("policyinsights.PolicyEventsClient", "ListQueryResultsForResource", err.Error()) } - req, err := client.ListQueryResultsForResourcePreparer(ctx, resourceID, top, orderBy, selectParameter, from, toParameter, filter, apply) + result.fn = client.listQueryResultsForResourceNextResults + req, err := client.ListQueryResultsForResourcePreparer(ctx, resourceID, top, orderBy, selectParameter, from, toParameter, filter, apply, skipToken) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForResource", nil, "Failure preparing request") return @@ -503,12 +561,12 @@ func (client PolicyEventsClient) ListQueryResultsForResource(ctx context.Context resp, err := client.ListQueryResultsForResourceSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} + result.peqr.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForResource", resp, "Failure sending request") return } - result, err = client.ListQueryResultsForResourceResponder(resp) + result.peqr, err = client.ListQueryResultsForResourceResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForResource", resp, "Failure responding to request") } @@ -517,13 +575,13 @@ func (client PolicyEventsClient) ListQueryResultsForResource(ctx context.Context } // ListQueryResultsForResourcePreparer prepares the ListQueryResultsForResource request. -func (client PolicyEventsClient) ListQueryResultsForResourcePreparer(ctx context.Context, resourceID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (*http.Request, error) { +func (client PolicyEventsClient) ListQueryResultsForResourcePreparer(ctx context.Context, resourceID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (*http.Request, error) { pathParameters := map[string]interface{}{ "policyEventsResource": autorest.Encode("path", "default"), "resourceId": resourceID, } - const APIVersion = "2018-04-04" + const APIVersion = "2018-07-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -548,6 +606,9 @@ func (client PolicyEventsClient) ListQueryResultsForResourcePreparer(ctx context if len(apply) > 0 { queryParameters["$apply"] = autorest.Encode("query", apply) } + if len(skipToken) > 0 { + queryParameters["$skiptoken"] = autorest.Encode("query", skipToken) + } preparer := autorest.CreatePreparer( autorest.AsPost(), @@ -576,6 +637,43 @@ func (client PolicyEventsClient) ListQueryResultsForResourceResponder(resp *http return } +// listQueryResultsForResourceNextResults retrieves the next set of results, if any. +func (client PolicyEventsClient) listQueryResultsForResourceNextResults(ctx context.Context, lastResults PolicyEventsQueryResults) (result PolicyEventsQueryResults, err error) { + req, err := lastResults.policyEventsQueryResultsPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "listQueryResultsForResourceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListQueryResultsForResourceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "listQueryResultsForResourceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListQueryResultsForResourceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "listQueryResultsForResourceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListQueryResultsForResourceComplete enumerates all values, automatically crossing page boundaries as required. +func (client PolicyEventsClient) ListQueryResultsForResourceComplete(ctx context.Context, resourceID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result PolicyEventsQueryResultsIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyEventsClient.ListQueryResultsForResource") + 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.ListQueryResultsForResource(ctx, resourceID, top, orderBy, selectParameter, from, toParameter, filter, apply, skipToken) + return +} + // ListQueryResultsForResourceGroup queries policy events for the resources under the resource group. // Parameters: // subscriptionID - microsoft Azure subscription ID. @@ -591,13 +689,15 @@ func (client PolicyEventsClient) ListQueryResultsForResourceResponder(resp *http // specified, the service uses request time. // filter - oData filter expression. // apply - oData apply expression for aggregations. -func (client PolicyEventsClient) ListQueryResultsForResourceGroup(ctx context.Context, subscriptionID string, resourceGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result PolicyEventsQueryResults, err error) { +// skipToken - skiptoken is only provided if a previous response returned a partial result as a part of +// nextLink element. +func (client PolicyEventsClient) ListQueryResultsForResourceGroup(ctx context.Context, subscriptionID string, resourceGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result PolicyEventsQueryResultsPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PolicyEventsClient.ListQueryResultsForResourceGroup") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.peqr.Response.Response != nil { + sc = result.peqr.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -609,7 +709,8 @@ func (client PolicyEventsClient) ListQueryResultsForResourceGroup(ctx context.Co return result, validation.NewError("policyinsights.PolicyEventsClient", "ListQueryResultsForResourceGroup", err.Error()) } - req, err := client.ListQueryResultsForResourceGroupPreparer(ctx, subscriptionID, resourceGroupName, top, orderBy, selectParameter, from, toParameter, filter, apply) + result.fn = client.listQueryResultsForResourceGroupNextResults + req, err := client.ListQueryResultsForResourceGroupPreparer(ctx, subscriptionID, resourceGroupName, top, orderBy, selectParameter, from, toParameter, filter, apply, skipToken) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForResourceGroup", nil, "Failure preparing request") return @@ -617,12 +718,12 @@ func (client PolicyEventsClient) ListQueryResultsForResourceGroup(ctx context.Co resp, err := client.ListQueryResultsForResourceGroupSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} + result.peqr.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForResourceGroup", resp, "Failure sending request") return } - result, err = client.ListQueryResultsForResourceGroupResponder(resp) + result.peqr, err = client.ListQueryResultsForResourceGroupResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForResourceGroup", resp, "Failure responding to request") } @@ -631,14 +732,14 @@ func (client PolicyEventsClient) ListQueryResultsForResourceGroup(ctx context.Co } // ListQueryResultsForResourceGroupPreparer prepares the ListQueryResultsForResourceGroup request. -func (client PolicyEventsClient) ListQueryResultsForResourceGroupPreparer(ctx context.Context, subscriptionID string, resourceGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (*http.Request, error) { +func (client PolicyEventsClient) ListQueryResultsForResourceGroupPreparer(ctx context.Context, subscriptionID string, resourceGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (*http.Request, error) { pathParameters := map[string]interface{}{ "policyEventsResource": autorest.Encode("path", "default"), "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", subscriptionID), } - const APIVersion = "2018-04-04" + const APIVersion = "2018-07-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -663,6 +764,9 @@ func (client PolicyEventsClient) ListQueryResultsForResourceGroupPreparer(ctx co if len(apply) > 0 { queryParameters["$apply"] = autorest.Encode("query", apply) } + if len(skipToken) > 0 { + queryParameters["$skiptoken"] = autorest.Encode("query", skipToken) + } preparer := autorest.CreatePreparer( autorest.AsPost(), @@ -691,6 +795,43 @@ func (client PolicyEventsClient) ListQueryResultsForResourceGroupResponder(resp return } +// listQueryResultsForResourceGroupNextResults retrieves the next set of results, if any. +func (client PolicyEventsClient) listQueryResultsForResourceGroupNextResults(ctx context.Context, lastResults PolicyEventsQueryResults) (result PolicyEventsQueryResults, err error) { + req, err := lastResults.policyEventsQueryResultsPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "listQueryResultsForResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListQueryResultsForResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "listQueryResultsForResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListQueryResultsForResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "listQueryResultsForResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListQueryResultsForResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client PolicyEventsClient) ListQueryResultsForResourceGroupComplete(ctx context.Context, subscriptionID string, resourceGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result PolicyEventsQueryResultsIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyEventsClient.ListQueryResultsForResourceGroup") + 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.ListQueryResultsForResourceGroup(ctx, subscriptionID, resourceGroupName, top, orderBy, selectParameter, from, toParameter, filter, apply, skipToken) + return +} + // ListQueryResultsForResourceGroupLevelPolicyAssignment queries policy events for the resource group level policy // assignment. // Parameters: @@ -708,13 +849,15 @@ func (client PolicyEventsClient) ListQueryResultsForResourceGroupResponder(resp // specified, the service uses request time. // filter - oData filter expression. // apply - oData apply expression for aggregations. -func (client PolicyEventsClient) ListQueryResultsForResourceGroupLevelPolicyAssignment(ctx context.Context, subscriptionID string, resourceGroupName string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result PolicyEventsQueryResults, err error) { +// skipToken - skiptoken is only provided if a previous response returned a partial result as a part of +// nextLink element. +func (client PolicyEventsClient) ListQueryResultsForResourceGroupLevelPolicyAssignment(ctx context.Context, subscriptionID string, resourceGroupName string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result PolicyEventsQueryResultsPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PolicyEventsClient.ListQueryResultsForResourceGroupLevelPolicyAssignment") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.peqr.Response.Response != nil { + sc = result.peqr.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -726,7 +869,8 @@ func (client PolicyEventsClient) ListQueryResultsForResourceGroupLevelPolicyAssi return result, validation.NewError("policyinsights.PolicyEventsClient", "ListQueryResultsForResourceGroupLevelPolicyAssignment", err.Error()) } - req, err := client.ListQueryResultsForResourceGroupLevelPolicyAssignmentPreparer(ctx, subscriptionID, resourceGroupName, policyAssignmentName, top, orderBy, selectParameter, from, toParameter, filter, apply) + result.fn = client.listQueryResultsForResourceGroupLevelPolicyAssignmentNextResults + req, err := client.ListQueryResultsForResourceGroupLevelPolicyAssignmentPreparer(ctx, subscriptionID, resourceGroupName, policyAssignmentName, top, orderBy, selectParameter, from, toParameter, filter, apply, skipToken) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForResourceGroupLevelPolicyAssignment", nil, "Failure preparing request") return @@ -734,12 +878,12 @@ func (client PolicyEventsClient) ListQueryResultsForResourceGroupLevelPolicyAssi resp, err := client.ListQueryResultsForResourceGroupLevelPolicyAssignmentSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} + result.peqr.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForResourceGroupLevelPolicyAssignment", resp, "Failure sending request") return } - result, err = client.ListQueryResultsForResourceGroupLevelPolicyAssignmentResponder(resp) + result.peqr, err = client.ListQueryResultsForResourceGroupLevelPolicyAssignmentResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForResourceGroupLevelPolicyAssignment", resp, "Failure responding to request") } @@ -748,7 +892,7 @@ func (client PolicyEventsClient) ListQueryResultsForResourceGroupLevelPolicyAssi } // ListQueryResultsForResourceGroupLevelPolicyAssignmentPreparer prepares the ListQueryResultsForResourceGroupLevelPolicyAssignment request. -func (client PolicyEventsClient) ListQueryResultsForResourceGroupLevelPolicyAssignmentPreparer(ctx context.Context, subscriptionID string, resourceGroupName string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (*http.Request, error) { +func (client PolicyEventsClient) ListQueryResultsForResourceGroupLevelPolicyAssignmentPreparer(ctx context.Context, subscriptionID string, resourceGroupName string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (*http.Request, error) { pathParameters := map[string]interface{}{ "authorizationNamespace": autorest.Encode("path", "Microsoft.Authorization"), "policyAssignmentName": autorest.Encode("path", policyAssignmentName), @@ -757,7 +901,7 @@ func (client PolicyEventsClient) ListQueryResultsForResourceGroupLevelPolicyAssi "subscriptionId": autorest.Encode("path", subscriptionID), } - const APIVersion = "2018-04-04" + const APIVersion = "2018-07-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -782,6 +926,9 @@ func (client PolicyEventsClient) ListQueryResultsForResourceGroupLevelPolicyAssi if len(apply) > 0 { queryParameters["$apply"] = autorest.Encode("query", apply) } + if len(skipToken) > 0 { + queryParameters["$skiptoken"] = autorest.Encode("query", skipToken) + } preparer := autorest.CreatePreparer( autorest.AsPost(), @@ -810,6 +957,43 @@ func (client PolicyEventsClient) ListQueryResultsForResourceGroupLevelPolicyAssi return } +// listQueryResultsForResourceGroupLevelPolicyAssignmentNextResults retrieves the next set of results, if any. +func (client PolicyEventsClient) listQueryResultsForResourceGroupLevelPolicyAssignmentNextResults(ctx context.Context, lastResults PolicyEventsQueryResults) (result PolicyEventsQueryResults, err error) { + req, err := lastResults.policyEventsQueryResultsPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "listQueryResultsForResourceGroupLevelPolicyAssignmentNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListQueryResultsForResourceGroupLevelPolicyAssignmentSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "listQueryResultsForResourceGroupLevelPolicyAssignmentNextResults", resp, "Failure sending next results request") + } + result, err = client.ListQueryResultsForResourceGroupLevelPolicyAssignmentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "listQueryResultsForResourceGroupLevelPolicyAssignmentNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListQueryResultsForResourceGroupLevelPolicyAssignmentComplete enumerates all values, automatically crossing page boundaries as required. +func (client PolicyEventsClient) ListQueryResultsForResourceGroupLevelPolicyAssignmentComplete(ctx context.Context, subscriptionID string, resourceGroupName string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result PolicyEventsQueryResultsIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyEventsClient.ListQueryResultsForResourceGroupLevelPolicyAssignment") + 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.ListQueryResultsForResourceGroupLevelPolicyAssignment(ctx, subscriptionID, resourceGroupName, policyAssignmentName, top, orderBy, selectParameter, from, toParameter, filter, apply, skipToken) + return +} + // ListQueryResultsForSubscription queries policy events for the resources under the subscription. // Parameters: // subscriptionID - microsoft Azure subscription ID. @@ -824,13 +1008,15 @@ func (client PolicyEventsClient) ListQueryResultsForResourceGroupLevelPolicyAssi // specified, the service uses request time. // filter - oData filter expression. // apply - oData apply expression for aggregations. -func (client PolicyEventsClient) ListQueryResultsForSubscription(ctx context.Context, subscriptionID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result PolicyEventsQueryResults, err error) { +// skipToken - skiptoken is only provided if a previous response returned a partial result as a part of +// nextLink element. +func (client PolicyEventsClient) ListQueryResultsForSubscription(ctx context.Context, subscriptionID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result PolicyEventsQueryResultsPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PolicyEventsClient.ListQueryResultsForSubscription") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.peqr.Response.Response != nil { + sc = result.peqr.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -842,7 +1028,8 @@ func (client PolicyEventsClient) ListQueryResultsForSubscription(ctx context.Con return result, validation.NewError("policyinsights.PolicyEventsClient", "ListQueryResultsForSubscription", err.Error()) } - req, err := client.ListQueryResultsForSubscriptionPreparer(ctx, subscriptionID, top, orderBy, selectParameter, from, toParameter, filter, apply) + result.fn = client.listQueryResultsForSubscriptionNextResults + req, err := client.ListQueryResultsForSubscriptionPreparer(ctx, subscriptionID, top, orderBy, selectParameter, from, toParameter, filter, apply, skipToken) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForSubscription", nil, "Failure preparing request") return @@ -850,12 +1037,12 @@ func (client PolicyEventsClient) ListQueryResultsForSubscription(ctx context.Con resp, err := client.ListQueryResultsForSubscriptionSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} + result.peqr.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForSubscription", resp, "Failure sending request") return } - result, err = client.ListQueryResultsForSubscriptionResponder(resp) + result.peqr, err = client.ListQueryResultsForSubscriptionResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForSubscription", resp, "Failure responding to request") } @@ -864,13 +1051,13 @@ func (client PolicyEventsClient) ListQueryResultsForSubscription(ctx context.Con } // ListQueryResultsForSubscriptionPreparer prepares the ListQueryResultsForSubscription request. -func (client PolicyEventsClient) ListQueryResultsForSubscriptionPreparer(ctx context.Context, subscriptionID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (*http.Request, error) { +func (client PolicyEventsClient) ListQueryResultsForSubscriptionPreparer(ctx context.Context, subscriptionID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (*http.Request, error) { pathParameters := map[string]interface{}{ "policyEventsResource": autorest.Encode("path", "default"), "subscriptionId": autorest.Encode("path", subscriptionID), } - const APIVersion = "2018-04-04" + const APIVersion = "2018-07-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -895,6 +1082,9 @@ func (client PolicyEventsClient) ListQueryResultsForSubscriptionPreparer(ctx con if len(apply) > 0 { queryParameters["$apply"] = autorest.Encode("query", apply) } + if len(skipToken) > 0 { + queryParameters["$skiptoken"] = autorest.Encode("query", skipToken) + } preparer := autorest.CreatePreparer( autorest.AsPost(), @@ -923,6 +1113,43 @@ func (client PolicyEventsClient) ListQueryResultsForSubscriptionResponder(resp * return } +// listQueryResultsForSubscriptionNextResults retrieves the next set of results, if any. +func (client PolicyEventsClient) listQueryResultsForSubscriptionNextResults(ctx context.Context, lastResults PolicyEventsQueryResults) (result PolicyEventsQueryResults, err error) { + req, err := lastResults.policyEventsQueryResultsPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "listQueryResultsForSubscriptionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListQueryResultsForSubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "listQueryResultsForSubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListQueryResultsForSubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "listQueryResultsForSubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListQueryResultsForSubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client PolicyEventsClient) ListQueryResultsForSubscriptionComplete(ctx context.Context, subscriptionID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result PolicyEventsQueryResultsIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyEventsClient.ListQueryResultsForSubscription") + 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.ListQueryResultsForSubscription(ctx, subscriptionID, top, orderBy, selectParameter, from, toParameter, filter, apply, skipToken) + return +} + // ListQueryResultsForSubscriptionLevelPolicyAssignment queries policy events for the subscription level policy // assignment. // Parameters: @@ -939,13 +1166,15 @@ func (client PolicyEventsClient) ListQueryResultsForSubscriptionResponder(resp * // specified, the service uses request time. // filter - oData filter expression. // apply - oData apply expression for aggregations. -func (client PolicyEventsClient) ListQueryResultsForSubscriptionLevelPolicyAssignment(ctx context.Context, subscriptionID string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result PolicyEventsQueryResults, err error) { +// skipToken - skiptoken is only provided if a previous response returned a partial result as a part of +// nextLink element. +func (client PolicyEventsClient) ListQueryResultsForSubscriptionLevelPolicyAssignment(ctx context.Context, subscriptionID string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result PolicyEventsQueryResultsPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PolicyEventsClient.ListQueryResultsForSubscriptionLevelPolicyAssignment") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.peqr.Response.Response != nil { + sc = result.peqr.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -957,7 +1186,8 @@ func (client PolicyEventsClient) ListQueryResultsForSubscriptionLevelPolicyAssig return result, validation.NewError("policyinsights.PolicyEventsClient", "ListQueryResultsForSubscriptionLevelPolicyAssignment", err.Error()) } - req, err := client.ListQueryResultsForSubscriptionLevelPolicyAssignmentPreparer(ctx, subscriptionID, policyAssignmentName, top, orderBy, selectParameter, from, toParameter, filter, apply) + result.fn = client.listQueryResultsForSubscriptionLevelPolicyAssignmentNextResults + req, err := client.ListQueryResultsForSubscriptionLevelPolicyAssignmentPreparer(ctx, subscriptionID, policyAssignmentName, top, orderBy, selectParameter, from, toParameter, filter, apply, skipToken) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForSubscriptionLevelPolicyAssignment", nil, "Failure preparing request") return @@ -965,12 +1195,12 @@ func (client PolicyEventsClient) ListQueryResultsForSubscriptionLevelPolicyAssig resp, err := client.ListQueryResultsForSubscriptionLevelPolicyAssignmentSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} + result.peqr.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForSubscriptionLevelPolicyAssignment", resp, "Failure sending request") return } - result, err = client.ListQueryResultsForSubscriptionLevelPolicyAssignmentResponder(resp) + result.peqr, err = client.ListQueryResultsForSubscriptionLevelPolicyAssignmentResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "ListQueryResultsForSubscriptionLevelPolicyAssignment", resp, "Failure responding to request") } @@ -979,7 +1209,7 @@ func (client PolicyEventsClient) ListQueryResultsForSubscriptionLevelPolicyAssig } // ListQueryResultsForSubscriptionLevelPolicyAssignmentPreparer prepares the ListQueryResultsForSubscriptionLevelPolicyAssignment request. -func (client PolicyEventsClient) ListQueryResultsForSubscriptionLevelPolicyAssignmentPreparer(ctx context.Context, subscriptionID string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (*http.Request, error) { +func (client PolicyEventsClient) ListQueryResultsForSubscriptionLevelPolicyAssignmentPreparer(ctx context.Context, subscriptionID string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (*http.Request, error) { pathParameters := map[string]interface{}{ "authorizationNamespace": autorest.Encode("path", "Microsoft.Authorization"), "policyAssignmentName": autorest.Encode("path", policyAssignmentName), @@ -987,7 +1217,7 @@ func (client PolicyEventsClient) ListQueryResultsForSubscriptionLevelPolicyAssig "subscriptionId": autorest.Encode("path", subscriptionID), } - const APIVersion = "2018-04-04" + const APIVersion = "2018-07-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1012,6 +1242,9 @@ func (client PolicyEventsClient) ListQueryResultsForSubscriptionLevelPolicyAssig if len(apply) > 0 { queryParameters["$apply"] = autorest.Encode("query", apply) } + if len(skipToken) > 0 { + queryParameters["$skiptoken"] = autorest.Encode("query", skipToken) + } preparer := autorest.CreatePreparer( autorest.AsPost(), @@ -1039,3 +1272,40 @@ func (client PolicyEventsClient) ListQueryResultsForSubscriptionLevelPolicyAssig result.Response = autorest.Response{Response: resp} return } + +// listQueryResultsForSubscriptionLevelPolicyAssignmentNextResults retrieves the next set of results, if any. +func (client PolicyEventsClient) listQueryResultsForSubscriptionLevelPolicyAssignmentNextResults(ctx context.Context, lastResults PolicyEventsQueryResults) (result PolicyEventsQueryResults, err error) { + req, err := lastResults.policyEventsQueryResultsPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "listQueryResultsForSubscriptionLevelPolicyAssignmentNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListQueryResultsForSubscriptionLevelPolicyAssignmentSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "listQueryResultsForSubscriptionLevelPolicyAssignmentNextResults", resp, "Failure sending next results request") + } + result, err = client.ListQueryResultsForSubscriptionLevelPolicyAssignmentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyEventsClient", "listQueryResultsForSubscriptionLevelPolicyAssignmentNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListQueryResultsForSubscriptionLevelPolicyAssignmentComplete enumerates all values, automatically crossing page boundaries as required. +func (client PolicyEventsClient) ListQueryResultsForSubscriptionLevelPolicyAssignmentComplete(ctx context.Context, subscriptionID string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result PolicyEventsQueryResultsIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyEventsClient.ListQueryResultsForSubscriptionLevelPolicyAssignment") + 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.ListQueryResultsForSubscriptionLevelPolicyAssignment(ctx, subscriptionID, policyAssignmentName, top, orderBy, selectParameter, from, toParameter, filter, apply, skipToken) + return +} diff --git a/services/preview/policyinsights/mgmt/2018-07-01-preview/policyinsights/policyinsightsapi/interfaces.go b/services/preview/policyinsights/mgmt/2018-07-01-preview/policyinsights/policyinsightsapi/interfaces.go index 4f86ebd5641e..df7ea268d3e3 100644 --- a/services/preview/policyinsights/mgmt/2018-07-01-preview/policyinsights/policyinsightsapi/interfaces.go +++ b/services/preview/policyinsights/mgmt/2018-07-01-preview/policyinsights/policyinsightsapi/interfaces.go @@ -77,15 +77,22 @@ var _ RemediationsClientAPI = (*policyinsights.RemediationsClient)(nil) // PolicyEventsClientAPI contains the set of methods on the PolicyEventsClient type. type PolicyEventsClientAPI interface { - GetMetadata(ctx context.Context, scope string) (result policyinsights.String, err error) - ListQueryResultsForManagementGroup(ctx context.Context, managementGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result policyinsights.PolicyEventsQueryResults, err error) - ListQueryResultsForPolicyDefinition(ctx context.Context, subscriptionID string, policyDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result policyinsights.PolicyEventsQueryResults, err error) - ListQueryResultsForPolicySetDefinition(ctx context.Context, subscriptionID string, policySetDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result policyinsights.PolicyEventsQueryResults, err error) - ListQueryResultsForResource(ctx context.Context, resourceID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result policyinsights.PolicyEventsQueryResults, err error) - ListQueryResultsForResourceGroup(ctx context.Context, subscriptionID string, resourceGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result policyinsights.PolicyEventsQueryResults, err error) - ListQueryResultsForResourceGroupLevelPolicyAssignment(ctx context.Context, subscriptionID string, resourceGroupName string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result policyinsights.PolicyEventsQueryResults, err error) - ListQueryResultsForSubscription(ctx context.Context, subscriptionID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result policyinsights.PolicyEventsQueryResults, err error) - ListQueryResultsForSubscriptionLevelPolicyAssignment(ctx context.Context, subscriptionID string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result policyinsights.PolicyEventsQueryResults, err error) + ListQueryResultsForManagementGroup(ctx context.Context, managementGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result policyinsights.PolicyEventsQueryResultsPage, err error) + ListQueryResultsForManagementGroupComplete(ctx context.Context, managementGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result policyinsights.PolicyEventsQueryResultsIterator, err error) + ListQueryResultsForPolicyDefinition(ctx context.Context, subscriptionID string, policyDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result policyinsights.PolicyEventsQueryResultsPage, err error) + ListQueryResultsForPolicyDefinitionComplete(ctx context.Context, subscriptionID string, policyDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result policyinsights.PolicyEventsQueryResultsIterator, err error) + ListQueryResultsForPolicySetDefinition(ctx context.Context, subscriptionID string, policySetDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result policyinsights.PolicyEventsQueryResultsPage, err error) + ListQueryResultsForPolicySetDefinitionComplete(ctx context.Context, subscriptionID string, policySetDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result policyinsights.PolicyEventsQueryResultsIterator, err error) + ListQueryResultsForResource(ctx context.Context, resourceID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result policyinsights.PolicyEventsQueryResultsPage, err error) + ListQueryResultsForResourceComplete(ctx context.Context, resourceID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result policyinsights.PolicyEventsQueryResultsIterator, err error) + ListQueryResultsForResourceGroup(ctx context.Context, subscriptionID string, resourceGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result policyinsights.PolicyEventsQueryResultsPage, err error) + ListQueryResultsForResourceGroupComplete(ctx context.Context, subscriptionID string, resourceGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result policyinsights.PolicyEventsQueryResultsIterator, err error) + ListQueryResultsForResourceGroupLevelPolicyAssignment(ctx context.Context, subscriptionID string, resourceGroupName string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result policyinsights.PolicyEventsQueryResultsPage, err error) + ListQueryResultsForResourceGroupLevelPolicyAssignmentComplete(ctx context.Context, subscriptionID string, resourceGroupName string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result policyinsights.PolicyEventsQueryResultsIterator, err error) + ListQueryResultsForSubscription(ctx context.Context, subscriptionID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result policyinsights.PolicyEventsQueryResultsPage, err error) + ListQueryResultsForSubscriptionComplete(ctx context.Context, subscriptionID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result policyinsights.PolicyEventsQueryResultsIterator, err error) + ListQueryResultsForSubscriptionLevelPolicyAssignment(ctx context.Context, subscriptionID string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result policyinsights.PolicyEventsQueryResultsPage, err error) + ListQueryResultsForSubscriptionLevelPolicyAssignmentComplete(ctx context.Context, subscriptionID string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result policyinsights.PolicyEventsQueryResultsIterator, err error) } var _ PolicyEventsClientAPI = (*policyinsights.PolicyEventsClient)(nil) @@ -93,14 +100,22 @@ var _ PolicyEventsClientAPI = (*policyinsights.PolicyEventsClient)(nil) // PolicyStatesClientAPI contains the set of methods on the PolicyStatesClient type. type PolicyStatesClientAPI interface { GetMetadata(ctx context.Context, scope string) (result policyinsights.String, err error) - ListQueryResultsForManagementGroup(ctx context.Context, policyStatesResource policyinsights.PolicyStatesResource, managementGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result policyinsights.PolicyStatesQueryResults, err error) - ListQueryResultsForPolicyDefinition(ctx context.Context, policyStatesResource policyinsights.PolicyStatesResource, subscriptionID string, policyDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result policyinsights.PolicyStatesQueryResults, err error) - ListQueryResultsForPolicySetDefinition(ctx context.Context, policyStatesResource policyinsights.PolicyStatesResource, subscriptionID string, policySetDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result policyinsights.PolicyStatesQueryResults, err error) - ListQueryResultsForResource(ctx context.Context, policyStatesResource policyinsights.PolicyStatesResource, resourceID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, expand string) (result policyinsights.PolicyStatesQueryResults, err error) - ListQueryResultsForResourceGroup(ctx context.Context, policyStatesResource policyinsights.PolicyStatesResource, subscriptionID string, resourceGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result policyinsights.PolicyStatesQueryResults, err error) - ListQueryResultsForResourceGroupLevelPolicyAssignment(ctx context.Context, policyStatesResource policyinsights.PolicyStatesResource, subscriptionID string, resourceGroupName string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result policyinsights.PolicyStatesQueryResults, err error) - ListQueryResultsForSubscription(ctx context.Context, policyStatesResource policyinsights.PolicyStatesResource, subscriptionID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result policyinsights.PolicyStatesQueryResults, err error) - ListQueryResultsForSubscriptionLevelPolicyAssignment(ctx context.Context, policyStatesResource policyinsights.PolicyStatesResource, subscriptionID string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result policyinsights.PolicyStatesQueryResults, err error) + ListQueryResultsForManagementGroup(ctx context.Context, policyStatesResource policyinsights.PolicyStatesResource, managementGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result policyinsights.PolicyStatesQueryResultsPage, err error) + ListQueryResultsForManagementGroupComplete(ctx context.Context, policyStatesResource policyinsights.PolicyStatesResource, managementGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result policyinsights.PolicyStatesQueryResultsIterator, err error) + ListQueryResultsForPolicyDefinition(ctx context.Context, policyStatesResource policyinsights.PolicyStatesResource, subscriptionID string, policyDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result policyinsights.PolicyStatesQueryResultsPage, err error) + ListQueryResultsForPolicyDefinitionComplete(ctx context.Context, policyStatesResource policyinsights.PolicyStatesResource, subscriptionID string, policyDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result policyinsights.PolicyStatesQueryResultsIterator, err error) + ListQueryResultsForPolicySetDefinition(ctx context.Context, policyStatesResource policyinsights.PolicyStatesResource, subscriptionID string, policySetDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result policyinsights.PolicyStatesQueryResultsPage, err error) + ListQueryResultsForPolicySetDefinitionComplete(ctx context.Context, policyStatesResource policyinsights.PolicyStatesResource, subscriptionID string, policySetDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result policyinsights.PolicyStatesQueryResultsIterator, err error) + ListQueryResultsForResource(ctx context.Context, policyStatesResource policyinsights.PolicyStatesResource, resourceID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, expand string, skipToken string) (result policyinsights.PolicyStatesQueryResultsPage, err error) + ListQueryResultsForResourceComplete(ctx context.Context, policyStatesResource policyinsights.PolicyStatesResource, resourceID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, expand string, skipToken string) (result policyinsights.PolicyStatesQueryResultsIterator, err error) + ListQueryResultsForResourceGroup(ctx context.Context, policyStatesResource policyinsights.PolicyStatesResource, subscriptionID string, resourceGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result policyinsights.PolicyStatesQueryResultsPage, err error) + ListQueryResultsForResourceGroupComplete(ctx context.Context, policyStatesResource policyinsights.PolicyStatesResource, subscriptionID string, resourceGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result policyinsights.PolicyStatesQueryResultsIterator, err error) + ListQueryResultsForResourceGroupLevelPolicyAssignment(ctx context.Context, policyStatesResource policyinsights.PolicyStatesResource, subscriptionID string, resourceGroupName string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result policyinsights.PolicyStatesQueryResultsPage, err error) + ListQueryResultsForResourceGroupLevelPolicyAssignmentComplete(ctx context.Context, policyStatesResource policyinsights.PolicyStatesResource, subscriptionID string, resourceGroupName string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result policyinsights.PolicyStatesQueryResultsIterator, err error) + ListQueryResultsForSubscription(ctx context.Context, policyStatesResource policyinsights.PolicyStatesResource, subscriptionID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result policyinsights.PolicyStatesQueryResultsPage, err error) + ListQueryResultsForSubscriptionComplete(ctx context.Context, policyStatesResource policyinsights.PolicyStatesResource, subscriptionID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result policyinsights.PolicyStatesQueryResultsIterator, err error) + ListQueryResultsForSubscriptionLevelPolicyAssignment(ctx context.Context, policyStatesResource policyinsights.PolicyStatesResource, subscriptionID string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result policyinsights.PolicyStatesQueryResultsPage, err error) + ListQueryResultsForSubscriptionLevelPolicyAssignmentComplete(ctx context.Context, policyStatesResource policyinsights.PolicyStatesResource, subscriptionID string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result policyinsights.PolicyStatesQueryResultsIterator, err error) SummarizeForManagementGroup(ctx context.Context, managementGroupName string, top *int32, from *date.Time, toParameter *date.Time, filter string) (result policyinsights.SummarizeResults, err error) SummarizeForPolicyDefinition(ctx context.Context, subscriptionID string, policyDefinitionName string, top *int32, from *date.Time, toParameter *date.Time, filter string) (result policyinsights.SummarizeResults, err error) SummarizeForPolicySetDefinition(ctx context.Context, subscriptionID string, policySetDefinitionName string, top *int32, from *date.Time, toParameter *date.Time, filter string) (result policyinsights.SummarizeResults, err error) diff --git a/services/preview/policyinsights/mgmt/2018-07-01-preview/policyinsights/policystates.go b/services/preview/policyinsights/mgmt/2018-07-01-preview/policyinsights/policystates.go index 03651671fe80..87b9b748aa51 100644 --- a/services/preview/policyinsights/mgmt/2018-07-01-preview/policyinsights/policystates.go +++ b/services/preview/policyinsights/mgmt/2018-07-01-preview/policyinsights/policystates.go @@ -133,13 +133,15 @@ func (client PolicyStatesClient) GetMetadataResponder(resp *http.Response) (resu // specified, the service uses request time. // filter - oData filter expression. // apply - oData apply expression for aggregations. -func (client PolicyStatesClient) ListQueryResultsForManagementGroup(ctx context.Context, policyStatesResource PolicyStatesResource, managementGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result PolicyStatesQueryResults, err error) { +// skipToken - skiptoken is only provided if a previous response returned a partial result as a part of +// nextLink element. +func (client PolicyStatesClient) ListQueryResultsForManagementGroup(ctx context.Context, policyStatesResource PolicyStatesResource, managementGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result PolicyStatesQueryResultsPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PolicyStatesClient.ListQueryResultsForManagementGroup") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.psqr.Response.Response != nil { + sc = result.psqr.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -151,7 +153,8 @@ func (client PolicyStatesClient) ListQueryResultsForManagementGroup(ctx context. return result, validation.NewError("policyinsights.PolicyStatesClient", "ListQueryResultsForManagementGroup", err.Error()) } - req, err := client.ListQueryResultsForManagementGroupPreparer(ctx, policyStatesResource, managementGroupName, top, orderBy, selectParameter, from, toParameter, filter, apply) + result.fn = client.listQueryResultsForManagementGroupNextResults + req, err := client.ListQueryResultsForManagementGroupPreparer(ctx, policyStatesResource, managementGroupName, top, orderBy, selectParameter, from, toParameter, filter, apply, skipToken) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForManagementGroup", nil, "Failure preparing request") return @@ -159,12 +162,12 @@ func (client PolicyStatesClient) ListQueryResultsForManagementGroup(ctx context. resp, err := client.ListQueryResultsForManagementGroupSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} + result.psqr.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForManagementGroup", resp, "Failure sending request") return } - result, err = client.ListQueryResultsForManagementGroupResponder(resp) + result.psqr, err = client.ListQueryResultsForManagementGroupResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForManagementGroup", resp, "Failure responding to request") } @@ -173,7 +176,7 @@ func (client PolicyStatesClient) ListQueryResultsForManagementGroup(ctx context. } // ListQueryResultsForManagementGroupPreparer prepares the ListQueryResultsForManagementGroup request. -func (client PolicyStatesClient) ListQueryResultsForManagementGroupPreparer(ctx context.Context, policyStatesResource PolicyStatesResource, managementGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (*http.Request, error) { +func (client PolicyStatesClient) ListQueryResultsForManagementGroupPreparer(ctx context.Context, policyStatesResource PolicyStatesResource, managementGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (*http.Request, error) { pathParameters := map[string]interface{}{ "managementGroupName": autorest.Encode("path", managementGroupName), "managementGroupsNamespace": autorest.Encode("path", "Microsoft.Management"), @@ -205,6 +208,9 @@ func (client PolicyStatesClient) ListQueryResultsForManagementGroupPreparer(ctx if len(apply) > 0 { queryParameters["$apply"] = autorest.Encode("query", apply) } + if len(skipToken) > 0 { + queryParameters["$skiptoken"] = autorest.Encode("query", skipToken) + } preparer := autorest.CreatePreparer( autorest.AsPost(), @@ -233,6 +239,43 @@ func (client PolicyStatesClient) ListQueryResultsForManagementGroupResponder(res return } +// listQueryResultsForManagementGroupNextResults retrieves the next set of results, if any. +func (client PolicyStatesClient) listQueryResultsForManagementGroupNextResults(ctx context.Context, lastResults PolicyStatesQueryResults) (result PolicyStatesQueryResults, err error) { + req, err := lastResults.policyStatesQueryResultsPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "listQueryResultsForManagementGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListQueryResultsForManagementGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "listQueryResultsForManagementGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListQueryResultsForManagementGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "listQueryResultsForManagementGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListQueryResultsForManagementGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client PolicyStatesClient) ListQueryResultsForManagementGroupComplete(ctx context.Context, policyStatesResource PolicyStatesResource, managementGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result PolicyStatesQueryResultsIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyStatesClient.ListQueryResultsForManagementGroup") + 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.ListQueryResultsForManagementGroup(ctx, policyStatesResource, managementGroupName, top, orderBy, selectParameter, from, toParameter, filter, apply, skipToken) + return +} + // ListQueryResultsForPolicyDefinition queries policy states for the subscription level policy definition. // Parameters: // policyStatesResource - the virtual resource under PolicyStates resource type. In a given time range, @@ -250,13 +293,15 @@ func (client PolicyStatesClient) ListQueryResultsForManagementGroupResponder(res // specified, the service uses request time. // filter - oData filter expression. // apply - oData apply expression for aggregations. -func (client PolicyStatesClient) ListQueryResultsForPolicyDefinition(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, policyDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result PolicyStatesQueryResults, err error) { +// skipToken - skiptoken is only provided if a previous response returned a partial result as a part of +// nextLink element. +func (client PolicyStatesClient) ListQueryResultsForPolicyDefinition(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, policyDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result PolicyStatesQueryResultsPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PolicyStatesClient.ListQueryResultsForPolicyDefinition") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.psqr.Response.Response != nil { + sc = result.psqr.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -268,7 +313,8 @@ func (client PolicyStatesClient) ListQueryResultsForPolicyDefinition(ctx context return result, validation.NewError("policyinsights.PolicyStatesClient", "ListQueryResultsForPolicyDefinition", err.Error()) } - req, err := client.ListQueryResultsForPolicyDefinitionPreparer(ctx, policyStatesResource, subscriptionID, policyDefinitionName, top, orderBy, selectParameter, from, toParameter, filter, apply) + result.fn = client.listQueryResultsForPolicyDefinitionNextResults + req, err := client.ListQueryResultsForPolicyDefinitionPreparer(ctx, policyStatesResource, subscriptionID, policyDefinitionName, top, orderBy, selectParameter, from, toParameter, filter, apply, skipToken) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForPolicyDefinition", nil, "Failure preparing request") return @@ -276,12 +322,12 @@ func (client PolicyStatesClient) ListQueryResultsForPolicyDefinition(ctx context resp, err := client.ListQueryResultsForPolicyDefinitionSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} + result.psqr.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForPolicyDefinition", resp, "Failure sending request") return } - result, err = client.ListQueryResultsForPolicyDefinitionResponder(resp) + result.psqr, err = client.ListQueryResultsForPolicyDefinitionResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForPolicyDefinition", resp, "Failure responding to request") } @@ -290,7 +336,7 @@ func (client PolicyStatesClient) ListQueryResultsForPolicyDefinition(ctx context } // ListQueryResultsForPolicyDefinitionPreparer prepares the ListQueryResultsForPolicyDefinition request. -func (client PolicyStatesClient) ListQueryResultsForPolicyDefinitionPreparer(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, policyDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (*http.Request, error) { +func (client PolicyStatesClient) ListQueryResultsForPolicyDefinitionPreparer(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, policyDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (*http.Request, error) { pathParameters := map[string]interface{}{ "authorizationNamespace": autorest.Encode("path", "Microsoft.Authorization"), "policyDefinitionName": autorest.Encode("path", policyDefinitionName), @@ -323,6 +369,9 @@ func (client PolicyStatesClient) ListQueryResultsForPolicyDefinitionPreparer(ctx if len(apply) > 0 { queryParameters["$apply"] = autorest.Encode("query", apply) } + if len(skipToken) > 0 { + queryParameters["$skiptoken"] = autorest.Encode("query", skipToken) + } preparer := autorest.CreatePreparer( autorest.AsPost(), @@ -351,6 +400,43 @@ func (client PolicyStatesClient) ListQueryResultsForPolicyDefinitionResponder(re return } +// listQueryResultsForPolicyDefinitionNextResults retrieves the next set of results, if any. +func (client PolicyStatesClient) listQueryResultsForPolicyDefinitionNextResults(ctx context.Context, lastResults PolicyStatesQueryResults) (result PolicyStatesQueryResults, err error) { + req, err := lastResults.policyStatesQueryResultsPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "listQueryResultsForPolicyDefinitionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListQueryResultsForPolicyDefinitionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "listQueryResultsForPolicyDefinitionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListQueryResultsForPolicyDefinitionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "listQueryResultsForPolicyDefinitionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListQueryResultsForPolicyDefinitionComplete enumerates all values, automatically crossing page boundaries as required. +func (client PolicyStatesClient) ListQueryResultsForPolicyDefinitionComplete(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, policyDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result PolicyStatesQueryResultsIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyStatesClient.ListQueryResultsForPolicyDefinition") + 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.ListQueryResultsForPolicyDefinition(ctx, policyStatesResource, subscriptionID, policyDefinitionName, top, orderBy, selectParameter, from, toParameter, filter, apply, skipToken) + return +} + // ListQueryResultsForPolicySetDefinition queries policy states for the subscription level policy set definition. // Parameters: // policyStatesResource - the virtual resource under PolicyStates resource type. In a given time range, @@ -368,13 +454,15 @@ func (client PolicyStatesClient) ListQueryResultsForPolicyDefinitionResponder(re // specified, the service uses request time. // filter - oData filter expression. // apply - oData apply expression for aggregations. -func (client PolicyStatesClient) ListQueryResultsForPolicySetDefinition(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, policySetDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result PolicyStatesQueryResults, err error) { +// skipToken - skiptoken is only provided if a previous response returned a partial result as a part of +// nextLink element. +func (client PolicyStatesClient) ListQueryResultsForPolicySetDefinition(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, policySetDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result PolicyStatesQueryResultsPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PolicyStatesClient.ListQueryResultsForPolicySetDefinition") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.psqr.Response.Response != nil { + sc = result.psqr.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -386,7 +474,8 @@ func (client PolicyStatesClient) ListQueryResultsForPolicySetDefinition(ctx cont return result, validation.NewError("policyinsights.PolicyStatesClient", "ListQueryResultsForPolicySetDefinition", err.Error()) } - req, err := client.ListQueryResultsForPolicySetDefinitionPreparer(ctx, policyStatesResource, subscriptionID, policySetDefinitionName, top, orderBy, selectParameter, from, toParameter, filter, apply) + result.fn = client.listQueryResultsForPolicySetDefinitionNextResults + req, err := client.ListQueryResultsForPolicySetDefinitionPreparer(ctx, policyStatesResource, subscriptionID, policySetDefinitionName, top, orderBy, selectParameter, from, toParameter, filter, apply, skipToken) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForPolicySetDefinition", nil, "Failure preparing request") return @@ -394,12 +483,12 @@ func (client PolicyStatesClient) ListQueryResultsForPolicySetDefinition(ctx cont resp, err := client.ListQueryResultsForPolicySetDefinitionSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} + result.psqr.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForPolicySetDefinition", resp, "Failure sending request") return } - result, err = client.ListQueryResultsForPolicySetDefinitionResponder(resp) + result.psqr, err = client.ListQueryResultsForPolicySetDefinitionResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForPolicySetDefinition", resp, "Failure responding to request") } @@ -408,7 +497,7 @@ func (client PolicyStatesClient) ListQueryResultsForPolicySetDefinition(ctx cont } // ListQueryResultsForPolicySetDefinitionPreparer prepares the ListQueryResultsForPolicySetDefinition request. -func (client PolicyStatesClient) ListQueryResultsForPolicySetDefinitionPreparer(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, policySetDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (*http.Request, error) { +func (client PolicyStatesClient) ListQueryResultsForPolicySetDefinitionPreparer(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, policySetDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (*http.Request, error) { pathParameters := map[string]interface{}{ "authorizationNamespace": autorest.Encode("path", "Microsoft.Authorization"), "policySetDefinitionName": autorest.Encode("path", policySetDefinitionName), @@ -441,6 +530,9 @@ func (client PolicyStatesClient) ListQueryResultsForPolicySetDefinitionPreparer( if len(apply) > 0 { queryParameters["$apply"] = autorest.Encode("query", apply) } + if len(skipToken) > 0 { + queryParameters["$skiptoken"] = autorest.Encode("query", skipToken) + } preparer := autorest.CreatePreparer( autorest.AsPost(), @@ -469,6 +561,43 @@ func (client PolicyStatesClient) ListQueryResultsForPolicySetDefinitionResponder return } +// listQueryResultsForPolicySetDefinitionNextResults retrieves the next set of results, if any. +func (client PolicyStatesClient) listQueryResultsForPolicySetDefinitionNextResults(ctx context.Context, lastResults PolicyStatesQueryResults) (result PolicyStatesQueryResults, err error) { + req, err := lastResults.policyStatesQueryResultsPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "listQueryResultsForPolicySetDefinitionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListQueryResultsForPolicySetDefinitionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "listQueryResultsForPolicySetDefinitionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListQueryResultsForPolicySetDefinitionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "listQueryResultsForPolicySetDefinitionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListQueryResultsForPolicySetDefinitionComplete enumerates all values, automatically crossing page boundaries as required. +func (client PolicyStatesClient) ListQueryResultsForPolicySetDefinitionComplete(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, policySetDefinitionName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result PolicyStatesQueryResultsIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyStatesClient.ListQueryResultsForPolicySetDefinition") + 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.ListQueryResultsForPolicySetDefinition(ctx, policyStatesResource, subscriptionID, policySetDefinitionName, top, orderBy, selectParameter, from, toParameter, filter, apply, skipToken) + return +} + // ListQueryResultsForResource queries policy states for the resource. // Parameters: // policyStatesResource - the virtual resource under PolicyStates resource type. In a given time range, @@ -487,13 +616,15 @@ func (client PolicyStatesClient) ListQueryResultsForPolicySetDefinitionResponder // apply - oData apply expression for aggregations. // expand - the $expand query parameter. For example, to expand policyEvaluationDetails, use // $expand=policyEvaluationDetails -func (client PolicyStatesClient) ListQueryResultsForResource(ctx context.Context, policyStatesResource PolicyStatesResource, resourceID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, expand string) (result PolicyStatesQueryResults, err error) { +// skipToken - skiptoken is only provided if a previous response returned a partial result as a part of +// nextLink element. +func (client PolicyStatesClient) ListQueryResultsForResource(ctx context.Context, policyStatesResource PolicyStatesResource, resourceID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, expand string, skipToken string) (result PolicyStatesQueryResultsPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PolicyStatesClient.ListQueryResultsForResource") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.psqr.Response.Response != nil { + sc = result.psqr.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -505,7 +636,8 @@ func (client PolicyStatesClient) ListQueryResultsForResource(ctx context.Context return result, validation.NewError("policyinsights.PolicyStatesClient", "ListQueryResultsForResource", err.Error()) } - req, err := client.ListQueryResultsForResourcePreparer(ctx, policyStatesResource, resourceID, top, orderBy, selectParameter, from, toParameter, filter, apply, expand) + result.fn = client.listQueryResultsForResourceNextResults + req, err := client.ListQueryResultsForResourcePreparer(ctx, policyStatesResource, resourceID, top, orderBy, selectParameter, from, toParameter, filter, apply, expand, skipToken) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForResource", nil, "Failure preparing request") return @@ -513,12 +645,12 @@ func (client PolicyStatesClient) ListQueryResultsForResource(ctx context.Context resp, err := client.ListQueryResultsForResourceSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} + result.psqr.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForResource", resp, "Failure sending request") return } - result, err = client.ListQueryResultsForResourceResponder(resp) + result.psqr, err = client.ListQueryResultsForResourceResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForResource", resp, "Failure responding to request") } @@ -527,7 +659,7 @@ func (client PolicyStatesClient) ListQueryResultsForResource(ctx context.Context } // ListQueryResultsForResourcePreparer prepares the ListQueryResultsForResource request. -func (client PolicyStatesClient) ListQueryResultsForResourcePreparer(ctx context.Context, policyStatesResource PolicyStatesResource, resourceID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, expand string) (*http.Request, error) { +func (client PolicyStatesClient) ListQueryResultsForResourcePreparer(ctx context.Context, policyStatesResource PolicyStatesResource, resourceID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, expand string, skipToken string) (*http.Request, error) { pathParameters := map[string]interface{}{ "policyStatesResource": autorest.Encode("path", policyStatesResource), "resourceId": resourceID, @@ -561,6 +693,9 @@ func (client PolicyStatesClient) ListQueryResultsForResourcePreparer(ctx context if len(expand) > 0 { queryParameters["$expand"] = autorest.Encode("query", expand) } + if len(skipToken) > 0 { + queryParameters["$skiptoken"] = autorest.Encode("query", skipToken) + } preparer := autorest.CreatePreparer( autorest.AsPost(), @@ -589,6 +724,43 @@ func (client PolicyStatesClient) ListQueryResultsForResourceResponder(resp *http return } +// listQueryResultsForResourceNextResults retrieves the next set of results, if any. +func (client PolicyStatesClient) listQueryResultsForResourceNextResults(ctx context.Context, lastResults PolicyStatesQueryResults) (result PolicyStatesQueryResults, err error) { + req, err := lastResults.policyStatesQueryResultsPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "listQueryResultsForResourceNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListQueryResultsForResourceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "listQueryResultsForResourceNextResults", resp, "Failure sending next results request") + } + result, err = client.ListQueryResultsForResourceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "listQueryResultsForResourceNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListQueryResultsForResourceComplete enumerates all values, automatically crossing page boundaries as required. +func (client PolicyStatesClient) ListQueryResultsForResourceComplete(ctx context.Context, policyStatesResource PolicyStatesResource, resourceID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, expand string, skipToken string) (result PolicyStatesQueryResultsIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyStatesClient.ListQueryResultsForResource") + 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.ListQueryResultsForResource(ctx, policyStatesResource, resourceID, top, orderBy, selectParameter, from, toParameter, filter, apply, expand, skipToken) + return +} + // ListQueryResultsForResourceGroup queries policy states for the resources under the resource group. // Parameters: // policyStatesResource - the virtual resource under PolicyStates resource type. In a given time range, @@ -606,13 +778,15 @@ func (client PolicyStatesClient) ListQueryResultsForResourceResponder(resp *http // specified, the service uses request time. // filter - oData filter expression. // apply - oData apply expression for aggregations. -func (client PolicyStatesClient) ListQueryResultsForResourceGroup(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, resourceGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result PolicyStatesQueryResults, err error) { +// skipToken - skiptoken is only provided if a previous response returned a partial result as a part of +// nextLink element. +func (client PolicyStatesClient) ListQueryResultsForResourceGroup(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, resourceGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result PolicyStatesQueryResultsPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PolicyStatesClient.ListQueryResultsForResourceGroup") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.psqr.Response.Response != nil { + sc = result.psqr.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -624,7 +798,8 @@ func (client PolicyStatesClient) ListQueryResultsForResourceGroup(ctx context.Co return result, validation.NewError("policyinsights.PolicyStatesClient", "ListQueryResultsForResourceGroup", err.Error()) } - req, err := client.ListQueryResultsForResourceGroupPreparer(ctx, policyStatesResource, subscriptionID, resourceGroupName, top, orderBy, selectParameter, from, toParameter, filter, apply) + result.fn = client.listQueryResultsForResourceGroupNextResults + req, err := client.ListQueryResultsForResourceGroupPreparer(ctx, policyStatesResource, subscriptionID, resourceGroupName, top, orderBy, selectParameter, from, toParameter, filter, apply, skipToken) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForResourceGroup", nil, "Failure preparing request") return @@ -632,12 +807,12 @@ func (client PolicyStatesClient) ListQueryResultsForResourceGroup(ctx context.Co resp, err := client.ListQueryResultsForResourceGroupSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} + result.psqr.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForResourceGroup", resp, "Failure sending request") return } - result, err = client.ListQueryResultsForResourceGroupResponder(resp) + result.psqr, err = client.ListQueryResultsForResourceGroupResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForResourceGroup", resp, "Failure responding to request") } @@ -646,7 +821,7 @@ func (client PolicyStatesClient) ListQueryResultsForResourceGroup(ctx context.Co } // ListQueryResultsForResourceGroupPreparer prepares the ListQueryResultsForResourceGroup request. -func (client PolicyStatesClient) ListQueryResultsForResourceGroupPreparer(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, resourceGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (*http.Request, error) { +func (client PolicyStatesClient) ListQueryResultsForResourceGroupPreparer(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, resourceGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (*http.Request, error) { pathParameters := map[string]interface{}{ "policyStatesResource": autorest.Encode("path", policyStatesResource), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -678,6 +853,9 @@ func (client PolicyStatesClient) ListQueryResultsForResourceGroupPreparer(ctx co if len(apply) > 0 { queryParameters["$apply"] = autorest.Encode("query", apply) } + if len(skipToken) > 0 { + queryParameters["$skiptoken"] = autorest.Encode("query", skipToken) + } preparer := autorest.CreatePreparer( autorest.AsPost(), @@ -706,6 +884,43 @@ func (client PolicyStatesClient) ListQueryResultsForResourceGroupResponder(resp return } +// listQueryResultsForResourceGroupNextResults retrieves the next set of results, if any. +func (client PolicyStatesClient) listQueryResultsForResourceGroupNextResults(ctx context.Context, lastResults PolicyStatesQueryResults) (result PolicyStatesQueryResults, err error) { + req, err := lastResults.policyStatesQueryResultsPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "listQueryResultsForResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListQueryResultsForResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "listQueryResultsForResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListQueryResultsForResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "listQueryResultsForResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListQueryResultsForResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client PolicyStatesClient) ListQueryResultsForResourceGroupComplete(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, resourceGroupName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result PolicyStatesQueryResultsIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyStatesClient.ListQueryResultsForResourceGroup") + 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.ListQueryResultsForResourceGroup(ctx, policyStatesResource, subscriptionID, resourceGroupName, top, orderBy, selectParameter, from, toParameter, filter, apply, skipToken) + return +} + // ListQueryResultsForResourceGroupLevelPolicyAssignment queries policy states for the resource group level policy // assignment. // Parameters: @@ -725,13 +940,15 @@ func (client PolicyStatesClient) ListQueryResultsForResourceGroupResponder(resp // specified, the service uses request time. // filter - oData filter expression. // apply - oData apply expression for aggregations. -func (client PolicyStatesClient) ListQueryResultsForResourceGroupLevelPolicyAssignment(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, resourceGroupName string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result PolicyStatesQueryResults, err error) { +// skipToken - skiptoken is only provided if a previous response returned a partial result as a part of +// nextLink element. +func (client PolicyStatesClient) ListQueryResultsForResourceGroupLevelPolicyAssignment(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, resourceGroupName string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result PolicyStatesQueryResultsPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PolicyStatesClient.ListQueryResultsForResourceGroupLevelPolicyAssignment") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.psqr.Response.Response != nil { + sc = result.psqr.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -743,7 +960,8 @@ func (client PolicyStatesClient) ListQueryResultsForResourceGroupLevelPolicyAssi return result, validation.NewError("policyinsights.PolicyStatesClient", "ListQueryResultsForResourceGroupLevelPolicyAssignment", err.Error()) } - req, err := client.ListQueryResultsForResourceGroupLevelPolicyAssignmentPreparer(ctx, policyStatesResource, subscriptionID, resourceGroupName, policyAssignmentName, top, orderBy, selectParameter, from, toParameter, filter, apply) + result.fn = client.listQueryResultsForResourceGroupLevelPolicyAssignmentNextResults + req, err := client.ListQueryResultsForResourceGroupLevelPolicyAssignmentPreparer(ctx, policyStatesResource, subscriptionID, resourceGroupName, policyAssignmentName, top, orderBy, selectParameter, from, toParameter, filter, apply, skipToken) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForResourceGroupLevelPolicyAssignment", nil, "Failure preparing request") return @@ -751,12 +969,12 @@ func (client PolicyStatesClient) ListQueryResultsForResourceGroupLevelPolicyAssi resp, err := client.ListQueryResultsForResourceGroupLevelPolicyAssignmentSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} + result.psqr.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForResourceGroupLevelPolicyAssignment", resp, "Failure sending request") return } - result, err = client.ListQueryResultsForResourceGroupLevelPolicyAssignmentResponder(resp) + result.psqr, err = client.ListQueryResultsForResourceGroupLevelPolicyAssignmentResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForResourceGroupLevelPolicyAssignment", resp, "Failure responding to request") } @@ -765,7 +983,7 @@ func (client PolicyStatesClient) ListQueryResultsForResourceGroupLevelPolicyAssi } // ListQueryResultsForResourceGroupLevelPolicyAssignmentPreparer prepares the ListQueryResultsForResourceGroupLevelPolicyAssignment request. -func (client PolicyStatesClient) ListQueryResultsForResourceGroupLevelPolicyAssignmentPreparer(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, resourceGroupName string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (*http.Request, error) { +func (client PolicyStatesClient) ListQueryResultsForResourceGroupLevelPolicyAssignmentPreparer(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, resourceGroupName string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (*http.Request, error) { pathParameters := map[string]interface{}{ "authorizationNamespace": autorest.Encode("path", "Microsoft.Authorization"), "policyAssignmentName": autorest.Encode("path", policyAssignmentName), @@ -799,6 +1017,9 @@ func (client PolicyStatesClient) ListQueryResultsForResourceGroupLevelPolicyAssi if len(apply) > 0 { queryParameters["$apply"] = autorest.Encode("query", apply) } + if len(skipToken) > 0 { + queryParameters["$skiptoken"] = autorest.Encode("query", skipToken) + } preparer := autorest.CreatePreparer( autorest.AsPost(), @@ -827,6 +1048,43 @@ func (client PolicyStatesClient) ListQueryResultsForResourceGroupLevelPolicyAssi return } +// listQueryResultsForResourceGroupLevelPolicyAssignmentNextResults retrieves the next set of results, if any. +func (client PolicyStatesClient) listQueryResultsForResourceGroupLevelPolicyAssignmentNextResults(ctx context.Context, lastResults PolicyStatesQueryResults) (result PolicyStatesQueryResults, err error) { + req, err := lastResults.policyStatesQueryResultsPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "listQueryResultsForResourceGroupLevelPolicyAssignmentNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListQueryResultsForResourceGroupLevelPolicyAssignmentSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "listQueryResultsForResourceGroupLevelPolicyAssignmentNextResults", resp, "Failure sending next results request") + } + result, err = client.ListQueryResultsForResourceGroupLevelPolicyAssignmentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "listQueryResultsForResourceGroupLevelPolicyAssignmentNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListQueryResultsForResourceGroupLevelPolicyAssignmentComplete enumerates all values, automatically crossing page boundaries as required. +func (client PolicyStatesClient) ListQueryResultsForResourceGroupLevelPolicyAssignmentComplete(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, resourceGroupName string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result PolicyStatesQueryResultsIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyStatesClient.ListQueryResultsForResourceGroupLevelPolicyAssignment") + 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.ListQueryResultsForResourceGroupLevelPolicyAssignment(ctx, policyStatesResource, subscriptionID, resourceGroupName, policyAssignmentName, top, orderBy, selectParameter, from, toParameter, filter, apply, skipToken) + return +} + // ListQueryResultsForSubscription queries policy states for the resources under the subscription. // Parameters: // policyStatesResource - the virtual resource under PolicyStates resource type. In a given time range, @@ -843,13 +1101,15 @@ func (client PolicyStatesClient) ListQueryResultsForResourceGroupLevelPolicyAssi // specified, the service uses request time. // filter - oData filter expression. // apply - oData apply expression for aggregations. -func (client PolicyStatesClient) ListQueryResultsForSubscription(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result PolicyStatesQueryResults, err error) { +// skipToken - skiptoken is only provided if a previous response returned a partial result as a part of +// nextLink element. +func (client PolicyStatesClient) ListQueryResultsForSubscription(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result PolicyStatesQueryResultsPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PolicyStatesClient.ListQueryResultsForSubscription") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.psqr.Response.Response != nil { + sc = result.psqr.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -861,7 +1121,8 @@ func (client PolicyStatesClient) ListQueryResultsForSubscription(ctx context.Con return result, validation.NewError("policyinsights.PolicyStatesClient", "ListQueryResultsForSubscription", err.Error()) } - req, err := client.ListQueryResultsForSubscriptionPreparer(ctx, policyStatesResource, subscriptionID, top, orderBy, selectParameter, from, toParameter, filter, apply) + result.fn = client.listQueryResultsForSubscriptionNextResults + req, err := client.ListQueryResultsForSubscriptionPreparer(ctx, policyStatesResource, subscriptionID, top, orderBy, selectParameter, from, toParameter, filter, apply, skipToken) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForSubscription", nil, "Failure preparing request") return @@ -869,12 +1130,12 @@ func (client PolicyStatesClient) ListQueryResultsForSubscription(ctx context.Con resp, err := client.ListQueryResultsForSubscriptionSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} + result.psqr.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForSubscription", resp, "Failure sending request") return } - result, err = client.ListQueryResultsForSubscriptionResponder(resp) + result.psqr, err = client.ListQueryResultsForSubscriptionResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForSubscription", resp, "Failure responding to request") } @@ -883,7 +1144,7 @@ func (client PolicyStatesClient) ListQueryResultsForSubscription(ctx context.Con } // ListQueryResultsForSubscriptionPreparer prepares the ListQueryResultsForSubscription request. -func (client PolicyStatesClient) ListQueryResultsForSubscriptionPreparer(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (*http.Request, error) { +func (client PolicyStatesClient) ListQueryResultsForSubscriptionPreparer(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (*http.Request, error) { pathParameters := map[string]interface{}{ "policyStatesResource": autorest.Encode("path", policyStatesResource), "subscriptionId": autorest.Encode("path", subscriptionID), @@ -914,6 +1175,9 @@ func (client PolicyStatesClient) ListQueryResultsForSubscriptionPreparer(ctx con if len(apply) > 0 { queryParameters["$apply"] = autorest.Encode("query", apply) } + if len(skipToken) > 0 { + queryParameters["$skiptoken"] = autorest.Encode("query", skipToken) + } preparer := autorest.CreatePreparer( autorest.AsPost(), @@ -942,6 +1206,43 @@ func (client PolicyStatesClient) ListQueryResultsForSubscriptionResponder(resp * return } +// listQueryResultsForSubscriptionNextResults retrieves the next set of results, if any. +func (client PolicyStatesClient) listQueryResultsForSubscriptionNextResults(ctx context.Context, lastResults PolicyStatesQueryResults) (result PolicyStatesQueryResults, err error) { + req, err := lastResults.policyStatesQueryResultsPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "listQueryResultsForSubscriptionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListQueryResultsForSubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "listQueryResultsForSubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListQueryResultsForSubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "listQueryResultsForSubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListQueryResultsForSubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client PolicyStatesClient) ListQueryResultsForSubscriptionComplete(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result PolicyStatesQueryResultsIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyStatesClient.ListQueryResultsForSubscription") + 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.ListQueryResultsForSubscription(ctx, policyStatesResource, subscriptionID, top, orderBy, selectParameter, from, toParameter, filter, apply, skipToken) + return +} + // ListQueryResultsForSubscriptionLevelPolicyAssignment queries policy states for the subscription level policy // assignment. // Parameters: @@ -960,13 +1261,15 @@ func (client PolicyStatesClient) ListQueryResultsForSubscriptionResponder(resp * // specified, the service uses request time. // filter - oData filter expression. // apply - oData apply expression for aggregations. -func (client PolicyStatesClient) ListQueryResultsForSubscriptionLevelPolicyAssignment(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (result PolicyStatesQueryResults, err error) { +// skipToken - skiptoken is only provided if a previous response returned a partial result as a part of +// nextLink element. +func (client PolicyStatesClient) ListQueryResultsForSubscriptionLevelPolicyAssignment(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result PolicyStatesQueryResultsPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PolicyStatesClient.ListQueryResultsForSubscriptionLevelPolicyAssignment") defer func() { sc := -1 - if result.Response.Response != nil { - sc = result.Response.Response.StatusCode + if result.psqr.Response.Response != nil { + sc = result.psqr.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -978,7 +1281,8 @@ func (client PolicyStatesClient) ListQueryResultsForSubscriptionLevelPolicyAssig return result, validation.NewError("policyinsights.PolicyStatesClient", "ListQueryResultsForSubscriptionLevelPolicyAssignment", err.Error()) } - req, err := client.ListQueryResultsForSubscriptionLevelPolicyAssignmentPreparer(ctx, policyStatesResource, subscriptionID, policyAssignmentName, top, orderBy, selectParameter, from, toParameter, filter, apply) + result.fn = client.listQueryResultsForSubscriptionLevelPolicyAssignmentNextResults + req, err := client.ListQueryResultsForSubscriptionLevelPolicyAssignmentPreparer(ctx, policyStatesResource, subscriptionID, policyAssignmentName, top, orderBy, selectParameter, from, toParameter, filter, apply, skipToken) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForSubscriptionLevelPolicyAssignment", nil, "Failure preparing request") return @@ -986,12 +1290,12 @@ func (client PolicyStatesClient) ListQueryResultsForSubscriptionLevelPolicyAssig resp, err := client.ListQueryResultsForSubscriptionLevelPolicyAssignmentSender(req) if err != nil { - result.Response = autorest.Response{Response: resp} + result.psqr.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForSubscriptionLevelPolicyAssignment", resp, "Failure sending request") return } - result, err = client.ListQueryResultsForSubscriptionLevelPolicyAssignmentResponder(resp) + result.psqr, err = client.ListQueryResultsForSubscriptionLevelPolicyAssignmentResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "ListQueryResultsForSubscriptionLevelPolicyAssignment", resp, "Failure responding to request") } @@ -1000,7 +1304,7 @@ func (client PolicyStatesClient) ListQueryResultsForSubscriptionLevelPolicyAssig } // ListQueryResultsForSubscriptionLevelPolicyAssignmentPreparer prepares the ListQueryResultsForSubscriptionLevelPolicyAssignment request. -func (client PolicyStatesClient) ListQueryResultsForSubscriptionLevelPolicyAssignmentPreparer(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string) (*http.Request, error) { +func (client PolicyStatesClient) ListQueryResultsForSubscriptionLevelPolicyAssignmentPreparer(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (*http.Request, error) { pathParameters := map[string]interface{}{ "authorizationNamespace": autorest.Encode("path", "Microsoft.Authorization"), "policyAssignmentName": autorest.Encode("path", policyAssignmentName), @@ -1033,6 +1337,9 @@ func (client PolicyStatesClient) ListQueryResultsForSubscriptionLevelPolicyAssig if len(apply) > 0 { queryParameters["$apply"] = autorest.Encode("query", apply) } + if len(skipToken) > 0 { + queryParameters["$skiptoken"] = autorest.Encode("query", skipToken) + } preparer := autorest.CreatePreparer( autorest.AsPost(), @@ -1061,6 +1368,43 @@ func (client PolicyStatesClient) ListQueryResultsForSubscriptionLevelPolicyAssig return } +// listQueryResultsForSubscriptionLevelPolicyAssignmentNextResults retrieves the next set of results, if any. +func (client PolicyStatesClient) listQueryResultsForSubscriptionLevelPolicyAssignmentNextResults(ctx context.Context, lastResults PolicyStatesQueryResults) (result PolicyStatesQueryResults, err error) { + req, err := lastResults.policyStatesQueryResultsPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "listQueryResultsForSubscriptionLevelPolicyAssignmentNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListQueryResultsForSubscriptionLevelPolicyAssignmentSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "listQueryResultsForSubscriptionLevelPolicyAssignmentNextResults", resp, "Failure sending next results request") + } + result, err = client.ListQueryResultsForSubscriptionLevelPolicyAssignmentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "policyinsights.PolicyStatesClient", "listQueryResultsForSubscriptionLevelPolicyAssignmentNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListQueryResultsForSubscriptionLevelPolicyAssignmentComplete enumerates all values, automatically crossing page boundaries as required. +func (client PolicyStatesClient) ListQueryResultsForSubscriptionLevelPolicyAssignmentComplete(ctx context.Context, policyStatesResource PolicyStatesResource, subscriptionID string, policyAssignmentName string, top *int32, orderBy string, selectParameter string, from *date.Time, toParameter *date.Time, filter string, apply string, skipToken string) (result PolicyStatesQueryResultsIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PolicyStatesClient.ListQueryResultsForSubscriptionLevelPolicyAssignment") + 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.ListQueryResultsForSubscriptionLevelPolicyAssignment(ctx, policyStatesResource, subscriptionID, policyAssignmentName, top, orderBy, selectParameter, from, toParameter, filter, apply, skipToken) + return +} + // SummarizeForManagementGroup summarizes policy states for the resources under the management group. // Parameters: // managementGroupName - management group name. diff --git a/services/preview/reservations/mgmt/2019-07-19-preview/reservations/models.go b/services/preview/reservations/mgmt/2019-07-19-preview/reservations/models.go index 0d9fb9602e71..720d0c1bfd4d 100644 --- a/services/preview/reservations/mgmt/2019-07-19-preview/reservations/models.go +++ b/services/preview/reservations/mgmt/2019-07-19-preview/reservations/models.go @@ -287,6 +287,12 @@ func PossibleStatusCodeValues() []StatusCode { return []StatusCode{StatusCodeActive, StatusCodeExpired, StatusCodeMerged, StatusCodeNone, StatusCodePaymentInstrumentError, StatusCodePending, StatusCodePurchaseError, StatusCodeSplit, StatusCodeSucceeded} } +// Actions the actions for auto quota increase. +type Actions struct { + // EmailActions - The email actions for auto quota increase. + EmailActions *EmailActions `json:"emailActions,omitempty"` +} + // AppliedReservationList ... type AppliedReservationList struct { Value *[]string `json:"value,omitempty"` @@ -455,9 +461,9 @@ type AutoQuotaIncreaseSettings struct { // Settings - Settings for automatic quota increase. Settings *AqiSettings `json:"settings,omitempty"` // OnFailure - The on failure Actions. - OnFailure *OnFailure `json:"onFailure,omitempty"` + OnFailure *Actions `json:"onFailure,omitempty"` // OnSuccess - The on success Actions. - OnSuccess *OnFailure `json:"onSuccess,omitempty"` + OnSuccess *Actions `json:"onSuccess,omitempty"` // SupportTicketAction - The support ticket action. SupportTicketAction *SupportRequestAction `json:"supportTicketAction,omitempty"` } @@ -600,8 +606,8 @@ type EmailAction struct { // EmailActions the email actions. type EmailActions struct { - // Value - The list of email actions based on the success or failure of automatic quota increase action. - Value *[]EmailAction `json:"value,omitempty"` + // EmailAddresses - The list of email actions. + EmailAddresses *[]EmailAction `json:"emailAddresses,omitempty"` } // Error ... @@ -839,26 +845,6 @@ func (mr *MergeRequest) UnmarshalJSON(body []byte) error { return nil } -// OnFailure the actions for auto quota increase. -type OnFailure struct { - // EmailActions - The email actions for auto quota increase. - EmailActions *OnFailureEmailActions `json:"emailActions,omitempty"` - // PhoneActions - The phone actions for auto quota increase. - PhoneActions *OnFailurePhoneActions `json:"phoneActions,omitempty"` -} - -// OnFailureEmailActions the email actions for auto quota increase. -type OnFailureEmailActions struct { - // Value - The list of email actions. - Value *[]EmailAction `json:"value,omitempty"` -} - -// OnFailurePhoneActions the phone actions for auto quota increase. -type OnFailurePhoneActions struct { - // Value - The list of phone actions. - Value *[]PhoneAction `json:"value,omitempty"` -} - // OperationDisplay ... type OperationDisplay struct { Provider *string `json:"provider,omitempty"` @@ -1534,6 +1520,35 @@ type PurchaseRequestPropertiesReservedResourceProperties struct { InstanceFlexibility InstanceFlexibility `json:"instanceFlexibility,omitempty"` } +// QuotaCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type QuotaCreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *QuotaCreateOrUpdateFuture) Result(client QuotaClient) (so SetObject, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "reservations.QuotaCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("reservations.QuotaCreateOrUpdateFuture") + 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.CreateOrUpdateResponder(so.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "reservations.QuotaCreateOrUpdateFuture", "Result", so.Response.Response, "Failure responding to request") + } + } + return +} + // QuotaLimits quota limits. type QuotaLimits struct { autorest.Response `json:"-"` @@ -1706,35 +1721,6 @@ type QuotaProperties struct { Properties interface{} `json:"properties,omitempty"` } -// QuotaRequestCreateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type QuotaRequestCreateFuture struct { - azure.Future -} - -// Result returns the result of the asynchronous operation. -// If the operation has not completed it will return an error. -func (future *QuotaRequestCreateFuture) Result(client QuotaRequestClient) (so SetObject, err error) { - var done bool - done, err = future.DoneWithContext(context.Background(), client) - if err != nil { - err = autorest.NewErrorWithError(err, "reservations.QuotaRequestCreateFuture", "Result", future.Response(), "Polling failure") - return - } - if !done { - err = azure.NewAsyncOpIncompleteError("reservations.QuotaRequestCreateFuture") - 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.CreateResponder(so.Response.Response) - if err != nil { - err = autorest.NewErrorWithError(err, "reservations.QuotaRequestCreateFuture", "Result", so.Response.Response, "Failure responding to request") - } - } - return -} - // QuotaRequestDetails the details of the quota Request. type QuotaRequestDetails struct { autorest.Response `json:"-"` @@ -2202,30 +2188,29 @@ func (qrsr2 *QuotaRequestSubmitResponse201) UnmarshalJSON(body []byte) error { return nil } -// QuotaRequestUpdateFuture an abstraction for monitoring and retrieving the results of a long-running -// operation. -type QuotaRequestUpdateFuture struct { +// QuotaUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type QuotaUpdateFuture struct { azure.Future } // Result returns the result of the asynchronous operation. // If the operation has not completed it will return an error. -func (future *QuotaRequestUpdateFuture) Result(client QuotaRequestClient) (so SetObject, err error) { +func (future *QuotaUpdateFuture) Result(client QuotaClient) (so SetObject, err error) { var done bool done, err = future.DoneWithContext(context.Background(), client) if err != nil { - err = autorest.NewErrorWithError(err, "reservations.QuotaRequestUpdateFuture", "Result", future.Response(), "Polling failure") + err = autorest.NewErrorWithError(err, "reservations.QuotaUpdateFuture", "Result", future.Response(), "Polling failure") return } if !done { - err = azure.NewAsyncOpIncompleteError("reservations.QuotaRequestUpdateFuture") + err = azure.NewAsyncOpIncompleteError("reservations.QuotaUpdateFuture") 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.UpdateResponder(so.Response.Response) if err != nil { - err = autorest.NewErrorWithError(err, "reservations.QuotaRequestUpdateFuture", "Result", so.Response.Response, "Failure responding to request") + err = autorest.NewErrorWithError(err, "reservations.QuotaUpdateFuture", "Result", so.Response.Response, "Failure responding to request") } } return diff --git a/services/preview/reservations/mgmt/2019-07-19-preview/reservations/quota.go b/services/preview/reservations/mgmt/2019-07-19-preview/reservations/quota.go index de40231e6495..4da701b31a0e 100644 --- a/services/preview/reservations/mgmt/2019-07-19-preview/reservations/quota.go +++ b/services/preview/reservations/mgmt/2019-07-19-preview/reservations/quota.go @@ -41,7 +41,96 @@ func NewQuotaClientWithBaseURI(baseURI string) QuotaClient { return QuotaClient{NewWithBaseURI(baseURI)} } -// ListStatus this API gets the current quota limit and usages for the specific resource for resource provider for the +// CreateOrUpdate submits Quota change request for a resource provider for the specified location for the specific +// resource in the parameter. To use, first make a Get request to get quota information for the specific resource. This +// information consists of information regarding that specific resources. For the specific resource, if it requires an +// update to the quota, update the limit field in the response from the Get request to the new value of quota. Then, +// submit this updated JSON object to this quota request API. This will update the quota to the value specified. The +// location header in the response will be used to track the status of the quota request. Please check the +// provisioningState field in the response. The Patch operation can be used also to update the quota. +// Parameters: +// subscriptionID - azure subscription id. +// providerID - azure resource Provider id. +// location - azure region. +// resourceName - the Resource name for the specific resource provider, such as SKU name for Microsoft.Compute, +// pool for Microsoft.Batch. +// createQuotaRequest - quota requests payload. +func (client QuotaClient) CreateOrUpdate(ctx context.Context, subscriptionID string, providerID string, location string, resourceName string, createQuotaRequest CurrentQuotaLimitBase) (result QuotaCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/QuotaClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CreateOrUpdatePreparer(ctx, subscriptionID, providerID, location, resourceName, createQuotaRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "reservations.QuotaClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "reservations.QuotaClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client QuotaClient) CreateOrUpdatePreparer(ctx context.Context, subscriptionID string, providerID string, location string, resourceName string, createQuotaRequest CurrentQuotaLimitBase) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "providerId": autorest.Encode("path", providerID), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", subscriptionID), + } + + const APIVersion = "2019-07-19-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}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimits/{resourceName}", pathParameters), + autorest.WithJSON(createQuotaRequest), + 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 QuotaClient) CreateOrUpdateSender(req *http.Request) (future QuotaCreateOrUpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client QuotaClient) CreateOrUpdateResponder(resp *http.Response) (result SetObject, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get this API gets the current quota limit and usages for the specific resource for resource provider for the // specified location. This response can be used to submit quotaRequests. // Parameters: // subscriptionID - azure subscription id. @@ -49,9 +138,9 @@ func NewQuotaClientWithBaseURI(baseURI string) QuotaClient { // location - azure region. // resourceName - the Resource name for the specific resource provider, such as SKU name for Microsoft.Compute, // pool for Microsoft.Batch. -func (client QuotaClient) ListStatus(ctx context.Context, subscriptionID string, providerID string, location string, resourceName string) (result CurrentQuotaLimitBase, err error) { +func (client QuotaClient) Get(ctx context.Context, subscriptionID string, providerID string, location string, resourceName string) (result CurrentQuotaLimitBase, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/QuotaClient.ListStatus") + ctx = tracing.StartSpan(ctx, fqdn+"/QuotaClient.Get") defer func() { sc := -1 if result.Response.Response != nil { @@ -60,29 +149,29 @@ func (client QuotaClient) ListStatus(ctx context.Context, subscriptionID string, tracing.EndSpan(ctx, sc, err) }() } - req, err := client.ListStatusPreparer(ctx, subscriptionID, providerID, location, resourceName) + req, err := client.GetPreparer(ctx, subscriptionID, providerID, location, resourceName) if err != nil { - err = autorest.NewErrorWithError(err, "reservations.QuotaClient", "ListStatus", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "reservations.QuotaClient", "Get", nil, "Failure preparing request") return } - resp, err := client.ListStatusSender(req) + resp, err := client.GetSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "reservations.QuotaClient", "ListStatus", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "reservations.QuotaClient", "Get", resp, "Failure sending request") return } - result, err = client.ListStatusResponder(resp) + result, err = client.GetResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "reservations.QuotaClient", "ListStatus", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "reservations.QuotaClient", "Get", resp, "Failure responding to request") } return } -// ListStatusPreparer prepares the ListStatus request. -func (client QuotaClient) ListStatusPreparer(ctx context.Context, subscriptionID string, providerID string, location string, resourceName string) (*http.Request, error) { +// GetPreparer prepares the Get request. +func (client QuotaClient) GetPreparer(ctx context.Context, subscriptionID string, providerID string, location string, resourceName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "location": autorest.Encode("path", location), "providerId": autorest.Encode("path", providerID), @@ -103,15 +192,94 @@ func (client QuotaClient) ListStatusPreparer(ctx context.Context, subscriptionID return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// ListStatusSender sends the ListStatus request. The method will close the +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client QuotaClient) 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 QuotaClient) GetResponder(resp *http.Response) (result CurrentQuotaLimitBase, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List this API gets the current quota limits and usages for the resource provider for the specified location. This +// response can be used to submit quotaRequests. +// Parameters: +// subscriptionID - azure subscription id. +// providerID - azure resource Provider id. +// location - azure region. +func (client QuotaClient) List(ctx context.Context, subscriptionID string, providerID string, location string) (result QuotaLimitsPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/QuotaClient.List") + defer func() { + sc := -1 + if result.ql.Response.Response != nil { + sc = result.ql.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, subscriptionID, providerID, location) + if err != nil { + err = autorest.NewErrorWithError(err, "reservations.QuotaClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.ql.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "reservations.QuotaClient", "List", resp, "Failure sending request") + return + } + + result.ql, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "reservations.QuotaClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client QuotaClient) ListPreparer(ctx context.Context, subscriptionID string, providerID string, location string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "providerId": autorest.Encode("path", providerID), + "subscriptionId": autorest.Encode("path", subscriptionID), + } + + const APIVersion = "2019-07-19-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimits", 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 QuotaClient) ListStatusSender(req *http.Request) (*http.Response, error) { +func (client QuotaClient) ListSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } -// ListStatusResponder handles the response to the ListStatus request. The method always +// ListResponder handles the response to the List request. The method always // closes the http.Response Body. -func (client QuotaClient) ListStatusResponder(resp *http.Response) (result CurrentQuotaLimitBase, err error) { +func (client QuotaClient) ListResponder(resp *http.Response) (result QuotaLimits, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -121,3 +289,129 @@ func (client QuotaClient) ListStatusResponder(resp *http.Response) (result Curre result.Response = autorest.Response{Response: resp} return } + +// listNextResults retrieves the next set of results, if any. +func (client QuotaClient) listNextResults(ctx context.Context, lastResults QuotaLimits) (result QuotaLimits, err error) { + req, err := lastResults.quotaLimitsPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "reservations.QuotaClient", "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, "reservations.QuotaClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "reservations.QuotaClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client QuotaClient) ListComplete(ctx context.Context, subscriptionID string, providerID string, location string) (result QuotaLimitsIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/QuotaClient.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, subscriptionID, providerID, location) + return +} + +// Update submits Quota change request for a resource provider for the specified location for the specific resource in +// the parameter. To use, first make a Get request to get quota information for the specific resource. This information +// consists of information regarding that specific resources. For the specific resource, if it requires an update to +// the quota, update the limit field in the response from the Get request to the new value of quota. Then, submit this +// updated JSON object to this quota request API. This will update the quota to the value specified. The location +// header in the response will be used to track the status of the quota request. Please check the provisioningState +// field in the response. The Put operation can be used also to update the quota. +// Parameters: +// subscriptionID - azure subscription id. +// providerID - azure resource Provider id. +// location - azure region. +// resourceName - the Resource name for the specific resource provider, such as SKU name for Microsoft.Compute, +// pool for Microsoft.Batch. +// createQuotaRequest - quota requests payload. +func (client QuotaClient) Update(ctx context.Context, subscriptionID string, providerID string, location string, resourceName string, createQuotaRequest CurrentQuotaLimitBase) (result QuotaUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/QuotaClient.Update") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, subscriptionID, providerID, location, resourceName, createQuotaRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "reservations.QuotaClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "reservations.QuotaClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client QuotaClient) UpdatePreparer(ctx context.Context, subscriptionID string, providerID string, location string, resourceName string, createQuotaRequest CurrentQuotaLimitBase) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "providerId": autorest.Encode("path", providerID), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", subscriptionID), + } + + const APIVersion = "2019-07-19-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}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimits/{resourceName}", pathParameters), + autorest.WithJSON(createQuotaRequest), + 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 QuotaClient) UpdateSender(req *http.Request) (future QuotaUpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client QuotaClient) UpdateResponder(resp *http.Response) (result SetObject, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/reservations/mgmt/2019-07-19-preview/reservations/quotarequest.go b/services/preview/reservations/mgmt/2019-07-19-preview/reservations/quotarequest.go deleted file mode 100644 index a6da0454070e..000000000000 --- a/services/preview/reservations/mgmt/2019-07-19-preview/reservations/quotarequest.go +++ /dev/null @@ -1,226 +0,0 @@ -package reservations - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// 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" -) - -// QuotaRequestClient is the client for the QuotaRequest methods of the Reservations service. -type QuotaRequestClient struct { - BaseClient -} - -// NewQuotaRequestClient creates an instance of the QuotaRequestClient client. -func NewQuotaRequestClient() QuotaRequestClient { - return NewQuotaRequestClientWithBaseURI(DefaultBaseURI) -} - -// NewQuotaRequestClientWithBaseURI creates an instance of the QuotaRequestClient 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 NewQuotaRequestClientWithBaseURI(baseURI string) QuotaRequestClient { - return QuotaRequestClient{NewWithBaseURI(baseURI)} -} - -// Create submits Quota change request for a resource provider for the specified location for the specific resource in -// the parameter. To use, first make a Get request to get quota information for the specific resource. This information -// consists of information regarding that specific resources. For the specific resource, if it requires an update to -// the quota, update the limit field in the response from the Get request to the new value of quota. Then, submit this -// updated JSON object to this quota request API. This will update the quota to the value specified. The location -// header in the response will be used to track the status of the quota request. Please check the provisioningState -// field in the response. -// Parameters: -// subscriptionID - azure subscription id. -// providerID - azure resource Provider id. -// location - azure region. -// resourceName - the Resource name for the specific resource provider, such as SKU name for Microsoft.Compute, -// pool for Microsoft.Batch. -// createQuotaRequest - quota requests payload. -// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET -// request or it should be * for unconditional update. -func (client QuotaRequestClient) Create(ctx context.Context, subscriptionID string, providerID string, location string, resourceName string, createQuotaRequest CurrentQuotaLimitBase, ifMatch string) (result QuotaRequestCreateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/QuotaRequestClient.Create") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.CreatePreparer(ctx, subscriptionID, providerID, location, resourceName, createQuotaRequest, ifMatch) - if err != nil { - err = autorest.NewErrorWithError(err, "reservations.QuotaRequestClient", "Create", nil, "Failure preparing request") - return - } - - result, err = client.CreateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "reservations.QuotaRequestClient", "Create", result.Response(), "Failure sending request") - return - } - - return -} - -// CreatePreparer prepares the Create request. -func (client QuotaRequestClient) CreatePreparer(ctx context.Context, subscriptionID string, providerID string, location string, resourceName string, createQuotaRequest CurrentQuotaLimitBase, ifMatch string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "providerId": autorest.Encode("path", providerID), - "resourceName": autorest.Encode("path", resourceName), - "subscriptionId": autorest.Encode("path", subscriptionID), - } - - const APIVersion = "2019-07-19-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}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimits/{resourceName}", pathParameters), - autorest.WithJSON(createQuotaRequest), - autorest.WithQueryParameters(queryParameters), - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - 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 QuotaRequestClient) CreateSender(req *http.Request) (future QuotaRequestCreateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - future.Future, err = azure.NewFutureFromResponse(resp) - return -} - -// CreateResponder handles the response to the Create request. The method always -// closes the http.Response Body. -func (client QuotaRequestClient) CreateResponder(resp *http.Response) (result SetObject, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// Update submits Quota change request for a resource provider for the specified location for the specific resource in -// the parameter. To use, first make a Get request to get quota information for the specific resource. This information -// consists of information regarding that specific resources. For the specific resource, if it requires an update to -// the quota, update the limit field in the response from the Get request to the new value of quota. Then, submit this -// updated JSON object to this quota request API. This will update the quota to the value specified. The location -// header in the response will be used to track the status of the quota request. Please check the provisioningState -// field in the response. -// Parameters: -// subscriptionID - azure subscription id. -// providerID - azure resource Provider id. -// location - azure region. -// resourceName - the Resource name for the specific resource provider, such as SKU name for Microsoft.Compute, -// pool for Microsoft.Batch. -// createQuotaRequest - quota requests payload. -// ifMatch - eTag of the Entity. ETag should match the current entity state from the header response of the GET -// request or it should be * for unconditional update. -func (client QuotaRequestClient) Update(ctx context.Context, subscriptionID string, providerID string, location string, resourceName string, createQuotaRequest CurrentQuotaLimitBase, ifMatch string) (result QuotaRequestUpdateFuture, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/QuotaRequestClient.Update") - defer func() { - sc := -1 - if result.Response() != nil { - sc = result.Response().StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - req, err := client.UpdatePreparer(ctx, subscriptionID, providerID, location, resourceName, createQuotaRequest, ifMatch) - if err != nil { - err = autorest.NewErrorWithError(err, "reservations.QuotaRequestClient", "Update", nil, "Failure preparing request") - return - } - - result, err = client.UpdateSender(req) - if err != nil { - err = autorest.NewErrorWithError(err, "reservations.QuotaRequestClient", "Update", result.Response(), "Failure sending request") - return - } - - return -} - -// UpdatePreparer prepares the Update request. -func (client QuotaRequestClient) UpdatePreparer(ctx context.Context, subscriptionID string, providerID string, location string, resourceName string, createQuotaRequest CurrentQuotaLimitBase, ifMatch string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "providerId": autorest.Encode("path", providerID), - "resourceName": autorest.Encode("path", resourceName), - "subscriptionId": autorest.Encode("path", subscriptionID), - } - - const APIVersion = "2019-07-19-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}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimits/{resourceName}", pathParameters), - autorest.WithJSON(createQuotaRequest), - autorest.WithQueryParameters(queryParameters), - autorest.WithHeader("If-Match", autorest.String(ifMatch))) - 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 QuotaRequestClient) UpdateSender(req *http.Request) (future QuotaRequestUpdateFuture, err error) { - var resp *http.Response - resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) - if err != nil { - return - } - future.Future, err = azure.NewFutureFromResponse(resp) - return -} - -// UpdateResponder handles the response to the Update request. The method always -// closes the http.Response Body. -func (client QuotaRequestClient) UpdateResponder(resp *http.Response) (result SetObject, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} diff --git a/services/preview/reservations/mgmt/2019-07-19-preview/reservations/quotarequests.go b/services/preview/reservations/mgmt/2019-07-19-preview/reservations/quotarequeststatus.go similarity index 57% rename from services/preview/reservations/mgmt/2019-07-19-preview/reservations/quotarequests.go rename to services/preview/reservations/mgmt/2019-07-19-preview/reservations/quotarequeststatus.go index e79fb23d4efc..df4a8b62da5d 100644 --- a/services/preview/reservations/mgmt/2019-07-19-preview/reservations/quotarequests.go +++ b/services/preview/reservations/mgmt/2019-07-19-preview/reservations/quotarequeststatus.go @@ -26,32 +26,33 @@ import ( "net/http" ) -// QuotaRequestsClient is the client for the QuotaRequests methods of the Reservations service. -type QuotaRequestsClient struct { +// QuotaRequestStatusClient is the client for the QuotaRequestStatus methods of the Reservations service. +type QuotaRequestStatusClient struct { BaseClient } -// NewQuotaRequestsClient creates an instance of the QuotaRequestsClient client. -func NewQuotaRequestsClient() QuotaRequestsClient { - return NewQuotaRequestsClientWithBaseURI(DefaultBaseURI) +// NewQuotaRequestStatusClient creates an instance of the QuotaRequestStatusClient client. +func NewQuotaRequestStatusClient() QuotaRequestStatusClient { + return NewQuotaRequestStatusClientWithBaseURI(DefaultBaseURI) } -// NewQuotaRequestsClientWithBaseURI creates an instance of the QuotaRequestsClient 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 NewQuotaRequestsClientWithBaseURI(baseURI string) QuotaRequestsClient { - return QuotaRequestsClient{NewWithBaseURI(baseURI)} +// NewQuotaRequestStatusClientWithBaseURI creates an instance of the QuotaRequestStatusClient 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 NewQuotaRequestStatusClientWithBaseURI(baseURI string) QuotaRequestStatusClient { + return QuotaRequestStatusClient{NewWithBaseURI(baseURI)} } -// GetStatus gets the QuotaRequest details and status by the quota request Id for the resources for the resource -// provider at a specific location. The requestId is returned as response to the Put requests for serviceLimits. +// Get gets the QuotaRequest details and status by the quota request Id for the resources for the resource provider at +// a specific location. The requestId is returned as response to the Put requests for serviceLimits. // Parameters: // subscriptionID - azure subscription id. // providerID - azure resource Provider id. // location - azure region. // ID - quota Request id. -func (client QuotaRequestsClient) GetStatus(ctx context.Context, subscriptionID string, providerID string, location string, ID string) (result QuotaRequestDetails, err error) { +func (client QuotaRequestStatusClient) Get(ctx context.Context, subscriptionID string, providerID string, location string, ID string) (result QuotaRequestDetails, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/QuotaRequestsClient.GetStatus") + ctx = tracing.StartSpan(ctx, fqdn+"/QuotaRequestStatusClient.Get") defer func() { sc := -1 if result.Response.Response != nil { @@ -60,29 +61,29 @@ func (client QuotaRequestsClient) GetStatus(ctx context.Context, subscriptionID tracing.EndSpan(ctx, sc, err) }() } - req, err := client.GetStatusPreparer(ctx, subscriptionID, providerID, location, ID) + req, err := client.GetPreparer(ctx, subscriptionID, providerID, location, ID) if err != nil { - err = autorest.NewErrorWithError(err, "reservations.QuotaRequestsClient", "GetStatus", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "reservations.QuotaRequestStatusClient", "Get", nil, "Failure preparing request") return } - resp, err := client.GetStatusSender(req) + resp, err := client.GetSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "reservations.QuotaRequestsClient", "GetStatus", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "reservations.QuotaRequestStatusClient", "Get", resp, "Failure sending request") return } - result, err = client.GetStatusResponder(resp) + result, err = client.GetResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "reservations.QuotaRequestsClient", "GetStatus", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "reservations.QuotaRequestStatusClient", "Get", resp, "Failure responding to request") } return } -// GetStatusPreparer prepares the GetStatus request. -func (client QuotaRequestsClient) GetStatusPreparer(ctx context.Context, subscriptionID string, providerID string, location string, ID string) (*http.Request, error) { +// GetPreparer prepares the Get request. +func (client QuotaRequestStatusClient) GetPreparer(ctx context.Context, subscriptionID string, providerID string, location string, ID string) (*http.Request, error) { pathParameters := map[string]interface{}{ "id": autorest.Encode("path", ID), "location": autorest.Encode("path", location), @@ -103,15 +104,15 @@ func (client QuotaRequestsClient) GetStatusPreparer(ctx context.Context, subscri return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// GetStatusSender sends the GetStatus request. The method will close the +// GetSender sends the Get request. The method will close the // http.Response Body if it receives an error. -func (client QuotaRequestsClient) GetStatusSender(req *http.Request) (*http.Response, error) { +func (client QuotaRequestStatusClient) GetSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } -// GetStatusResponder handles the response to the GetStatus request. The method always +// GetResponder handles the response to the Get request. The method always // closes the http.Response Body. -func (client QuotaRequestsClient) GetStatusResponder(resp *http.Response) (result QuotaRequestDetails, err error) { +func (client QuotaRequestStatusClient) GetResponder(resp *http.Response) (result QuotaRequestDetails, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -122,8 +123,8 @@ func (client QuotaRequestsClient) GetStatusResponder(resp *http.Response) (resul return } -// ListStatus for the specified location and Resource provider gets the current quota requests under the subscription -// over the time period of one year ago from now to one year back. oData filter can be used to select quota requests. +// List for the specified location and Resource provider gets the current quota requests under the subscription over +// the time period of one year ago from now to one year back. oData filter can be used to select quota requests. // Parameters: // subscriptionID - azure subscription id. // providerID - azure resource Provider id. @@ -136,9 +137,9 @@ func (client QuotaRequestsClient) GetStatusResponder(resp *http.Response) (resul // skiptoken - skiptoken is only used if a previous operation returned a partial result. If a previous response // contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that // specifies a starting point to use for subsequent calls -func (client QuotaRequestsClient) ListStatus(ctx context.Context, subscriptionID string, providerID string, location string, filter string, top *int32, skiptoken string) (result QuotaRequestDetailsListPage, err error) { +func (client QuotaRequestStatusClient) List(ctx context.Context, subscriptionID string, providerID string, location string, filter string, top *int32, skiptoken string) (result QuotaRequestDetailsListPage, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/QuotaRequestsClient.ListStatus") + ctx = tracing.StartSpan(ctx, fqdn+"/QuotaRequestStatusClient.List") defer func() { sc := -1 if result.qrdl.Response.Response != nil { @@ -151,33 +152,33 @@ func (client QuotaRequestsClient) ListStatus(ctx context.Context, subscriptionID {TargetValue: top, Constraints: []validation.Constraint{{Target: "top", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "top", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}}}}); err != nil { - return result, validation.NewError("reservations.QuotaRequestsClient", "ListStatus", err.Error()) + return result, validation.NewError("reservations.QuotaRequestStatusClient", "List", err.Error()) } - result.fn = client.listStatusNextResults - req, err := client.ListStatusPreparer(ctx, subscriptionID, providerID, location, filter, top, skiptoken) + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, subscriptionID, providerID, location, filter, top, skiptoken) if err != nil { - err = autorest.NewErrorWithError(err, "reservations.QuotaRequestsClient", "ListStatus", nil, "Failure preparing request") + err = autorest.NewErrorWithError(err, "reservations.QuotaRequestStatusClient", "List", nil, "Failure preparing request") return } - resp, err := client.ListStatusSender(req) + resp, err := client.ListSender(req) if err != nil { result.qrdl.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "reservations.QuotaRequestsClient", "ListStatus", resp, "Failure sending request") + err = autorest.NewErrorWithError(err, "reservations.QuotaRequestStatusClient", "List", resp, "Failure sending request") return } - result.qrdl, err = client.ListStatusResponder(resp) + result.qrdl, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "reservations.QuotaRequestsClient", "ListStatus", resp, "Failure responding to request") + err = autorest.NewErrorWithError(err, "reservations.QuotaRequestStatusClient", "List", resp, "Failure responding to request") } return } -// ListStatusPreparer prepares the ListStatus request. -func (client QuotaRequestsClient) ListStatusPreparer(ctx context.Context, subscriptionID string, providerID string, location string, filter string, top *int32, skiptoken string) (*http.Request, error) { +// ListPreparer prepares the List request. +func (client QuotaRequestStatusClient) ListPreparer(ctx context.Context, subscriptionID string, providerID string, location string, filter string, top *int32, skiptoken string) (*http.Request, error) { pathParameters := map[string]interface{}{ "location": autorest.Encode("path", location), "providerId": autorest.Encode("path", providerID), @@ -206,15 +207,15 @@ func (client QuotaRequestsClient) ListStatusPreparer(ctx context.Context, subscr return preparer.Prepare((&http.Request{}).WithContext(ctx)) } -// ListStatusSender sends the ListStatus request. The method will close the +// ListSender sends the List request. The method will close the // http.Response Body if it receives an error. -func (client QuotaRequestsClient) ListStatusSender(req *http.Request) (*http.Response, error) { +func (client QuotaRequestStatusClient) ListSender(req *http.Request) (*http.Response, error) { return client.Send(req, azure.DoRetryWithRegistration(client.Client)) } -// ListStatusResponder handles the response to the ListStatus request. The method always +// ListResponder handles the response to the List request. The method always // closes the http.Response Body. -func (client QuotaRequestsClient) ListStatusResponder(resp *http.Response) (result QuotaRequestDetailsList, err error) { +func (client QuotaRequestStatusClient) ListResponder(resp *http.Response) (result QuotaRequestDetailsList, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -225,31 +226,31 @@ func (client QuotaRequestsClient) ListStatusResponder(resp *http.Response) (resu return } -// listStatusNextResults retrieves the next set of results, if any. -func (client QuotaRequestsClient) listStatusNextResults(ctx context.Context, lastResults QuotaRequestDetailsList) (result QuotaRequestDetailsList, err error) { +// listNextResults retrieves the next set of results, if any. +func (client QuotaRequestStatusClient) listNextResults(ctx context.Context, lastResults QuotaRequestDetailsList) (result QuotaRequestDetailsList, err error) { req, err := lastResults.quotaRequestDetailsListPreparer(ctx) if err != nil { - return result, autorest.NewErrorWithError(err, "reservations.QuotaRequestsClient", "listStatusNextResults", nil, "Failure preparing next results request") + return result, autorest.NewErrorWithError(err, "reservations.QuotaRequestStatusClient", "listNextResults", nil, "Failure preparing next results request") } if req == nil { return } - resp, err := client.ListStatusSender(req) + resp, err := client.ListSender(req) if err != nil { result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "reservations.QuotaRequestsClient", "listStatusNextResults", resp, "Failure sending next results request") + return result, autorest.NewErrorWithError(err, "reservations.QuotaRequestStatusClient", "listNextResults", resp, "Failure sending next results request") } - result, err = client.ListStatusResponder(resp) + result, err = client.ListResponder(resp) if err != nil { - err = autorest.NewErrorWithError(err, "reservations.QuotaRequestsClient", "listStatusNextResults", resp, "Failure responding to next results request") + err = autorest.NewErrorWithError(err, "reservations.QuotaRequestStatusClient", "listNextResults", resp, "Failure responding to next results request") } return } -// ListStatusComplete enumerates all values, automatically crossing page boundaries as required. -func (client QuotaRequestsClient) ListStatusComplete(ctx context.Context, subscriptionID string, providerID string, location string, filter string, top *int32, skiptoken string) (result QuotaRequestDetailsListIterator, err error) { +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client QuotaRequestStatusClient) ListComplete(ctx context.Context, subscriptionID string, providerID string, location string, filter string, top *int32, skiptoken string) (result QuotaRequestDetailsListIterator, err error) { if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/QuotaRequestsClient.ListStatus") + ctx = tracing.StartSpan(ctx, fqdn+"/QuotaRequestStatusClient.List") defer func() { sc := -1 if result.Response().Response.Response != nil { @@ -258,6 +259,6 @@ func (client QuotaRequestsClient) ListStatusComplete(ctx context.Context, subscr tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListStatus(ctx, subscriptionID, providerID, location, filter, top, skiptoken) + result.page, err = client.List(ctx, subscriptionID, providerID, location, filter, top, skiptoken) return } diff --git a/services/preview/reservations/mgmt/2019-07-19-preview/reservations/quotas.go b/services/preview/reservations/mgmt/2019-07-19-preview/reservations/quotas.go deleted file mode 100644 index bf74a18e5771..000000000000 --- a/services/preview/reservations/mgmt/2019-07-19-preview/reservations/quotas.go +++ /dev/null @@ -1,158 +0,0 @@ -package reservations - -// Copyright (c) Microsoft and contributors. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// -// See the License for the specific language governing permissions and -// limitations under the License. -// -// 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" -) - -// QuotasClient is the client for the Quotas methods of the Reservations service. -type QuotasClient struct { - BaseClient -} - -// NewQuotasClient creates an instance of the QuotasClient client. -func NewQuotasClient() QuotasClient { - return NewQuotasClientWithBaseURI(DefaultBaseURI) -} - -// NewQuotasClientWithBaseURI creates an instance of the QuotasClient 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 NewQuotasClientWithBaseURI(baseURI string) QuotasClient { - return QuotasClient{NewWithBaseURI(baseURI)} -} - -// ListStatus this API gets the current quota limits and usages for the resource provider for the specified location. -// This response can be used to submit quotaRequests. -// Parameters: -// subscriptionID - azure subscription id. -// providerID - azure resource Provider id. -// location - azure region. -func (client QuotasClient) ListStatus(ctx context.Context, subscriptionID string, providerID string, location string) (result QuotaLimitsPage, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/QuotasClient.ListStatus") - defer func() { - sc := -1 - if result.ql.Response.Response != nil { - sc = result.ql.Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - result.fn = client.listStatusNextResults - req, err := client.ListStatusPreparer(ctx, subscriptionID, providerID, location) - if err != nil { - err = autorest.NewErrorWithError(err, "reservations.QuotasClient", "ListStatus", nil, "Failure preparing request") - return - } - - resp, err := client.ListStatusSender(req) - if err != nil { - result.ql.Response = autorest.Response{Response: resp} - err = autorest.NewErrorWithError(err, "reservations.QuotasClient", "ListStatus", resp, "Failure sending request") - return - } - - result.ql, err = client.ListStatusResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "reservations.QuotasClient", "ListStatus", resp, "Failure responding to request") - } - - return -} - -// ListStatusPreparer prepares the ListStatus request. -func (client QuotasClient) ListStatusPreparer(ctx context.Context, subscriptionID string, providerID string, location string) (*http.Request, error) { - pathParameters := map[string]interface{}{ - "location": autorest.Encode("path", location), - "providerId": autorest.Encode("path", providerID), - "subscriptionId": autorest.Encode("path", subscriptionID), - } - - const APIVersion = "2019-07-19-preview" - queryParameters := map[string]interface{}{ - "api-version": APIVersion, - } - - preparer := autorest.CreatePreparer( - autorest.AsGet(), - autorest.WithBaseURL(client.BaseURI), - autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Capacity/resourceProviders/{providerId}/locations/{location}/serviceLimits", pathParameters), - autorest.WithQueryParameters(queryParameters)) - return preparer.Prepare((&http.Request{}).WithContext(ctx)) -} - -// ListStatusSender sends the ListStatus request. The method will close the -// http.Response Body if it receives an error. -func (client QuotasClient) ListStatusSender(req *http.Request) (*http.Response, error) { - return client.Send(req, azure.DoRetryWithRegistration(client.Client)) -} - -// ListStatusResponder handles the response to the ListStatus request. The method always -// closes the http.Response Body. -func (client QuotasClient) ListStatusResponder(resp *http.Response) (result QuotaLimits, err error) { - err = autorest.Respond( - resp, - client.ByInspecting(), - azure.WithErrorUnlessStatusCode(http.StatusOK), - autorest.ByUnmarshallingJSON(&result), - autorest.ByClosing()) - result.Response = autorest.Response{Response: resp} - return -} - -// listStatusNextResults retrieves the next set of results, if any. -func (client QuotasClient) listStatusNextResults(ctx context.Context, lastResults QuotaLimits) (result QuotaLimits, err error) { - req, err := lastResults.quotaLimitsPreparer(ctx) - if err != nil { - return result, autorest.NewErrorWithError(err, "reservations.QuotasClient", "listStatusNextResults", nil, "Failure preparing next results request") - } - if req == nil { - return - } - resp, err := client.ListStatusSender(req) - if err != nil { - result.Response = autorest.Response{Response: resp} - return result, autorest.NewErrorWithError(err, "reservations.QuotasClient", "listStatusNextResults", resp, "Failure sending next results request") - } - result, err = client.ListStatusResponder(resp) - if err != nil { - err = autorest.NewErrorWithError(err, "reservations.QuotasClient", "listStatusNextResults", resp, "Failure responding to next results request") - } - return -} - -// ListStatusComplete enumerates all values, automatically crossing page boundaries as required. -func (client QuotasClient) ListStatusComplete(ctx context.Context, subscriptionID string, providerID string, location string) (result QuotaLimitsIterator, err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/QuotasClient.ListStatus") - 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.ListStatus(ctx, subscriptionID, providerID, location) - return -} diff --git a/services/preview/reservations/mgmt/2019-07-19-preview/reservations/reservationsapi/interfaces.go b/services/preview/reservations/mgmt/2019-07-19-preview/reservations/reservationsapi/interfaces.go index fdd360a3e43c..b24a8e159fec 100644 --- a/services/preview/reservations/mgmt/2019-07-19-preview/reservations/reservationsapi/interfaces.go +++ b/services/preview/reservations/mgmt/2019-07-19-preview/reservations/reservationsapi/interfaces.go @@ -32,35 +32,23 @@ var _ BaseClientAPI = (*reservations.BaseClient)(nil) // QuotaClientAPI contains the set of methods on the QuotaClient type. type QuotaClientAPI interface { - ListStatus(ctx context.Context, subscriptionID string, providerID string, location string, resourceName string) (result reservations.CurrentQuotaLimitBase, err error) + CreateOrUpdate(ctx context.Context, subscriptionID string, providerID string, location string, resourceName string, createQuotaRequest reservations.CurrentQuotaLimitBase) (result reservations.QuotaCreateOrUpdateFuture, err error) + Get(ctx context.Context, subscriptionID string, providerID string, location string, resourceName string) (result reservations.CurrentQuotaLimitBase, err error) + List(ctx context.Context, subscriptionID string, providerID string, location string) (result reservations.QuotaLimitsPage, err error) + ListComplete(ctx context.Context, subscriptionID string, providerID string, location string) (result reservations.QuotaLimitsIterator, err error) + Update(ctx context.Context, subscriptionID string, providerID string, location string, resourceName string, createQuotaRequest reservations.CurrentQuotaLimitBase) (result reservations.QuotaUpdateFuture, err error) } var _ QuotaClientAPI = (*reservations.QuotaClient)(nil) -// QuotaRequestClientAPI contains the set of methods on the QuotaRequestClient type. -type QuotaRequestClientAPI interface { - Create(ctx context.Context, subscriptionID string, providerID string, location string, resourceName string, createQuotaRequest reservations.CurrentQuotaLimitBase, ifMatch string) (result reservations.QuotaRequestCreateFuture, err error) - Update(ctx context.Context, subscriptionID string, providerID string, location string, resourceName string, createQuotaRequest reservations.CurrentQuotaLimitBase, ifMatch string) (result reservations.QuotaRequestUpdateFuture, err error) +// QuotaRequestStatusClientAPI contains the set of methods on the QuotaRequestStatusClient type. +type QuotaRequestStatusClientAPI interface { + Get(ctx context.Context, subscriptionID string, providerID string, location string, ID string) (result reservations.QuotaRequestDetails, err error) + List(ctx context.Context, subscriptionID string, providerID string, location string, filter string, top *int32, skiptoken string) (result reservations.QuotaRequestDetailsListPage, err error) + ListComplete(ctx context.Context, subscriptionID string, providerID string, location string, filter string, top *int32, skiptoken string) (result reservations.QuotaRequestDetailsListIterator, err error) } -var _ QuotaRequestClientAPI = (*reservations.QuotaRequestClient)(nil) - -// QuotasClientAPI contains the set of methods on the QuotasClient type. -type QuotasClientAPI interface { - ListStatus(ctx context.Context, subscriptionID string, providerID string, location string) (result reservations.QuotaLimitsPage, err error) - ListStatusComplete(ctx context.Context, subscriptionID string, providerID string, location string) (result reservations.QuotaLimitsIterator, err error) -} - -var _ QuotasClientAPI = (*reservations.QuotasClient)(nil) - -// QuotaRequestsClientAPI contains the set of methods on the QuotaRequestsClient type. -type QuotaRequestsClientAPI interface { - GetStatus(ctx context.Context, subscriptionID string, providerID string, location string, ID string) (result reservations.QuotaRequestDetails, err error) - ListStatus(ctx context.Context, subscriptionID string, providerID string, location string, filter string, top *int32, skiptoken string) (result reservations.QuotaRequestDetailsListPage, err error) - ListStatusComplete(ctx context.Context, subscriptionID string, providerID string, location string, filter string, top *int32, skiptoken string) (result reservations.QuotaRequestDetailsListIterator, err error) -} - -var _ QuotaRequestsClientAPI = (*reservations.QuotaRequestsClient)(nil) +var _ QuotaRequestStatusClientAPI = (*reservations.QuotaRequestStatusClient)(nil) // AutoQuotaIncreaseClientAPI contains the set of methods on the AutoQuotaIncreaseClient type. type AutoQuotaIncreaseClientAPI interface { diff --git a/services/preview/security/mgmt/v1.0/security/alertssuppressionrules.go b/services/preview/security/mgmt/v1.0/security/alertssuppressionrules.go new file mode 100644 index 000000000000..4a2a2f0d4462 --- /dev/null +++ b/services/preview/security/mgmt/v1.0/security/alertssuppressionrules.go @@ -0,0 +1,413 @@ +package security + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// AlertsSuppressionRulesClient is the API spec for Microsoft.Security (Azure Security Center) resource provider +type AlertsSuppressionRulesClient struct { + BaseClient +} + +// NewAlertsSuppressionRulesClient creates an instance of the AlertsSuppressionRulesClient client. +func NewAlertsSuppressionRulesClient(subscriptionID string, ascLocation string) AlertsSuppressionRulesClient { + return NewAlertsSuppressionRulesClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +} + +// NewAlertsSuppressionRulesClientWithBaseURI creates an instance of the AlertsSuppressionRulesClient 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 NewAlertsSuppressionRulesClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) AlertsSuppressionRulesClient { + return AlertsSuppressionRulesClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +} + +// Delete delete dismiss alert rule for this subscription. +// Parameters: +// alertsSuppressionRuleName - the unique name of the suppression alert rule +func (client AlertsSuppressionRulesClient) Delete(ctx context.Context, alertsSuppressionRuleName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AlertsSuppressionRulesClient.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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.AlertsSuppressionRulesClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, alertsSuppressionRuleName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AlertsSuppressionRulesClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "security.AlertsSuppressionRulesClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AlertsSuppressionRulesClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client AlertsSuppressionRulesClient) DeletePreparer(ctx context.Context, alertsSuppressionRuleName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "alertsSuppressionRuleName": autorest.Encode("path", alertsSuppressionRuleName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules/{alertsSuppressionRuleName}", 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 AlertsSuppressionRulesClient) 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 AlertsSuppressionRulesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription +// Parameters: +// alertsSuppressionRuleName - the unique name of the suppression alert rule +func (client AlertsSuppressionRulesClient) Get(ctx context.Context, alertsSuppressionRuleName string) (result AlertsSuppressionRule, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AlertsSuppressionRulesClient.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.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.AlertsSuppressionRulesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, alertsSuppressionRuleName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AlertsSuppressionRulesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.AlertsSuppressionRulesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AlertsSuppressionRulesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client AlertsSuppressionRulesClient) GetPreparer(ctx context.Context, alertsSuppressionRuleName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "alertsSuppressionRuleName": autorest.Encode("path", alertsSuppressionRuleName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules/{alertsSuppressionRuleName}", 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 AlertsSuppressionRulesClient) 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 AlertsSuppressionRulesClient) GetResponder(resp *http.Response) (result AlertsSuppressionRule, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List list of all the dismiss rules for the given subscription +// Parameters: +// alertType - type of the alert to get rules for +func (client AlertsSuppressionRulesClient) List(ctx context.Context, alertType string) (result AlertsSuppressionRulesListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AlertsSuppressionRulesClient.List") + defer func() { + sc := -1 + if result.asrl.Response.Response != nil { + sc = result.asrl.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.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.AlertsSuppressionRulesClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, alertType) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AlertsSuppressionRulesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.asrl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.AlertsSuppressionRulesClient", "List", resp, "Failure sending request") + return + } + + result.asrl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AlertsSuppressionRulesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client AlertsSuppressionRulesClient) ListPreparer(ctx context.Context, alertType string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(alertType) > 0 { + queryParameters["AlertType"] = autorest.Encode("query", alertType) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules", 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 AlertsSuppressionRulesClient) 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 AlertsSuppressionRulesClient) ListResponder(resp *http.Response) (result AlertsSuppressionRulesList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 AlertsSuppressionRulesClient) listNextResults(ctx context.Context, lastResults AlertsSuppressionRulesList) (result AlertsSuppressionRulesList, err error) { + req, err := lastResults.alertsSuppressionRulesListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.AlertsSuppressionRulesClient", "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, "security.AlertsSuppressionRulesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AlertsSuppressionRulesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client AlertsSuppressionRulesClient) ListComplete(ctx context.Context, alertType string) (result AlertsSuppressionRulesListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AlertsSuppressionRulesClient.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, alertType) + return +} + +// Update update existing rule or create new rule if it doesn't exist +// Parameters: +// alertsSuppressionRuleName - the unique name of the suppression alert rule +// alertsSuppressionRule - suppression rule object +func (client AlertsSuppressionRulesClient) Update(ctx context.Context, alertsSuppressionRuleName string, alertsSuppressionRule AlertsSuppressionRule) (result AlertsSuppressionRule, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AlertsSuppressionRulesClient.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.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}, + {TargetValue: alertsSuppressionRule, + Constraints: []validation.Constraint{{Target: "alertsSuppressionRule.AlertsSuppressionRuleProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "alertsSuppressionRule.AlertsSuppressionRuleProperties.AlertType", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "alertsSuppressionRule.AlertsSuppressionRuleProperties.Reason", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "alertsSuppressionRule.AlertsSuppressionRuleProperties.SuppressionAlertsScope", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "alertsSuppressionRule.AlertsSuppressionRuleProperties.SuppressionAlertsScope.AllOf", Name: validation.Null, Rule: true, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("security.AlertsSuppressionRulesClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, alertsSuppressionRuleName, alertsSuppressionRule) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AlertsSuppressionRulesClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.AlertsSuppressionRulesClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AlertsSuppressionRulesClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client AlertsSuppressionRulesClient) UpdatePreparer(ctx context.Context, alertsSuppressionRuleName string, alertsSuppressionRule AlertsSuppressionRule) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "alertsSuppressionRuleName": autorest.Encode("path", alertsSuppressionRuleName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-01-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}/providers/Microsoft.Security/alertsSuppressionRules/{alertsSuppressionRuleName}", pathParameters), + autorest.WithJSON(alertsSuppressionRule), + 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 AlertsSuppressionRulesClient) 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 AlertsSuppressionRulesClient) UpdateResponder(resp *http.Response) (result AlertsSuppressionRule, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/security/mgmt/v1.0/security/models.go b/services/preview/security/mgmt/v1.0/security/models.go index 3b1da6e16ad7..a1836ea84e9e 100644 --- a/services/preview/security/mgmt/v1.0/security/models.go +++ b/services/preview/security/mgmt/v1.0/security/models.go @@ -227,6 +227,21 @@ func PossibleConnectionTypeValues() []ConnectionType { return []ConnectionType{External, Internal} } +// ControlType enumerates the values for control type. +type ControlType string + +const ( + // BuiltIn Azure Security Center managed assessments + BuiltIn ControlType = "BuiltIn" + // Custom Non Azure Security Center managed assessments + Custom ControlType = "Custom" +) + +// PossibleControlTypeValues returns an array of possible values for the ControlType const type. +func PossibleControlTypeValues() []ControlType { + return []ControlType{BuiltIn, Custom} +} + // Direction enumerates the values for direction. type Direction string @@ -342,6 +357,19 @@ func PossibleExecutableValues() []Executable { return []Executable{ExecutableAudit, ExecutableEnforce, ExecutableNone} } +// ExpandControlsEnum enumerates the values for expand controls enum. +type ExpandControlsEnum string + +const ( + // Definition Add definition object for each control + Definition ExpandControlsEnum = "definition" +) + +// PossibleExpandControlsEnumValues returns an array of possible values for the ExpandControlsEnum const type. +func PossibleExpandControlsEnumValues() []ExpandControlsEnum { + return []ExpandControlsEnum{Definition} +} + // ExternalSecuritySolutionKind enumerates the values for external security solution kind. type ExternalSecuritySolutionKind string @@ -633,6 +661,23 @@ func PossibleReportedSeverityValues() []ReportedSeverity { return []ReportedSeverity{High, Information, Low, Silent} } +// RuleState enumerates the values for rule state. +type RuleState string + +const ( + // Disabled ... + Disabled RuleState = "Disabled" + // Enabled ... + Enabled RuleState = "Enabled" + // Expired ... + Expired RuleState = "Expired" +) + +// PossibleRuleStateValues returns an array of possible values for the RuleState const type. +func PossibleRuleStateValues() []RuleState { + return []RuleState{Disabled, Enabled, Expired} +} + // Script enumerates the values for script. type Script string @@ -759,17 +804,17 @@ func PossibleStatusValues() []Status { type StatusReason string const ( - // Expired ... - Expired StatusReason = "Expired" - // NewerRequestInitiated ... - NewerRequestInitiated StatusReason = "NewerRequestInitiated" - // UserRequested ... - UserRequested StatusReason = "UserRequested" + // StatusReasonExpired ... + StatusReasonExpired StatusReason = "Expired" + // StatusReasonNewerRequestInitiated ... + StatusReasonNewerRequestInitiated StatusReason = "NewerRequestInitiated" + // StatusReasonUserRequested ... + StatusReasonUserRequested StatusReason = "UserRequested" ) // PossibleStatusReasonValues returns an array of possible values for the StatusReason const type. func PossibleStatusReasonValues() []StatusReason { - return []StatusReason{Expired, NewerRequestInitiated, UserRequested} + return []StatusReason{StatusReasonExpired, StatusReasonNewerRequestInitiated, StatusReasonUserRequested} } // SubAssessmentStatusCode enumerates the values for sub assessment status code. @@ -1687,6 +1732,242 @@ func (ap AlertProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AlertsSuppressionRule describes the suppression rule +type AlertsSuppressionRule struct { + autorest.Response `json:"-"` + *AlertsSuppressionRuleProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AlertsSuppressionRule. +func (asr AlertsSuppressionRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if asr.AlertsSuppressionRuleProperties != nil { + objectMap["properties"] = asr.AlertsSuppressionRuleProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AlertsSuppressionRule struct. +func (asr *AlertsSuppressionRule) 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 alertsSuppressionRuleProperties AlertsSuppressionRuleProperties + err = json.Unmarshal(*v, &alertsSuppressionRuleProperties) + if err != nil { + return err + } + asr.AlertsSuppressionRuleProperties = &alertsSuppressionRuleProperties + } + 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 "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + asr.Type = &typeVar + } + } + } + + return nil +} + +// AlertsSuppressionRuleProperties describes AlertsSuppressionRule properties +type AlertsSuppressionRuleProperties struct { + // AlertType - Type of the alert to automatically suppress. For all alert types, use '*' + AlertType *string `json:"alertType,omitempty"` + // LastModifiedUtc - READ-ONLY; The last time this rule was modified + LastModifiedUtc *date.Time `json:"lastModifiedUtc,omitempty"` + // ExpirationDateUtc - Expiration date of the rule, if value is not provided or provided as null this field will default to the maximum allowed expiration date. + ExpirationDateUtc *date.Time `json:"expirationDateUtc,omitempty"` + // Reason - The reason for dismissing the alert + Reason *string `json:"reason,omitempty"` + // State - Possible states of the rule. Possible values include: 'Enabled', 'Disabled', 'Expired' + State RuleState `json:"state,omitempty"` + // Comment - Any comment regarding the rule + Comment *string `json:"comment,omitempty"` + // SuppressionAlertsScope - The suppression conditions + SuppressionAlertsScope *SuppressionAlertsScope `json:"suppressionAlertsScope,omitempty"` +} + +// AlertsSuppressionRulesList suppression rules list for subscription. +type AlertsSuppressionRulesList struct { + autorest.Response `json:"-"` + Value *[]AlertsSuppressionRule `json:"value,omitempty"` + // NextLink - READ-ONLY; URI to fetch the next page. + NextLink *string `json:"nextLink,omitempty"` +} + +// AlertsSuppressionRulesListIterator provides access to a complete listing of AlertsSuppressionRule +// values. +type AlertsSuppressionRulesListIterator struct { + i int + page AlertsSuppressionRulesListPage +} + +// 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 *AlertsSuppressionRulesListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AlertsSuppressionRulesListIterator.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 *AlertsSuppressionRulesListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter AlertsSuppressionRulesListIterator) 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 AlertsSuppressionRulesListIterator) Response() AlertsSuppressionRulesList { + 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 AlertsSuppressionRulesListIterator) Value() AlertsSuppressionRule { + if !iter.page.NotDone() { + return AlertsSuppressionRule{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the AlertsSuppressionRulesListIterator type. +func NewAlertsSuppressionRulesListIterator(page AlertsSuppressionRulesListPage) AlertsSuppressionRulesListIterator { + return AlertsSuppressionRulesListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (asrl AlertsSuppressionRulesList) IsEmpty() bool { + return asrl.Value == nil || len(*asrl.Value) == 0 +} + +// alertsSuppressionRulesListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (asrl AlertsSuppressionRulesList) alertsSuppressionRulesListPreparer(ctx context.Context) (*http.Request, error) { + if asrl.NextLink == nil || len(to.String(asrl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(asrl.NextLink))) +} + +// AlertsSuppressionRulesListPage contains a page of AlertsSuppressionRule values. +type AlertsSuppressionRulesListPage struct { + fn func(context.Context, AlertsSuppressionRulesList) (AlertsSuppressionRulesList, error) + asrl AlertsSuppressionRulesList +} + +// 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 *AlertsSuppressionRulesListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AlertsSuppressionRulesListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.asrl) + if err != nil { + return err + } + page.asrl = next + 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 *AlertsSuppressionRulesListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page AlertsSuppressionRulesListPage) NotDone() bool { + return !page.asrl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page AlertsSuppressionRulesListPage) Response() AlertsSuppressionRulesList { + return page.asrl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page AlertsSuppressionRulesListPage) Values() []AlertsSuppressionRule { + if page.asrl.IsEmpty() { + return nil + } + return *page.asrl.Value +} + +// Creates a new instance of the AlertsSuppressionRulesListPage type. +func NewAlertsSuppressionRulesListPage(getNextPage func(context.Context, AlertsSuppressionRulesList) (AlertsSuppressionRulesList, error)) AlertsSuppressionRulesListPage { + return AlertsSuppressionRulesListPage{fn: getNextPage} +} + // AllowedConnectionsList list of all possible traffic between Azure resources type AllowedConnectionsList struct { autorest.Response `json:"-"` @@ -3280,6 +3561,12 @@ func (ard AzureResourceDetails) AsBasicResourceDetails() (BasicResourceDetails, return &ard, true } +// AzureResourceLink describes an Azure resource with kind +type AzureResourceLink struct { + // ID - READ-ONLY; Azure resource Id + ID *string `json:"id,omitempty"` +} + // CefExternalSecuritySolution represents a security solution which sends CEF logs to an OMS workspace type CefExternalSecuritySolution struct { Properties *CefSolutionProperties `json:"properties,omitempty"` @@ -5659,7 +5946,7 @@ type JitNetworkAccessRequestPort struct { EndTimeUtc *date.Time `json:"endTimeUtc,omitempty"` // Status - The status of the port. Possible values include: 'Revoked', 'Initiated' Status Status `json:"status,omitempty"` - // StatusReason - A description of why the `status` has its value. Possible values include: 'Expired', 'UserRequested', 'NewerRequestInitiated' + // StatusReason - A description of why the `status` has its value. Possible values include: 'StatusReasonExpired', 'StatusReasonUserRequested', 'StatusReasonNewerRequestInitiated' StatusReason StatusReason `json:"statusReason,omitempty"` // MappedPort - The port which is mapped to this port's `number` in the Azure Firewall, if applicable MappedPort *int32 `json:"mappedPort,omitempty"` @@ -7006,53 +7293,941 @@ type Rule struct { IPAddresses *[]string `json:"ipAddresses,omitempty"` } -// SensitivityLabel the sensitivity label. -type SensitivityLabel struct { - // DisplayName - The name of the sensitivity label. - DisplayName *string `json:"displayName,omitempty"` - // Description - The description of the sensitivity label. - Description *string `json:"description,omitempty"` - // Rank - The rank of the sensitivity label. Possible values include: 'RankNone', 'RankLow', 'RankMedium', 'RankHigh', 'RankCritical' - Rank Rank `json:"rank,omitempty"` - // Order - The order of the sensitivity label. - Order *int32 `json:"order,omitempty"` - // Enabled - Indicates whether the label is enabled or not. - Enabled *bool `json:"enabled,omitempty"` -} - -// ServerVulnerabilityProperties additional context fields for server vulnerability assessment -type ServerVulnerabilityProperties struct { - // Type - READ-ONLY; Vulnerability Type. e.g: Vulnerability, Potential Vulnerability, Information Gathered - Type *string `json:"type,omitempty"` - // Cvss - READ-ONLY; Dictionary from cvss version to cvss details object - Cvss map[string]*CVSS `json:"cvss"` - // Patchable - READ-ONLY; Indicates whether a patch is available or not - Patchable *bool `json:"patchable,omitempty"` - // Cve - READ-ONLY; List of CVEs - Cve *[]CVE `json:"cve,omitempty"` - // Threat - READ-ONLY; Threat name - Threat *string `json:"threat,omitempty"` - // PublishedTime - READ-ONLY; Published time - PublishedTime *date.Time `json:"publishedTime,omitempty"` - // VendorReferences - READ-ONLY - VendorReferences *[]VendorReference `json:"vendorReferences,omitempty"` - // AssessedResourceType - Possible values include: 'AssessedResourceTypeAdditionalData', 'AssessedResourceTypeSQLServerVulnerability', 'AssessedResourceTypeContainerRegistryVulnerability', 'AssessedResourceTypeServerVulnerabilityAssessment' - AssessedResourceType AssessedResourceType `json:"assessedResourceType,omitempty"` +// ScopeElement a more specific scope used to identify the alerts to suppress. +type ScopeElement struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Field - The alert entity type to suppress by. + Field *string `json:"field,omitempty"` } -// MarshalJSON is the custom marshaler for ServerVulnerabilityProperties. -func (svp ServerVulnerabilityProperties) MarshalJSON() ([]byte, error) { - svp.AssessedResourceType = AssessedResourceTypeServerVulnerabilityAssessment +// MarshalJSON is the custom marshaler for ScopeElement. +func (se ScopeElement) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if svp.AssessedResourceType != "" { - objectMap["assessedResourceType"] = svp.AssessedResourceType + if se.Field != nil { + objectMap["field"] = se.Field + } + for k, v := range se.AdditionalProperties { + objectMap[k] = v } return json.Marshal(objectMap) } -// AsSQLServerVulnerabilityProperties is the BasicAdditionalData implementation for ServerVulnerabilityProperties. -func (svp ServerVulnerabilityProperties) AsSQLServerVulnerabilityProperties() (*SQLServerVulnerabilityProperties, bool) { - return nil, false +// UnmarshalJSON is the custom unmarshaler for ScopeElement struct. +func (se *ScopeElement) 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 { + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if se.AdditionalProperties == nil { + se.AdditionalProperties = make(map[string]interface{}) + } + se.AdditionalProperties[k] = additionalProperties + } + case "field": + if v != nil { + var field string + err = json.Unmarshal(*v, &field) + if err != nil { + return err + } + se.Field = &field + } + } + } + + return nil +} + +// ScoreDetails calculation result data +type ScoreDetails struct { + // Max - READ-ONLY; Maximum score available + Max *int32 `json:"max,omitempty"` + // Current - READ-ONLY; Current score + Current *float64 `json:"current,omitempty"` +} + +// SecureScoreControlDefinitionItem information about the security control. +type SecureScoreControlDefinitionItem struct { + *SecureScoreControlDefinitionItemProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SecureScoreControlDefinitionItem. +func (sscdi SecureScoreControlDefinitionItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sscdi.SecureScoreControlDefinitionItemProperties != nil { + objectMap["properties"] = sscdi.SecureScoreControlDefinitionItemProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SecureScoreControlDefinitionItem struct. +func (sscdi *SecureScoreControlDefinitionItem) 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 secureScoreControlDefinitionItemProperties SecureScoreControlDefinitionItemProperties + err = json.Unmarshal(*v, &secureScoreControlDefinitionItemProperties) + if err != nil { + return err + } + sscdi.SecureScoreControlDefinitionItemProperties = &secureScoreControlDefinitionItemProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sscdi.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sscdi.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sscdi.Type = &typeVar + } + } + } + + return nil +} + +// SecureScoreControlDefinitionItemProperties security Control Definition Properties. +type SecureScoreControlDefinitionItemProperties struct { + // DisplayName - READ-ONLY; User friendly display name of the control + DisplayName *string `json:"displayName,omitempty"` + // Description - READ-ONLY; User friendly description of the control + Description *string `json:"description,omitempty"` + // MaxScore - READ-ONLY; Maximum control score (0..10) + MaxScore *int32 `json:"maxScore,omitempty"` + // Source - READ-ONLY; Source object from which the control was created + Source *SecureScoreControlDefinitionSource `json:"source,omitempty"` + // AssessmentDefinitions - READ-ONLY; Array of assessments metadata IDs that are included in this security control + AssessmentDefinitions *[]AzureResourceLink `json:"assessmentDefinitions,omitempty"` +} + +// SecureScoreControlDefinitionList list of security controls definition +type SecureScoreControlDefinitionList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; Collection of security controls definition in this page + Value *[]SecureScoreControlDefinitionItem `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page. + NextLink *string `json:"nextLink,omitempty"` +} + +// SecureScoreControlDefinitionListIterator provides access to a complete listing of +// SecureScoreControlDefinitionItem values. +type SecureScoreControlDefinitionListIterator struct { + i int + page SecureScoreControlDefinitionListPage +} + +// 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 *SecureScoreControlDefinitionListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoreControlDefinitionListIterator.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 *SecureScoreControlDefinitionListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SecureScoreControlDefinitionListIterator) 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 SecureScoreControlDefinitionListIterator) Response() SecureScoreControlDefinitionList { + 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 SecureScoreControlDefinitionListIterator) Value() SecureScoreControlDefinitionItem { + if !iter.page.NotDone() { + return SecureScoreControlDefinitionItem{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the SecureScoreControlDefinitionListIterator type. +func NewSecureScoreControlDefinitionListIterator(page SecureScoreControlDefinitionListPage) SecureScoreControlDefinitionListIterator { + return SecureScoreControlDefinitionListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (sscdl SecureScoreControlDefinitionList) IsEmpty() bool { + return sscdl.Value == nil || len(*sscdl.Value) == 0 +} + +// secureScoreControlDefinitionListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (sscdl SecureScoreControlDefinitionList) secureScoreControlDefinitionListPreparer(ctx context.Context) (*http.Request, error) { + if sscdl.NextLink == nil || len(to.String(sscdl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(sscdl.NextLink))) +} + +// SecureScoreControlDefinitionListPage contains a page of SecureScoreControlDefinitionItem values. +type SecureScoreControlDefinitionListPage struct { + fn func(context.Context, SecureScoreControlDefinitionList) (SecureScoreControlDefinitionList, error) + sscdl SecureScoreControlDefinitionList +} + +// 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 *SecureScoreControlDefinitionListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoreControlDefinitionListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.sscdl) + if err != nil { + return err + } + page.sscdl = next + 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 *SecureScoreControlDefinitionListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SecureScoreControlDefinitionListPage) NotDone() bool { + return !page.sscdl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SecureScoreControlDefinitionListPage) Response() SecureScoreControlDefinitionList { + return page.sscdl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SecureScoreControlDefinitionListPage) Values() []SecureScoreControlDefinitionItem { + if page.sscdl.IsEmpty() { + return nil + } + return *page.sscdl.Value +} + +// Creates a new instance of the SecureScoreControlDefinitionListPage type. +func NewSecureScoreControlDefinitionListPage(getNextPage func(context.Context, SecureScoreControlDefinitionList) (SecureScoreControlDefinitionList, error)) SecureScoreControlDefinitionListPage { + return SecureScoreControlDefinitionListPage{fn: getNextPage} +} + +// SecureScoreControlDefinitionSource the type of the security control (For example, BuiltIn) +type SecureScoreControlDefinitionSource struct { + // SourceType - The type of security control (for example, BuiltIn). Possible values include: 'BuiltIn', 'Custom' + SourceType ControlType `json:"sourceType,omitempty"` +} + +// SecureScoreControlDetails details of the security control, its score, and the health status of the +// relevant resources. +type SecureScoreControlDetails struct { + *SecureScoreControlScoreDetails `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SecureScoreControlDetails. +func (sscd SecureScoreControlDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sscd.SecureScoreControlScoreDetails != nil { + objectMap["properties"] = sscd.SecureScoreControlScoreDetails + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SecureScoreControlDetails struct. +func (sscd *SecureScoreControlDetails) 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 secureScoreControlScoreDetails SecureScoreControlScoreDetails + err = json.Unmarshal(*v, &secureScoreControlScoreDetails) + if err != nil { + return err + } + sscd.SecureScoreControlScoreDetails = &secureScoreControlScoreDetails + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sscd.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sscd.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sscd.Type = &typeVar + } + } + } + + return nil +} + +// SecureScoreControlList list of security controls +type SecureScoreControlList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; Collection of security controls in this page + Value *[]SecureScoreControlDetails `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page. + NextLink *string `json:"nextLink,omitempty"` +} + +// SecureScoreControlListIterator provides access to a complete listing of SecureScoreControlDetails +// values. +type SecureScoreControlListIterator struct { + i int + page SecureScoreControlListPage +} + +// 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 *SecureScoreControlListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoreControlListIterator.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 *SecureScoreControlListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SecureScoreControlListIterator) 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 SecureScoreControlListIterator) Response() SecureScoreControlList { + 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 SecureScoreControlListIterator) Value() SecureScoreControlDetails { + if !iter.page.NotDone() { + return SecureScoreControlDetails{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the SecureScoreControlListIterator type. +func NewSecureScoreControlListIterator(page SecureScoreControlListPage) SecureScoreControlListIterator { + return SecureScoreControlListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (sscl SecureScoreControlList) IsEmpty() bool { + return sscl.Value == nil || len(*sscl.Value) == 0 +} + +// secureScoreControlListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (sscl SecureScoreControlList) secureScoreControlListPreparer(ctx context.Context) (*http.Request, error) { + if sscl.NextLink == nil || len(to.String(sscl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(sscl.NextLink))) +} + +// SecureScoreControlListPage contains a page of SecureScoreControlDetails values. +type SecureScoreControlListPage struct { + fn func(context.Context, SecureScoreControlList) (SecureScoreControlList, error) + sscl SecureScoreControlList +} + +// 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 *SecureScoreControlListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoreControlListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.sscl) + if err != nil { + return err + } + page.sscl = next + 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 *SecureScoreControlListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SecureScoreControlListPage) NotDone() bool { + return !page.sscl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SecureScoreControlListPage) Response() SecureScoreControlList { + return page.sscl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SecureScoreControlListPage) Values() []SecureScoreControlDetails { + if page.sscl.IsEmpty() { + return nil + } + return *page.sscl.Value +} + +// Creates a new instance of the SecureScoreControlListPage type. +func NewSecureScoreControlListPage(getNextPage func(context.Context, SecureScoreControlList) (SecureScoreControlList, error)) SecureScoreControlListPage { + return SecureScoreControlListPage{fn: getNextPage} +} + +// SecureScoreControlScore calculation result data +type SecureScoreControlScore struct { + // Max - READ-ONLY; Maximum control score (0..10) + Max *int32 `json:"max,omitempty"` + // Current - READ-ONLY; Actual score for the control = (achieved points / total points) * max score. if total points is zeroed, the return number is 0.00 + Current *float64 `json:"current,omitempty"` +} + +// SecureScoreControlScoreDetails calculation result data in control level +type SecureScoreControlScoreDetails struct { + // DisplayName - READ-ONLY; User friendly display name of the control + DisplayName *string `json:"displayName,omitempty"` + // ScoreDetails - Actual score object for the control + *ScoreDetails `json:"score,omitempty"` + // HealthyResourceCount - READ-ONLY; Number of healthy resources in the control + HealthyResourceCount *int32 `json:"healthyResourceCount,omitempty"` + // UnhealthyResourceCount - READ-ONLY; Number of unhealthy resources in the control + UnhealthyResourceCount *int32 `json:"unhealthyResourceCount,omitempty"` + // NotApplicableResourceCount - READ-ONLY; Number of not applicable resources in the control + NotApplicableResourceCount *int32 `json:"notApplicableResourceCount,omitempty"` + Definition *SecureScoreControlDefinitionItem `json:"definition,omitempty"` +} + +// MarshalJSON is the custom marshaler for SecureScoreControlScoreDetails. +func (sscsd SecureScoreControlScoreDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sscsd.ScoreDetails != nil { + objectMap["score"] = sscsd.ScoreDetails + } + if sscsd.Definition != nil { + objectMap["definition"] = sscsd.Definition + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SecureScoreControlScoreDetails struct. +func (sscsd *SecureScoreControlScoreDetails) 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 "displayName": + if v != nil { + var displayName string + err = json.Unmarshal(*v, &displayName) + if err != nil { + return err + } + sscsd.DisplayName = &displayName + } + case "score": + if v != nil { + var scoreDetails ScoreDetails + err = json.Unmarshal(*v, &scoreDetails) + if err != nil { + return err + } + sscsd.ScoreDetails = &scoreDetails + } + case "healthyResourceCount": + if v != nil { + var healthyResourceCount int32 + err = json.Unmarshal(*v, &healthyResourceCount) + if err != nil { + return err + } + sscsd.HealthyResourceCount = &healthyResourceCount + } + case "unhealthyResourceCount": + if v != nil { + var unhealthyResourceCount int32 + err = json.Unmarshal(*v, &unhealthyResourceCount) + if err != nil { + return err + } + sscsd.UnhealthyResourceCount = &unhealthyResourceCount + } + case "notApplicableResourceCount": + if v != nil { + var notApplicableResourceCount int32 + err = json.Unmarshal(*v, ¬ApplicableResourceCount) + if err != nil { + return err + } + sscsd.NotApplicableResourceCount = ¬ApplicableResourceCount + } + case "definition": + if v != nil { + var definition SecureScoreControlDefinitionItem + err = json.Unmarshal(*v, &definition) + if err != nil { + return err + } + sscsd.Definition = &definition + } + } + } + + return nil +} + +// SecureScoreItem secure score item data model +type SecureScoreItem struct { + autorest.Response `json:"-"` + // SecureScoreItemProperties - READ-ONLY; Secure score item + *SecureScoreItemProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SecureScoreItem. +func (ssi SecureScoreItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SecureScoreItem struct. +func (ssi *SecureScoreItem) 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 secureScoreItemProperties SecureScoreItemProperties + err = json.Unmarshal(*v, &secureScoreItemProperties) + if err != nil { + return err + } + ssi.SecureScoreItemProperties = &secureScoreItemProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ssi.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ssi.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ssi.Type = &typeVar + } + } + } + + return nil +} + +// SecureScoreItemProperties describes properties of a calculated secure score. +type SecureScoreItemProperties struct { + // DisplayName - READ-ONLY; The initiative’s name + DisplayName *string `json:"displayName,omitempty"` + // ScoreDetails - READ-ONLY; score object + *ScoreDetails `json:"score,omitempty"` +} + +// MarshalJSON is the custom marshaler for SecureScoreItemProperties. +func (ssip SecureScoreItemProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SecureScoreItemProperties struct. +func (ssip *SecureScoreItemProperties) 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 "displayName": + if v != nil { + var displayName string + err = json.Unmarshal(*v, &displayName) + if err != nil { + return err + } + ssip.DisplayName = &displayName + } + case "score": + if v != nil { + var scoreDetails ScoreDetails + err = json.Unmarshal(*v, &scoreDetails) + if err != nil { + return err + } + ssip.ScoreDetails = &scoreDetails + } + } + } + + return nil +} + +// SecureScoresList list of secure scores +type SecureScoresList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; Collection of secure scores in this page + Value *[]SecureScoreItem `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page. + NextLink *string `json:"nextLink,omitempty"` +} + +// SecureScoresListIterator provides access to a complete listing of SecureScoreItem values. +type SecureScoresListIterator struct { + i int + page SecureScoresListPage +} + +// 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 *SecureScoresListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoresListIterator.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 *SecureScoresListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SecureScoresListIterator) 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 SecureScoresListIterator) Response() SecureScoresList { + 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 SecureScoresListIterator) Value() SecureScoreItem { + if !iter.page.NotDone() { + return SecureScoreItem{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the SecureScoresListIterator type. +func NewSecureScoresListIterator(page SecureScoresListPage) SecureScoresListIterator { + return SecureScoresListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ssl SecureScoresList) IsEmpty() bool { + return ssl.Value == nil || len(*ssl.Value) == 0 +} + +// secureScoresListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ssl SecureScoresList) secureScoresListPreparer(ctx context.Context) (*http.Request, error) { + if ssl.NextLink == nil || len(to.String(ssl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ssl.NextLink))) +} + +// SecureScoresListPage contains a page of SecureScoreItem values. +type SecureScoresListPage struct { + fn func(context.Context, SecureScoresList) (SecureScoresList, error) + ssl SecureScoresList +} + +// 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 *SecureScoresListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoresListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.ssl) + if err != nil { + return err + } + page.ssl = next + 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 *SecureScoresListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SecureScoresListPage) NotDone() bool { + return !page.ssl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SecureScoresListPage) Response() SecureScoresList { + return page.ssl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SecureScoresListPage) Values() []SecureScoreItem { + if page.ssl.IsEmpty() { + return nil + } + return *page.ssl.Value +} + +// Creates a new instance of the SecureScoresListPage type. +func NewSecureScoresListPage(getNextPage func(context.Context, SecureScoresList) (SecureScoresList, error)) SecureScoresListPage { + return SecureScoresListPage{fn: getNextPage} +} + +// SensitivityLabel the sensitivity label. +type SensitivityLabel struct { + // DisplayName - The name of the sensitivity label. + DisplayName *string `json:"displayName,omitempty"` + // Description - The description of the sensitivity label. + Description *string `json:"description,omitempty"` + // Rank - The rank of the sensitivity label. Possible values include: 'RankNone', 'RankLow', 'RankMedium', 'RankHigh', 'RankCritical' + Rank Rank `json:"rank,omitempty"` + // Order - The order of the sensitivity label. + Order *int32 `json:"order,omitempty"` + // Enabled - Indicates whether the label is enabled or not. + Enabled *bool `json:"enabled,omitempty"` +} + +// ServerVulnerabilityProperties additional context fields for server vulnerability assessment +type ServerVulnerabilityProperties struct { + // Type - READ-ONLY; Vulnerability Type. e.g: Vulnerability, Potential Vulnerability, Information Gathered + Type *string `json:"type,omitempty"` + // Cvss - READ-ONLY; Dictionary from cvss version to cvss details object + Cvss map[string]*CVSS `json:"cvss"` + // Patchable - READ-ONLY; Indicates whether a patch is available or not + Patchable *bool `json:"patchable,omitempty"` + // Cve - READ-ONLY; List of CVEs + Cve *[]CVE `json:"cve,omitempty"` + // Threat - READ-ONLY; Threat name + Threat *string `json:"threat,omitempty"` + // PublishedTime - READ-ONLY; Published time + PublishedTime *date.Time `json:"publishedTime,omitempty"` + // VendorReferences - READ-ONLY + VendorReferences *[]VendorReference `json:"vendorReferences,omitempty"` + // AssessedResourceType - Possible values include: 'AssessedResourceTypeAdditionalData', 'AssessedResourceTypeSQLServerVulnerability', 'AssessedResourceTypeContainerRegistryVulnerability', 'AssessedResourceTypeServerVulnerabilityAssessment' + AssessedResourceType AssessedResourceType `json:"assessedResourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ServerVulnerabilityProperties. +func (svp ServerVulnerabilityProperties) MarshalJSON() ([]byte, error) { + svp.AssessedResourceType = AssessedResourceTypeServerVulnerabilityAssessment + objectMap := make(map[string]interface{}) + if svp.AssessedResourceType != "" { + objectMap["assessedResourceType"] = svp.AssessedResourceType + } + return json.Marshal(objectMap) +} + +// AsSQLServerVulnerabilityProperties is the BasicAdditionalData implementation for ServerVulnerabilityProperties. +func (svp ServerVulnerabilityProperties) AsSQLServerVulnerabilityProperties() (*SQLServerVulnerabilityProperties, bool) { + return nil, false } // AsContainerRegistryVulnerabilityProperties is the BasicAdditionalData implementation for ServerVulnerabilityProperties. @@ -7645,6 +8820,12 @@ type SubAssessmentStatus struct { Severity Severity `json:"severity,omitempty"` } +// SuppressionAlertsScope ... +type SuppressionAlertsScope struct { + // AllOf - All the conditions inside need to be true in order to suppress the alert + AllOf *[]ScopeElement `json:"allOf,omitempty"` +} + // Tags a list of key value pairs that describe the resource. type Tags struct { // Tags - A list of key value pairs that describe the resource. diff --git a/services/preview/security/mgmt/v1.0/security/securescorecontroldefinitions.go b/services/preview/security/mgmt/v1.0/security/securescorecontroldefinitions.go new file mode 100644 index 000000000000..e20bda476e36 --- /dev/null +++ b/services/preview/security/mgmt/v1.0/security/securescorecontroldefinitions.go @@ -0,0 +1,265 @@ +package security + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// SecureScoreControlDefinitionsClient is the API spec for Microsoft.Security (Azure Security Center) resource provider +type SecureScoreControlDefinitionsClient struct { + BaseClient +} + +// NewSecureScoreControlDefinitionsClient creates an instance of the SecureScoreControlDefinitionsClient client. +func NewSecureScoreControlDefinitionsClient(subscriptionID string, ascLocation string) SecureScoreControlDefinitionsClient { + return NewSecureScoreControlDefinitionsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +} + +// NewSecureScoreControlDefinitionsClientWithBaseURI creates an instance of the SecureScoreControlDefinitionsClient +// 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 NewSecureScoreControlDefinitionsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) SecureScoreControlDefinitionsClient { + return SecureScoreControlDefinitionsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +} + +// List list the available security controls, their assessments, and the max score +func (client SecureScoreControlDefinitionsClient) List(ctx context.Context) (result SecureScoreControlDefinitionListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoreControlDefinitionsClient.List") + defer func() { + sc := -1 + if result.sscdl.Response.Response != nil { + sc = result.sscdl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SecureScoreControlDefinitionsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.sscdl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.SecureScoreControlDefinitionsClient", "List", resp, "Failure sending request") + return + } + + result.sscdl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SecureScoreControlDefinitionsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client SecureScoreControlDefinitionsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2020-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.Security/secureScoreControlDefinitions"), + 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 SecureScoreControlDefinitionsClient) 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 SecureScoreControlDefinitionsClient) ListResponder(resp *http.Response) (result SecureScoreControlDefinitionList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 SecureScoreControlDefinitionsClient) listNextResults(ctx context.Context, lastResults SecureScoreControlDefinitionList) (result SecureScoreControlDefinitionList, err error) { + req, err := lastResults.secureScoreControlDefinitionListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.SecureScoreControlDefinitionsClient", "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, "security.SecureScoreControlDefinitionsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SecureScoreControlDefinitionsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client SecureScoreControlDefinitionsClient) ListComplete(ctx context.Context) (result SecureScoreControlDefinitionListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoreControlDefinitionsClient.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 +} + +// ListBySubscription for a specified subscription, list the available security controls, their assessments, and the +// max score +func (client SecureScoreControlDefinitionsClient) ListBySubscription(ctx context.Context) (result SecureScoreControlDefinitionListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoreControlDefinitionsClient.ListBySubscription") + defer func() { + sc := -1 + if result.sscdl.Response.Response != nil { + sc = result.sscdl.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.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.SecureScoreControlDefinitionsClient", "ListBySubscription", err.Error()) + } + + result.fn = client.listBySubscriptionNextResults + req, err := client.ListBySubscriptionPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SecureScoreControlDefinitionsClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.sscdl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.SecureScoreControlDefinitionsClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result.sscdl, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SecureScoreControlDefinitionsClient", "ListBySubscription", resp, "Failure responding to request") + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client SecureScoreControlDefinitionsClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScoreControlDefinitions", 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 SecureScoreControlDefinitionsClient) 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 SecureScoreControlDefinitionsClient) ListBySubscriptionResponder(resp *http.Response) (result SecureScoreControlDefinitionList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 SecureScoreControlDefinitionsClient) listBySubscriptionNextResults(ctx context.Context, lastResults SecureScoreControlDefinitionList) (result SecureScoreControlDefinitionList, err error) { + req, err := lastResults.secureScoreControlDefinitionListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.SecureScoreControlDefinitionsClient", "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, "security.SecureScoreControlDefinitionsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SecureScoreControlDefinitionsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client SecureScoreControlDefinitionsClient) ListBySubscriptionComplete(ctx context.Context) (result SecureScoreControlDefinitionListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoreControlDefinitionsClient.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 +} diff --git a/services/preview/security/mgmt/v1.0/security/securescorecontrols.go b/services/preview/security/mgmt/v1.0/security/securescorecontrols.go new file mode 100644 index 000000000000..113a92cc1a5d --- /dev/null +++ b/services/preview/security/mgmt/v1.0/security/securescorecontrols.go @@ -0,0 +1,287 @@ +package security + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// SecureScoreControlsClient is the API spec for Microsoft.Security (Azure Security Center) resource provider +type SecureScoreControlsClient struct { + BaseClient +} + +// NewSecureScoreControlsClient creates an instance of the SecureScoreControlsClient client. +func NewSecureScoreControlsClient(subscriptionID string, ascLocation string) SecureScoreControlsClient { + return NewSecureScoreControlsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +} + +// NewSecureScoreControlsClientWithBaseURI creates an instance of the SecureScoreControlsClient 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 NewSecureScoreControlsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) SecureScoreControlsClient { + return SecureScoreControlsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +} + +// List get all security controls within a scope +// Parameters: +// expand - oData expand. Optional. +func (client SecureScoreControlsClient) List(ctx context.Context, expand ExpandControlsEnum) (result SecureScoreControlListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoreControlsClient.List") + defer func() { + sc := -1 + if result.sscl.Response.Response != nil { + sc = result.sscl.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.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.SecureScoreControlsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SecureScoreControlsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.sscl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.SecureScoreControlsClient", "List", resp, "Failure sending request") + return + } + + result.sscl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SecureScoreControlsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client SecureScoreControlsClient) ListPreparer(ctx context.Context, expand ExpandControlsEnum) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(string(expand)) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScoreControls", 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 SecureScoreControlsClient) 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 SecureScoreControlsClient) ListResponder(resp *http.Response) (result SecureScoreControlList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 SecureScoreControlsClient) listNextResults(ctx context.Context, lastResults SecureScoreControlList) (result SecureScoreControlList, err error) { + req, err := lastResults.secureScoreControlListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.SecureScoreControlsClient", "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, "security.SecureScoreControlsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SecureScoreControlsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client SecureScoreControlsClient) ListComplete(ctx context.Context, expand ExpandControlsEnum) (result SecureScoreControlListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoreControlsClient.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, expand) + return +} + +// ListBySecureScore get all security controls for a specific initiative within a scope +// Parameters: +// secureScoreName - the initiative name. For the ASC Default initiative, use 'ascScore' as in the sample +// request below. +// expand - oData expand. Optional. +func (client SecureScoreControlsClient) ListBySecureScore(ctx context.Context, secureScoreName string, expand ExpandControlsEnum) (result SecureScoreControlListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoreControlsClient.ListBySecureScore") + defer func() { + sc := -1 + if result.sscl.Response.Response != nil { + sc = result.sscl.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.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.SecureScoreControlsClient", "ListBySecureScore", err.Error()) + } + + result.fn = client.listBySecureScoreNextResults + req, err := client.ListBySecureScorePreparer(ctx, secureScoreName, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SecureScoreControlsClient", "ListBySecureScore", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySecureScoreSender(req) + if err != nil { + result.sscl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.SecureScoreControlsClient", "ListBySecureScore", resp, "Failure sending request") + return + } + + result.sscl, err = client.ListBySecureScoreResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SecureScoreControlsClient", "ListBySecureScore", resp, "Failure responding to request") + } + + return +} + +// ListBySecureScorePreparer prepares the ListBySecureScore request. +func (client SecureScoreControlsClient) ListBySecureScorePreparer(ctx context.Context, secureScoreName string, expand ExpandControlsEnum) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "secureScoreName": autorest.Encode("path", secureScoreName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(string(expand)) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScores/{secureScoreName}/secureScoreControls", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBySecureScoreSender sends the ListBySecureScore request. The method will close the +// http.Response Body if it receives an error. +func (client SecureScoreControlsClient) ListBySecureScoreSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListBySecureScoreResponder handles the response to the ListBySecureScore request. The method always +// closes the http.Response Body. +func (client SecureScoreControlsClient) ListBySecureScoreResponder(resp *http.Response) (result SecureScoreControlList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listBySecureScoreNextResults retrieves the next set of results, if any. +func (client SecureScoreControlsClient) listBySecureScoreNextResults(ctx context.Context, lastResults SecureScoreControlList) (result SecureScoreControlList, err error) { + req, err := lastResults.secureScoreControlListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.SecureScoreControlsClient", "listBySecureScoreNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListBySecureScoreSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "security.SecureScoreControlsClient", "listBySecureScoreNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySecureScoreResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SecureScoreControlsClient", "listBySecureScoreNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySecureScoreComplete enumerates all values, automatically crossing page boundaries as required. +func (client SecureScoreControlsClient) ListBySecureScoreComplete(ctx context.Context, secureScoreName string, expand ExpandControlsEnum) (result SecureScoreControlListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoreControlsClient.ListBySecureScore") + 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.ListBySecureScore(ctx, secureScoreName, expand) + return +} diff --git a/services/preview/security/mgmt/v1.0/security/securescores.go b/services/preview/security/mgmt/v1.0/security/securescores.go new file mode 100644 index 000000000000..0825973292a9 --- /dev/null +++ b/services/preview/security/mgmt/v1.0/security/securescores.go @@ -0,0 +1,240 @@ +package security + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// SecureScoresClient is the API spec for Microsoft.Security (Azure Security Center) resource provider +type SecureScoresClient struct { + BaseClient +} + +// NewSecureScoresClient creates an instance of the SecureScoresClient client. +func NewSecureScoresClient(subscriptionID string, ascLocation string) SecureScoresClient { + return NewSecureScoresClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +} + +// NewSecureScoresClientWithBaseURI creates an instance of the SecureScoresClient 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 NewSecureScoresClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) SecureScoresClient { + return SecureScoresClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +} + +// Get get secure score for a specific initiative within your current scope. For the ASC Default initiative, use +// 'ascScore'. +// Parameters: +// secureScoreName - the initiative name. For the ASC Default initiative, use 'ascScore' as in the sample +// request below. +func (client SecureScoresClient) Get(ctx context.Context, secureScoreName string) (result SecureScoreItem, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoresClient.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.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.SecureScoresClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, secureScoreName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SecureScoresClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.SecureScoresClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SecureScoresClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client SecureScoresClient) GetPreparer(ctx context.Context, secureScoreName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "secureScoreName": autorest.Encode("path", secureScoreName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScores/{secureScoreName}", 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 SecureScoresClient) 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 SecureScoresClient) GetResponder(resp *http.Response) (result SecureScoreItem, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List list secure scores for all your Security Center initiatives within your current scope. +func (client SecureScoresClient) List(ctx context.Context) (result SecureScoresListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoresClient.List") + defer func() { + sc := -1 + if result.ssl.Response.Response != nil { + sc = result.ssl.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.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.SecureScoresClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SecureScoresClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.ssl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.SecureScoresClient", "List", resp, "Failure sending request") + return + } + + result.ssl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SecureScoresClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client SecureScoresClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScores", 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 SecureScoresClient) 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 SecureScoresClient) ListResponder(resp *http.Response) (result SecureScoresList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 SecureScoresClient) listNextResults(ctx context.Context, lastResults SecureScoresList) (result SecureScoresList, err error) { + req, err := lastResults.secureScoresListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.SecureScoresClient", "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, "security.SecureScoresClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SecureScoresClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client SecureScoresClient) ListComplete(ctx context.Context) (result SecureScoresListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoresClient.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/security/mgmt/v1.0/security/securityapi/interfaces.go b/services/preview/security/mgmt/v1.0/security/securityapi/interfaces.go index f48976c7fd74..fe64acb1fccc 100644 --- a/services/preview/security/mgmt/v1.0/security/securityapi/interfaces.go +++ b/services/preview/security/mgmt/v1.0/security/securityapi/interfaces.go @@ -23,6 +23,35 @@ import ( "github.com/Azure/go-autorest/autorest" ) +// SecureScoresClientAPI contains the set of methods on the SecureScoresClient type. +type SecureScoresClientAPI interface { + Get(ctx context.Context, secureScoreName string) (result security.SecureScoreItem, err error) + List(ctx context.Context) (result security.SecureScoresListPage, err error) + ListComplete(ctx context.Context) (result security.SecureScoresListIterator, err error) +} + +var _ SecureScoresClientAPI = (*security.SecureScoresClient)(nil) + +// SecureScoreControlsClientAPI contains the set of methods on the SecureScoreControlsClient type. +type SecureScoreControlsClientAPI interface { + List(ctx context.Context, expand security.ExpandControlsEnum) (result security.SecureScoreControlListPage, err error) + ListComplete(ctx context.Context, expand security.ExpandControlsEnum) (result security.SecureScoreControlListIterator, err error) + ListBySecureScore(ctx context.Context, secureScoreName string, expand security.ExpandControlsEnum) (result security.SecureScoreControlListPage, err error) + ListBySecureScoreComplete(ctx context.Context, secureScoreName string, expand security.ExpandControlsEnum) (result security.SecureScoreControlListIterator, err error) +} + +var _ SecureScoreControlsClientAPI = (*security.SecureScoreControlsClient)(nil) + +// SecureScoreControlDefinitionsClientAPI contains the set of methods on the SecureScoreControlDefinitionsClient type. +type SecureScoreControlDefinitionsClientAPI interface { + List(ctx context.Context) (result security.SecureScoreControlDefinitionListPage, err error) + ListComplete(ctx context.Context) (result security.SecureScoreControlDefinitionListIterator, err error) + ListBySubscription(ctx context.Context) (result security.SecureScoreControlDefinitionListPage, err error) + ListBySubscriptionComplete(ctx context.Context) (result security.SecureScoreControlDefinitionListIterator, err error) +} + +var _ SecureScoreControlDefinitionsClientAPI = (*security.SecureScoreControlDefinitionsClient)(nil) + // AutomationsClientAPI contains the set of methods on the AutomationsClient type. type AutomationsClientAPI interface { CreateOrUpdate(ctx context.Context, resourceGroupName string, automationName string, automation security.Automation) (result security.Automation, err error) @@ -305,3 +334,14 @@ type AdaptiveNetworkHardeningsClientAPI interface { } var _ AdaptiveNetworkHardeningsClientAPI = (*security.AdaptiveNetworkHardeningsClient)(nil) + +// AlertsSuppressionRulesClientAPI contains the set of methods on the AlertsSuppressionRulesClient type. +type AlertsSuppressionRulesClientAPI interface { + Delete(ctx context.Context, alertsSuppressionRuleName string) (result autorest.Response, err error) + Get(ctx context.Context, alertsSuppressionRuleName string) (result security.AlertsSuppressionRule, err error) + List(ctx context.Context, alertType string) (result security.AlertsSuppressionRulesListPage, err error) + ListComplete(ctx context.Context, alertType string) (result security.AlertsSuppressionRulesListIterator, err error) + Update(ctx context.Context, alertsSuppressionRuleName string, alertsSuppressionRule security.AlertsSuppressionRule) (result security.AlertsSuppressionRule, err error) +} + +var _ AlertsSuppressionRulesClientAPI = (*security.AlertsSuppressionRulesClient)(nil) diff --git a/services/preview/security/mgmt/v2.0/security/alerts.go b/services/preview/security/mgmt/v2.0/security/alerts.go index 27c79ff77b33..6b5f3f35746d 100644 --- a/services/preview/security/mgmt/v2.0/security/alerts.go +++ b/services/preview/security/mgmt/v2.0/security/alerts.go @@ -216,7 +216,9 @@ func (client AlertsClient) GetSubscriptionLevelAlertResponder(resp *http.Respons // filter - oData filter. Optional. // selectParameter - oData select. Optional. // expand - oData expand. Optional. -func (client AlertsClient) List(ctx context.Context, filter string, selectParameter string, expand string) (result AlertListPage, err error) { +// autoDismissRuleName - the name of an existing auto dismiss rule. Use it to simulate the rule on existing +// alerts and get the alerts that would have been dismissed if the rule was enabled when the alert was created +func (client AlertsClient) List(ctx context.Context, filter string, selectParameter string, expand string, autoDismissRuleName string) (result AlertListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.List") defer func() { @@ -234,7 +236,7 @@ func (client AlertsClient) List(ctx context.Context, filter string, selectParame } result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, filter, selectParameter, expand) + req, err := client.ListPreparer(ctx, filter, selectParameter, expand, autoDismissRuleName) if err != nil { err = autorest.NewErrorWithError(err, "security.AlertsClient", "List", nil, "Failure preparing request") return @@ -256,7 +258,7 @@ func (client AlertsClient) List(ctx context.Context, filter string, selectParame } // ListPreparer prepares the List request. -func (client AlertsClient) ListPreparer(ctx context.Context, filter string, selectParameter string, expand string) (*http.Request, error) { +func (client AlertsClient) ListPreparer(ctx context.Context, filter string, selectParameter string, expand string, autoDismissRuleName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -274,6 +276,9 @@ func (client AlertsClient) ListPreparer(ctx context.Context, filter string, sele if len(expand) > 0 { queryParameters["$expand"] = autorest.Encode("query", expand) } + if len(autoDismissRuleName) > 0 { + queryParameters["autoDismissRuleName"] = autorest.Encode("query", autoDismissRuleName) + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -324,7 +329,7 @@ func (client AlertsClient) listNextResults(ctx context.Context, lastResults Aler } // ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client AlertsClient) ListComplete(ctx context.Context, filter string, selectParameter string, expand string) (result AlertListIterator, err error) { +func (client AlertsClient) ListComplete(ctx context.Context, filter string, selectParameter string, expand string, autoDismissRuleName string) (result AlertListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.List") defer func() { @@ -335,7 +340,7 @@ func (client AlertsClient) ListComplete(ctx context.Context, filter string, sele tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.List(ctx, filter, selectParameter, expand) + result.page, err = client.List(ctx, filter, selectParameter, expand, autoDismissRuleName) return } @@ -346,7 +351,9 @@ func (client AlertsClient) ListComplete(ctx context.Context, filter string, sele // filter - oData filter. Optional. // selectParameter - oData select. Optional. // expand - oData expand. Optional. -func (client AlertsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, filter string, selectParameter string, expand string) (result AlertListPage, err error) { +// autoDismissRuleName - the name of an existing auto dismiss rule. Use it to simulate the rule on existing +// alerts and get the alerts that would have been dismissed if the rule was enabled when the alert was created +func (client AlertsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, filter string, selectParameter string, expand string, autoDismissRuleName string) (result AlertListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.ListByResourceGroup") defer func() { @@ -368,7 +375,7 @@ func (client AlertsClient) ListByResourceGroup(ctx context.Context, resourceGrou } result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, filter, selectParameter, expand) + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, filter, selectParameter, expand, autoDismissRuleName) if err != nil { err = autorest.NewErrorWithError(err, "security.AlertsClient", "ListByResourceGroup", nil, "Failure preparing request") return @@ -390,7 +397,7 @@ func (client AlertsClient) ListByResourceGroup(ctx context.Context, resourceGrou } // ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client AlertsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string, filter string, selectParameter string, expand string) (*http.Request, error) { +func (client AlertsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string, filter string, selectParameter string, expand string, autoDismissRuleName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -409,6 +416,9 @@ func (client AlertsClient) ListByResourceGroupPreparer(ctx context.Context, reso if len(expand) > 0 { queryParameters["$expand"] = autorest.Encode("query", expand) } + if len(autoDismissRuleName) > 0 { + queryParameters["autoDismissRuleName"] = autorest.Encode("query", autoDismissRuleName) + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -459,7 +469,7 @@ func (client AlertsClient) listByResourceGroupNextResults(ctx context.Context, l } // ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client AlertsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, filter string, selectParameter string, expand string) (result AlertListIterator, err error) { +func (client AlertsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, filter string, selectParameter string, expand string, autoDismissRuleName string) (result AlertListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.ListByResourceGroup") defer func() { @@ -470,7 +480,7 @@ func (client AlertsClient) ListByResourceGroupComplete(ctx context.Context, reso tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName, filter, selectParameter, expand) + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName, filter, selectParameter, expand, autoDismissRuleName) return } @@ -482,7 +492,9 @@ func (client AlertsClient) ListByResourceGroupComplete(ctx context.Context, reso // filter - oData filter. Optional. // selectParameter - oData select. Optional. // expand - oData expand. Optional. -func (client AlertsClient) ListResourceGroupLevelAlertsByRegion(ctx context.Context, resourceGroupName string, filter string, selectParameter string, expand string) (result AlertListPage, err error) { +// autoDismissRuleName - the name of an existing auto dismiss rule. Use it to simulate the rule on existing +// alerts and get the alerts that would have been dismissed if the rule was enabled when the alert was created +func (client AlertsClient) ListResourceGroupLevelAlertsByRegion(ctx context.Context, resourceGroupName string, filter string, selectParameter string, expand string, autoDismissRuleName string) (result AlertListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.ListResourceGroupLevelAlertsByRegion") defer func() { @@ -504,7 +516,7 @@ func (client AlertsClient) ListResourceGroupLevelAlertsByRegion(ctx context.Cont } result.fn = client.listResourceGroupLevelAlertsByRegionNextResults - req, err := client.ListResourceGroupLevelAlertsByRegionPreparer(ctx, resourceGroupName, filter, selectParameter, expand) + req, err := client.ListResourceGroupLevelAlertsByRegionPreparer(ctx, resourceGroupName, filter, selectParameter, expand, autoDismissRuleName) if err != nil { err = autorest.NewErrorWithError(err, "security.AlertsClient", "ListResourceGroupLevelAlertsByRegion", nil, "Failure preparing request") return @@ -526,7 +538,7 @@ func (client AlertsClient) ListResourceGroupLevelAlertsByRegion(ctx context.Cont } // ListResourceGroupLevelAlertsByRegionPreparer prepares the ListResourceGroupLevelAlertsByRegion request. -func (client AlertsClient) ListResourceGroupLevelAlertsByRegionPreparer(ctx context.Context, resourceGroupName string, filter string, selectParameter string, expand string) (*http.Request, error) { +func (client AlertsClient) ListResourceGroupLevelAlertsByRegionPreparer(ctx context.Context, resourceGroupName string, filter string, selectParameter string, expand string, autoDismissRuleName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "ascLocation": autorest.Encode("path", client.AscLocation), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -546,6 +558,9 @@ func (client AlertsClient) ListResourceGroupLevelAlertsByRegionPreparer(ctx cont if len(expand) > 0 { queryParameters["$expand"] = autorest.Encode("query", expand) } + if len(autoDismissRuleName) > 0 { + queryParameters["autoDismissRuleName"] = autorest.Encode("query", autoDismissRuleName) + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -596,7 +611,7 @@ func (client AlertsClient) listResourceGroupLevelAlertsByRegionNextResults(ctx c } // ListResourceGroupLevelAlertsByRegionComplete enumerates all values, automatically crossing page boundaries as required. -func (client AlertsClient) ListResourceGroupLevelAlertsByRegionComplete(ctx context.Context, resourceGroupName string, filter string, selectParameter string, expand string) (result AlertListIterator, err error) { +func (client AlertsClient) ListResourceGroupLevelAlertsByRegionComplete(ctx context.Context, resourceGroupName string, filter string, selectParameter string, expand string, autoDismissRuleName string) (result AlertListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.ListResourceGroupLevelAlertsByRegion") defer func() { @@ -607,7 +622,7 @@ func (client AlertsClient) ListResourceGroupLevelAlertsByRegionComplete(ctx cont tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListResourceGroupLevelAlertsByRegion(ctx, resourceGroupName, filter, selectParameter, expand) + result.page, err = client.ListResourceGroupLevelAlertsByRegion(ctx, resourceGroupName, filter, selectParameter, expand, autoDismissRuleName) return } @@ -617,7 +632,9 @@ func (client AlertsClient) ListResourceGroupLevelAlertsByRegionComplete(ctx cont // filter - oData filter. Optional. // selectParameter - oData select. Optional. // expand - oData expand. Optional. -func (client AlertsClient) ListSubscriptionLevelAlertsByRegion(ctx context.Context, filter string, selectParameter string, expand string) (result AlertListPage, err error) { +// autoDismissRuleName - the name of an existing auto dismiss rule. Use it to simulate the rule on existing +// alerts and get the alerts that would have been dismissed if the rule was enabled when the alert was created +func (client AlertsClient) ListSubscriptionLevelAlertsByRegion(ctx context.Context, filter string, selectParameter string, expand string, autoDismissRuleName string) (result AlertListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.ListSubscriptionLevelAlertsByRegion") defer func() { @@ -635,7 +652,7 @@ func (client AlertsClient) ListSubscriptionLevelAlertsByRegion(ctx context.Conte } result.fn = client.listSubscriptionLevelAlertsByRegionNextResults - req, err := client.ListSubscriptionLevelAlertsByRegionPreparer(ctx, filter, selectParameter, expand) + req, err := client.ListSubscriptionLevelAlertsByRegionPreparer(ctx, filter, selectParameter, expand, autoDismissRuleName) if err != nil { err = autorest.NewErrorWithError(err, "security.AlertsClient", "ListSubscriptionLevelAlertsByRegion", nil, "Failure preparing request") return @@ -657,7 +674,7 @@ func (client AlertsClient) ListSubscriptionLevelAlertsByRegion(ctx context.Conte } // ListSubscriptionLevelAlertsByRegionPreparer prepares the ListSubscriptionLevelAlertsByRegion request. -func (client AlertsClient) ListSubscriptionLevelAlertsByRegionPreparer(ctx context.Context, filter string, selectParameter string, expand string) (*http.Request, error) { +func (client AlertsClient) ListSubscriptionLevelAlertsByRegionPreparer(ctx context.Context, filter string, selectParameter string, expand string, autoDismissRuleName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "ascLocation": autorest.Encode("path", client.AscLocation), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -676,6 +693,9 @@ func (client AlertsClient) ListSubscriptionLevelAlertsByRegionPreparer(ctx conte if len(expand) > 0 { queryParameters["$expand"] = autorest.Encode("query", expand) } + if len(autoDismissRuleName) > 0 { + queryParameters["autoDismissRuleName"] = autorest.Encode("query", autoDismissRuleName) + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -726,7 +746,7 @@ func (client AlertsClient) listSubscriptionLevelAlertsByRegionNextResults(ctx co } // ListSubscriptionLevelAlertsByRegionComplete enumerates all values, automatically crossing page boundaries as required. -func (client AlertsClient) ListSubscriptionLevelAlertsByRegionComplete(ctx context.Context, filter string, selectParameter string, expand string) (result AlertListIterator, err error) { +func (client AlertsClient) ListSubscriptionLevelAlertsByRegionComplete(ctx context.Context, filter string, selectParameter string, expand string, autoDismissRuleName string) (result AlertListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.ListSubscriptionLevelAlertsByRegion") defer func() { @@ -737,7 +757,7 @@ func (client AlertsClient) ListSubscriptionLevelAlertsByRegionComplete(ctx conte tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListSubscriptionLevelAlertsByRegion(ctx, filter, selectParameter, expand) + result.page, err = client.ListSubscriptionLevelAlertsByRegion(ctx, filter, selectParameter, expand, autoDismissRuleName) return } diff --git a/services/preview/security/mgmt/v2.0/security/alertssuppressionrules.go b/services/preview/security/mgmt/v2.0/security/alertssuppressionrules.go new file mode 100644 index 000000000000..4a2a2f0d4462 --- /dev/null +++ b/services/preview/security/mgmt/v2.0/security/alertssuppressionrules.go @@ -0,0 +1,413 @@ +package security + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// AlertsSuppressionRulesClient is the API spec for Microsoft.Security (Azure Security Center) resource provider +type AlertsSuppressionRulesClient struct { + BaseClient +} + +// NewAlertsSuppressionRulesClient creates an instance of the AlertsSuppressionRulesClient client. +func NewAlertsSuppressionRulesClient(subscriptionID string, ascLocation string) AlertsSuppressionRulesClient { + return NewAlertsSuppressionRulesClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +} + +// NewAlertsSuppressionRulesClientWithBaseURI creates an instance of the AlertsSuppressionRulesClient 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 NewAlertsSuppressionRulesClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) AlertsSuppressionRulesClient { + return AlertsSuppressionRulesClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +} + +// Delete delete dismiss alert rule for this subscription. +// Parameters: +// alertsSuppressionRuleName - the unique name of the suppression alert rule +func (client AlertsSuppressionRulesClient) Delete(ctx context.Context, alertsSuppressionRuleName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AlertsSuppressionRulesClient.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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.AlertsSuppressionRulesClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, alertsSuppressionRuleName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AlertsSuppressionRulesClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "security.AlertsSuppressionRulesClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AlertsSuppressionRulesClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client AlertsSuppressionRulesClient) DeletePreparer(ctx context.Context, alertsSuppressionRuleName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "alertsSuppressionRuleName": autorest.Encode("path", alertsSuppressionRuleName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules/{alertsSuppressionRuleName}", 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 AlertsSuppressionRulesClient) 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 AlertsSuppressionRulesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription +// Parameters: +// alertsSuppressionRuleName - the unique name of the suppression alert rule +func (client AlertsSuppressionRulesClient) Get(ctx context.Context, alertsSuppressionRuleName string) (result AlertsSuppressionRule, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AlertsSuppressionRulesClient.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.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.AlertsSuppressionRulesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, alertsSuppressionRuleName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AlertsSuppressionRulesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.AlertsSuppressionRulesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AlertsSuppressionRulesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client AlertsSuppressionRulesClient) GetPreparer(ctx context.Context, alertsSuppressionRuleName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "alertsSuppressionRuleName": autorest.Encode("path", alertsSuppressionRuleName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules/{alertsSuppressionRuleName}", 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 AlertsSuppressionRulesClient) 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 AlertsSuppressionRulesClient) GetResponder(resp *http.Response) (result AlertsSuppressionRule, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List list of all the dismiss rules for the given subscription +// Parameters: +// alertType - type of the alert to get rules for +func (client AlertsSuppressionRulesClient) List(ctx context.Context, alertType string) (result AlertsSuppressionRulesListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AlertsSuppressionRulesClient.List") + defer func() { + sc := -1 + if result.asrl.Response.Response != nil { + sc = result.asrl.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.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.AlertsSuppressionRulesClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, alertType) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AlertsSuppressionRulesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.asrl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.AlertsSuppressionRulesClient", "List", resp, "Failure sending request") + return + } + + result.asrl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AlertsSuppressionRulesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client AlertsSuppressionRulesClient) ListPreparer(ctx context.Context, alertType string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(alertType) > 0 { + queryParameters["AlertType"] = autorest.Encode("query", alertType) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules", 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 AlertsSuppressionRulesClient) 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 AlertsSuppressionRulesClient) ListResponder(resp *http.Response) (result AlertsSuppressionRulesList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 AlertsSuppressionRulesClient) listNextResults(ctx context.Context, lastResults AlertsSuppressionRulesList) (result AlertsSuppressionRulesList, err error) { + req, err := lastResults.alertsSuppressionRulesListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.AlertsSuppressionRulesClient", "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, "security.AlertsSuppressionRulesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AlertsSuppressionRulesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client AlertsSuppressionRulesClient) ListComplete(ctx context.Context, alertType string) (result AlertsSuppressionRulesListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AlertsSuppressionRulesClient.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, alertType) + return +} + +// Update update existing rule or create new rule if it doesn't exist +// Parameters: +// alertsSuppressionRuleName - the unique name of the suppression alert rule +// alertsSuppressionRule - suppression rule object +func (client AlertsSuppressionRulesClient) Update(ctx context.Context, alertsSuppressionRuleName string, alertsSuppressionRule AlertsSuppressionRule) (result AlertsSuppressionRule, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AlertsSuppressionRulesClient.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.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}, + {TargetValue: alertsSuppressionRule, + Constraints: []validation.Constraint{{Target: "alertsSuppressionRule.AlertsSuppressionRuleProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "alertsSuppressionRule.AlertsSuppressionRuleProperties.AlertType", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "alertsSuppressionRule.AlertsSuppressionRuleProperties.Reason", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "alertsSuppressionRule.AlertsSuppressionRuleProperties.SuppressionAlertsScope", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "alertsSuppressionRule.AlertsSuppressionRuleProperties.SuppressionAlertsScope.AllOf", Name: validation.Null, Rule: true, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("security.AlertsSuppressionRulesClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, alertsSuppressionRuleName, alertsSuppressionRule) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AlertsSuppressionRulesClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.AlertsSuppressionRulesClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AlertsSuppressionRulesClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client AlertsSuppressionRulesClient) UpdatePreparer(ctx context.Context, alertsSuppressionRuleName string, alertsSuppressionRule AlertsSuppressionRule) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "alertsSuppressionRuleName": autorest.Encode("path", alertsSuppressionRuleName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-01-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}/providers/Microsoft.Security/alertsSuppressionRules/{alertsSuppressionRuleName}", pathParameters), + autorest.WithJSON(alertsSuppressionRule), + 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 AlertsSuppressionRulesClient) 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 AlertsSuppressionRulesClient) UpdateResponder(resp *http.Response) (result AlertsSuppressionRule, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/security/mgmt/v2.0/security/models.go b/services/preview/security/mgmt/v2.0/security/models.go index f775fbfdfed8..731c30bee958 100644 --- a/services/preview/security/mgmt/v2.0/security/models.go +++ b/services/preview/security/mgmt/v2.0/security/models.go @@ -227,6 +227,21 @@ func PossibleConnectionTypeValues() []ConnectionType { return []ConnectionType{External, Internal} } +// ControlType enumerates the values for control type. +type ControlType string + +const ( + // BuiltIn Azure Security Center managed assessments + BuiltIn ControlType = "BuiltIn" + // Custom Non Azure Security Center managed assessments + Custom ControlType = "Custom" +) + +// PossibleControlTypeValues returns an array of possible values for the ControlType const type. +func PossibleControlTypeValues() []ControlType { + return []ControlType{BuiltIn, Custom} +} + // DataSource enumerates the values for data source. type DataSource string @@ -355,6 +370,19 @@ func PossibleExecutableValues() []Executable { return []Executable{ExecutableAudit, ExecutableEnforce, ExecutableNone} } +// ExpandControlsEnum enumerates the values for expand controls enum. +type ExpandControlsEnum string + +const ( + // Definition Add definition object for each control + Definition ExpandControlsEnum = "definition" +) + +// PossibleExpandControlsEnumValues returns an array of possible values for the ExpandControlsEnum const type. +func PossibleExpandControlsEnumValues() []ExpandControlsEnum { + return []ExpandControlsEnum{Definition} +} + // ExportData enumerates the values for export data. type ExportData string @@ -729,6 +757,23 @@ func PossibleReportedSeverityValues() []ReportedSeverity { return []ReportedSeverity{High, Informational, Low, Medium} } +// RuleState enumerates the values for rule state. +type RuleState string + +const ( + // RuleStateDisabled ... + RuleStateDisabled RuleState = "Disabled" + // RuleStateEnabled ... + RuleStateEnabled RuleState = "Enabled" + // RuleStateExpired ... + RuleStateExpired RuleState = "Expired" +) + +// PossibleRuleStateValues returns an array of possible values for the RuleState const type. +func PossibleRuleStateValues() []RuleState { + return []RuleState{RuleStateDisabled, RuleStateEnabled, RuleStateExpired} +} + // Script enumerates the values for script. type Script string @@ -1798,6 +1843,242 @@ func (ap AlertProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AlertsSuppressionRule describes the suppression rule +type AlertsSuppressionRule struct { + autorest.Response `json:"-"` + *AlertsSuppressionRuleProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AlertsSuppressionRule. +func (asr AlertsSuppressionRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if asr.AlertsSuppressionRuleProperties != nil { + objectMap["properties"] = asr.AlertsSuppressionRuleProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AlertsSuppressionRule struct. +func (asr *AlertsSuppressionRule) 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 alertsSuppressionRuleProperties AlertsSuppressionRuleProperties + err = json.Unmarshal(*v, &alertsSuppressionRuleProperties) + if err != nil { + return err + } + asr.AlertsSuppressionRuleProperties = &alertsSuppressionRuleProperties + } + 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 "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + asr.Type = &typeVar + } + } + } + + return nil +} + +// AlertsSuppressionRuleProperties describes AlertsSuppressionRule properties +type AlertsSuppressionRuleProperties struct { + // AlertType - Type of the alert to automatically suppress. For all alert types, use '*' + AlertType *string `json:"alertType,omitempty"` + // LastModifiedUtc - READ-ONLY; The last time this rule was modified + LastModifiedUtc *date.Time `json:"lastModifiedUtc,omitempty"` + // ExpirationDateUtc - Expiration date of the rule, if value is not provided or provided as null this field will default to the maximum allowed expiration date. + ExpirationDateUtc *date.Time `json:"expirationDateUtc,omitempty"` + // Reason - The reason for dismissing the alert + Reason *string `json:"reason,omitempty"` + // State - Possible states of the rule. Possible values include: 'RuleStateEnabled', 'RuleStateDisabled', 'RuleStateExpired' + State RuleState `json:"state,omitempty"` + // Comment - Any comment regarding the rule + Comment *string `json:"comment,omitempty"` + // SuppressionAlertsScope - The suppression conditions + SuppressionAlertsScope *SuppressionAlertsScope `json:"suppressionAlertsScope,omitempty"` +} + +// AlertsSuppressionRulesList suppression rules list for subscription. +type AlertsSuppressionRulesList struct { + autorest.Response `json:"-"` + Value *[]AlertsSuppressionRule `json:"value,omitempty"` + // NextLink - READ-ONLY; URI to fetch the next page. + NextLink *string `json:"nextLink,omitempty"` +} + +// AlertsSuppressionRulesListIterator provides access to a complete listing of AlertsSuppressionRule +// values. +type AlertsSuppressionRulesListIterator struct { + i int + page AlertsSuppressionRulesListPage +} + +// 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 *AlertsSuppressionRulesListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AlertsSuppressionRulesListIterator.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 *AlertsSuppressionRulesListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter AlertsSuppressionRulesListIterator) 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 AlertsSuppressionRulesListIterator) Response() AlertsSuppressionRulesList { + 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 AlertsSuppressionRulesListIterator) Value() AlertsSuppressionRule { + if !iter.page.NotDone() { + return AlertsSuppressionRule{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the AlertsSuppressionRulesListIterator type. +func NewAlertsSuppressionRulesListIterator(page AlertsSuppressionRulesListPage) AlertsSuppressionRulesListIterator { + return AlertsSuppressionRulesListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (asrl AlertsSuppressionRulesList) IsEmpty() bool { + return asrl.Value == nil || len(*asrl.Value) == 0 +} + +// alertsSuppressionRulesListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (asrl AlertsSuppressionRulesList) alertsSuppressionRulesListPreparer(ctx context.Context) (*http.Request, error) { + if asrl.NextLink == nil || len(to.String(asrl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(asrl.NextLink))) +} + +// AlertsSuppressionRulesListPage contains a page of AlertsSuppressionRule values. +type AlertsSuppressionRulesListPage struct { + fn func(context.Context, AlertsSuppressionRulesList) (AlertsSuppressionRulesList, error) + asrl AlertsSuppressionRulesList +} + +// 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 *AlertsSuppressionRulesListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AlertsSuppressionRulesListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.asrl) + if err != nil { + return err + } + page.asrl = next + 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 *AlertsSuppressionRulesListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page AlertsSuppressionRulesListPage) NotDone() bool { + return !page.asrl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page AlertsSuppressionRulesListPage) Response() AlertsSuppressionRulesList { + return page.asrl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page AlertsSuppressionRulesListPage) Values() []AlertsSuppressionRule { + if page.asrl.IsEmpty() { + return nil + } + return *page.asrl.Value +} + +// Creates a new instance of the AlertsSuppressionRulesListPage type. +func NewAlertsSuppressionRulesListPage(getNextPage func(context.Context, AlertsSuppressionRulesList) (AlertsSuppressionRulesList, error)) AlertsSuppressionRulesListPage { + return AlertsSuppressionRulesListPage{fn: getNextPage} +} + // AllowedConnectionsList list of all possible traffic between Azure resources type AllowedConnectionsList struct { autorest.Response `json:"-"` @@ -3391,6 +3672,12 @@ func (ard AzureResourceDetails) AsBasicResourceDetails() (BasicResourceDetails, return &ard, true } +// AzureResourceLink describes an Azure resource with kind +type AzureResourceLink struct { + // ID - READ-ONLY; Azure resource Id + ID *string `json:"id,omitempty"` +} + // CefExternalSecuritySolution represents a security solution which sends CEF logs to an OMS workspace type CefExternalSecuritySolution struct { Properties *CefSolutionProperties `json:"properties,omitempty"` @@ -7952,56 +8239,944 @@ type Rule struct { IPAddresses *[]string `json:"ipAddresses,omitempty"` } -// SensitivityLabel the sensitivity label. -type SensitivityLabel struct { - // DisplayName - The name of the sensitivity label. - DisplayName *string `json:"displayName,omitempty"` - // Description - The description of the sensitivity label. - Description *string `json:"description,omitempty"` - // Rank - The rank of the sensitivity label. Possible values include: 'RankNone', 'RankLow', 'RankMedium', 'RankHigh', 'RankCritical' - Rank Rank `json:"rank,omitempty"` - // Order - The order of the sensitivity label. - Order *int32 `json:"order,omitempty"` - // Enabled - Indicates whether the label is enabled or not. - Enabled *bool `json:"enabled,omitempty"` -} - -// ServerVulnerabilityProperties additional context fields for server vulnerability assessment -type ServerVulnerabilityProperties struct { - // Type - READ-ONLY; Vulnerability Type. e.g: Vulnerability, Potential Vulnerability, Information Gathered - Type *string `json:"type,omitempty"` - // Cvss - READ-ONLY; Dictionary from cvss version to cvss details object - Cvss map[string]*CVSS `json:"cvss"` - // Patchable - READ-ONLY; Indicates whether a patch is available or not - Patchable *bool `json:"patchable,omitempty"` - // Cve - READ-ONLY; List of CVEs - Cve *[]CVE `json:"cve,omitempty"` - // Threat - READ-ONLY; Threat name - Threat *string `json:"threat,omitempty"` - // PublishedTime - READ-ONLY; Published time - PublishedTime *date.Time `json:"publishedTime,omitempty"` - // VendorReferences - READ-ONLY - VendorReferences *[]VendorReference `json:"vendorReferences,omitempty"` - // AssessedResourceType - Possible values include: 'AssessedResourceTypeAdditionalData', 'AssessedResourceTypeSQLServerVulnerability', 'AssessedResourceTypeContainerRegistryVulnerability', 'AssessedResourceTypeServerVulnerabilityAssessment' - AssessedResourceType AssessedResourceType `json:"assessedResourceType,omitempty"` +// ScopeElement a more specific scope used to identify the alerts to suppress. +type ScopeElement struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Field - The alert entity type to suppress by. + Field *string `json:"field,omitempty"` } -// MarshalJSON is the custom marshaler for ServerVulnerabilityProperties. -func (svp ServerVulnerabilityProperties) MarshalJSON() ([]byte, error) { - svp.AssessedResourceType = AssessedResourceTypeServerVulnerabilityAssessment +// MarshalJSON is the custom marshaler for ScopeElement. +func (se ScopeElement) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if svp.AssessedResourceType != "" { - objectMap["assessedResourceType"] = svp.AssessedResourceType + if se.Field != nil { + objectMap["field"] = se.Field + } + for k, v := range se.AdditionalProperties { + objectMap[k] = v } return json.Marshal(objectMap) } -// AsSQLServerVulnerabilityProperties is the BasicAdditionalData implementation for ServerVulnerabilityProperties. -func (svp ServerVulnerabilityProperties) AsSQLServerVulnerabilityProperties() (*SQLServerVulnerabilityProperties, bool) { - return nil, false +// UnmarshalJSON is the custom unmarshaler for ScopeElement struct. +func (se *ScopeElement) 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 { + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if se.AdditionalProperties == nil { + se.AdditionalProperties = make(map[string]interface{}) + } + se.AdditionalProperties[k] = additionalProperties + } + case "field": + if v != nil { + var field string + err = json.Unmarshal(*v, &field) + if err != nil { + return err + } + se.Field = &field + } + } + } + + return nil } -// AsContainerRegistryVulnerabilityProperties is the BasicAdditionalData implementation for ServerVulnerabilityProperties. +// ScoreDetails calculation result data +type ScoreDetails struct { + // Max - READ-ONLY; Maximum score available + Max *int32 `json:"max,omitempty"` + // Current - READ-ONLY; Current score + Current *float64 `json:"current,omitempty"` +} + +// SecureScoreControlDefinitionItem information about the security control. +type SecureScoreControlDefinitionItem struct { + *SecureScoreControlDefinitionItemProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SecureScoreControlDefinitionItem. +func (sscdi SecureScoreControlDefinitionItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sscdi.SecureScoreControlDefinitionItemProperties != nil { + objectMap["properties"] = sscdi.SecureScoreControlDefinitionItemProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SecureScoreControlDefinitionItem struct. +func (sscdi *SecureScoreControlDefinitionItem) 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 secureScoreControlDefinitionItemProperties SecureScoreControlDefinitionItemProperties + err = json.Unmarshal(*v, &secureScoreControlDefinitionItemProperties) + if err != nil { + return err + } + sscdi.SecureScoreControlDefinitionItemProperties = &secureScoreControlDefinitionItemProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sscdi.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sscdi.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sscdi.Type = &typeVar + } + } + } + + return nil +} + +// SecureScoreControlDefinitionItemProperties security Control Definition Properties. +type SecureScoreControlDefinitionItemProperties struct { + // DisplayName - READ-ONLY; User friendly display name of the control + DisplayName *string `json:"displayName,omitempty"` + // Description - READ-ONLY; User friendly description of the control + Description *string `json:"description,omitempty"` + // MaxScore - READ-ONLY; Maximum control score (0..10) + MaxScore *int32 `json:"maxScore,omitempty"` + // Source - READ-ONLY; Source object from which the control was created + Source *SecureScoreControlDefinitionSource `json:"source,omitempty"` + // AssessmentDefinitions - READ-ONLY; Array of assessments metadata IDs that are included in this security control + AssessmentDefinitions *[]AzureResourceLink `json:"assessmentDefinitions,omitempty"` +} + +// SecureScoreControlDefinitionList list of security controls definition +type SecureScoreControlDefinitionList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; Collection of security controls definition in this page + Value *[]SecureScoreControlDefinitionItem `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page. + NextLink *string `json:"nextLink,omitempty"` +} + +// SecureScoreControlDefinitionListIterator provides access to a complete listing of +// SecureScoreControlDefinitionItem values. +type SecureScoreControlDefinitionListIterator struct { + i int + page SecureScoreControlDefinitionListPage +} + +// 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 *SecureScoreControlDefinitionListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoreControlDefinitionListIterator.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 *SecureScoreControlDefinitionListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SecureScoreControlDefinitionListIterator) 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 SecureScoreControlDefinitionListIterator) Response() SecureScoreControlDefinitionList { + 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 SecureScoreControlDefinitionListIterator) Value() SecureScoreControlDefinitionItem { + if !iter.page.NotDone() { + return SecureScoreControlDefinitionItem{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the SecureScoreControlDefinitionListIterator type. +func NewSecureScoreControlDefinitionListIterator(page SecureScoreControlDefinitionListPage) SecureScoreControlDefinitionListIterator { + return SecureScoreControlDefinitionListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (sscdl SecureScoreControlDefinitionList) IsEmpty() bool { + return sscdl.Value == nil || len(*sscdl.Value) == 0 +} + +// secureScoreControlDefinitionListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (sscdl SecureScoreControlDefinitionList) secureScoreControlDefinitionListPreparer(ctx context.Context) (*http.Request, error) { + if sscdl.NextLink == nil || len(to.String(sscdl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(sscdl.NextLink))) +} + +// SecureScoreControlDefinitionListPage contains a page of SecureScoreControlDefinitionItem values. +type SecureScoreControlDefinitionListPage struct { + fn func(context.Context, SecureScoreControlDefinitionList) (SecureScoreControlDefinitionList, error) + sscdl SecureScoreControlDefinitionList +} + +// 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 *SecureScoreControlDefinitionListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoreControlDefinitionListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.sscdl) + if err != nil { + return err + } + page.sscdl = next + 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 *SecureScoreControlDefinitionListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SecureScoreControlDefinitionListPage) NotDone() bool { + return !page.sscdl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SecureScoreControlDefinitionListPage) Response() SecureScoreControlDefinitionList { + return page.sscdl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SecureScoreControlDefinitionListPage) Values() []SecureScoreControlDefinitionItem { + if page.sscdl.IsEmpty() { + return nil + } + return *page.sscdl.Value +} + +// Creates a new instance of the SecureScoreControlDefinitionListPage type. +func NewSecureScoreControlDefinitionListPage(getNextPage func(context.Context, SecureScoreControlDefinitionList) (SecureScoreControlDefinitionList, error)) SecureScoreControlDefinitionListPage { + return SecureScoreControlDefinitionListPage{fn: getNextPage} +} + +// SecureScoreControlDefinitionSource the type of the security control (For example, BuiltIn) +type SecureScoreControlDefinitionSource struct { + // SourceType - The type of security control (for example, BuiltIn). Possible values include: 'BuiltIn', 'Custom' + SourceType ControlType `json:"sourceType,omitempty"` +} + +// SecureScoreControlDetails details of the security control, its score, and the health status of the +// relevant resources. +type SecureScoreControlDetails struct { + *SecureScoreControlScoreDetails `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SecureScoreControlDetails. +func (sscd SecureScoreControlDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sscd.SecureScoreControlScoreDetails != nil { + objectMap["properties"] = sscd.SecureScoreControlScoreDetails + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SecureScoreControlDetails struct. +func (sscd *SecureScoreControlDetails) 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 secureScoreControlScoreDetails SecureScoreControlScoreDetails + err = json.Unmarshal(*v, &secureScoreControlScoreDetails) + if err != nil { + return err + } + sscd.SecureScoreControlScoreDetails = &secureScoreControlScoreDetails + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sscd.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sscd.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sscd.Type = &typeVar + } + } + } + + return nil +} + +// SecureScoreControlList list of security controls +type SecureScoreControlList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; Collection of security controls in this page + Value *[]SecureScoreControlDetails `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page. + NextLink *string `json:"nextLink,omitempty"` +} + +// SecureScoreControlListIterator provides access to a complete listing of SecureScoreControlDetails +// values. +type SecureScoreControlListIterator struct { + i int + page SecureScoreControlListPage +} + +// 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 *SecureScoreControlListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoreControlListIterator.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 *SecureScoreControlListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SecureScoreControlListIterator) 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 SecureScoreControlListIterator) Response() SecureScoreControlList { + 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 SecureScoreControlListIterator) Value() SecureScoreControlDetails { + if !iter.page.NotDone() { + return SecureScoreControlDetails{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the SecureScoreControlListIterator type. +func NewSecureScoreControlListIterator(page SecureScoreControlListPage) SecureScoreControlListIterator { + return SecureScoreControlListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (sscl SecureScoreControlList) IsEmpty() bool { + return sscl.Value == nil || len(*sscl.Value) == 0 +} + +// secureScoreControlListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (sscl SecureScoreControlList) secureScoreControlListPreparer(ctx context.Context) (*http.Request, error) { + if sscl.NextLink == nil || len(to.String(sscl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(sscl.NextLink))) +} + +// SecureScoreControlListPage contains a page of SecureScoreControlDetails values. +type SecureScoreControlListPage struct { + fn func(context.Context, SecureScoreControlList) (SecureScoreControlList, error) + sscl SecureScoreControlList +} + +// 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 *SecureScoreControlListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoreControlListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.sscl) + if err != nil { + return err + } + page.sscl = next + 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 *SecureScoreControlListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SecureScoreControlListPage) NotDone() bool { + return !page.sscl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SecureScoreControlListPage) Response() SecureScoreControlList { + return page.sscl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SecureScoreControlListPage) Values() []SecureScoreControlDetails { + if page.sscl.IsEmpty() { + return nil + } + return *page.sscl.Value +} + +// Creates a new instance of the SecureScoreControlListPage type. +func NewSecureScoreControlListPage(getNextPage func(context.Context, SecureScoreControlList) (SecureScoreControlList, error)) SecureScoreControlListPage { + return SecureScoreControlListPage{fn: getNextPage} +} + +// SecureScoreControlScore calculation result data +type SecureScoreControlScore struct { + // Max - READ-ONLY; Maximum control score (0..10) + Max *int32 `json:"max,omitempty"` + // Current - READ-ONLY; Actual score for the control = (achieved points / total points) * max score. if total points is zeroed, the return number is 0.00 + Current *float64 `json:"current,omitempty"` +} + +// SecureScoreControlScoreDetails calculation result data in control level +type SecureScoreControlScoreDetails struct { + // DisplayName - READ-ONLY; User friendly display name of the control + DisplayName *string `json:"displayName,omitempty"` + // ScoreDetails - Actual score object for the control + *ScoreDetails `json:"score,omitempty"` + // HealthyResourceCount - READ-ONLY; Number of healthy resources in the control + HealthyResourceCount *int32 `json:"healthyResourceCount,omitempty"` + // UnhealthyResourceCount - READ-ONLY; Number of unhealthy resources in the control + UnhealthyResourceCount *int32 `json:"unhealthyResourceCount,omitempty"` + // NotApplicableResourceCount - READ-ONLY; Number of not applicable resources in the control + NotApplicableResourceCount *int32 `json:"notApplicableResourceCount,omitempty"` + Definition *SecureScoreControlDefinitionItem `json:"definition,omitempty"` +} + +// MarshalJSON is the custom marshaler for SecureScoreControlScoreDetails. +func (sscsd SecureScoreControlScoreDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sscsd.ScoreDetails != nil { + objectMap["score"] = sscsd.ScoreDetails + } + if sscsd.Definition != nil { + objectMap["definition"] = sscsd.Definition + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SecureScoreControlScoreDetails struct. +func (sscsd *SecureScoreControlScoreDetails) 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 "displayName": + if v != nil { + var displayName string + err = json.Unmarshal(*v, &displayName) + if err != nil { + return err + } + sscsd.DisplayName = &displayName + } + case "score": + if v != nil { + var scoreDetails ScoreDetails + err = json.Unmarshal(*v, &scoreDetails) + if err != nil { + return err + } + sscsd.ScoreDetails = &scoreDetails + } + case "healthyResourceCount": + if v != nil { + var healthyResourceCount int32 + err = json.Unmarshal(*v, &healthyResourceCount) + if err != nil { + return err + } + sscsd.HealthyResourceCount = &healthyResourceCount + } + case "unhealthyResourceCount": + if v != nil { + var unhealthyResourceCount int32 + err = json.Unmarshal(*v, &unhealthyResourceCount) + if err != nil { + return err + } + sscsd.UnhealthyResourceCount = &unhealthyResourceCount + } + case "notApplicableResourceCount": + if v != nil { + var notApplicableResourceCount int32 + err = json.Unmarshal(*v, ¬ApplicableResourceCount) + if err != nil { + return err + } + sscsd.NotApplicableResourceCount = ¬ApplicableResourceCount + } + case "definition": + if v != nil { + var definition SecureScoreControlDefinitionItem + err = json.Unmarshal(*v, &definition) + if err != nil { + return err + } + sscsd.Definition = &definition + } + } + } + + return nil +} + +// SecureScoreItem secure score item data model +type SecureScoreItem struct { + autorest.Response `json:"-"` + // SecureScoreItemProperties - READ-ONLY; Secure score item + *SecureScoreItemProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SecureScoreItem. +func (ssi SecureScoreItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SecureScoreItem struct. +func (ssi *SecureScoreItem) 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 secureScoreItemProperties SecureScoreItemProperties + err = json.Unmarshal(*v, &secureScoreItemProperties) + if err != nil { + return err + } + ssi.SecureScoreItemProperties = &secureScoreItemProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ssi.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ssi.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ssi.Type = &typeVar + } + } + } + + return nil +} + +// SecureScoreItemProperties describes properties of a calculated secure score. +type SecureScoreItemProperties struct { + // DisplayName - READ-ONLY; The initiative’s name + DisplayName *string `json:"displayName,omitempty"` + // ScoreDetails - READ-ONLY; score object + *ScoreDetails `json:"score,omitempty"` +} + +// MarshalJSON is the custom marshaler for SecureScoreItemProperties. +func (ssip SecureScoreItemProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SecureScoreItemProperties struct. +func (ssip *SecureScoreItemProperties) 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 "displayName": + if v != nil { + var displayName string + err = json.Unmarshal(*v, &displayName) + if err != nil { + return err + } + ssip.DisplayName = &displayName + } + case "score": + if v != nil { + var scoreDetails ScoreDetails + err = json.Unmarshal(*v, &scoreDetails) + if err != nil { + return err + } + ssip.ScoreDetails = &scoreDetails + } + } + } + + return nil +} + +// SecureScoresList list of secure scores +type SecureScoresList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; Collection of secure scores in this page + Value *[]SecureScoreItem `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page. + NextLink *string `json:"nextLink,omitempty"` +} + +// SecureScoresListIterator provides access to a complete listing of SecureScoreItem values. +type SecureScoresListIterator struct { + i int + page SecureScoresListPage +} + +// 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 *SecureScoresListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoresListIterator.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 *SecureScoresListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SecureScoresListIterator) 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 SecureScoresListIterator) Response() SecureScoresList { + 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 SecureScoresListIterator) Value() SecureScoreItem { + if !iter.page.NotDone() { + return SecureScoreItem{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the SecureScoresListIterator type. +func NewSecureScoresListIterator(page SecureScoresListPage) SecureScoresListIterator { + return SecureScoresListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ssl SecureScoresList) IsEmpty() bool { + return ssl.Value == nil || len(*ssl.Value) == 0 +} + +// secureScoresListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ssl SecureScoresList) secureScoresListPreparer(ctx context.Context) (*http.Request, error) { + if ssl.NextLink == nil || len(to.String(ssl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ssl.NextLink))) +} + +// SecureScoresListPage contains a page of SecureScoreItem values. +type SecureScoresListPage struct { + fn func(context.Context, SecureScoresList) (SecureScoresList, error) + ssl SecureScoresList +} + +// 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 *SecureScoresListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoresListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.ssl) + if err != nil { + return err + } + page.ssl = next + 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 *SecureScoresListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SecureScoresListPage) NotDone() bool { + return !page.ssl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SecureScoresListPage) Response() SecureScoresList { + return page.ssl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SecureScoresListPage) Values() []SecureScoreItem { + if page.ssl.IsEmpty() { + return nil + } + return *page.ssl.Value +} + +// Creates a new instance of the SecureScoresListPage type. +func NewSecureScoresListPage(getNextPage func(context.Context, SecureScoresList) (SecureScoresList, error)) SecureScoresListPage { + return SecureScoresListPage{fn: getNextPage} +} + +// SensitivityLabel the sensitivity label. +type SensitivityLabel struct { + // DisplayName - The name of the sensitivity label. + DisplayName *string `json:"displayName,omitempty"` + // Description - The description of the sensitivity label. + Description *string `json:"description,omitempty"` + // Rank - The rank of the sensitivity label. Possible values include: 'RankNone', 'RankLow', 'RankMedium', 'RankHigh', 'RankCritical' + Rank Rank `json:"rank,omitempty"` + // Order - The order of the sensitivity label. + Order *int32 `json:"order,omitempty"` + // Enabled - Indicates whether the label is enabled or not. + Enabled *bool `json:"enabled,omitempty"` +} + +// ServerVulnerabilityProperties additional context fields for server vulnerability assessment +type ServerVulnerabilityProperties struct { + // Type - READ-ONLY; Vulnerability Type. e.g: Vulnerability, Potential Vulnerability, Information Gathered + Type *string `json:"type,omitempty"` + // Cvss - READ-ONLY; Dictionary from cvss version to cvss details object + Cvss map[string]*CVSS `json:"cvss"` + // Patchable - READ-ONLY; Indicates whether a patch is available or not + Patchable *bool `json:"patchable,omitempty"` + // Cve - READ-ONLY; List of CVEs + Cve *[]CVE `json:"cve,omitempty"` + // Threat - READ-ONLY; Threat name + Threat *string `json:"threat,omitempty"` + // PublishedTime - READ-ONLY; Published time + PublishedTime *date.Time `json:"publishedTime,omitempty"` + // VendorReferences - READ-ONLY + VendorReferences *[]VendorReference `json:"vendorReferences,omitempty"` + // AssessedResourceType - Possible values include: 'AssessedResourceTypeAdditionalData', 'AssessedResourceTypeSQLServerVulnerability', 'AssessedResourceTypeContainerRegistryVulnerability', 'AssessedResourceTypeServerVulnerabilityAssessment' + AssessedResourceType AssessedResourceType `json:"assessedResourceType,omitempty"` +} + +// MarshalJSON is the custom marshaler for ServerVulnerabilityProperties. +func (svp ServerVulnerabilityProperties) MarshalJSON() ([]byte, error) { + svp.AssessedResourceType = AssessedResourceTypeServerVulnerabilityAssessment + objectMap := make(map[string]interface{}) + if svp.AssessedResourceType != "" { + objectMap["assessedResourceType"] = svp.AssessedResourceType + } + return json.Marshal(objectMap) +} + +// AsSQLServerVulnerabilityProperties is the BasicAdditionalData implementation for ServerVulnerabilityProperties. +func (svp ServerVulnerabilityProperties) AsSQLServerVulnerabilityProperties() (*SQLServerVulnerabilityProperties, bool) { + return nil, false +} + +// AsContainerRegistryVulnerabilityProperties is the BasicAdditionalData implementation for ServerVulnerabilityProperties. func (svp ServerVulnerabilityProperties) AsContainerRegistryVulnerabilityProperties() (*ContainerRegistryVulnerabilityProperties, bool) { return nil, false } @@ -8591,6 +9766,12 @@ type SubAssessmentStatus struct { Severity Severity `json:"severity,omitempty"` } +// SuppressionAlertsScope ... +type SuppressionAlertsScope struct { + // AllOf - All the conditions inside need to be true in order to suppress the alert + AllOf *[]ScopeElement `json:"allOf,omitempty"` +} + // Tags a list of key value pairs that describe the resource. type Tags struct { // Tags - A list of key value pairs that describe the resource. diff --git a/services/preview/security/mgmt/v2.0/security/securescorecontroldefinitions.go b/services/preview/security/mgmt/v2.0/security/securescorecontroldefinitions.go new file mode 100644 index 000000000000..e20bda476e36 --- /dev/null +++ b/services/preview/security/mgmt/v2.0/security/securescorecontroldefinitions.go @@ -0,0 +1,265 @@ +package security + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// SecureScoreControlDefinitionsClient is the API spec for Microsoft.Security (Azure Security Center) resource provider +type SecureScoreControlDefinitionsClient struct { + BaseClient +} + +// NewSecureScoreControlDefinitionsClient creates an instance of the SecureScoreControlDefinitionsClient client. +func NewSecureScoreControlDefinitionsClient(subscriptionID string, ascLocation string) SecureScoreControlDefinitionsClient { + return NewSecureScoreControlDefinitionsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +} + +// NewSecureScoreControlDefinitionsClientWithBaseURI creates an instance of the SecureScoreControlDefinitionsClient +// 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 NewSecureScoreControlDefinitionsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) SecureScoreControlDefinitionsClient { + return SecureScoreControlDefinitionsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +} + +// List list the available security controls, their assessments, and the max score +func (client SecureScoreControlDefinitionsClient) List(ctx context.Context) (result SecureScoreControlDefinitionListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoreControlDefinitionsClient.List") + defer func() { + sc := -1 + if result.sscdl.Response.Response != nil { + sc = result.sscdl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SecureScoreControlDefinitionsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.sscdl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.SecureScoreControlDefinitionsClient", "List", resp, "Failure sending request") + return + } + + result.sscdl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SecureScoreControlDefinitionsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client SecureScoreControlDefinitionsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2020-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.Security/secureScoreControlDefinitions"), + 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 SecureScoreControlDefinitionsClient) 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 SecureScoreControlDefinitionsClient) ListResponder(resp *http.Response) (result SecureScoreControlDefinitionList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 SecureScoreControlDefinitionsClient) listNextResults(ctx context.Context, lastResults SecureScoreControlDefinitionList) (result SecureScoreControlDefinitionList, err error) { + req, err := lastResults.secureScoreControlDefinitionListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.SecureScoreControlDefinitionsClient", "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, "security.SecureScoreControlDefinitionsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SecureScoreControlDefinitionsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client SecureScoreControlDefinitionsClient) ListComplete(ctx context.Context) (result SecureScoreControlDefinitionListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoreControlDefinitionsClient.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 +} + +// ListBySubscription for a specified subscription, list the available security controls, their assessments, and the +// max score +func (client SecureScoreControlDefinitionsClient) ListBySubscription(ctx context.Context) (result SecureScoreControlDefinitionListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoreControlDefinitionsClient.ListBySubscription") + defer func() { + sc := -1 + if result.sscdl.Response.Response != nil { + sc = result.sscdl.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.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.SecureScoreControlDefinitionsClient", "ListBySubscription", err.Error()) + } + + result.fn = client.listBySubscriptionNextResults + req, err := client.ListBySubscriptionPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SecureScoreControlDefinitionsClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.sscdl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.SecureScoreControlDefinitionsClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result.sscdl, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SecureScoreControlDefinitionsClient", "ListBySubscription", resp, "Failure responding to request") + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client SecureScoreControlDefinitionsClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScoreControlDefinitions", 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 SecureScoreControlDefinitionsClient) 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 SecureScoreControlDefinitionsClient) ListBySubscriptionResponder(resp *http.Response) (result SecureScoreControlDefinitionList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 SecureScoreControlDefinitionsClient) listBySubscriptionNextResults(ctx context.Context, lastResults SecureScoreControlDefinitionList) (result SecureScoreControlDefinitionList, err error) { + req, err := lastResults.secureScoreControlDefinitionListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.SecureScoreControlDefinitionsClient", "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, "security.SecureScoreControlDefinitionsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SecureScoreControlDefinitionsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client SecureScoreControlDefinitionsClient) ListBySubscriptionComplete(ctx context.Context) (result SecureScoreControlDefinitionListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoreControlDefinitionsClient.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 +} diff --git a/services/preview/security/mgmt/v2.0/security/securescorecontrols.go b/services/preview/security/mgmt/v2.0/security/securescorecontrols.go new file mode 100644 index 000000000000..113a92cc1a5d --- /dev/null +++ b/services/preview/security/mgmt/v2.0/security/securescorecontrols.go @@ -0,0 +1,287 @@ +package security + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// SecureScoreControlsClient is the API spec for Microsoft.Security (Azure Security Center) resource provider +type SecureScoreControlsClient struct { + BaseClient +} + +// NewSecureScoreControlsClient creates an instance of the SecureScoreControlsClient client. +func NewSecureScoreControlsClient(subscriptionID string, ascLocation string) SecureScoreControlsClient { + return NewSecureScoreControlsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +} + +// NewSecureScoreControlsClientWithBaseURI creates an instance of the SecureScoreControlsClient 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 NewSecureScoreControlsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) SecureScoreControlsClient { + return SecureScoreControlsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +} + +// List get all security controls within a scope +// Parameters: +// expand - oData expand. Optional. +func (client SecureScoreControlsClient) List(ctx context.Context, expand ExpandControlsEnum) (result SecureScoreControlListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoreControlsClient.List") + defer func() { + sc := -1 + if result.sscl.Response.Response != nil { + sc = result.sscl.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.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.SecureScoreControlsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SecureScoreControlsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.sscl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.SecureScoreControlsClient", "List", resp, "Failure sending request") + return + } + + result.sscl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SecureScoreControlsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client SecureScoreControlsClient) ListPreparer(ctx context.Context, expand ExpandControlsEnum) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(string(expand)) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScoreControls", 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 SecureScoreControlsClient) 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 SecureScoreControlsClient) ListResponder(resp *http.Response) (result SecureScoreControlList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 SecureScoreControlsClient) listNextResults(ctx context.Context, lastResults SecureScoreControlList) (result SecureScoreControlList, err error) { + req, err := lastResults.secureScoreControlListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.SecureScoreControlsClient", "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, "security.SecureScoreControlsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SecureScoreControlsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client SecureScoreControlsClient) ListComplete(ctx context.Context, expand ExpandControlsEnum) (result SecureScoreControlListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoreControlsClient.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, expand) + return +} + +// ListBySecureScore get all security controls for a specific initiative within a scope +// Parameters: +// secureScoreName - the initiative name. For the ASC Default initiative, use 'ascScore' as in the sample +// request below. +// expand - oData expand. Optional. +func (client SecureScoreControlsClient) ListBySecureScore(ctx context.Context, secureScoreName string, expand ExpandControlsEnum) (result SecureScoreControlListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoreControlsClient.ListBySecureScore") + defer func() { + sc := -1 + if result.sscl.Response.Response != nil { + sc = result.sscl.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.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.SecureScoreControlsClient", "ListBySecureScore", err.Error()) + } + + result.fn = client.listBySecureScoreNextResults + req, err := client.ListBySecureScorePreparer(ctx, secureScoreName, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SecureScoreControlsClient", "ListBySecureScore", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySecureScoreSender(req) + if err != nil { + result.sscl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.SecureScoreControlsClient", "ListBySecureScore", resp, "Failure sending request") + return + } + + result.sscl, err = client.ListBySecureScoreResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SecureScoreControlsClient", "ListBySecureScore", resp, "Failure responding to request") + } + + return +} + +// ListBySecureScorePreparer prepares the ListBySecureScore request. +func (client SecureScoreControlsClient) ListBySecureScorePreparer(ctx context.Context, secureScoreName string, expand ExpandControlsEnum) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "secureScoreName": autorest.Encode("path", secureScoreName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(string(expand)) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScores/{secureScoreName}/secureScoreControls", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBySecureScoreSender sends the ListBySecureScore request. The method will close the +// http.Response Body if it receives an error. +func (client SecureScoreControlsClient) ListBySecureScoreSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListBySecureScoreResponder handles the response to the ListBySecureScore request. The method always +// closes the http.Response Body. +func (client SecureScoreControlsClient) ListBySecureScoreResponder(resp *http.Response) (result SecureScoreControlList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listBySecureScoreNextResults retrieves the next set of results, if any. +func (client SecureScoreControlsClient) listBySecureScoreNextResults(ctx context.Context, lastResults SecureScoreControlList) (result SecureScoreControlList, err error) { + req, err := lastResults.secureScoreControlListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.SecureScoreControlsClient", "listBySecureScoreNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListBySecureScoreSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "security.SecureScoreControlsClient", "listBySecureScoreNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySecureScoreResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SecureScoreControlsClient", "listBySecureScoreNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySecureScoreComplete enumerates all values, automatically crossing page boundaries as required. +func (client SecureScoreControlsClient) ListBySecureScoreComplete(ctx context.Context, secureScoreName string, expand ExpandControlsEnum) (result SecureScoreControlListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoreControlsClient.ListBySecureScore") + 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.ListBySecureScore(ctx, secureScoreName, expand) + return +} diff --git a/services/preview/security/mgmt/v2.0/security/securescores.go b/services/preview/security/mgmt/v2.0/security/securescores.go new file mode 100644 index 000000000000..0825973292a9 --- /dev/null +++ b/services/preview/security/mgmt/v2.0/security/securescores.go @@ -0,0 +1,240 @@ +package security + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// SecureScoresClient is the API spec for Microsoft.Security (Azure Security Center) resource provider +type SecureScoresClient struct { + BaseClient +} + +// NewSecureScoresClient creates an instance of the SecureScoresClient client. +func NewSecureScoresClient(subscriptionID string, ascLocation string) SecureScoresClient { + return NewSecureScoresClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +} + +// NewSecureScoresClientWithBaseURI creates an instance of the SecureScoresClient 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 NewSecureScoresClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) SecureScoresClient { + return SecureScoresClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +} + +// Get get secure score for a specific initiative within your current scope. For the ASC Default initiative, use +// 'ascScore'. +// Parameters: +// secureScoreName - the initiative name. For the ASC Default initiative, use 'ascScore' as in the sample +// request below. +func (client SecureScoresClient) Get(ctx context.Context, secureScoreName string) (result SecureScoreItem, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoresClient.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.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.SecureScoresClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, secureScoreName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SecureScoresClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.SecureScoresClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SecureScoresClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client SecureScoresClient) GetPreparer(ctx context.Context, secureScoreName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "secureScoreName": autorest.Encode("path", secureScoreName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScores/{secureScoreName}", 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 SecureScoresClient) 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 SecureScoresClient) GetResponder(resp *http.Response) (result SecureScoreItem, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List list secure scores for all your Security Center initiatives within your current scope. +func (client SecureScoresClient) List(ctx context.Context) (result SecureScoresListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoresClient.List") + defer func() { + sc := -1 + if result.ssl.Response.Response != nil { + sc = result.ssl.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.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.SecureScoresClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SecureScoresClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.ssl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.SecureScoresClient", "List", resp, "Failure sending request") + return + } + + result.ssl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SecureScoresClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client SecureScoresClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScores", 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 SecureScoresClient) 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 SecureScoresClient) ListResponder(resp *http.Response) (result SecureScoresList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 SecureScoresClient) listNextResults(ctx context.Context, lastResults SecureScoresList) (result SecureScoresList, err error) { + req, err := lastResults.secureScoresListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.SecureScoresClient", "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, "security.SecureScoresClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SecureScoresClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client SecureScoresClient) ListComplete(ctx context.Context) (result SecureScoresListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoresClient.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/security/mgmt/v2.0/security/securityapi/interfaces.go b/services/preview/security/mgmt/v2.0/security/securityapi/interfaces.go index 198d3e0bedb8..a55e272b0775 100644 --- a/services/preview/security/mgmt/v2.0/security/securityapi/interfaces.go +++ b/services/preview/security/mgmt/v2.0/security/securityapi/interfaces.go @@ -23,6 +23,35 @@ import ( "github.com/Azure/go-autorest/autorest" ) +// SecureScoresClientAPI contains the set of methods on the SecureScoresClient type. +type SecureScoresClientAPI interface { + Get(ctx context.Context, secureScoreName string) (result security.SecureScoreItem, err error) + List(ctx context.Context) (result security.SecureScoresListPage, err error) + ListComplete(ctx context.Context) (result security.SecureScoresListIterator, err error) +} + +var _ SecureScoresClientAPI = (*security.SecureScoresClient)(nil) + +// SecureScoreControlsClientAPI contains the set of methods on the SecureScoreControlsClient type. +type SecureScoreControlsClientAPI interface { + List(ctx context.Context, expand security.ExpandControlsEnum) (result security.SecureScoreControlListPage, err error) + ListComplete(ctx context.Context, expand security.ExpandControlsEnum) (result security.SecureScoreControlListIterator, err error) + ListBySecureScore(ctx context.Context, secureScoreName string, expand security.ExpandControlsEnum) (result security.SecureScoreControlListPage, err error) + ListBySecureScoreComplete(ctx context.Context, secureScoreName string, expand security.ExpandControlsEnum) (result security.SecureScoreControlListIterator, err error) +} + +var _ SecureScoreControlsClientAPI = (*security.SecureScoreControlsClient)(nil) + +// SecureScoreControlDefinitionsClientAPI contains the set of methods on the SecureScoreControlDefinitionsClient type. +type SecureScoreControlDefinitionsClientAPI interface { + List(ctx context.Context) (result security.SecureScoreControlDefinitionListPage, err error) + ListComplete(ctx context.Context) (result security.SecureScoreControlDefinitionListIterator, err error) + ListBySubscription(ctx context.Context) (result security.SecureScoreControlDefinitionListPage, err error) + ListBySubscriptionComplete(ctx context.Context) (result security.SecureScoreControlDefinitionListIterator, err error) +} + +var _ SecureScoreControlDefinitionsClientAPI = (*security.SecureScoreControlDefinitionsClient)(nil) + // AutomationsClientAPI contains the set of methods on the AutomationsClient type. type AutomationsClientAPI interface { CreateOrUpdate(ctx context.Context, resourceGroupName string, automationName string, automation security.Automation) (result security.Automation, err error) @@ -268,14 +297,14 @@ var _ TasksClientAPI = (*security.TasksClient)(nil) type AlertsClientAPI interface { GetResourceGroupLevelAlerts(ctx context.Context, alertName string, resourceGroupName string) (result security.Alert, err error) GetSubscriptionLevelAlert(ctx context.Context, alertName string) (result security.Alert, err error) - List(ctx context.Context, filter string, selectParameter string, expand string) (result security.AlertListPage, err error) - ListComplete(ctx context.Context, filter string, selectParameter string, expand string) (result security.AlertListIterator, err error) - ListByResourceGroup(ctx context.Context, resourceGroupName string, filter string, selectParameter string, expand string) (result security.AlertListPage, err error) - ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, filter string, selectParameter string, expand string) (result security.AlertListIterator, err error) - ListResourceGroupLevelAlertsByRegion(ctx context.Context, resourceGroupName string, filter string, selectParameter string, expand string) (result security.AlertListPage, err error) - ListResourceGroupLevelAlertsByRegionComplete(ctx context.Context, resourceGroupName string, filter string, selectParameter string, expand string) (result security.AlertListIterator, err error) - ListSubscriptionLevelAlertsByRegion(ctx context.Context, filter string, selectParameter string, expand string) (result security.AlertListPage, err error) - ListSubscriptionLevelAlertsByRegionComplete(ctx context.Context, filter string, selectParameter string, expand string) (result security.AlertListIterator, err error) + List(ctx context.Context, filter string, selectParameter string, expand string, autoDismissRuleName string) (result security.AlertListPage, err error) + ListComplete(ctx context.Context, filter string, selectParameter string, expand string, autoDismissRuleName string) (result security.AlertListIterator, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string, filter string, selectParameter string, expand string, autoDismissRuleName string) (result security.AlertListPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, filter string, selectParameter string, expand string, autoDismissRuleName string) (result security.AlertListIterator, err error) + ListResourceGroupLevelAlertsByRegion(ctx context.Context, resourceGroupName string, filter string, selectParameter string, expand string, autoDismissRuleName string) (result security.AlertListPage, err error) + ListResourceGroupLevelAlertsByRegionComplete(ctx context.Context, resourceGroupName string, filter string, selectParameter string, expand string, autoDismissRuleName string) (result security.AlertListIterator, err error) + ListSubscriptionLevelAlertsByRegion(ctx context.Context, filter string, selectParameter string, expand string, autoDismissRuleName string) (result security.AlertListPage, err error) + ListSubscriptionLevelAlertsByRegionComplete(ctx context.Context, filter string, selectParameter string, expand string, autoDismissRuleName string) (result security.AlertListIterator, err error) UpdateResourceGroupLevelAlertStateToDismiss(ctx context.Context, alertName string, resourceGroupName string) (result autorest.Response, err error) UpdateResourceGroupLevelAlertStateToReactivate(ctx context.Context, alertName string, resourceGroupName string) (result autorest.Response, err error) UpdateSubscriptionLevelAlertStateToDismiss(ctx context.Context, alertName string) (result autorest.Response, err error) @@ -365,3 +394,14 @@ type AdaptiveNetworkHardeningsClientAPI interface { } var _ AdaptiveNetworkHardeningsClientAPI = (*security.AdaptiveNetworkHardeningsClient)(nil) + +// AlertsSuppressionRulesClientAPI contains the set of methods on the AlertsSuppressionRulesClient type. +type AlertsSuppressionRulesClientAPI interface { + Delete(ctx context.Context, alertsSuppressionRuleName string) (result autorest.Response, err error) + Get(ctx context.Context, alertsSuppressionRuleName string) (result security.AlertsSuppressionRule, err error) + List(ctx context.Context, alertType string) (result security.AlertsSuppressionRulesListPage, err error) + ListComplete(ctx context.Context, alertType string) (result security.AlertsSuppressionRulesListIterator, err error) + Update(ctx context.Context, alertsSuppressionRuleName string, alertsSuppressionRule security.AlertsSuppressionRule) (result security.AlertsSuppressionRule, err error) +} + +var _ AlertsSuppressionRulesClientAPI = (*security.AlertsSuppressionRulesClient)(nil) diff --git a/services/preview/security/mgmt/v3.0/security/alerts.go b/services/preview/security/mgmt/v3.0/security/alerts.go index 27c79ff77b33..6b5f3f35746d 100644 --- a/services/preview/security/mgmt/v3.0/security/alerts.go +++ b/services/preview/security/mgmt/v3.0/security/alerts.go @@ -216,7 +216,9 @@ func (client AlertsClient) GetSubscriptionLevelAlertResponder(resp *http.Respons // filter - oData filter. Optional. // selectParameter - oData select. Optional. // expand - oData expand. Optional. -func (client AlertsClient) List(ctx context.Context, filter string, selectParameter string, expand string) (result AlertListPage, err error) { +// autoDismissRuleName - the name of an existing auto dismiss rule. Use it to simulate the rule on existing +// alerts and get the alerts that would have been dismissed if the rule was enabled when the alert was created +func (client AlertsClient) List(ctx context.Context, filter string, selectParameter string, expand string, autoDismissRuleName string) (result AlertListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.List") defer func() { @@ -234,7 +236,7 @@ func (client AlertsClient) List(ctx context.Context, filter string, selectParame } result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, filter, selectParameter, expand) + req, err := client.ListPreparer(ctx, filter, selectParameter, expand, autoDismissRuleName) if err != nil { err = autorest.NewErrorWithError(err, "security.AlertsClient", "List", nil, "Failure preparing request") return @@ -256,7 +258,7 @@ func (client AlertsClient) List(ctx context.Context, filter string, selectParame } // ListPreparer prepares the List request. -func (client AlertsClient) ListPreparer(ctx context.Context, filter string, selectParameter string, expand string) (*http.Request, error) { +func (client AlertsClient) ListPreparer(ctx context.Context, filter string, selectParameter string, expand string, autoDismissRuleName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "subscriptionId": autorest.Encode("path", client.SubscriptionID), } @@ -274,6 +276,9 @@ func (client AlertsClient) ListPreparer(ctx context.Context, filter string, sele if len(expand) > 0 { queryParameters["$expand"] = autorest.Encode("query", expand) } + if len(autoDismissRuleName) > 0 { + queryParameters["autoDismissRuleName"] = autorest.Encode("query", autoDismissRuleName) + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -324,7 +329,7 @@ func (client AlertsClient) listNextResults(ctx context.Context, lastResults Aler } // ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client AlertsClient) ListComplete(ctx context.Context, filter string, selectParameter string, expand string) (result AlertListIterator, err error) { +func (client AlertsClient) ListComplete(ctx context.Context, filter string, selectParameter string, expand string, autoDismissRuleName string) (result AlertListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.List") defer func() { @@ -335,7 +340,7 @@ func (client AlertsClient) ListComplete(ctx context.Context, filter string, sele tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.List(ctx, filter, selectParameter, expand) + result.page, err = client.List(ctx, filter, selectParameter, expand, autoDismissRuleName) return } @@ -346,7 +351,9 @@ func (client AlertsClient) ListComplete(ctx context.Context, filter string, sele // filter - oData filter. Optional. // selectParameter - oData select. Optional. // expand - oData expand. Optional. -func (client AlertsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, filter string, selectParameter string, expand string) (result AlertListPage, err error) { +// autoDismissRuleName - the name of an existing auto dismiss rule. Use it to simulate the rule on existing +// alerts and get the alerts that would have been dismissed if the rule was enabled when the alert was created +func (client AlertsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, filter string, selectParameter string, expand string, autoDismissRuleName string) (result AlertListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.ListByResourceGroup") defer func() { @@ -368,7 +375,7 @@ func (client AlertsClient) ListByResourceGroup(ctx context.Context, resourceGrou } result.fn = client.listByResourceGroupNextResults - req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, filter, selectParameter, expand) + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, filter, selectParameter, expand, autoDismissRuleName) if err != nil { err = autorest.NewErrorWithError(err, "security.AlertsClient", "ListByResourceGroup", nil, "Failure preparing request") return @@ -390,7 +397,7 @@ func (client AlertsClient) ListByResourceGroup(ctx context.Context, resourceGrou } // ListByResourceGroupPreparer prepares the ListByResourceGroup request. -func (client AlertsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string, filter string, selectParameter string, expand string) (*http.Request, error) { +func (client AlertsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string, filter string, selectParameter string, expand string, autoDismissRuleName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "resourceGroupName": autorest.Encode("path", resourceGroupName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -409,6 +416,9 @@ func (client AlertsClient) ListByResourceGroupPreparer(ctx context.Context, reso if len(expand) > 0 { queryParameters["$expand"] = autorest.Encode("query", expand) } + if len(autoDismissRuleName) > 0 { + queryParameters["autoDismissRuleName"] = autorest.Encode("query", autoDismissRuleName) + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -459,7 +469,7 @@ func (client AlertsClient) listByResourceGroupNextResults(ctx context.Context, l } // ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. -func (client AlertsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, filter string, selectParameter string, expand string) (result AlertListIterator, err error) { +func (client AlertsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, filter string, selectParameter string, expand string, autoDismissRuleName string) (result AlertListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.ListByResourceGroup") defer func() { @@ -470,7 +480,7 @@ func (client AlertsClient) ListByResourceGroupComplete(ctx context.Context, reso tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListByResourceGroup(ctx, resourceGroupName, filter, selectParameter, expand) + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName, filter, selectParameter, expand, autoDismissRuleName) return } @@ -482,7 +492,9 @@ func (client AlertsClient) ListByResourceGroupComplete(ctx context.Context, reso // filter - oData filter. Optional. // selectParameter - oData select. Optional. // expand - oData expand. Optional. -func (client AlertsClient) ListResourceGroupLevelAlertsByRegion(ctx context.Context, resourceGroupName string, filter string, selectParameter string, expand string) (result AlertListPage, err error) { +// autoDismissRuleName - the name of an existing auto dismiss rule. Use it to simulate the rule on existing +// alerts and get the alerts that would have been dismissed if the rule was enabled when the alert was created +func (client AlertsClient) ListResourceGroupLevelAlertsByRegion(ctx context.Context, resourceGroupName string, filter string, selectParameter string, expand string, autoDismissRuleName string) (result AlertListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.ListResourceGroupLevelAlertsByRegion") defer func() { @@ -504,7 +516,7 @@ func (client AlertsClient) ListResourceGroupLevelAlertsByRegion(ctx context.Cont } result.fn = client.listResourceGroupLevelAlertsByRegionNextResults - req, err := client.ListResourceGroupLevelAlertsByRegionPreparer(ctx, resourceGroupName, filter, selectParameter, expand) + req, err := client.ListResourceGroupLevelAlertsByRegionPreparer(ctx, resourceGroupName, filter, selectParameter, expand, autoDismissRuleName) if err != nil { err = autorest.NewErrorWithError(err, "security.AlertsClient", "ListResourceGroupLevelAlertsByRegion", nil, "Failure preparing request") return @@ -526,7 +538,7 @@ func (client AlertsClient) ListResourceGroupLevelAlertsByRegion(ctx context.Cont } // ListResourceGroupLevelAlertsByRegionPreparer prepares the ListResourceGroupLevelAlertsByRegion request. -func (client AlertsClient) ListResourceGroupLevelAlertsByRegionPreparer(ctx context.Context, resourceGroupName string, filter string, selectParameter string, expand string) (*http.Request, error) { +func (client AlertsClient) ListResourceGroupLevelAlertsByRegionPreparer(ctx context.Context, resourceGroupName string, filter string, selectParameter string, expand string, autoDismissRuleName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "ascLocation": autorest.Encode("path", client.AscLocation), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -546,6 +558,9 @@ func (client AlertsClient) ListResourceGroupLevelAlertsByRegionPreparer(ctx cont if len(expand) > 0 { queryParameters["$expand"] = autorest.Encode("query", expand) } + if len(autoDismissRuleName) > 0 { + queryParameters["autoDismissRuleName"] = autorest.Encode("query", autoDismissRuleName) + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -596,7 +611,7 @@ func (client AlertsClient) listResourceGroupLevelAlertsByRegionNextResults(ctx c } // ListResourceGroupLevelAlertsByRegionComplete enumerates all values, automatically crossing page boundaries as required. -func (client AlertsClient) ListResourceGroupLevelAlertsByRegionComplete(ctx context.Context, resourceGroupName string, filter string, selectParameter string, expand string) (result AlertListIterator, err error) { +func (client AlertsClient) ListResourceGroupLevelAlertsByRegionComplete(ctx context.Context, resourceGroupName string, filter string, selectParameter string, expand string, autoDismissRuleName string) (result AlertListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.ListResourceGroupLevelAlertsByRegion") defer func() { @@ -607,7 +622,7 @@ func (client AlertsClient) ListResourceGroupLevelAlertsByRegionComplete(ctx cont tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListResourceGroupLevelAlertsByRegion(ctx, resourceGroupName, filter, selectParameter, expand) + result.page, err = client.ListResourceGroupLevelAlertsByRegion(ctx, resourceGroupName, filter, selectParameter, expand, autoDismissRuleName) return } @@ -617,7 +632,9 @@ func (client AlertsClient) ListResourceGroupLevelAlertsByRegionComplete(ctx cont // filter - oData filter. Optional. // selectParameter - oData select. Optional. // expand - oData expand. Optional. -func (client AlertsClient) ListSubscriptionLevelAlertsByRegion(ctx context.Context, filter string, selectParameter string, expand string) (result AlertListPage, err error) { +// autoDismissRuleName - the name of an existing auto dismiss rule. Use it to simulate the rule on existing +// alerts and get the alerts that would have been dismissed if the rule was enabled when the alert was created +func (client AlertsClient) ListSubscriptionLevelAlertsByRegion(ctx context.Context, filter string, selectParameter string, expand string, autoDismissRuleName string) (result AlertListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.ListSubscriptionLevelAlertsByRegion") defer func() { @@ -635,7 +652,7 @@ func (client AlertsClient) ListSubscriptionLevelAlertsByRegion(ctx context.Conte } result.fn = client.listSubscriptionLevelAlertsByRegionNextResults - req, err := client.ListSubscriptionLevelAlertsByRegionPreparer(ctx, filter, selectParameter, expand) + req, err := client.ListSubscriptionLevelAlertsByRegionPreparer(ctx, filter, selectParameter, expand, autoDismissRuleName) if err != nil { err = autorest.NewErrorWithError(err, "security.AlertsClient", "ListSubscriptionLevelAlertsByRegion", nil, "Failure preparing request") return @@ -657,7 +674,7 @@ func (client AlertsClient) ListSubscriptionLevelAlertsByRegion(ctx context.Conte } // ListSubscriptionLevelAlertsByRegionPreparer prepares the ListSubscriptionLevelAlertsByRegion request. -func (client AlertsClient) ListSubscriptionLevelAlertsByRegionPreparer(ctx context.Context, filter string, selectParameter string, expand string) (*http.Request, error) { +func (client AlertsClient) ListSubscriptionLevelAlertsByRegionPreparer(ctx context.Context, filter string, selectParameter string, expand string, autoDismissRuleName string) (*http.Request, error) { pathParameters := map[string]interface{}{ "ascLocation": autorest.Encode("path", client.AscLocation), "subscriptionId": autorest.Encode("path", client.SubscriptionID), @@ -676,6 +693,9 @@ func (client AlertsClient) ListSubscriptionLevelAlertsByRegionPreparer(ctx conte if len(expand) > 0 { queryParameters["$expand"] = autorest.Encode("query", expand) } + if len(autoDismissRuleName) > 0 { + queryParameters["autoDismissRuleName"] = autorest.Encode("query", autoDismissRuleName) + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -726,7 +746,7 @@ func (client AlertsClient) listSubscriptionLevelAlertsByRegionNextResults(ctx co } // ListSubscriptionLevelAlertsByRegionComplete enumerates all values, automatically crossing page boundaries as required. -func (client AlertsClient) ListSubscriptionLevelAlertsByRegionComplete(ctx context.Context, filter string, selectParameter string, expand string) (result AlertListIterator, err error) { +func (client AlertsClient) ListSubscriptionLevelAlertsByRegionComplete(ctx context.Context, filter string, selectParameter string, expand string, autoDismissRuleName string) (result AlertListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/AlertsClient.ListSubscriptionLevelAlertsByRegion") defer func() { @@ -737,7 +757,7 @@ func (client AlertsClient) ListSubscriptionLevelAlertsByRegionComplete(ctx conte tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.ListSubscriptionLevelAlertsByRegion(ctx, filter, selectParameter, expand) + result.page, err = client.ListSubscriptionLevelAlertsByRegion(ctx, filter, selectParameter, expand, autoDismissRuleName) return } diff --git a/services/preview/security/mgmt/v3.0/security/alertssuppressionrules.go b/services/preview/security/mgmt/v3.0/security/alertssuppressionrules.go new file mode 100644 index 000000000000..4a2a2f0d4462 --- /dev/null +++ b/services/preview/security/mgmt/v3.0/security/alertssuppressionrules.go @@ -0,0 +1,413 @@ +package security + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// AlertsSuppressionRulesClient is the API spec for Microsoft.Security (Azure Security Center) resource provider +type AlertsSuppressionRulesClient struct { + BaseClient +} + +// NewAlertsSuppressionRulesClient creates an instance of the AlertsSuppressionRulesClient client. +func NewAlertsSuppressionRulesClient(subscriptionID string, ascLocation string) AlertsSuppressionRulesClient { + return NewAlertsSuppressionRulesClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +} + +// NewAlertsSuppressionRulesClientWithBaseURI creates an instance of the AlertsSuppressionRulesClient 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 NewAlertsSuppressionRulesClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) AlertsSuppressionRulesClient { + return AlertsSuppressionRulesClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +} + +// Delete delete dismiss alert rule for this subscription. +// Parameters: +// alertsSuppressionRuleName - the unique name of the suppression alert rule +func (client AlertsSuppressionRulesClient) Delete(ctx context.Context, alertsSuppressionRuleName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AlertsSuppressionRulesClient.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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.AlertsSuppressionRulesClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, alertsSuppressionRuleName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AlertsSuppressionRulesClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "security.AlertsSuppressionRulesClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AlertsSuppressionRulesClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client AlertsSuppressionRulesClient) DeletePreparer(ctx context.Context, alertsSuppressionRuleName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "alertsSuppressionRuleName": autorest.Encode("path", alertsSuppressionRuleName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules/{alertsSuppressionRuleName}", 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 AlertsSuppressionRulesClient) 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 AlertsSuppressionRulesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get dismiss rule, with name: {alertsSuppressionRuleName}, for the given subscription +// Parameters: +// alertsSuppressionRuleName - the unique name of the suppression alert rule +func (client AlertsSuppressionRulesClient) Get(ctx context.Context, alertsSuppressionRuleName string) (result AlertsSuppressionRule, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AlertsSuppressionRulesClient.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.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.AlertsSuppressionRulesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, alertsSuppressionRuleName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AlertsSuppressionRulesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.AlertsSuppressionRulesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AlertsSuppressionRulesClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client AlertsSuppressionRulesClient) GetPreparer(ctx context.Context, alertsSuppressionRuleName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "alertsSuppressionRuleName": autorest.Encode("path", alertsSuppressionRuleName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules/{alertsSuppressionRuleName}", 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 AlertsSuppressionRulesClient) 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 AlertsSuppressionRulesClient) GetResponder(resp *http.Response) (result AlertsSuppressionRule, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List list of all the dismiss rules for the given subscription +// Parameters: +// alertType - type of the alert to get rules for +func (client AlertsSuppressionRulesClient) List(ctx context.Context, alertType string) (result AlertsSuppressionRulesListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AlertsSuppressionRulesClient.List") + defer func() { + sc := -1 + if result.asrl.Response.Response != nil { + sc = result.asrl.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.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.AlertsSuppressionRulesClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, alertType) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AlertsSuppressionRulesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.asrl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.AlertsSuppressionRulesClient", "List", resp, "Failure sending request") + return + } + + result.asrl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AlertsSuppressionRulesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client AlertsSuppressionRulesClient) ListPreparer(ctx context.Context, alertType string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(alertType) > 0 { + queryParameters["AlertType"] = autorest.Encode("query", alertType) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/alertsSuppressionRules", 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 AlertsSuppressionRulesClient) 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 AlertsSuppressionRulesClient) ListResponder(resp *http.Response) (result AlertsSuppressionRulesList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 AlertsSuppressionRulesClient) listNextResults(ctx context.Context, lastResults AlertsSuppressionRulesList) (result AlertsSuppressionRulesList, err error) { + req, err := lastResults.alertsSuppressionRulesListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.AlertsSuppressionRulesClient", "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, "security.AlertsSuppressionRulesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AlertsSuppressionRulesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client AlertsSuppressionRulesClient) ListComplete(ctx context.Context, alertType string) (result AlertsSuppressionRulesListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AlertsSuppressionRulesClient.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, alertType) + return +} + +// Update update existing rule or create new rule if it doesn't exist +// Parameters: +// alertsSuppressionRuleName - the unique name of the suppression alert rule +// alertsSuppressionRule - suppression rule object +func (client AlertsSuppressionRulesClient) Update(ctx context.Context, alertsSuppressionRuleName string, alertsSuppressionRule AlertsSuppressionRule) (result AlertsSuppressionRule, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AlertsSuppressionRulesClient.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.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}, + {TargetValue: alertsSuppressionRule, + Constraints: []validation.Constraint{{Target: "alertsSuppressionRule.AlertsSuppressionRuleProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "alertsSuppressionRule.AlertsSuppressionRuleProperties.AlertType", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "alertsSuppressionRule.AlertsSuppressionRuleProperties.Reason", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "alertsSuppressionRule.AlertsSuppressionRuleProperties.SuppressionAlertsScope", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "alertsSuppressionRule.AlertsSuppressionRuleProperties.SuppressionAlertsScope.AllOf", Name: validation.Null, Rule: true, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("security.AlertsSuppressionRulesClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, alertsSuppressionRuleName, alertsSuppressionRule) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AlertsSuppressionRulesClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.AlertsSuppressionRulesClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.AlertsSuppressionRulesClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client AlertsSuppressionRulesClient) UpdatePreparer(ctx context.Context, alertsSuppressionRuleName string, alertsSuppressionRule AlertsSuppressionRule) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "alertsSuppressionRuleName": autorest.Encode("path", alertsSuppressionRuleName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-01-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}/providers/Microsoft.Security/alertsSuppressionRules/{alertsSuppressionRuleName}", pathParameters), + autorest.WithJSON(alertsSuppressionRule), + 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 AlertsSuppressionRulesClient) 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 AlertsSuppressionRulesClient) UpdateResponder(resp *http.Response) (result AlertsSuppressionRule, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/security/mgmt/v3.0/security/discoveredsecuritysolutions.go b/services/preview/security/mgmt/v3.0/security/discoveredsecuritysolutions.go index 5cad25154319..217033b9c567 100644 --- a/services/preview/security/mgmt/v3.0/security/discoveredsecuritysolutions.go +++ b/services/preview/security/mgmt/v3.0/security/discoveredsecuritysolutions.go @@ -99,7 +99,7 @@ func (client DiscoveredSecuritySolutionsClient) GetPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2015-06-01-preview" + const APIVersion = "2020-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -177,7 +177,7 @@ func (client DiscoveredSecuritySolutionsClient) ListPreparer(ctx context.Context "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2015-06-01-preview" + const APIVersion = "2020-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -293,7 +293,7 @@ func (client DiscoveredSecuritySolutionsClient) ListByHomeRegionPreparer(ctx con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2015-06-01-preview" + const APIVersion = "2020-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/preview/security/mgmt/v3.0/security/externalsecuritysolutions.go b/services/preview/security/mgmt/v3.0/security/externalsecuritysolutions.go index 614aa067c07b..6bb43eddfe52 100644 --- a/services/preview/security/mgmt/v3.0/security/externalsecuritysolutions.go +++ b/services/preview/security/mgmt/v3.0/security/externalsecuritysolutions.go @@ -99,7 +99,7 @@ func (client ExternalSecuritySolutionsClient) GetPreparer(ctx context.Context, r "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2015-06-01-preview" + const APIVersion = "2020-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -177,7 +177,7 @@ func (client ExternalSecuritySolutionsClient) ListPreparer(ctx context.Context) "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2015-06-01-preview" + const APIVersion = "2020-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -293,7 +293,7 @@ func (client ExternalSecuritySolutionsClient) ListByHomeRegionPreparer(ctx conte "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2015-06-01-preview" + const APIVersion = "2020-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/preview/security/mgmt/v3.0/security/iotsecuritysolution.go b/services/preview/security/mgmt/v3.0/security/iotsecuritysolution.go index bcedd492e4e8..327cd1cb56a9 100644 --- a/services/preview/security/mgmt/v3.0/security/iotsecuritysolution.go +++ b/services/preview/security/mgmt/v3.0/security/iotsecuritysolution.go @@ -69,8 +69,7 @@ func (client IotSecuritySolutionClient) CreateOrUpdate(ctx context.Context, reso {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, {TargetValue: iotSecuritySolutionData, Constraints: []validation.Constraint{{Target: "iotSecuritySolutionData.IoTSecuritySolutionProperties", Name: validation.Null, Rule: false, - Chain: []validation.Constraint{{Target: "iotSecuritySolutionData.IoTSecuritySolutionProperties.Workspace", Name: validation.Null, Rule: true, Chain: nil}, - {Target: "iotSecuritySolutionData.IoTSecuritySolutionProperties.DisplayName", Name: validation.Null, Rule: true, Chain: nil}, + Chain: []validation.Constraint{{Target: "iotSecuritySolutionData.IoTSecuritySolutionProperties.DisplayName", Name: validation.Null, Rule: true, Chain: nil}, {Target: "iotSecuritySolutionData.IoTSecuritySolutionProperties.IotHubs", Name: validation.Null, Rule: true, Chain: nil}, {Target: "iotSecuritySolutionData.IoTSecuritySolutionProperties.UserDefinedResources", Name: validation.Null, Rule: false, Chain: []validation.Constraint{{Target: "iotSecuritySolutionData.IoTSecuritySolutionProperties.UserDefinedResources.Query", Name: validation.Null, Rule: true, Chain: nil}, diff --git a/services/preview/security/mgmt/v3.0/security/models.go b/services/preview/security/mgmt/v3.0/security/models.go index 671f0eb66a6e..25e534ac14d8 100644 --- a/services/preview/security/mgmt/v3.0/security/models.go +++ b/services/preview/security/mgmt/v3.0/security/models.go @@ -286,6 +286,21 @@ func PossibleConnectionTypeValues() []ConnectionType { return []ConnectionType{External, Internal} } +// ControlType enumerates the values for control type. +type ControlType string + +const ( + // ControlTypeBuiltIn Azure Security Center managed assessments + ControlTypeBuiltIn ControlType = "BuiltIn" + // ControlTypeCustom Non Azure Security Center managed assessments + ControlTypeCustom ControlType = "Custom" +) + +// PossibleControlTypeValues returns an array of possible values for the ControlType const type. +func PossibleControlTypeValues() []ControlType { + return []ControlType{ControlTypeBuiltIn, ControlTypeCustom} +} + // DataSource enumerates the values for data source. type DataSource string @@ -397,6 +412,19 @@ func PossibleExecutableValues() []Executable { return []Executable{ExecutableAudit, ExecutableEnforce, ExecutableNone} } +// ExpandControlsEnum enumerates the values for expand controls enum. +type ExpandControlsEnum string + +const ( + // Definition Add definition object for each control + Definition ExpandControlsEnum = "definition" +) + +// PossibleExpandControlsEnumValues returns an array of possible values for the ExpandControlsEnum const type. +func PossibleExpandControlsEnumValues() []ExpandControlsEnum { + return []ExpandControlsEnum{Definition} +} + // ExpandEnum enumerates the values for expand enum. type ExpandEnum string @@ -527,20 +555,37 @@ func PossibleIssueValues() []Issue { // KindEnum enumerates the values for kind enum. type KindEnum string +const ( + // KindDataExportSettings ... + KindDataExportSettings KindEnum = "DataExportSettings" + // KindSetting ... + KindSetting KindEnum = "Setting" + // KindSettingResource ... + KindSettingResource KindEnum = "SettingResource" +) + +// PossibleKindEnumValues returns an array of possible values for the KindEnum const type. +func PossibleKindEnumValues() []KindEnum { + return []KindEnum{KindDataExportSettings, KindSetting, KindSettingResource} +} + +// KindEnum1 enumerates the values for kind enum 1. +type KindEnum1 string + const ( // KindAAD ... - KindAAD KindEnum = "AAD" + KindAAD KindEnum1 = "AAD" // KindATA ... - KindATA KindEnum = "ATA" + KindATA KindEnum1 = "ATA" // KindCEF ... - KindCEF KindEnum = "CEF" + KindCEF KindEnum1 = "CEF" // KindExternalSecuritySolution ... - KindExternalSecuritySolution KindEnum = "ExternalSecuritySolution" + KindExternalSecuritySolution KindEnum1 = "ExternalSecuritySolution" ) -// PossibleKindEnumValues returns an array of possible values for the KindEnum const type. -func PossibleKindEnumValues() []KindEnum { - return []KindEnum{KindAAD, KindATA, KindCEF, KindExternalSecuritySolution} +// PossibleKindEnum1Values returns an array of possible values for the KindEnum1 const type. +func PossibleKindEnum1Values() []KindEnum1 { + return []KindEnum1{KindAAD, KindATA, KindCEF, KindExternalSecuritySolution} } // Msi enumerates the values for msi. @@ -843,6 +888,23 @@ func PossibleResourceStatusValues() []ResourceStatus { return []ResourceStatus{ResourceStatusHealthy, ResourceStatusNotApplicable, ResourceStatusNotHealthy, ResourceStatusOffByPolicy} } +// RuleState enumerates the values for rule state. +type RuleState string + +const ( + // RuleStateDisabled ... + RuleStateDisabled RuleState = "Disabled" + // RuleStateEnabled ... + RuleStateEnabled RuleState = "Enabled" + // RuleStateExpired ... + RuleStateExpired RuleState = "Expired" +) + +// PossibleRuleStateValues returns an array of possible values for the RuleState const type. +func PossibleRuleStateValues() []RuleState { + return []RuleState{RuleStateDisabled, RuleStateEnabled, RuleStateExpired} +} + // RuleType enumerates the values for rule type. type RuleType string @@ -921,21 +983,6 @@ func PossibleScriptValues() []Script { return []Script{ScriptAudit, ScriptEnforce, ScriptNone} } -// SettingKind enumerates the values for setting kind. -type SettingKind string - -const ( - // SettingKindAlertSuppressionSetting ... - SettingKindAlertSuppressionSetting SettingKind = "AlertSuppressionSetting" - // SettingKindDataExportSetting ... - SettingKindDataExportSetting SettingKind = "DataExportSetting" -) - -// PossibleSettingKindValues returns an array of possible values for the SettingKind const type. -func PossibleSettingKindValues() []SettingKind { - return []SettingKind{SettingKindAlertSuppressionSetting, SettingKindDataExportSetting} -} - // Severity enumerates the values for severity. type Severity string @@ -1206,7 +1253,7 @@ type AadExternalSecuritySolution struct { // Location - READ-ONLY; Location where the resource is stored Location *string `json:"location,omitempty"` // Kind - Possible values include: 'KindExternalSecuritySolution', 'KindCEF', 'KindATA', 'KindAAD' - Kind KindEnum `json:"kind,omitempty"` + Kind KindEnum1 `json:"kind,omitempty"` } // MarshalJSON is the custom marshaler for AadExternalSecuritySolution. @@ -2222,6 +2269,242 @@ func (ap AlertProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// AlertsSuppressionRule describes the suppression rule +type AlertsSuppressionRule struct { + autorest.Response `json:"-"` + *AlertsSuppressionRuleProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AlertsSuppressionRule. +func (asr AlertsSuppressionRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if asr.AlertsSuppressionRuleProperties != nil { + objectMap["properties"] = asr.AlertsSuppressionRuleProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AlertsSuppressionRule struct. +func (asr *AlertsSuppressionRule) 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 alertsSuppressionRuleProperties AlertsSuppressionRuleProperties + err = json.Unmarshal(*v, &alertsSuppressionRuleProperties) + if err != nil { + return err + } + asr.AlertsSuppressionRuleProperties = &alertsSuppressionRuleProperties + } + 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 "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + asr.Type = &typeVar + } + } + } + + return nil +} + +// AlertsSuppressionRuleProperties describes AlertsSuppressionRule properties +type AlertsSuppressionRuleProperties struct { + // AlertType - Type of the alert to automatically suppress. For all alert types, use '*' + AlertType *string `json:"alertType,omitempty"` + // LastModifiedUtc - READ-ONLY; The last time this rule was modified + LastModifiedUtc *date.Time `json:"lastModifiedUtc,omitempty"` + // ExpirationDateUtc - Expiration date of the rule, if value is not provided or provided as null this field will default to the maximum allowed expiration date. + ExpirationDateUtc *date.Time `json:"expirationDateUtc,omitempty"` + // Reason - The reason for dismissing the alert + Reason *string `json:"reason,omitempty"` + // State - Possible states of the rule. Possible values include: 'RuleStateEnabled', 'RuleStateDisabled', 'RuleStateExpired' + State RuleState `json:"state,omitempty"` + // Comment - Any comment regarding the rule + Comment *string `json:"comment,omitempty"` + // SuppressionAlertsScope - The suppression conditions + SuppressionAlertsScope *SuppressionAlertsScope `json:"suppressionAlertsScope,omitempty"` +} + +// AlertsSuppressionRulesList suppression rules list for subscription. +type AlertsSuppressionRulesList struct { + autorest.Response `json:"-"` + Value *[]AlertsSuppressionRule `json:"value,omitempty"` + // NextLink - READ-ONLY; URI to fetch the next page. + NextLink *string `json:"nextLink,omitempty"` +} + +// AlertsSuppressionRulesListIterator provides access to a complete listing of AlertsSuppressionRule +// values. +type AlertsSuppressionRulesListIterator struct { + i int + page AlertsSuppressionRulesListPage +} + +// 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 *AlertsSuppressionRulesListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AlertsSuppressionRulesListIterator.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 *AlertsSuppressionRulesListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter AlertsSuppressionRulesListIterator) 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 AlertsSuppressionRulesListIterator) Response() AlertsSuppressionRulesList { + 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 AlertsSuppressionRulesListIterator) Value() AlertsSuppressionRule { + if !iter.page.NotDone() { + return AlertsSuppressionRule{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the AlertsSuppressionRulesListIterator type. +func NewAlertsSuppressionRulesListIterator(page AlertsSuppressionRulesListPage) AlertsSuppressionRulesListIterator { + return AlertsSuppressionRulesListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (asrl AlertsSuppressionRulesList) IsEmpty() bool { + return asrl.Value == nil || len(*asrl.Value) == 0 +} + +// alertsSuppressionRulesListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (asrl AlertsSuppressionRulesList) alertsSuppressionRulesListPreparer(ctx context.Context) (*http.Request, error) { + if asrl.NextLink == nil || len(to.String(asrl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(asrl.NextLink))) +} + +// AlertsSuppressionRulesListPage contains a page of AlertsSuppressionRule values. +type AlertsSuppressionRulesListPage struct { + fn func(context.Context, AlertsSuppressionRulesList) (AlertsSuppressionRulesList, error) + asrl AlertsSuppressionRulesList +} + +// 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 *AlertsSuppressionRulesListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AlertsSuppressionRulesListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.asrl) + if err != nil { + return err + } + page.asrl = next + 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 *AlertsSuppressionRulesListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page AlertsSuppressionRulesListPage) NotDone() bool { + return !page.asrl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page AlertsSuppressionRulesListPage) Response() AlertsSuppressionRulesList { + return page.asrl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page AlertsSuppressionRulesListPage) Values() []AlertsSuppressionRule { + if page.asrl.IsEmpty() { + return nil + } + return *page.asrl.Value +} + +// Creates a new instance of the AlertsSuppressionRulesListPage type. +func NewAlertsSuppressionRulesListPage(getNextPage func(context.Context, AlertsSuppressionRulesList) (AlertsSuppressionRulesList, error)) AlertsSuppressionRulesListPage { + return AlertsSuppressionRulesListPage{fn: getNextPage} +} + // AllowedConnectionsList list of all possible traffic between Azure resources type AllowedConnectionsList struct { autorest.Response `json:"-"` @@ -4162,7 +4445,7 @@ type AtaExternalSecuritySolution struct { // Location - READ-ONLY; Location where the resource is stored Location *string `json:"location,omitempty"` // Kind - Possible values include: 'KindExternalSecuritySolution', 'KindCEF', 'KindATA', 'KindAAD' - Kind KindEnum `json:"kind,omitempty"` + Kind KindEnum1 `json:"kind,omitempty"` } // MarshalJSON is the custom marshaler for AtaExternalSecuritySolution. @@ -5206,6 +5489,12 @@ func (ard AzureResourceDetails) AsBasicResourceDetails() (BasicResourceDetails, return &ard, true } +// AzureResourceLink describes an Azure resource with kind +type AzureResourceLink struct { + // ID - READ-ONLY; Azure resource Id + ID *string `json:"id,omitempty"` +} + // CefExternalSecuritySolution represents a security solution which sends CEF logs to an OMS workspace type CefExternalSecuritySolution struct { Properties *CefSolutionProperties `json:"properties,omitempty"` @@ -5218,7 +5507,7 @@ type CefExternalSecuritySolution struct { // Location - READ-ONLY; Location where the resource is stored Location *string `json:"location,omitempty"` // Kind - Possible values include: 'KindExternalSecuritySolution', 'KindCEF', 'KindATA', 'KindAAD' - Kind KindEnum `json:"kind,omitempty"` + Kind KindEnum1 `json:"kind,omitempty"` } // MarshalJSON is the custom marshaler for CefExternalSecuritySolution. @@ -6739,22 +7028,29 @@ type CVSS struct { Base *float64 `json:"base,omitempty"` } -// DataExportSetting represents a data export setting -type DataExportSetting struct { +// DataExportSettingProperties the data export setting properties +type DataExportSettingProperties struct { + // Enabled - Is the data export setting is enabled + Enabled *bool `json:"enabled,omitempty"` +} + +// DataExportSettings represents a data export setting +type DataExportSettings struct { // DataExportSettingProperties - Data export setting data *DataExportSettingProperties `json:"properties,omitempty"` - // Kind - the kind of the settings string (DataExportSetting). Possible values include: 'SettingKindDataExportSetting', 'SettingKindAlertSuppressionSetting' - Kind SettingKind `json:"kind,omitempty"` // ID - READ-ONLY; Resource Id ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name Name *string `json:"name,omitempty"` // Type - READ-ONLY; Resource type Type *string `json:"type,omitempty"` + // Kind - Possible values include: 'KindSettingResource', 'KindSetting', 'KindDataExportSettings' + Kind KindEnum `json:"kind,omitempty"` } -// MarshalJSON is the custom marshaler for DataExportSetting. -func (desVar DataExportSetting) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for DataExportSettings. +func (desVar DataExportSettings) MarshalJSON() ([]byte, error) { + desVar.Kind = KindDataExportSettings objectMap := make(map[string]interface{}) if desVar.DataExportSettingProperties != nil { objectMap["properties"] = desVar.DataExportSettingProperties @@ -6765,8 +7061,33 @@ func (desVar DataExportSetting) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for DataExportSetting struct. -func (desVar *DataExportSetting) UnmarshalJSON(body []byte) error { +// AsSetting is the BasicSettingResource implementation for DataExportSettings. +func (desVar DataExportSettings) AsSetting() (*Setting, bool) { + return nil, false +} + +// AsBasicSetting is the BasicSettingResource implementation for DataExportSettings. +func (desVar DataExportSettings) AsBasicSetting() (BasicSetting, bool) { + return &desVar, true +} + +// AsDataExportSettings is the BasicSettingResource implementation for DataExportSettings. +func (desVar DataExportSettings) AsDataExportSettings() (*DataExportSettings, bool) { + return &desVar, true +} + +// AsSettingResource is the BasicSettingResource implementation for DataExportSettings. +func (desVar DataExportSettings) AsSettingResource() (*SettingResource, bool) { + return nil, false +} + +// AsBasicSettingResource is the BasicSettingResource implementation for DataExportSettings. +func (desVar DataExportSettings) AsBasicSettingResource() (BasicSettingResource, bool) { + return &desVar, true +} + +// UnmarshalJSON is the custom unmarshaler for DataExportSettings struct. +func (desVar *DataExportSettings) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -6785,7 +7106,7 @@ func (desVar *DataExportSetting) UnmarshalJSON(body []byte) error { } case "kind": if v != nil { - var kind SettingKind + var kind KindEnum err = json.Unmarshal(*v, &kind) if err != nil { return err @@ -6825,12 +7146,6 @@ func (desVar *DataExportSetting) UnmarshalJSON(body []byte) error { return nil } -// DataExportSettingProperties the data export setting properties -type DataExportSettingProperties struct { - // Enabled - Is the data export setting is enabled - Enabled *bool `json:"enabled,omitempty"` -} - // DenylistCustomAlertRule a custom alert rule that checks if a value (depends on the custom alert type) is // denied. type DenylistCustomAlertRule struct { @@ -7760,7 +8075,7 @@ type ExternalSecuritySolution struct { // Location - READ-ONLY; Location where the resource is stored Location *string `json:"location,omitempty"` // Kind - Possible values include: 'KindExternalSecuritySolution', 'KindCEF', 'KindATA', 'KindAAD' - Kind KindEnum `json:"kind,omitempty"` + Kind KindEnum1 `json:"kind,omitempty"` } func unmarshalBasicExternalSecuritySolution(body []byte) (BasicExternalSecuritySolution, error) { @@ -13204,31 +13519,919 @@ type Rule struct { IPAddresses *[]string `json:"ipAddresses,omitempty"` } -// SensitivityLabel the sensitivity label. -type SensitivityLabel struct { - // DisplayName - The name of the sensitivity label. - DisplayName *string `json:"displayName,omitempty"` - // Description - The description of the sensitivity label. - Description *string `json:"description,omitempty"` - // Rank - The rank of the sensitivity label. Possible values include: 'RankNone', 'RankLow', 'RankMedium', 'RankHigh', 'RankCritical' - Rank Rank `json:"rank,omitempty"` - // Order - The order of the sensitivity label. - Order *int32 `json:"order,omitempty"` - // Enabled - Indicates whether the label is enabled or not. - Enabled *bool `json:"enabled,omitempty"` +// ScopeElement a more specific scope used to identify the alerts to suppress. +type ScopeElement struct { + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Field - The alert entity type to suppress by. + Field *string `json:"field,omitempty"` } -// ServerVulnerabilityAssessment describes the server vulnerability assessment details on a resource -type ServerVulnerabilityAssessment struct { - autorest.Response `json:"-"` - *ServerVulnerabilityAssessmentProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Resource type - Type *string `json:"type,omitempty"` -} +// MarshalJSON is the custom marshaler for ScopeElement. +func (se ScopeElement) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if se.Field != nil { + objectMap["field"] = se.Field + } + for k, v := range se.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ScopeElement struct. +func (se *ScopeElement) 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 { + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if se.AdditionalProperties == nil { + se.AdditionalProperties = make(map[string]interface{}) + } + se.AdditionalProperties[k] = additionalProperties + } + case "field": + if v != nil { + var field string + err = json.Unmarshal(*v, &field) + if err != nil { + return err + } + se.Field = &field + } + } + } + + return nil +} + +// ScoreDetails calculation result data +type ScoreDetails struct { + // Max - READ-ONLY; Maximum score available + Max *int32 `json:"max,omitempty"` + // Current - READ-ONLY; Current score + Current *float64 `json:"current,omitempty"` +} + +// SecureScoreControlDefinitionItem information about the security control. +type SecureScoreControlDefinitionItem struct { + *SecureScoreControlDefinitionItemProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SecureScoreControlDefinitionItem. +func (sscdi SecureScoreControlDefinitionItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sscdi.SecureScoreControlDefinitionItemProperties != nil { + objectMap["properties"] = sscdi.SecureScoreControlDefinitionItemProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SecureScoreControlDefinitionItem struct. +func (sscdi *SecureScoreControlDefinitionItem) 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 secureScoreControlDefinitionItemProperties SecureScoreControlDefinitionItemProperties + err = json.Unmarshal(*v, &secureScoreControlDefinitionItemProperties) + if err != nil { + return err + } + sscdi.SecureScoreControlDefinitionItemProperties = &secureScoreControlDefinitionItemProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sscdi.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sscdi.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sscdi.Type = &typeVar + } + } + } + + return nil +} + +// SecureScoreControlDefinitionItemProperties security Control Definition Properties. +type SecureScoreControlDefinitionItemProperties struct { + // DisplayName - READ-ONLY; User friendly display name of the control + DisplayName *string `json:"displayName,omitempty"` + // Description - READ-ONLY; User friendly description of the control + Description *string `json:"description,omitempty"` + // MaxScore - READ-ONLY; Maximum control score (0..10) + MaxScore *int32 `json:"maxScore,omitempty"` + // Source - READ-ONLY; Source object from which the control was created + Source *SecureScoreControlDefinitionSource `json:"source,omitempty"` + // AssessmentDefinitions - READ-ONLY; Array of assessments metadata IDs that are included in this security control + AssessmentDefinitions *[]AzureResourceLink `json:"assessmentDefinitions,omitempty"` +} + +// SecureScoreControlDefinitionList list of security controls definition +type SecureScoreControlDefinitionList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; Collection of security controls definition in this page + Value *[]SecureScoreControlDefinitionItem `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page. + NextLink *string `json:"nextLink,omitempty"` +} + +// SecureScoreControlDefinitionListIterator provides access to a complete listing of +// SecureScoreControlDefinitionItem values. +type SecureScoreControlDefinitionListIterator struct { + i int + page SecureScoreControlDefinitionListPage +} + +// 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 *SecureScoreControlDefinitionListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoreControlDefinitionListIterator.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 *SecureScoreControlDefinitionListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SecureScoreControlDefinitionListIterator) 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 SecureScoreControlDefinitionListIterator) Response() SecureScoreControlDefinitionList { + 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 SecureScoreControlDefinitionListIterator) Value() SecureScoreControlDefinitionItem { + if !iter.page.NotDone() { + return SecureScoreControlDefinitionItem{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the SecureScoreControlDefinitionListIterator type. +func NewSecureScoreControlDefinitionListIterator(page SecureScoreControlDefinitionListPage) SecureScoreControlDefinitionListIterator { + return SecureScoreControlDefinitionListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (sscdl SecureScoreControlDefinitionList) IsEmpty() bool { + return sscdl.Value == nil || len(*sscdl.Value) == 0 +} + +// secureScoreControlDefinitionListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (sscdl SecureScoreControlDefinitionList) secureScoreControlDefinitionListPreparer(ctx context.Context) (*http.Request, error) { + if sscdl.NextLink == nil || len(to.String(sscdl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(sscdl.NextLink))) +} + +// SecureScoreControlDefinitionListPage contains a page of SecureScoreControlDefinitionItem values. +type SecureScoreControlDefinitionListPage struct { + fn func(context.Context, SecureScoreControlDefinitionList) (SecureScoreControlDefinitionList, error) + sscdl SecureScoreControlDefinitionList +} + +// 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 *SecureScoreControlDefinitionListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoreControlDefinitionListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.sscdl) + if err != nil { + return err + } + page.sscdl = next + 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 *SecureScoreControlDefinitionListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SecureScoreControlDefinitionListPage) NotDone() bool { + return !page.sscdl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SecureScoreControlDefinitionListPage) Response() SecureScoreControlDefinitionList { + return page.sscdl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SecureScoreControlDefinitionListPage) Values() []SecureScoreControlDefinitionItem { + if page.sscdl.IsEmpty() { + return nil + } + return *page.sscdl.Value +} + +// Creates a new instance of the SecureScoreControlDefinitionListPage type. +func NewSecureScoreControlDefinitionListPage(getNextPage func(context.Context, SecureScoreControlDefinitionList) (SecureScoreControlDefinitionList, error)) SecureScoreControlDefinitionListPage { + return SecureScoreControlDefinitionListPage{fn: getNextPage} +} + +// SecureScoreControlDefinitionSource the type of the security control (For example, BuiltIn) +type SecureScoreControlDefinitionSource struct { + // SourceType - The type of security control (for example, BuiltIn). Possible values include: 'ControlTypeBuiltIn', 'ControlTypeCustom' + SourceType ControlType `json:"sourceType,omitempty"` +} + +// SecureScoreControlDetails details of the security control, its score, and the health status of the +// relevant resources. +type SecureScoreControlDetails struct { + *SecureScoreControlScoreDetails `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SecureScoreControlDetails. +func (sscd SecureScoreControlDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sscd.SecureScoreControlScoreDetails != nil { + objectMap["properties"] = sscd.SecureScoreControlScoreDetails + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SecureScoreControlDetails struct. +func (sscd *SecureScoreControlDetails) 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 secureScoreControlScoreDetails SecureScoreControlScoreDetails + err = json.Unmarshal(*v, &secureScoreControlScoreDetails) + if err != nil { + return err + } + sscd.SecureScoreControlScoreDetails = &secureScoreControlScoreDetails + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sscd.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sscd.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sscd.Type = &typeVar + } + } + } + + return nil +} + +// SecureScoreControlList list of security controls +type SecureScoreControlList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; Collection of security controls in this page + Value *[]SecureScoreControlDetails `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page. + NextLink *string `json:"nextLink,omitempty"` +} + +// SecureScoreControlListIterator provides access to a complete listing of SecureScoreControlDetails +// values. +type SecureScoreControlListIterator struct { + i int + page SecureScoreControlListPage +} + +// 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 *SecureScoreControlListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoreControlListIterator.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 *SecureScoreControlListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SecureScoreControlListIterator) 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 SecureScoreControlListIterator) Response() SecureScoreControlList { + 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 SecureScoreControlListIterator) Value() SecureScoreControlDetails { + if !iter.page.NotDone() { + return SecureScoreControlDetails{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the SecureScoreControlListIterator type. +func NewSecureScoreControlListIterator(page SecureScoreControlListPage) SecureScoreControlListIterator { + return SecureScoreControlListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (sscl SecureScoreControlList) IsEmpty() bool { + return sscl.Value == nil || len(*sscl.Value) == 0 +} + +// secureScoreControlListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (sscl SecureScoreControlList) secureScoreControlListPreparer(ctx context.Context) (*http.Request, error) { + if sscl.NextLink == nil || len(to.String(sscl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(sscl.NextLink))) +} + +// SecureScoreControlListPage contains a page of SecureScoreControlDetails values. +type SecureScoreControlListPage struct { + fn func(context.Context, SecureScoreControlList) (SecureScoreControlList, error) + sscl SecureScoreControlList +} + +// 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 *SecureScoreControlListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoreControlListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.sscl) + if err != nil { + return err + } + page.sscl = next + 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 *SecureScoreControlListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SecureScoreControlListPage) NotDone() bool { + return !page.sscl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SecureScoreControlListPage) Response() SecureScoreControlList { + return page.sscl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SecureScoreControlListPage) Values() []SecureScoreControlDetails { + if page.sscl.IsEmpty() { + return nil + } + return *page.sscl.Value +} + +// Creates a new instance of the SecureScoreControlListPage type. +func NewSecureScoreControlListPage(getNextPage func(context.Context, SecureScoreControlList) (SecureScoreControlList, error)) SecureScoreControlListPage { + return SecureScoreControlListPage{fn: getNextPage} +} + +// SecureScoreControlScore calculation result data +type SecureScoreControlScore struct { + // Max - READ-ONLY; Maximum control score (0..10) + Max *int32 `json:"max,omitempty"` + // Current - READ-ONLY; Actual score for the control = (achieved points / total points) * max score. if total points is zeroed, the return number is 0.00 + Current *float64 `json:"current,omitempty"` +} + +// SecureScoreControlScoreDetails calculation result data in control level +type SecureScoreControlScoreDetails struct { + // DisplayName - READ-ONLY; User friendly display name of the control + DisplayName *string `json:"displayName,omitempty"` + // ScoreDetails - Actual score object for the control + *ScoreDetails `json:"score,omitempty"` + // HealthyResourceCount - READ-ONLY; Number of healthy resources in the control + HealthyResourceCount *int32 `json:"healthyResourceCount,omitempty"` + // UnhealthyResourceCount - READ-ONLY; Number of unhealthy resources in the control + UnhealthyResourceCount *int32 `json:"unhealthyResourceCount,omitempty"` + // NotApplicableResourceCount - READ-ONLY; Number of not applicable resources in the control + NotApplicableResourceCount *int32 `json:"notApplicableResourceCount,omitempty"` + Definition *SecureScoreControlDefinitionItem `json:"definition,omitempty"` +} + +// MarshalJSON is the custom marshaler for SecureScoreControlScoreDetails. +func (sscsd SecureScoreControlScoreDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sscsd.ScoreDetails != nil { + objectMap["score"] = sscsd.ScoreDetails + } + if sscsd.Definition != nil { + objectMap["definition"] = sscsd.Definition + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SecureScoreControlScoreDetails struct. +func (sscsd *SecureScoreControlScoreDetails) 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 "displayName": + if v != nil { + var displayName string + err = json.Unmarshal(*v, &displayName) + if err != nil { + return err + } + sscsd.DisplayName = &displayName + } + case "score": + if v != nil { + var scoreDetails ScoreDetails + err = json.Unmarshal(*v, &scoreDetails) + if err != nil { + return err + } + sscsd.ScoreDetails = &scoreDetails + } + case "healthyResourceCount": + if v != nil { + var healthyResourceCount int32 + err = json.Unmarshal(*v, &healthyResourceCount) + if err != nil { + return err + } + sscsd.HealthyResourceCount = &healthyResourceCount + } + case "unhealthyResourceCount": + if v != nil { + var unhealthyResourceCount int32 + err = json.Unmarshal(*v, &unhealthyResourceCount) + if err != nil { + return err + } + sscsd.UnhealthyResourceCount = &unhealthyResourceCount + } + case "notApplicableResourceCount": + if v != nil { + var notApplicableResourceCount int32 + err = json.Unmarshal(*v, ¬ApplicableResourceCount) + if err != nil { + return err + } + sscsd.NotApplicableResourceCount = ¬ApplicableResourceCount + } + case "definition": + if v != nil { + var definition SecureScoreControlDefinitionItem + err = json.Unmarshal(*v, &definition) + if err != nil { + return err + } + sscsd.Definition = &definition + } + } + } + + return nil +} + +// SecureScoreItem secure score item data model +type SecureScoreItem struct { + autorest.Response `json:"-"` + // SecureScoreItemProperties - READ-ONLY; Secure score item + *SecureScoreItemProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SecureScoreItem. +func (ssi SecureScoreItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SecureScoreItem struct. +func (ssi *SecureScoreItem) 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 secureScoreItemProperties SecureScoreItemProperties + err = json.Unmarshal(*v, &secureScoreItemProperties) + if err != nil { + return err + } + ssi.SecureScoreItemProperties = &secureScoreItemProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ssi.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ssi.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ssi.Type = &typeVar + } + } + } + + return nil +} + +// SecureScoreItemProperties describes properties of a calculated secure score. +type SecureScoreItemProperties struct { + // DisplayName - READ-ONLY; The initiative’s name + DisplayName *string `json:"displayName,omitempty"` + // ScoreDetails - READ-ONLY; score object + *ScoreDetails `json:"score,omitempty"` +} + +// MarshalJSON is the custom marshaler for SecureScoreItemProperties. +func (ssip SecureScoreItemProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SecureScoreItemProperties struct. +func (ssip *SecureScoreItemProperties) 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 "displayName": + if v != nil { + var displayName string + err = json.Unmarshal(*v, &displayName) + if err != nil { + return err + } + ssip.DisplayName = &displayName + } + case "score": + if v != nil { + var scoreDetails ScoreDetails + err = json.Unmarshal(*v, &scoreDetails) + if err != nil { + return err + } + ssip.ScoreDetails = &scoreDetails + } + } + } + + return nil +} + +// SecureScoresList list of secure scores +type SecureScoresList struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; Collection of secure scores in this page + Value *[]SecureScoreItem `json:"value,omitempty"` + // NextLink - READ-ONLY; The URI to fetch the next page. + NextLink *string `json:"nextLink,omitempty"` +} + +// SecureScoresListIterator provides access to a complete listing of SecureScoreItem values. +type SecureScoresListIterator struct { + i int + page SecureScoresListPage +} + +// 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 *SecureScoresListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoresListIterator.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 *SecureScoresListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SecureScoresListIterator) 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 SecureScoresListIterator) Response() SecureScoresList { + 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 SecureScoresListIterator) Value() SecureScoreItem { + if !iter.page.NotDone() { + return SecureScoreItem{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the SecureScoresListIterator type. +func NewSecureScoresListIterator(page SecureScoresListPage) SecureScoresListIterator { + return SecureScoresListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ssl SecureScoresList) IsEmpty() bool { + return ssl.Value == nil || len(*ssl.Value) == 0 +} + +// secureScoresListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ssl SecureScoresList) secureScoresListPreparer(ctx context.Context) (*http.Request, error) { + if ssl.NextLink == nil || len(to.String(ssl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ssl.NextLink))) +} + +// SecureScoresListPage contains a page of SecureScoreItem values. +type SecureScoresListPage struct { + fn func(context.Context, SecureScoresList) (SecureScoresList, error) + ssl SecureScoresList +} + +// 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 *SecureScoresListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoresListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.ssl) + if err != nil { + return err + } + page.ssl = next + 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 *SecureScoresListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SecureScoresListPage) NotDone() bool { + return !page.ssl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SecureScoresListPage) Response() SecureScoresList { + return page.ssl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SecureScoresListPage) Values() []SecureScoreItem { + if page.ssl.IsEmpty() { + return nil + } + return *page.ssl.Value +} + +// Creates a new instance of the SecureScoresListPage type. +func NewSecureScoresListPage(getNextPage func(context.Context, SecureScoresList) (SecureScoresList, error)) SecureScoresListPage { + return SecureScoresListPage{fn: getNextPage} +} + +// SensitivityLabel the sensitivity label. +type SensitivityLabel struct { + // DisplayName - The name of the sensitivity label. + DisplayName *string `json:"displayName,omitempty"` + // Description - The description of the sensitivity label. + Description *string `json:"description,omitempty"` + // Rank - The rank of the sensitivity label. Possible values include: 'RankNone', 'RankLow', 'RankMedium', 'RankHigh', 'RankCritical' + Rank Rank `json:"rank,omitempty"` + // Order - The order of the sensitivity label. + Order *int32 `json:"order,omitempty"` + // Enabled - Indicates whether the label is enabled or not. + Enabled *bool `json:"enabled,omitempty"` +} + +// ServerVulnerabilityAssessment describes the server vulnerability assessment details on a resource +type ServerVulnerabilityAssessment struct { + autorest.Response `json:"-"` + *ServerVulnerabilityAssessmentProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type + Type *string `json:"type,omitempty"` +} // MarshalJSON is the custom marshaler for ServerVulnerabilityAssessment. func (sva ServerVulnerabilityAssessment) MarshalJSON() ([]byte, error) { @@ -13357,11 +14560,17 @@ func (svp ServerVulnerabilityProperties) AsBasicAdditionalData() (BasicAdditiona return &svp, true } +// BasicSetting represents a security setting in Azure Security Center. +type BasicSetting interface { + AsDataExportSettings() (*DataExportSettings, bool) + AsSetting() (*Setting, bool) +} + // Setting represents a security setting in Azure Security Center. type Setting struct { autorest.Response `json:"-"` - // Kind - the kind of the settings string (DataExportSetting). Possible values include: 'SettingKindDataExportSetting', 'SettingKindAlertSuppressionSetting' - Kind SettingKind `json:"kind,omitempty"` + // Kind - Possible values include: 'KindSettingResource', 'KindSetting', 'KindDataExportSettings' + Kind KindEnum `json:"kind,omitempty"` // ID - READ-ONLY; Resource Id ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name @@ -13370,10 +14579,90 @@ type Setting struct { Type *string `json:"type,omitempty"` } +func unmarshalBasicSetting(body []byte) (BasicSetting, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["kind"] { + case string(KindDataExportSettings): + var desVar DataExportSettings + err := json.Unmarshal(body, &desVar) + return desVar, err + default: + var s Setting + err := json.Unmarshal(body, &s) + return s, err + } +} +func unmarshalBasicSettingArray(body []byte) ([]BasicSetting, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + sArray := make([]BasicSetting, len(rawMessages)) + + for index, rawMessage := range rawMessages { + s, err := unmarshalBasicSetting(*rawMessage) + if err != nil { + return nil, err + } + sArray[index] = s + } + return sArray, nil +} + +// MarshalJSON is the custom marshaler for Setting. +func (s Setting) MarshalJSON() ([]byte, error) { + s.Kind = KindSetting + objectMap := make(map[string]interface{}) + if s.Kind != "" { + objectMap["kind"] = s.Kind + } + return json.Marshal(objectMap) +} + +// AsSetting is the BasicSettingResource implementation for Setting. +func (s Setting) AsSetting() (*Setting, bool) { + return &s, true +} + +// AsBasicSetting is the BasicSettingResource implementation for Setting. +func (s Setting) AsBasicSetting() (BasicSetting, bool) { + return &s, true +} + +// AsDataExportSettings is the BasicSettingResource implementation for Setting. +func (s Setting) AsDataExportSettings() (*DataExportSettings, bool) { + return nil, false +} + +// AsSettingResource is the BasicSettingResource implementation for Setting. +func (s Setting) AsSettingResource() (*SettingResource, bool) { + return nil, false +} + +// AsBasicSettingResource is the BasicSettingResource implementation for Setting. +func (s Setting) AsBasicSettingResource() (BasicSettingResource, bool) { + return &s, true +} + +// BasicSettingResource the kind of the security setting +type BasicSettingResource interface { + AsSetting() (*Setting, bool) + AsBasicSetting() (BasicSetting, bool) + AsDataExportSettings() (*DataExportSettings, bool) + AsSettingResource() (*SettingResource, bool) +} + // SettingResource the kind of the security setting type SettingResource struct { - // Kind - the kind of the settings string (DataExportSetting). Possible values include: 'SettingKindDataExportSetting', 'SettingKindAlertSuppressionSetting' - Kind SettingKind `json:"kind,omitempty"` + // Kind - Possible values include: 'KindSettingResource', 'KindSetting', 'KindDataExportSettings' + Kind KindEnum `json:"kind,omitempty"` // ID - READ-ONLY; Resource Id ID *string `json:"id,omitempty"` // Name - READ-ONLY; Resource name @@ -13382,15 +14671,123 @@ type SettingResource struct { Type *string `json:"type,omitempty"` } +func unmarshalBasicSettingResource(body []byte) (BasicSettingResource, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["kind"] { + case string(KindSetting): + var s Setting + err := json.Unmarshal(body, &s) + return s, err + case string(KindDataExportSettings): + var desVar DataExportSettings + err := json.Unmarshal(body, &desVar) + return desVar, err + default: + var sr SettingResource + err := json.Unmarshal(body, &sr) + return sr, err + } +} +func unmarshalBasicSettingResourceArray(body []byte) ([]BasicSettingResource, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + srArray := make([]BasicSettingResource, len(rawMessages)) + + for index, rawMessage := range rawMessages { + sr, err := unmarshalBasicSettingResource(*rawMessage) + if err != nil { + return nil, err + } + srArray[index] = sr + } + return srArray, nil +} + +// MarshalJSON is the custom marshaler for SettingResource. +func (sr SettingResource) MarshalJSON() ([]byte, error) { + sr.Kind = KindSettingResource + objectMap := make(map[string]interface{}) + if sr.Kind != "" { + objectMap["kind"] = sr.Kind + } + return json.Marshal(objectMap) +} + +// AsSetting is the BasicSettingResource implementation for SettingResource. +func (sr SettingResource) AsSetting() (*Setting, bool) { + return nil, false +} + +// AsBasicSetting is the BasicSettingResource implementation for SettingResource. +func (sr SettingResource) AsBasicSetting() (BasicSetting, bool) { + return nil, false +} + +// AsDataExportSettings is the BasicSettingResource implementation for SettingResource. +func (sr SettingResource) AsDataExportSettings() (*DataExportSettings, bool) { + return nil, false +} + +// AsSettingResource is the BasicSettingResource implementation for SettingResource. +func (sr SettingResource) AsSettingResource() (*SettingResource, bool) { + return &sr, true +} + +// AsBasicSettingResource is the BasicSettingResource implementation for SettingResource. +func (sr SettingResource) AsBasicSettingResource() (BasicSettingResource, bool) { + return &sr, true +} + // SettingsList subscription settings list. type SettingsList struct { autorest.Response `json:"-"` // Value - The settings list. - Value *[]Setting `json:"value,omitempty"` + Value *[]BasicSetting `json:"value,omitempty"` // NextLink - READ-ONLY; The URI to fetch the next page. NextLink *string `json:"nextLink,omitempty"` } +// UnmarshalJSON is the custom unmarshaler for SettingsList struct. +func (sl *SettingsList) 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 "value": + if v != nil { + value, err := unmarshalBasicSettingArray(*v) + if err != nil { + return err + } + sl.Value = &value + } + case "nextLink": + if v != nil { + var nextLink string + err = json.Unmarshal(*v, &nextLink) + if err != nil { + return err + } + sl.NextLink = &nextLink + } + } + } + + return nil +} + // SettingsListIterator provides access to a complete listing of Setting values. type SettingsListIterator struct { i int @@ -13442,7 +14839,7 @@ func (iter SettingsListIterator) Response() SettingsList { // Value returns the current value or a zero-initialized value if the // iterator has advanced beyond the end of the collection. -func (iter SettingsListIterator) Value() Setting { +func (iter SettingsListIterator) Value() BasicSetting { if !iter.page.NotDone() { return Setting{} } @@ -13471,7 +14868,7 @@ func (sl SettingsList) settingsListPreparer(ctx context.Context) (*http.Request, autorest.WithBaseURL(to.String(sl.NextLink))) } -// SettingsListPage contains a page of Setting values. +// SettingsListPage contains a page of BasicSetting values. type SettingsListPage struct { fn func(context.Context, SettingsList) (SettingsList, error) sl SettingsList @@ -13516,7 +14913,7 @@ func (page SettingsListPage) Response() SettingsList { } // Values returns the slice of values for the current page or nil if there are no values. -func (page SettingsListPage) Values() []Setting { +func (page SettingsListPage) Values() []BasicSetting { if page.sl.IsEmpty() { return nil } @@ -13927,6 +15324,12 @@ type SubAssessmentStatus struct { Severity Severity `json:"severity,omitempty"` } +// SuppressionAlertsScope ... +type SuppressionAlertsScope struct { + // AllOf - All the conditions inside need to be true in order to suppress the alert + AllOf *[]ScopeElement `json:"allOf,omitempty"` +} + // Tags a list of key value pairs that describe the resource. type Tags struct { // Tags - A list of key value pairs that describe the resource. diff --git a/services/preview/security/mgmt/v3.0/security/securescorecontroldefinitions.go b/services/preview/security/mgmt/v3.0/security/securescorecontroldefinitions.go new file mode 100644 index 000000000000..e20bda476e36 --- /dev/null +++ b/services/preview/security/mgmt/v3.0/security/securescorecontroldefinitions.go @@ -0,0 +1,265 @@ +package security + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// SecureScoreControlDefinitionsClient is the API spec for Microsoft.Security (Azure Security Center) resource provider +type SecureScoreControlDefinitionsClient struct { + BaseClient +} + +// NewSecureScoreControlDefinitionsClient creates an instance of the SecureScoreControlDefinitionsClient client. +func NewSecureScoreControlDefinitionsClient(subscriptionID string, ascLocation string) SecureScoreControlDefinitionsClient { + return NewSecureScoreControlDefinitionsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +} + +// NewSecureScoreControlDefinitionsClientWithBaseURI creates an instance of the SecureScoreControlDefinitionsClient +// 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 NewSecureScoreControlDefinitionsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) SecureScoreControlDefinitionsClient { + return SecureScoreControlDefinitionsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +} + +// List list the available security controls, their assessments, and the max score +func (client SecureScoreControlDefinitionsClient) List(ctx context.Context) (result SecureScoreControlDefinitionListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoreControlDefinitionsClient.List") + defer func() { + sc := -1 + if result.sscdl.Response.Response != nil { + sc = result.sscdl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SecureScoreControlDefinitionsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.sscdl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.SecureScoreControlDefinitionsClient", "List", resp, "Failure sending request") + return + } + + result.sscdl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SecureScoreControlDefinitionsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client SecureScoreControlDefinitionsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2020-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.Security/secureScoreControlDefinitions"), + 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 SecureScoreControlDefinitionsClient) 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 SecureScoreControlDefinitionsClient) ListResponder(resp *http.Response) (result SecureScoreControlDefinitionList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 SecureScoreControlDefinitionsClient) listNextResults(ctx context.Context, lastResults SecureScoreControlDefinitionList) (result SecureScoreControlDefinitionList, err error) { + req, err := lastResults.secureScoreControlDefinitionListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.SecureScoreControlDefinitionsClient", "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, "security.SecureScoreControlDefinitionsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SecureScoreControlDefinitionsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client SecureScoreControlDefinitionsClient) ListComplete(ctx context.Context) (result SecureScoreControlDefinitionListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoreControlDefinitionsClient.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 +} + +// ListBySubscription for a specified subscription, list the available security controls, their assessments, and the +// max score +func (client SecureScoreControlDefinitionsClient) ListBySubscription(ctx context.Context) (result SecureScoreControlDefinitionListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoreControlDefinitionsClient.ListBySubscription") + defer func() { + sc := -1 + if result.sscdl.Response.Response != nil { + sc = result.sscdl.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.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.SecureScoreControlDefinitionsClient", "ListBySubscription", err.Error()) + } + + result.fn = client.listBySubscriptionNextResults + req, err := client.ListBySubscriptionPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SecureScoreControlDefinitionsClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.sscdl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.SecureScoreControlDefinitionsClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result.sscdl, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SecureScoreControlDefinitionsClient", "ListBySubscription", resp, "Failure responding to request") + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client SecureScoreControlDefinitionsClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScoreControlDefinitions", 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 SecureScoreControlDefinitionsClient) 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 SecureScoreControlDefinitionsClient) ListBySubscriptionResponder(resp *http.Response) (result SecureScoreControlDefinitionList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 SecureScoreControlDefinitionsClient) listBySubscriptionNextResults(ctx context.Context, lastResults SecureScoreControlDefinitionList) (result SecureScoreControlDefinitionList, err error) { + req, err := lastResults.secureScoreControlDefinitionListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.SecureScoreControlDefinitionsClient", "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, "security.SecureScoreControlDefinitionsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SecureScoreControlDefinitionsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client SecureScoreControlDefinitionsClient) ListBySubscriptionComplete(ctx context.Context) (result SecureScoreControlDefinitionListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoreControlDefinitionsClient.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 +} diff --git a/services/preview/security/mgmt/v3.0/security/securescorecontrols.go b/services/preview/security/mgmt/v3.0/security/securescorecontrols.go new file mode 100644 index 000000000000..113a92cc1a5d --- /dev/null +++ b/services/preview/security/mgmt/v3.0/security/securescorecontrols.go @@ -0,0 +1,287 @@ +package security + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// SecureScoreControlsClient is the API spec for Microsoft.Security (Azure Security Center) resource provider +type SecureScoreControlsClient struct { + BaseClient +} + +// NewSecureScoreControlsClient creates an instance of the SecureScoreControlsClient client. +func NewSecureScoreControlsClient(subscriptionID string, ascLocation string) SecureScoreControlsClient { + return NewSecureScoreControlsClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +} + +// NewSecureScoreControlsClientWithBaseURI creates an instance of the SecureScoreControlsClient 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 NewSecureScoreControlsClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) SecureScoreControlsClient { + return SecureScoreControlsClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +} + +// List get all security controls within a scope +// Parameters: +// expand - oData expand. Optional. +func (client SecureScoreControlsClient) List(ctx context.Context, expand ExpandControlsEnum) (result SecureScoreControlListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoreControlsClient.List") + defer func() { + sc := -1 + if result.sscl.Response.Response != nil { + sc = result.sscl.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.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.SecureScoreControlsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SecureScoreControlsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.sscl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.SecureScoreControlsClient", "List", resp, "Failure sending request") + return + } + + result.sscl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SecureScoreControlsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client SecureScoreControlsClient) ListPreparer(ctx context.Context, expand ExpandControlsEnum) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(string(expand)) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScoreControls", 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 SecureScoreControlsClient) 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 SecureScoreControlsClient) ListResponder(resp *http.Response) (result SecureScoreControlList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 SecureScoreControlsClient) listNextResults(ctx context.Context, lastResults SecureScoreControlList) (result SecureScoreControlList, err error) { + req, err := lastResults.secureScoreControlListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.SecureScoreControlsClient", "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, "security.SecureScoreControlsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SecureScoreControlsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client SecureScoreControlsClient) ListComplete(ctx context.Context, expand ExpandControlsEnum) (result SecureScoreControlListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoreControlsClient.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, expand) + return +} + +// ListBySecureScore get all security controls for a specific initiative within a scope +// Parameters: +// secureScoreName - the initiative name. For the ASC Default initiative, use 'ascScore' as in the sample +// request below. +// expand - oData expand. Optional. +func (client SecureScoreControlsClient) ListBySecureScore(ctx context.Context, secureScoreName string, expand ExpandControlsEnum) (result SecureScoreControlListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoreControlsClient.ListBySecureScore") + defer func() { + sc := -1 + if result.sscl.Response.Response != nil { + sc = result.sscl.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.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.SecureScoreControlsClient", "ListBySecureScore", err.Error()) + } + + result.fn = client.listBySecureScoreNextResults + req, err := client.ListBySecureScorePreparer(ctx, secureScoreName, expand) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SecureScoreControlsClient", "ListBySecureScore", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySecureScoreSender(req) + if err != nil { + result.sscl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.SecureScoreControlsClient", "ListBySecureScore", resp, "Failure sending request") + return + } + + result.sscl, err = client.ListBySecureScoreResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SecureScoreControlsClient", "ListBySecureScore", resp, "Failure responding to request") + } + + return +} + +// ListBySecureScorePreparer prepares the ListBySecureScore request. +func (client SecureScoreControlsClient) ListBySecureScorePreparer(ctx context.Context, secureScoreName string, expand ExpandControlsEnum) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "secureScoreName": autorest.Encode("path", secureScoreName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(string(expand)) > 0 { + queryParameters["$expand"] = autorest.Encode("query", expand) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScores/{secureScoreName}/secureScoreControls", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBySecureScoreSender sends the ListBySecureScore request. The method will close the +// http.Response Body if it receives an error. +func (client SecureScoreControlsClient) ListBySecureScoreSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListBySecureScoreResponder handles the response to the ListBySecureScore request. The method always +// closes the http.Response Body. +func (client SecureScoreControlsClient) ListBySecureScoreResponder(resp *http.Response) (result SecureScoreControlList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listBySecureScoreNextResults retrieves the next set of results, if any. +func (client SecureScoreControlsClient) listBySecureScoreNextResults(ctx context.Context, lastResults SecureScoreControlList) (result SecureScoreControlList, err error) { + req, err := lastResults.secureScoreControlListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.SecureScoreControlsClient", "listBySecureScoreNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListBySecureScoreSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "security.SecureScoreControlsClient", "listBySecureScoreNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySecureScoreResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SecureScoreControlsClient", "listBySecureScoreNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySecureScoreComplete enumerates all values, automatically crossing page boundaries as required. +func (client SecureScoreControlsClient) ListBySecureScoreComplete(ctx context.Context, secureScoreName string, expand ExpandControlsEnum) (result SecureScoreControlListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoreControlsClient.ListBySecureScore") + 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.ListBySecureScore(ctx, secureScoreName, expand) + return +} diff --git a/services/preview/security/mgmt/v3.0/security/securescores.go b/services/preview/security/mgmt/v3.0/security/securescores.go new file mode 100644 index 000000000000..0825973292a9 --- /dev/null +++ b/services/preview/security/mgmt/v3.0/security/securescores.go @@ -0,0 +1,240 @@ +package security + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// SecureScoresClient is the API spec for Microsoft.Security (Azure Security Center) resource provider +type SecureScoresClient struct { + BaseClient +} + +// NewSecureScoresClient creates an instance of the SecureScoresClient client. +func NewSecureScoresClient(subscriptionID string, ascLocation string) SecureScoresClient { + return NewSecureScoresClientWithBaseURI(DefaultBaseURI, subscriptionID, ascLocation) +} + +// NewSecureScoresClientWithBaseURI creates an instance of the SecureScoresClient 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 NewSecureScoresClientWithBaseURI(baseURI string, subscriptionID string, ascLocation string) SecureScoresClient { + return SecureScoresClient{NewWithBaseURI(baseURI, subscriptionID, ascLocation)} +} + +// Get get secure score for a specific initiative within your current scope. For the ASC Default initiative, use +// 'ascScore'. +// Parameters: +// secureScoreName - the initiative name. For the ASC Default initiative, use 'ascScore' as in the sample +// request below. +func (client SecureScoresClient) Get(ctx context.Context, secureScoreName string) (result SecureScoreItem, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoresClient.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.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.SecureScoresClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, secureScoreName) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SecureScoresClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.SecureScoresClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SecureScoresClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client SecureScoresClient) GetPreparer(ctx context.Context, secureScoreName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "secureScoreName": autorest.Encode("path", secureScoreName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScores/{secureScoreName}", 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 SecureScoresClient) 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 SecureScoresClient) GetResponder(resp *http.Response) (result SecureScoreItem, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List list secure scores for all your Security Center initiatives within your current scope. +func (client SecureScoresClient) List(ctx context.Context) (result SecureScoresListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoresClient.List") + defer func() { + sc := -1 + if result.ssl.Response.Response != nil { + sc = result.ssl.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.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("security.SecureScoresClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SecureScoresClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.ssl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "security.SecureScoresClient", "List", resp, "Failure sending request") + return + } + + result.ssl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SecureScoresClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client SecureScoresClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-01-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Security/secureScores", 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 SecureScoresClient) 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 SecureScoresClient) ListResponder(resp *http.Response) (result SecureScoresList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 SecureScoresClient) listNextResults(ctx context.Context, lastResults SecureScoresList) (result SecureScoresList, err error) { + req, err := lastResults.secureScoresListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "security.SecureScoresClient", "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, "security.SecureScoresClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "security.SecureScoresClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client SecureScoresClient) ListComplete(ctx context.Context) (result SecureScoresListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SecureScoresClient.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/security/mgmt/v3.0/security/securityapi/interfaces.go b/services/preview/security/mgmt/v3.0/security/securityapi/interfaces.go index 08f217963382..15c40bc4a006 100644 --- a/services/preview/security/mgmt/v3.0/security/securityapi/interfaces.go +++ b/services/preview/security/mgmt/v3.0/security/securityapi/interfaces.go @@ -45,14 +45,14 @@ var _ PricingsClientAPI = (*security.PricingsClient)(nil) type AlertsClientAPI interface { GetResourceGroupLevelAlerts(ctx context.Context, alertName string, resourceGroupName string) (result security.Alert, err error) GetSubscriptionLevelAlert(ctx context.Context, alertName string) (result security.Alert, err error) - List(ctx context.Context, filter string, selectParameter string, expand string) (result security.AlertListPage, err error) - ListComplete(ctx context.Context, filter string, selectParameter string, expand string) (result security.AlertListIterator, err error) - ListByResourceGroup(ctx context.Context, resourceGroupName string, filter string, selectParameter string, expand string) (result security.AlertListPage, err error) - ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, filter string, selectParameter string, expand string) (result security.AlertListIterator, err error) - ListResourceGroupLevelAlertsByRegion(ctx context.Context, resourceGroupName string, filter string, selectParameter string, expand string) (result security.AlertListPage, err error) - ListResourceGroupLevelAlertsByRegionComplete(ctx context.Context, resourceGroupName string, filter string, selectParameter string, expand string) (result security.AlertListIterator, err error) - ListSubscriptionLevelAlertsByRegion(ctx context.Context, filter string, selectParameter string, expand string) (result security.AlertListPage, err error) - ListSubscriptionLevelAlertsByRegionComplete(ctx context.Context, filter string, selectParameter string, expand string) (result security.AlertListIterator, err error) + List(ctx context.Context, filter string, selectParameter string, expand string, autoDismissRuleName string) (result security.AlertListPage, err error) + ListComplete(ctx context.Context, filter string, selectParameter string, expand string, autoDismissRuleName string) (result security.AlertListIterator, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string, filter string, selectParameter string, expand string, autoDismissRuleName string) (result security.AlertListPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, filter string, selectParameter string, expand string, autoDismissRuleName string) (result security.AlertListIterator, err error) + ListResourceGroupLevelAlertsByRegion(ctx context.Context, resourceGroupName string, filter string, selectParameter string, expand string, autoDismissRuleName string) (result security.AlertListPage, err error) + ListResourceGroupLevelAlertsByRegionComplete(ctx context.Context, resourceGroupName string, filter string, selectParameter string, expand string, autoDismissRuleName string) (result security.AlertListIterator, err error) + ListSubscriptionLevelAlertsByRegion(ctx context.Context, filter string, selectParameter string, expand string, autoDismissRuleName string) (result security.AlertListPage, err error) + ListSubscriptionLevelAlertsByRegionComplete(ctx context.Context, filter string, selectParameter string, expand string, autoDismissRuleName string) (result security.AlertListIterator, err error) UpdateResourceGroupLevelAlertStateToDismiss(ctx context.Context, alertName string, resourceGroupName string) (result autorest.Response, err error) UpdateResourceGroupLevelAlertStateToReactivate(ctx context.Context, alertName string, resourceGroupName string) (result autorest.Response, err error) UpdateSubscriptionLevelAlertStateToDismiss(ctx context.Context, alertName string) (result autorest.Response, err error) @@ -66,7 +66,7 @@ type SettingsClientAPI interface { Get(ctx context.Context, settingName string) (result security.Setting, err error) List(ctx context.Context) (result security.SettingsListPage, err error) ListComplete(ctx context.Context) (result security.SettingsListIterator, err error) - Update(ctx context.Context, settingName string, setting security.Setting) (result security.Setting, err error) + Update(ctx context.Context, settingName string, setting security.BasicSetting) (result security.Setting, err error) } var _ SettingsClientAPI = (*security.SettingsClient)(nil) @@ -131,28 +131,6 @@ type IotSecuritySolutionsAnalyticsRecommendationClientAPI interface { var _ IotSecuritySolutionsAnalyticsRecommendationClientAPI = (*security.IotSecuritySolutionsAnalyticsRecommendationClient)(nil) -// DiscoveredSecuritySolutionsClientAPI contains the set of methods on the DiscoveredSecuritySolutionsClient type. -type DiscoveredSecuritySolutionsClientAPI interface { - Get(ctx context.Context, resourceGroupName string, discoveredSecuritySolutionName string) (result security.DiscoveredSecuritySolution, err error) - List(ctx context.Context) (result security.DiscoveredSecuritySolutionListPage, err error) - ListComplete(ctx context.Context) (result security.DiscoveredSecuritySolutionListIterator, err error) - ListByHomeRegion(ctx context.Context) (result security.DiscoveredSecuritySolutionListPage, err error) - ListByHomeRegionComplete(ctx context.Context) (result security.DiscoveredSecuritySolutionListIterator, err error) -} - -var _ DiscoveredSecuritySolutionsClientAPI = (*security.DiscoveredSecuritySolutionsClient)(nil) - -// ExternalSecuritySolutionsClientAPI contains the set of methods on the ExternalSecuritySolutionsClient type. -type ExternalSecuritySolutionsClientAPI interface { - Get(ctx context.Context, resourceGroupName string, externalSecuritySolutionsName string) (result security.ExternalSecuritySolutionModel, err error) - List(ctx context.Context) (result security.ExternalSecuritySolutionListPage, err error) - ListComplete(ctx context.Context) (result security.ExternalSecuritySolutionListIterator, err error) - ListByHomeRegion(ctx context.Context) (result security.ExternalSecuritySolutionListPage, err error) - ListByHomeRegionComplete(ctx context.Context) (result security.ExternalSecuritySolutionListIterator, err error) -} - -var _ ExternalSecuritySolutionsClientAPI = (*security.ExternalSecuritySolutionsClient)(nil) - // LocationsClientAPI contains the set of methods on the LocationsClient type. type LocationsClientAPI interface { Get(ctx context.Context) (result security.AscLocation, err error) @@ -266,16 +244,6 @@ type RegulatoryComplianceAssessmentsClientAPI interface { var _ RegulatoryComplianceAssessmentsClientAPI = (*security.RegulatoryComplianceAssessmentsClient)(nil) -// ServerVulnerabilityAssessmentClientAPI contains the set of methods on the ServerVulnerabilityAssessmentClient type. -type ServerVulnerabilityAssessmentClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string) (result security.ServerVulnerabilityAssessment, err error) - Delete(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string) (result autorest.Response, err error) - Get(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string) (result security.ServerVulnerabilityAssessment, err error) - ListByExtendedResource(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string) (result security.ServerVulnerabilityAssessmentsList, err error) -} - -var _ ServerVulnerabilityAssessmentClientAPI = (*security.ServerVulnerabilityAssessmentClient)(nil) - // SubAssessmentsClientAPI contains the set of methods on the SubAssessmentsClient type. type SubAssessmentsClientAPI interface { Get(ctx context.Context, scope string, assessmentName string, subAssessmentName string) (result security.SubAssessment, err error) @@ -301,6 +269,27 @@ type AutomationsClientAPI interface { var _ AutomationsClientAPI = (*security.AutomationsClient)(nil) +// AlertsSuppressionRulesClientAPI contains the set of methods on the AlertsSuppressionRulesClient type. +type AlertsSuppressionRulesClientAPI interface { + Delete(ctx context.Context, alertsSuppressionRuleName string) (result autorest.Response, err error) + Get(ctx context.Context, alertsSuppressionRuleName string) (result security.AlertsSuppressionRule, err error) + List(ctx context.Context, alertType string) (result security.AlertsSuppressionRulesListPage, err error) + ListComplete(ctx context.Context, alertType string) (result security.AlertsSuppressionRulesListIterator, err error) + Update(ctx context.Context, alertsSuppressionRuleName string, alertsSuppressionRule security.AlertsSuppressionRule) (result security.AlertsSuppressionRule, err error) +} + +var _ AlertsSuppressionRulesClientAPI = (*security.AlertsSuppressionRulesClient)(nil) + +// ServerVulnerabilityAssessmentClientAPI contains the set of methods on the ServerVulnerabilityAssessmentClient type. +type ServerVulnerabilityAssessmentClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string) (result security.ServerVulnerabilityAssessment, err error) + Delete(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string) (result security.ServerVulnerabilityAssessment, err error) + ListByExtendedResource(ctx context.Context, resourceGroupName string, resourceNamespace string, resourceType string, resourceName string) (result security.ServerVulnerabilityAssessmentsList, err error) +} + +var _ ServerVulnerabilityAssessmentClientAPI = (*security.ServerVulnerabilityAssessmentClient)(nil) + // AssessmentsMetadataClientAPI contains the set of methods on the AssessmentsMetadataClient type. type AssessmentsMetadataClientAPI interface { CreateInSubscription(ctx context.Context, assessmentMetadataName string, assessmentMetadata security.AssessmentMetadata) (result security.AssessmentMetadata, err error) @@ -385,3 +374,54 @@ type JitNetworkAccessPoliciesClientAPI interface { } var _ JitNetworkAccessPoliciesClientAPI = (*security.JitNetworkAccessPoliciesClient)(nil) + +// DiscoveredSecuritySolutionsClientAPI contains the set of methods on the DiscoveredSecuritySolutionsClient type. +type DiscoveredSecuritySolutionsClientAPI interface { + Get(ctx context.Context, resourceGroupName string, discoveredSecuritySolutionName string) (result security.DiscoveredSecuritySolution, err error) + List(ctx context.Context) (result security.DiscoveredSecuritySolutionListPage, err error) + ListComplete(ctx context.Context) (result security.DiscoveredSecuritySolutionListIterator, err error) + ListByHomeRegion(ctx context.Context) (result security.DiscoveredSecuritySolutionListPage, err error) + ListByHomeRegionComplete(ctx context.Context) (result security.DiscoveredSecuritySolutionListIterator, err error) +} + +var _ DiscoveredSecuritySolutionsClientAPI = (*security.DiscoveredSecuritySolutionsClient)(nil) + +// ExternalSecuritySolutionsClientAPI contains the set of methods on the ExternalSecuritySolutionsClient type. +type ExternalSecuritySolutionsClientAPI interface { + Get(ctx context.Context, resourceGroupName string, externalSecuritySolutionsName string) (result security.ExternalSecuritySolutionModel, err error) + List(ctx context.Context) (result security.ExternalSecuritySolutionListPage, err error) + ListComplete(ctx context.Context) (result security.ExternalSecuritySolutionListIterator, err error) + ListByHomeRegion(ctx context.Context) (result security.ExternalSecuritySolutionListPage, err error) + ListByHomeRegionComplete(ctx context.Context) (result security.ExternalSecuritySolutionListIterator, err error) +} + +var _ ExternalSecuritySolutionsClientAPI = (*security.ExternalSecuritySolutionsClient)(nil) + +// SecureScoresClientAPI contains the set of methods on the SecureScoresClient type. +type SecureScoresClientAPI interface { + Get(ctx context.Context, secureScoreName string) (result security.SecureScoreItem, err error) + List(ctx context.Context) (result security.SecureScoresListPage, err error) + ListComplete(ctx context.Context) (result security.SecureScoresListIterator, err error) +} + +var _ SecureScoresClientAPI = (*security.SecureScoresClient)(nil) + +// SecureScoreControlsClientAPI contains the set of methods on the SecureScoreControlsClient type. +type SecureScoreControlsClientAPI interface { + List(ctx context.Context, expand security.ExpandControlsEnum) (result security.SecureScoreControlListPage, err error) + ListComplete(ctx context.Context, expand security.ExpandControlsEnum) (result security.SecureScoreControlListIterator, err error) + ListBySecureScore(ctx context.Context, secureScoreName string, expand security.ExpandControlsEnum) (result security.SecureScoreControlListPage, err error) + ListBySecureScoreComplete(ctx context.Context, secureScoreName string, expand security.ExpandControlsEnum) (result security.SecureScoreControlListIterator, err error) +} + +var _ SecureScoreControlsClientAPI = (*security.SecureScoreControlsClient)(nil) + +// SecureScoreControlDefinitionsClientAPI contains the set of methods on the SecureScoreControlDefinitionsClient type. +type SecureScoreControlDefinitionsClientAPI interface { + List(ctx context.Context) (result security.SecureScoreControlDefinitionListPage, err error) + ListComplete(ctx context.Context) (result security.SecureScoreControlDefinitionListIterator, err error) + ListBySubscription(ctx context.Context) (result security.SecureScoreControlDefinitionListPage, err error) + ListBySubscriptionComplete(ctx context.Context) (result security.SecureScoreControlDefinitionListIterator, err error) +} + +var _ SecureScoreControlDefinitionsClientAPI = (*security.SecureScoreControlDefinitionsClient)(nil) diff --git a/services/preview/security/mgmt/v3.0/security/servervulnerabilityassessment.go b/services/preview/security/mgmt/v3.0/security/servervulnerabilityassessment.go index b1e50b758d83..237be291e784 100644 --- a/services/preview/security/mgmt/v3.0/security/servervulnerabilityassessment.go +++ b/services/preview/security/mgmt/v3.0/security/servervulnerabilityassessment.go @@ -104,7 +104,7 @@ func (client ServerVulnerabilityAssessmentClient) CreateOrUpdatePreparer(ctx con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-01-01-preview" + const APIVersion = "2020-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -196,7 +196,7 @@ func (client ServerVulnerabilityAssessmentClient) DeletePreparer(ctx context.Con "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-01-01-preview" + const APIVersion = "2020-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -287,7 +287,7 @@ func (client ServerVulnerabilityAssessmentClient) GetPreparer(ctx context.Contex "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-01-01-preview" + const APIVersion = "2020-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -378,7 +378,7 @@ func (client ServerVulnerabilityAssessmentClient) ListByExtendedResourcePreparer "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2019-01-01-preview" + const APIVersion = "2020-01-01" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/preview/security/mgmt/v3.0/security/settings.go b/services/preview/security/mgmt/v3.0/security/settings.go index cf1b4f08f2c9..e2e5085f4995 100644 --- a/services/preview/security/mgmt/v3.0/security/settings.go +++ b/services/preview/security/mgmt/v3.0/security/settings.go @@ -241,7 +241,7 @@ func (client SettingsClient) ListComplete(ctx context.Context) (result SettingsL // Parameters: // settingName - name of setting: (MCAS/WDATP) // setting - setting object -func (client SettingsClient) Update(ctx context.Context, settingName string, setting Setting) (result Setting, err error) { +func (client SettingsClient) Update(ctx context.Context, settingName string, setting BasicSetting) (result Setting, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/SettingsClient.Update") defer func() { @@ -280,7 +280,7 @@ func (client SettingsClient) Update(ctx context.Context, settingName string, set } // UpdatePreparer prepares the Update request. -func (client SettingsClient) UpdatePreparer(ctx context.Context, settingName string, setting Setting) (*http.Request, error) { +func (client SettingsClient) UpdatePreparer(ctx context.Context, settingName string, setting BasicSetting) (*http.Request, error) { pathParameters := map[string]interface{}{ "settingName": autorest.Encode("path", settingName), "subscriptionId": autorest.Encode("path", client.SubscriptionID), diff --git a/services/preview/securityinsight/mgmt/2019-01-01-preview/securityinsight/bookmarkrelations.go b/services/preview/securityinsight/mgmt/2019-01-01-preview/securityinsight/bookmarkrelations.go index 9dd008d36e82..64c47792a6f8 100644 --- a/services/preview/securityinsight/mgmt/2019-01-01-preview/securityinsight/bookmarkrelations.go +++ b/services/preview/securityinsight/mgmt/2019-01-01-preview/securityinsight/bookmarkrelations.go @@ -52,8 +52,8 @@ func NewBookmarkRelationsClientWithBaseURI(baseURI string, subscriptionID string // workspaceName - the name of the workspace. // bookmarkID - bookmark ID // relationName - relation Name -// relationInputModel - the relation input model -func (client BookmarkRelationsClient) CreateOrUpdateRelation(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, bookmarkID string, relationName string, relationInputModel RelationsModelInput) (result BookmarkRelation, err error) { +// relation - the relation model +func (client BookmarkRelationsClient) CreateOrUpdateRelation(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, bookmarkID string, relationName string, relation Relation) (result Relation, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/BookmarkRelationsClient.CreateOrUpdateRelation") defer func() { @@ -73,11 +73,14 @@ func (client BookmarkRelationsClient) CreateOrUpdateRelation(ctx context.Context {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, {TargetValue: workspaceName, Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 90, Chain: nil}, - {Target: "workspaceName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + {Target: "workspaceName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: relation, + Constraints: []validation.Constraint{{Target: "relation.RelationProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "relation.RelationProperties.RelatedResourceID", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { return result, validation.NewError("securityinsight.BookmarkRelationsClient", "CreateOrUpdateRelation", err.Error()) } - req, err := client.CreateOrUpdateRelationPreparer(ctx, resourceGroupName, operationalInsightsResourceProvider, workspaceName, bookmarkID, relationName, relationInputModel) + req, err := client.CreateOrUpdateRelationPreparer(ctx, resourceGroupName, operationalInsightsResourceProvider, workspaceName, bookmarkID, relationName, relation) if err != nil { err = autorest.NewErrorWithError(err, "securityinsight.BookmarkRelationsClient", "CreateOrUpdateRelation", nil, "Failure preparing request") return @@ -99,7 +102,7 @@ func (client BookmarkRelationsClient) CreateOrUpdateRelation(ctx context.Context } // CreateOrUpdateRelationPreparer prepares the CreateOrUpdateRelation request. -func (client BookmarkRelationsClient) CreateOrUpdateRelationPreparer(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, bookmarkID string, relationName string, relationInputModel RelationsModelInput) (*http.Request, error) { +func (client BookmarkRelationsClient) CreateOrUpdateRelationPreparer(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, bookmarkID string, relationName string, relation Relation) (*http.Request, error) { pathParameters := map[string]interface{}{ "bookmarkId": autorest.Encode("path", bookmarkID), "operationalInsightsResourceProvider": autorest.Encode("path", operationalInsightsResourceProvider), @@ -119,7 +122,7 @@ func (client BookmarkRelationsClient) CreateOrUpdateRelationPreparer(ctx context autorest.AsPut(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/bookmarks/{bookmarkId}/relations/{relationName}", pathParameters), - autorest.WithJSON(relationInputModel), + autorest.WithJSON(relation), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } @@ -132,7 +135,7 @@ func (client BookmarkRelationsClient) CreateOrUpdateRelationSender(req *http.Req // CreateOrUpdateRelationResponder handles the response to the CreateOrUpdateRelation request. The method always // closes the http.Response Body. -func (client BookmarkRelationsClient) CreateOrUpdateRelationResponder(resp *http.Response) (result BookmarkRelation, err error) { +func (client BookmarkRelationsClient) CreateOrUpdateRelationResponder(resp *http.Response) (result Relation, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -248,7 +251,7 @@ func (client BookmarkRelationsClient) DeleteRelationResponder(resp *http.Respons // workspaceName - the name of the workspace. // bookmarkID - bookmark ID // relationName - relation Name -func (client BookmarkRelationsClient) GetRelation(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, bookmarkID string, relationName string) (result BookmarkRelation, err error) { +func (client BookmarkRelationsClient) GetRelation(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, bookmarkID string, relationName string) (result Relation, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/BookmarkRelationsClient.GetRelation") defer func() { @@ -325,7 +328,7 @@ func (client BookmarkRelationsClient) GetRelationSender(req *http.Request) (*htt // GetRelationResponder handles the response to the GetRelation request. The method always // closes the http.Response Body. -func (client BookmarkRelationsClient) GetRelationResponder(resp *http.Response) (result BookmarkRelation, err error) { +func (client BookmarkRelationsClient) GetRelationResponder(resp *http.Response) (result Relation, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -350,13 +353,13 @@ func (client BookmarkRelationsClient) GetRelationResponder(resp *http.Response) // skipToken - skiptoken is only used if a previous operation returned a partial result. If a previous response // contains a nextLink element, the value of the nextLink element will include a skiptoken parameter that // specifies a starting point to use for subsequent calls. Optional. -func (client BookmarkRelationsClient) List(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, bookmarkID string, filter string, orderby string, top *int32, skipToken string) (result BookmarkRelationListPage, err error) { +func (client BookmarkRelationsClient) List(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, bookmarkID string, filter string, orderby string, top *int32, skipToken string) (result RelationListPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/BookmarkRelationsClient.List") defer func() { sc := -1 - if result.brl.Response.Response != nil { - sc = result.brl.Response.Response.StatusCode + if result.rl.Response.Response != nil { + sc = result.rl.Response.Response.StatusCode } tracing.EndSpan(ctx, sc, err) }() @@ -383,12 +386,12 @@ func (client BookmarkRelationsClient) List(ctx context.Context, resourceGroupNam resp, err := client.ListSender(req) if err != nil { - result.brl.Response = autorest.Response{Response: resp} + result.rl.Response = autorest.Response{Response: resp} err = autorest.NewErrorWithError(err, "securityinsight.BookmarkRelationsClient", "List", resp, "Failure sending request") return } - result.brl, err = client.ListResponder(resp) + result.rl, err = client.ListResponder(resp) if err != nil { err = autorest.NewErrorWithError(err, "securityinsight.BookmarkRelationsClient", "List", resp, "Failure responding to request") } @@ -439,7 +442,7 @@ func (client BookmarkRelationsClient) ListSender(req *http.Request) (*http.Respo // ListResponder handles the response to the List request. The method always // closes the http.Response Body. -func (client BookmarkRelationsClient) ListResponder(resp *http.Response) (result BookmarkRelationList, err error) { +func (client BookmarkRelationsClient) ListResponder(resp *http.Response) (result RelationList, err error) { err = autorest.Respond( resp, client.ByInspecting(), @@ -451,8 +454,8 @@ func (client BookmarkRelationsClient) ListResponder(resp *http.Response) (result } // listNextResults retrieves the next set of results, if any. -func (client BookmarkRelationsClient) listNextResults(ctx context.Context, lastResults BookmarkRelationList) (result BookmarkRelationList, err error) { - req, err := lastResults.bookmarkRelationListPreparer(ctx) +func (client BookmarkRelationsClient) listNextResults(ctx context.Context, lastResults RelationList) (result RelationList, err error) { + req, err := lastResults.relationListPreparer(ctx) if err != nil { return result, autorest.NewErrorWithError(err, "securityinsight.BookmarkRelationsClient", "listNextResults", nil, "Failure preparing next results request") } @@ -472,7 +475,7 @@ func (client BookmarkRelationsClient) listNextResults(ctx context.Context, lastR } // ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client BookmarkRelationsClient) ListComplete(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, bookmarkID string, filter string, orderby string, top *int32, skipToken string) (result BookmarkRelationListIterator, err error) { +func (client BookmarkRelationsClient) ListComplete(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, bookmarkID string, filter string, orderby string, top *int32, skipToken string) (result RelationListIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/BookmarkRelationsClient.List") defer func() { diff --git a/services/preview/securityinsight/mgmt/2019-01-01-preview/securityinsight/models.go b/services/preview/securityinsight/mgmt/2019-01-01-preview/securityinsight/models.go index f3babac046e6..d9235888e0ce 100644 --- a/services/preview/securityinsight/mgmt/2019-01-01-preview/securityinsight/models.go +++ b/services/preview/securityinsight/mgmt/2019-01-01-preview/securityinsight/models.go @@ -792,32 +792,15 @@ func PossibleKindBasicEntityValues() []KindBasicEntity { type KindBasicSettings string const ( + // KindEyesOn ... + KindEyesOn KindBasicSettings = "EyesOn" // KindSettings ... KindSettings KindBasicSettings = "Settings" - // KindToggleSettings ... - KindToggleSettings KindBasicSettings = "ToggleSettings" - // KindUebaSettings ... - KindUebaSettings KindBasicSettings = "UebaSettings" ) // PossibleKindBasicSettingsValues returns an array of possible values for the KindBasicSettings const type. func PossibleKindBasicSettingsValues() []KindBasicSettings { - return []KindBasicSettings{KindSettings, KindToggleSettings, KindUebaSettings} -} - -// LicenseStatus enumerates the values for license status. -type LicenseStatus string - -const ( - // LicenseStatusDisabled ... - LicenseStatusDisabled LicenseStatus = "Disabled" - // LicenseStatusEnabled ... - LicenseStatusEnabled LicenseStatus = "Enabled" -) - -// PossibleLicenseStatusValues returns an array of possible values for the LicenseStatus const type. -func PossibleLicenseStatusValues() []LicenseStatus { - return []LicenseStatus{LicenseStatusDisabled, LicenseStatusEnabled} + return []KindBasicSettings{KindEyesOn, KindSettings} } // MicrosoftSecurityProductName enumerates the values for microsoft security product name. @@ -946,36 +929,6 @@ func PossibleRelationTypesValues() []RelationTypes { return []RelationTypes{CasesToBookmarks} } -// SettingKind enumerates the values for setting kind. -type SettingKind string - -const ( - // SettingKindToggleSettings ... - SettingKindToggleSettings SettingKind = "ToggleSettings" - // SettingKindUebaSettings ... - SettingKindUebaSettings SettingKind = "UebaSettings" -) - -// PossibleSettingKindValues returns an array of possible values for the SettingKind const type. -func PossibleSettingKindValues() []SettingKind { - return []SettingKind{SettingKindToggleSettings, SettingKindUebaSettings} -} - -// StatusInMcas enumerates the values for status in mcas. -type StatusInMcas string - -const ( - // StatusInMcasDisabled ... - StatusInMcasDisabled StatusInMcas = "Disabled" - // StatusInMcasEnabled ... - StatusInMcasEnabled StatusInMcas = "Enabled" -) - -// PossibleStatusInMcasValues returns an array of possible values for the StatusInMcas const type. -func PossibleStatusInMcasValues() []StatusInMcas { - return []StatusInMcas{StatusInMcasDisabled, StatusInMcasEnabled} -} - // TemplateStatus enumerates the values for template status. type TemplateStatus string @@ -3874,264 +3827,6 @@ type BookmarkProperties struct { IncidentInfo *IncidentInfo `json:"incidentInfo,omitempty"` } -// BookmarkRelation represents a bookmark relation -type BookmarkRelation struct { - autorest.Response `json:"-"` - // BookmarkRelationProperties - Bookmark relation properties - *BookmarkRelationProperties `json:"properties,omitempty"` - // Kind - READ-ONLY; The type of relation node. Possible values include: 'CasesToBookmarks' - Kind RelationTypes `json:"kind,omitempty"` - // Etag - ETag for relation - Etag *string `json:"etag,omitempty"` - // ID - READ-ONLY; Azure resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Azure resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Azure resource type - Type *string `json:"type,omitempty"` -} - -// MarshalJSON is the custom marshaler for BookmarkRelation. -func (br BookmarkRelation) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if br.BookmarkRelationProperties != nil { - objectMap["properties"] = br.BookmarkRelationProperties - } - if br.Etag != nil { - objectMap["etag"] = br.Etag - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for BookmarkRelation struct. -func (br *BookmarkRelation) 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 bookmarkRelationProperties BookmarkRelationProperties - err = json.Unmarshal(*v, &bookmarkRelationProperties) - if err != nil { - return err - } - br.BookmarkRelationProperties = &bookmarkRelationProperties - } - case "kind": - if v != nil { - var kind RelationTypes - err = json.Unmarshal(*v, &kind) - if err != nil { - return err - } - br.Kind = kind - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - br.Etag = &etag - } - 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 "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - br.Type = &typeVar - } - } - } - - return nil -} - -// BookmarkRelationList list of bookmark relations. -type BookmarkRelationList struct { - autorest.Response `json:"-"` - // NextLink - READ-ONLY; URL to fetch the next set of relations. - NextLink *string `json:"nextLink,omitempty"` - // Value - Array of relations. - Value *[]BookmarkRelation `json:"value,omitempty"` -} - -// BookmarkRelationListIterator provides access to a complete listing of BookmarkRelation values. -type BookmarkRelationListIterator struct { - i int - page BookmarkRelationListPage -} - -// 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 *BookmarkRelationListIterator) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BookmarkRelationListIterator.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 *BookmarkRelationListIterator) Next() error { - return iter.NextWithContext(context.Background()) -} - -// NotDone returns true if the enumeration should be started or is not yet complete. -func (iter BookmarkRelationListIterator) 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 BookmarkRelationListIterator) Response() BookmarkRelationList { - 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 BookmarkRelationListIterator) Value() BookmarkRelation { - if !iter.page.NotDone() { - return BookmarkRelation{} - } - return iter.page.Values()[iter.i] -} - -// Creates a new instance of the BookmarkRelationListIterator type. -func NewBookmarkRelationListIterator(page BookmarkRelationListPage) BookmarkRelationListIterator { - return BookmarkRelationListIterator{page: page} -} - -// IsEmpty returns true if the ListResult contains no values. -func (brl BookmarkRelationList) IsEmpty() bool { - return brl.Value == nil || len(*brl.Value) == 0 -} - -// bookmarkRelationListPreparer prepares a request to retrieve the next set of results. -// It returns nil if no more results exist. -func (brl BookmarkRelationList) bookmarkRelationListPreparer(ctx context.Context) (*http.Request, error) { - if brl.NextLink == nil || len(to.String(brl.NextLink)) < 1 { - return nil, nil - } - return autorest.Prepare((&http.Request{}).WithContext(ctx), - autorest.AsJSON(), - autorest.AsGet(), - autorest.WithBaseURL(to.String(brl.NextLink))) -} - -// BookmarkRelationListPage contains a page of BookmarkRelation values. -type BookmarkRelationListPage struct { - fn func(context.Context, BookmarkRelationList) (BookmarkRelationList, error) - brl BookmarkRelationList -} - -// 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 *BookmarkRelationListPage) NextWithContext(ctx context.Context) (err error) { - if tracing.IsEnabled() { - ctx = tracing.StartSpan(ctx, fqdn+"/BookmarkRelationListPage.NextWithContext") - defer func() { - sc := -1 - if page.Response().Response.Response != nil { - sc = page.Response().Response.Response.StatusCode - } - tracing.EndSpan(ctx, sc, err) - }() - } - next, err := page.fn(ctx, page.brl) - if err != nil { - return err - } - page.brl = next - 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 *BookmarkRelationListPage) Next() error { - return page.NextWithContext(context.Background()) -} - -// NotDone returns true if the page enumeration should be started or is not yet complete. -func (page BookmarkRelationListPage) NotDone() bool { - return !page.brl.IsEmpty() -} - -// Response returns the raw server response from the last page request. -func (page BookmarkRelationListPage) Response() BookmarkRelationList { - return page.brl -} - -// Values returns the slice of values for the current page or nil if there are no values. -func (page BookmarkRelationListPage) Values() []BookmarkRelation { - if page.brl.IsEmpty() { - return nil - } - return *page.brl.Value -} - -// Creates a new instance of the BookmarkRelationListPage type. -func NewBookmarkRelationListPage(getNextPage func(context.Context, BookmarkRelationList) (BookmarkRelationList, error)) BookmarkRelationListPage { - return BookmarkRelationListPage{fn: getNextPage} -} - -// BookmarkRelationProperties bookmark relation properties -type BookmarkRelationProperties struct { - // RelationName - Name of relation - RelationName *string `json:"relationName,omitempty"` - // BookmarkID - The case related bookmark id - BookmarkID *string `json:"bookmarkId,omitempty"` - // CaseIdentifier - The case identifier - CaseIdentifier *string `json:"caseIdentifier,omitempty"` - // CaseTitle - The case title - CaseTitle *string `json:"caseTitle,omitempty"` - // CaseSeverity - The case severity - CaseSeverity *string `json:"caseSeverity,omitempty"` -} - // Case represents a case in Azure Security Insights. type Case struct { autorest.Response `json:"-"` @@ -6764,6 +6459,128 @@ type ExpansionResultsMetadata struct { Aggregations *[]ExpansionResultAggregation `json:"aggregations,omitempty"` } +// EyesOn settings with single toggle. +type EyesOn struct { + // EyesOnSettingsProperties - EyesOn properties + *EyesOnSettingsProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Azure resource Id + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Azure resource name + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Azure resource type + Type *string `json:"type,omitempty"` + // Etag - Etag of the azure resource + Etag *string `json:"etag,omitempty"` + // Kind - Possible values include: 'KindSettings', 'KindEyesOn' + Kind KindBasicSettings `json:"kind,omitempty"` +} + +// MarshalJSON is the custom marshaler for EyesOn. +func (eo EyesOn) MarshalJSON() ([]byte, error) { + eo.Kind = KindEyesOn + objectMap := make(map[string]interface{}) + if eo.EyesOnSettingsProperties != nil { + objectMap["properties"] = eo.EyesOnSettingsProperties + } + if eo.Etag != nil { + objectMap["etag"] = eo.Etag + } + if eo.Kind != "" { + objectMap["kind"] = eo.Kind + } + return json.Marshal(objectMap) +} + +// AsEyesOn is the BasicSettings implementation for EyesOn. +func (eo EyesOn) AsEyesOn() (*EyesOn, bool) { + return &eo, true +} + +// AsSettings is the BasicSettings implementation for EyesOn. +func (eo EyesOn) AsSettings() (*Settings, bool) { + return nil, false +} + +// AsBasicSettings is the BasicSettings implementation for EyesOn. +func (eo EyesOn) AsBasicSettings() (BasicSettings, bool) { + return &eo, true +} + +// UnmarshalJSON is the custom unmarshaler for EyesOn struct. +func (eo *EyesOn) 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 eyesOnSettingsProperties EyesOnSettingsProperties + err = json.Unmarshal(*v, &eyesOnSettingsProperties) + if err != nil { + return err + } + eo.EyesOnSettingsProperties = &eyesOnSettingsProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + eo.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + eo.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + eo.Type = &typeVar + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + eo.Etag = &etag + } + case "kind": + if v != nil { + var kind KindBasicSettings + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + eo.Kind = kind + } + } + } + + return nil +} + +// EyesOnSettingsProperties eyesOn property bag. +type EyesOnSettingsProperties struct { + // IsEnabled - READ-ONLY; Determines whether the setting is enable or disabled. + IsEnabled *bool `json:"isEnabled,omitempty"` +} + // FileEntity represents a file entity. type FileEntity struct { // FileEntityProperties - File entity properties @@ -11165,7 +10982,7 @@ func (rn RelationNode) MarshalJSON() ([]byte, error) { type RelationProperties struct { // RelatedResourceID - The resource ID of the related resource RelatedResourceID *string `json:"relatedResourceId,omitempty"` - // RelatedResourceName - The name of the related resource + // RelatedResourceName - READ-ONLY; The name of the related resource RelatedResourceName *string `json:"relatedResourceName,omitempty"` // RelatedResourceType - READ-ONLY; The resource type of the related resource RelatedResourceType *string `json:"relatedResourceType,omitempty"` @@ -11845,6 +11662,8 @@ type SecurityAlertProperties struct { TimeGenerated *date.Time `json:"timeGenerated,omitempty"` // VendorName - READ-ONLY; The name of the vendor that raise the alert. VendorName *string `json:"vendorName,omitempty"` + // AlertLink - READ-ONLY; The uri link of the alert. + AlertLink *string `json:"alertLink,omitempty"` // AdditionalData - READ-ONLY; A bag of custom fields that should be part of the entity and will be presented to the user. AdditionalData map[string]interface{} `json:"additionalData"` // FriendlyName - READ-ONLY; The graph item display name which is a short humanly readable description of the graph item instance. This property is optional and might be system generated. @@ -12065,10 +11884,39 @@ func (sgep SecurityGroupEntityProperties) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// SettingList list of all the settings. +type SettingList struct { + autorest.Response `json:"-"` + // Value - Array of settings. + Value *[]BasicSettings `json:"value,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for SettingList struct. +func (sl *SettingList) 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 "value": + if v != nil { + value, err := unmarshalBasicSettingsArray(*v) + if err != nil { + return err + } + sl.Value = &value + } + } + } + + return nil +} + // BasicSettings the Setting. type BasicSettings interface { - AsToggleSettings() (*ToggleSettings, bool) - AsUebaSettings() (*UebaSettings, bool) + AsEyesOn() (*EyesOn, bool) AsSettings() (*Settings, bool) } @@ -12083,7 +11931,7 @@ type Settings struct { Type *string `json:"type,omitempty"` // Etag - Etag of the azure resource Etag *string `json:"etag,omitempty"` - // Kind - Possible values include: 'KindSettings', 'KindToggleSettings', 'KindUebaSettings' + // Kind - Possible values include: 'KindSettings', 'KindEyesOn' Kind KindBasicSettings `json:"kind,omitempty"` } @@ -12095,14 +11943,10 @@ func unmarshalBasicSettings(body []byte) (BasicSettings, error) { } switch m["kind"] { - case string(KindToggleSettings): - var ts ToggleSettings - err := json.Unmarshal(body, &ts) - return ts, err - case string(KindUebaSettings): - var us UebaSettings - err := json.Unmarshal(body, &us) - return us, err + case string(KindEyesOn): + var eo EyesOn + err := json.Unmarshal(body, &eo) + return eo, err default: var s Settings err := json.Unmarshal(body, &s) @@ -12141,13 +11985,8 @@ func (s Settings) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } -// AsToggleSettings is the BasicSettings implementation for Settings. -func (s Settings) AsToggleSettings() (*ToggleSettings, bool) { - return nil, false -} - -// AsUebaSettings is the BasicSettings implementation for Settings. -func (s Settings) AsUebaSettings() (*UebaSettings, bool) { +// AsEyesOn is the BasicSettings implementation for Settings. +func (s Settings) AsEyesOn() (*EyesOn, bool) { return nil, false } @@ -12163,8 +12002,8 @@ func (s Settings) AsBasicSettings() (BasicSettings, bool) { // SettingsKind describes an Azure resource with kind. type SettingsKind struct { - // Kind - The kind of the setting. Possible values include: 'SettingKindUebaSettings', 'SettingKindToggleSettings' - Kind SettingKind `json:"kind,omitempty"` + // Kind - The kind of the setting + Kind *string `json:"kind,omitempty"` } // SettingsModel ... @@ -12785,264 +12624,6 @@ type TiTaxiiDataConnectorProperties struct { TenantID *string `json:"tenantId,omitempty"` } -// ToggleSettings settings with single toggle. -type ToggleSettings struct { - // ToggleSettingsProperties - toggle properties - *ToggleSettingsProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Azure resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Azure resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Azure resource type - Type *string `json:"type,omitempty"` - // Etag - Etag of the azure resource - Etag *string `json:"etag,omitempty"` - // Kind - Possible values include: 'KindSettings', 'KindToggleSettings', 'KindUebaSettings' - Kind KindBasicSettings `json:"kind,omitempty"` -} - -// MarshalJSON is the custom marshaler for ToggleSettings. -func (ts ToggleSettings) MarshalJSON() ([]byte, error) { - ts.Kind = KindToggleSettings - objectMap := make(map[string]interface{}) - if ts.ToggleSettingsProperties != nil { - objectMap["properties"] = ts.ToggleSettingsProperties - } - if ts.Etag != nil { - objectMap["etag"] = ts.Etag - } - if ts.Kind != "" { - objectMap["kind"] = ts.Kind - } - return json.Marshal(objectMap) -} - -// AsToggleSettings is the BasicSettings implementation for ToggleSettings. -func (ts ToggleSettings) AsToggleSettings() (*ToggleSettings, bool) { - return &ts, true -} - -// AsUebaSettings is the BasicSettings implementation for ToggleSettings. -func (ts ToggleSettings) AsUebaSettings() (*UebaSettings, bool) { - return nil, false -} - -// AsSettings is the BasicSettings implementation for ToggleSettings. -func (ts ToggleSettings) AsSettings() (*Settings, bool) { - return nil, false -} - -// AsBasicSettings is the BasicSettings implementation for ToggleSettings. -func (ts ToggleSettings) AsBasicSettings() (BasicSettings, bool) { - return &ts, true -} - -// UnmarshalJSON is the custom unmarshaler for ToggleSettings struct. -func (ts *ToggleSettings) 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 toggleSettingsProperties ToggleSettingsProperties - err = json.Unmarshal(*v, &toggleSettingsProperties) - if err != nil { - return err - } - ts.ToggleSettingsProperties = &toggleSettingsProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - ts.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - ts.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - ts.Type = &typeVar - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - ts.Etag = &etag - } - case "kind": - if v != nil { - var kind KindBasicSettings - err = json.Unmarshal(*v, &kind) - if err != nil { - return err - } - ts.Kind = kind - } - } - } - - return nil -} - -// ToggleSettingsProperties toggle property bag. -type ToggleSettingsProperties struct { - // IsEnabled - Determines whether the setting is enable or disabled. - IsEnabled *bool `json:"isEnabled,omitempty"` -} - -// UebaSettings represents settings for User and Entity Behavior Analytics enablement. -type UebaSettings struct { - // UebaSettingsProperties - User and Entity Behavior Analytics settings properties - *UebaSettingsProperties `json:"properties,omitempty"` - // ID - READ-ONLY; Azure resource Id - ID *string `json:"id,omitempty"` - // Name - READ-ONLY; Azure resource name - Name *string `json:"name,omitempty"` - // Type - READ-ONLY; Azure resource type - Type *string `json:"type,omitempty"` - // Etag - Etag of the azure resource - Etag *string `json:"etag,omitempty"` - // Kind - Possible values include: 'KindSettings', 'KindToggleSettings', 'KindUebaSettings' - Kind KindBasicSettings `json:"kind,omitempty"` -} - -// MarshalJSON is the custom marshaler for UebaSettings. -func (us UebaSettings) MarshalJSON() ([]byte, error) { - us.Kind = KindUebaSettings - objectMap := make(map[string]interface{}) - if us.UebaSettingsProperties != nil { - objectMap["properties"] = us.UebaSettingsProperties - } - if us.Etag != nil { - objectMap["etag"] = us.Etag - } - if us.Kind != "" { - objectMap["kind"] = us.Kind - } - return json.Marshal(objectMap) -} - -// AsToggleSettings is the BasicSettings implementation for UebaSettings. -func (us UebaSettings) AsToggleSettings() (*ToggleSettings, bool) { - return nil, false -} - -// AsUebaSettings is the BasicSettings implementation for UebaSettings. -func (us UebaSettings) AsUebaSettings() (*UebaSettings, bool) { - return &us, true -} - -// AsSettings is the BasicSettings implementation for UebaSettings. -func (us UebaSettings) AsSettings() (*Settings, bool) { - return nil, false -} - -// AsBasicSettings is the BasicSettings implementation for UebaSettings. -func (us UebaSettings) AsBasicSettings() (BasicSettings, bool) { - return &us, true -} - -// UnmarshalJSON is the custom unmarshaler for UebaSettings struct. -func (us *UebaSettings) 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 uebaSettingsProperties UebaSettingsProperties - err = json.Unmarshal(*v, &uebaSettingsProperties) - if err != nil { - return err - } - us.UebaSettingsProperties = &uebaSettingsProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - us.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - us.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - us.Type = &typeVar - } - case "etag": - if v != nil { - var etag string - err = json.Unmarshal(*v, &etag) - if err != nil { - return err - } - us.Etag = &etag - } - case "kind": - if v != nil { - var kind KindBasicSettings - err = json.Unmarshal(*v, &kind) - if err != nil { - return err - } - us.Kind = kind - } - } - } - - return nil -} - -// UebaSettingsProperties user and Entity Behavior Analytics settings property bag. -type UebaSettingsProperties struct { - // AtpLicenseStatus - READ-ONLY; Determines whether the tenant has ATP (Advanced Threat Protection) license. Possible values include: 'LicenseStatusEnabled', 'LicenseStatusDisabled' - AtpLicenseStatus LicenseStatus `json:"atpLicenseStatus,omitempty"` - // IsEnabled - Determines whether User and Entity Behavior Analytics is enabled for this workspace. - IsEnabled *bool `json:"isEnabled,omitempty"` - // StatusInMcas - READ-ONLY; Determines whether User and Entity Behavior Analytics is enabled from MCAS (Microsoft Cloud App Security). Possible values include: 'StatusInMcasEnabled', 'StatusInMcasDisabled' - StatusInMcas StatusInMcas `json:"statusInMcas,omitempty"` -} - // URLEntity represents a url entity. type URLEntity struct { // URLEntityProperties - Url entity properties diff --git a/services/preview/securityinsight/mgmt/2019-01-01-preview/securityinsight/productsettings.go b/services/preview/securityinsight/mgmt/2019-01-01-preview/securityinsight/productsettings.go index be8f48c5a507..8eb0ebdecee2 100644 --- a/services/preview/securityinsight/mgmt/2019-01-01-preview/securityinsight/productsettings.go +++ b/services/preview/securityinsight/mgmt/2019-01-01-preview/securityinsight/productsettings.go @@ -42,6 +42,100 @@ func NewProductSettingsClientWithBaseURI(baseURI string, subscriptionID string) return ProductSettingsClient{NewWithBaseURI(baseURI, subscriptionID)} } +// Delete delete setting of the product. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// operationalInsightsResourceProvider - the namespace of workspaces resource provider- +// Microsoft.OperationalInsights. +// workspaceName - the name of the workspace. +// settingsName - the setting name. Supports- EyesOn +func (client ProductSettingsClient) Delete(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, settingsName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProductSettingsClient.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: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, 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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("securityinsight.ProductSettingsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, operationalInsightsResourceProvider, workspaceName, settingsName) + if err != nil { + err = autorest.NewErrorWithError(err, "securityinsight.ProductSettingsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "securityinsight.ProductSettingsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "securityinsight.ProductSettingsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ProductSettingsClient) DeletePreparer(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, settingsName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "operationalInsightsResourceProvider": autorest.Encode("path", operationalInsightsResourceProvider), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "settingsName": autorest.Encode("path", settingsName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-01-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/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/settings/{settingsName}", 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 ProductSettingsClient) 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 ProductSettingsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + // Get gets a setting. // Parameters: // resourceGroupName - the name of the resource group within the user's subscription. The name is case @@ -49,7 +143,7 @@ func NewProductSettingsClientWithBaseURI(baseURI string, subscriptionID string) // operationalInsightsResourceProvider - the namespace of workspaces resource provider- // Microsoft.OperationalInsights. // workspaceName - the name of the workspace. -// settingsName - the setting name. Supports- Fusion, UEBA +// settingsName - the setting name. Supports- EyesOn func (client ProductSettingsClient) Get(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, settingsName string) (result SettingsModel, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ProductSettingsClient.Get") @@ -137,14 +231,107 @@ func (client ProductSettingsClient) GetResponder(resp *http.Response) (result Se return } -// Update updates the setting. +// GetAll list of all the settings +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// operationalInsightsResourceProvider - the namespace of workspaces resource provider- +// Microsoft.OperationalInsights. +// workspaceName - the name of the workspace. +func (client ProductSettingsClient) GetAll(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string) (result SettingList, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProductSettingsClient.GetAll") + defer func() { + 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.Pattern, Rule: `^[0-9A-Fa-f]{8}-([0-9A-Fa-f]{4}-){3}[0-9A-Fa-f]{12}$`, 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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}, + {TargetValue: workspaceName, + Constraints: []validation.Constraint{{Target: "workspaceName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "workspaceName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("securityinsight.ProductSettingsClient", "GetAll", err.Error()) + } + + req, err := client.GetAllPreparer(ctx, resourceGroupName, operationalInsightsResourceProvider, workspaceName) + if err != nil { + err = autorest.NewErrorWithError(err, "securityinsight.ProductSettingsClient", "GetAll", nil, "Failure preparing request") + return + } + + resp, err := client.GetAllSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "securityinsight.ProductSettingsClient", "GetAll", resp, "Failure sending request") + return + } + + result, err = client.GetAllResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "securityinsight.ProductSettingsClient", "GetAll", resp, "Failure responding to request") + } + + return +} + +// GetAllPreparer prepares the GetAll request. +func (client ProductSettingsClient) GetAllPreparer(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "operationalInsightsResourceProvider": autorest.Encode("path", operationalInsightsResourceProvider), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workspaceName": autorest.Encode("path", workspaceName), + } + + const APIVersion = "2019-01-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/{operationalInsightsResourceProvider}/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/settings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetAllSender sends the GetAll request. The method will close the +// http.Response Body if it receives an error. +func (client ProductSettingsClient) GetAllSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetAllResponder handles the response to the GetAll request. The method always +// closes the http.Response Body. +func (client ProductSettingsClient) GetAllResponder(resp *http.Response) (result SettingList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update updates setting. // Parameters: // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. // operationalInsightsResourceProvider - the namespace of workspaces resource provider- // Microsoft.OperationalInsights. // workspaceName - the name of the workspace. -// settingsName - the setting name. Supports- Fusion, UEBA +// settingsName - the setting name. Supports- EyesOn // settings - the setting func (client ProductSettingsClient) Update(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, settingsName string, settings BasicSettings) (result SettingsModel, err error) { if tracing.IsEnabled() { diff --git a/services/preview/securityinsight/mgmt/2019-01-01-preview/securityinsight/securityinsightapi/interfaces.go b/services/preview/securityinsight/mgmt/2019-01-01-preview/securityinsight/securityinsightapi/interfaces.go index 22b7c6969add..5361049635dc 100644 --- a/services/preview/securityinsight/mgmt/2019-01-01-preview/securityinsight/securityinsightapi/interfaces.go +++ b/services/preview/securityinsight/mgmt/2019-01-01-preview/securityinsight/securityinsightapi/interfaces.go @@ -113,11 +113,11 @@ var _ CaseRelationsClientAPI = (*securityinsight.CaseRelationsClient)(nil) // BookmarkRelationsClientAPI contains the set of methods on the BookmarkRelationsClient type. type BookmarkRelationsClientAPI interface { - CreateOrUpdateRelation(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, bookmarkID string, relationName string, relationInputModel securityinsight.RelationsModelInput) (result securityinsight.BookmarkRelation, err error) + CreateOrUpdateRelation(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, bookmarkID string, relationName string, relation securityinsight.Relation) (result securityinsight.Relation, err error) DeleteRelation(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, bookmarkID string, relationName string) (result autorest.Response, err error) - GetRelation(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, bookmarkID string, relationName string) (result securityinsight.BookmarkRelation, err error) - List(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, bookmarkID string, filter string, orderby string, top *int32, skipToken string) (result securityinsight.BookmarkRelationListPage, err error) - ListComplete(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, bookmarkID string, filter string, orderby string, top *int32, skipToken string) (result securityinsight.BookmarkRelationListIterator, err error) + GetRelation(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, bookmarkID string, relationName string) (result securityinsight.Relation, err error) + List(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, bookmarkID string, filter string, orderby string, top *int32, skipToken string) (result securityinsight.RelationListPage, err error) + ListComplete(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, bookmarkID string, filter string, orderby string, top *int32, skipToken string) (result securityinsight.RelationListIterator, err error) } var _ BookmarkRelationsClientAPI = (*securityinsight.BookmarkRelationsClient)(nil) @@ -184,7 +184,9 @@ var _ OfficeConsentsClientAPI = (*securityinsight.OfficeConsentsClient)(nil) // ProductSettingsClientAPI contains the set of methods on the ProductSettingsClient type. type ProductSettingsClientAPI interface { + Delete(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, settingsName string) (result autorest.Response, err error) Get(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, settingsName string) (result securityinsight.SettingsModel, err error) + GetAll(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string) (result securityinsight.SettingList, err error) Update(ctx context.Context, resourceGroupName string, operationalInsightsResourceProvider string, workspaceName string, settingsName string, settings securityinsight.BasicSettings) (result securityinsight.SettingsModel, err error) } diff --git a/services/preview/sql/mgmt/2015-05-01-preview/sql/models.go b/services/preview/sql/mgmt/2015-05-01-preview/sql/models.go index 5621ab55d85b..4a4f5d75cee7 100644 --- a/services/preview/sql/mgmt/2015-05-01-preview/sql/models.go +++ b/services/preview/sql/mgmt/2015-05-01-preview/sql/models.go @@ -1720,7 +1720,12 @@ type DatabaseBlobAuditingPolicyProperties struct { State BlobAuditingPolicyState `json:"state,omitempty"` // StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled is required. StorageEndpoint *string `json:"storageEndpoint,omitempty"` - // StorageAccountAccessKey - Specifies the identifier key of the auditing storage account. If state is Enabled and storageEndpoint is specified, storageAccountAccessKey is required. + // StorageAccountAccessKey - Specifies the identifier key of the auditing storage account. + // If state is Enabled and storageEndpoint is specified, not specifying the storageAccountAccessKey will use SQL server system-assigned managed identity to access the storage. + // Prerequisites for using managed identity authentication: + // 1. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD). + // 2. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data Contributor' RBAC role to the server identity. + // For more information, see [Auditing to storage using Managed Identity authentication](https://go.microsoft.com/fwlink/?linkid=2114355) StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"` // RetentionDays - Specifies the number of days to keep in the audit logs in the storage account. RetentionDays *int32 `json:"retentionDays,omitempty"` @@ -4739,6 +4744,8 @@ type ManagedInstanceProperties struct { TimezoneID *string `json:"timezoneId,omitempty"` // InstancePoolID - The Id of the instance pool this managed server belongs to. InstancePoolID *string `json:"instancePoolId,omitempty"` + // MaintenanceConfigurationID - Specifies maintenance configuration id to apply to this managed instance. + MaintenanceConfigurationID *string `json:"maintenanceConfigurationId,omitempty"` // MinimalTLSVersion - Minimal TLS version. Allowed values: 'None', '1.0', '1.1', '1.2' MinimalTLSVersion *string `json:"minimalTlsVersion,omitempty"` } diff --git a/services/preview/sql/mgmt/2017-03-01-preview/sql/extendeddatabaseblobauditingpolicies.go b/services/preview/sql/mgmt/2017-03-01-preview/sql/extendeddatabaseblobauditingpolicies.go index bbe1db0b5511..a32b47c6a125 100644 --- a/services/preview/sql/mgmt/2017-03-01-preview/sql/extendeddatabaseblobauditingpolicies.go +++ b/services/preview/sql/mgmt/2017-03-01-preview/sql/extendeddatabaseblobauditingpolicies.go @@ -207,3 +207,120 @@ func (client ExtendedDatabaseBlobAuditingPoliciesClient) GetResponder(resp *http result.Response = autorest.Response{Response: resp} return } + +// ListByDatabase lists extended auditing settings of a database. +// Parameters: +// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value +// from the Azure Resource Manager API or the portal. +// serverName - the name of the server. +// databaseName - the name of the database. +func (client ExtendedDatabaseBlobAuditingPoliciesClient) ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result ExtendedDatabaseBlobAuditingPolicyListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExtendedDatabaseBlobAuditingPoliciesClient.ListByDatabase") + defer func() { + sc := -1 + if result.edbaplr.Response.Response != nil { + sc = result.edbaplr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByDatabaseNextResults + req, err := client.ListByDatabasePreparer(ctx, resourceGroupName, serverName, databaseName) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ExtendedDatabaseBlobAuditingPoliciesClient", "ListByDatabase", nil, "Failure preparing request") + return + } + + resp, err := client.ListByDatabaseSender(req) + if err != nil { + result.edbaplr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "sql.ExtendedDatabaseBlobAuditingPoliciesClient", "ListByDatabase", resp, "Failure sending request") + return + } + + result.edbaplr, err = client.ListByDatabaseResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ExtendedDatabaseBlobAuditingPoliciesClient", "ListByDatabase", resp, "Failure responding to request") + } + + return +} + +// ListByDatabasePreparer prepares the ListByDatabase request. +func (client ExtendedDatabaseBlobAuditingPoliciesClient) ListByDatabasePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serverName": autorest.Encode("path", serverName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-03-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.Sql/servers/{serverName}/databases/{databaseName}/extendedAuditingSettings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByDatabaseSender sends the ListByDatabase request. The method will close the +// http.Response Body if it receives an error. +func (client ExtendedDatabaseBlobAuditingPoliciesClient) ListByDatabaseSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByDatabaseResponder handles the response to the ListByDatabase request. The method always +// closes the http.Response Body. +func (client ExtendedDatabaseBlobAuditingPoliciesClient) ListByDatabaseResponder(resp *http.Response) (result ExtendedDatabaseBlobAuditingPolicyListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByDatabaseNextResults retrieves the next set of results, if any. +func (client ExtendedDatabaseBlobAuditingPoliciesClient) listByDatabaseNextResults(ctx context.Context, lastResults ExtendedDatabaseBlobAuditingPolicyListResult) (result ExtendedDatabaseBlobAuditingPolicyListResult, err error) { + req, err := lastResults.extendedDatabaseBlobAuditingPolicyListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "sql.ExtendedDatabaseBlobAuditingPoliciesClient", "listByDatabaseNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByDatabaseSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "sql.ExtendedDatabaseBlobAuditingPoliciesClient", "listByDatabaseNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByDatabaseResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ExtendedDatabaseBlobAuditingPoliciesClient", "listByDatabaseNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByDatabaseComplete enumerates all values, automatically crossing page boundaries as required. +func (client ExtendedDatabaseBlobAuditingPoliciesClient) ListByDatabaseComplete(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result ExtendedDatabaseBlobAuditingPolicyListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExtendedDatabaseBlobAuditingPoliciesClient.ListByDatabase") + 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.ListByDatabase(ctx, resourceGroupName, serverName, databaseName) + return +} diff --git a/services/preview/sql/mgmt/2017-03-01-preview/sql/extendedserverblobauditingpolicies.go b/services/preview/sql/mgmt/2017-03-01-preview/sql/extendedserverblobauditingpolicies.go index 1cd842295c5f..db61b94da6b4 100644 --- a/services/preview/sql/mgmt/2017-03-01-preview/sql/extendedserverblobauditingpolicies.go +++ b/services/preview/sql/mgmt/2017-03-01-preview/sql/extendedserverblobauditingpolicies.go @@ -203,3 +203,118 @@ func (client ExtendedServerBlobAuditingPoliciesClient) GetResponder(resp *http.R result.Response = autorest.Response{Response: resp} return } + +// ListByServer lists extended auditing settings of a server. +// Parameters: +// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value +// from the Azure Resource Manager API or the portal. +// serverName - the name of the server. +func (client ExtendedServerBlobAuditingPoliciesClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result ExtendedServerBlobAuditingPolicyListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExtendedServerBlobAuditingPoliciesClient.ListByServer") + defer func() { + sc := -1 + if result.esbaplr.Response.Response != nil { + sc = result.esbaplr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByServerNextResults + req, err := client.ListByServerPreparer(ctx, resourceGroupName, serverName) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ExtendedServerBlobAuditingPoliciesClient", "ListByServer", nil, "Failure preparing request") + return + } + + resp, err := client.ListByServerSender(req) + if err != nil { + result.esbaplr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "sql.ExtendedServerBlobAuditingPoliciesClient", "ListByServer", resp, "Failure sending request") + return + } + + result.esbaplr, err = client.ListByServerResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ExtendedServerBlobAuditingPoliciesClient", "ListByServer", resp, "Failure responding to request") + } + + return +} + +// ListByServerPreparer prepares the ListByServer request. +func (client ExtendedServerBlobAuditingPoliciesClient) ListByServerPreparer(ctx context.Context, resourceGroupName string, serverName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serverName": autorest.Encode("path", serverName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-03-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.Sql/servers/{serverName}/extendedAuditingSettings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByServerSender sends the ListByServer request. The method will close the +// http.Response Body if it receives an error. +func (client ExtendedServerBlobAuditingPoliciesClient) ListByServerSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByServerResponder handles the response to the ListByServer request. The method always +// closes the http.Response Body. +func (client ExtendedServerBlobAuditingPoliciesClient) ListByServerResponder(resp *http.Response) (result ExtendedServerBlobAuditingPolicyListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByServerNextResults retrieves the next set of results, if any. +func (client ExtendedServerBlobAuditingPoliciesClient) listByServerNextResults(ctx context.Context, lastResults ExtendedServerBlobAuditingPolicyListResult) (result ExtendedServerBlobAuditingPolicyListResult, err error) { + req, err := lastResults.extendedServerBlobAuditingPolicyListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "sql.ExtendedServerBlobAuditingPoliciesClient", "listByServerNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByServerSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "sql.ExtendedServerBlobAuditingPoliciesClient", "listByServerNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByServerResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ExtendedServerBlobAuditingPoliciesClient", "listByServerNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByServerComplete enumerates all values, automatically crossing page boundaries as required. +func (client ExtendedServerBlobAuditingPoliciesClient) ListByServerComplete(ctx context.Context, resourceGroupName string, serverName string) (result ExtendedServerBlobAuditingPolicyListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExtendedServerBlobAuditingPoliciesClient.ListByServer") + 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.ListByServer(ctx, resourceGroupName, serverName) + return +} diff --git a/services/preview/sql/mgmt/2017-03-01-preview/sql/models.go b/services/preview/sql/mgmt/2017-03-01-preview/sql/models.go index 7780b9625fa1..b30fb5207ec9 100644 --- a/services/preview/sql/mgmt/2017-03-01-preview/sql/models.go +++ b/services/preview/sql/mgmt/2017-03-01-preview/sql/models.go @@ -2284,7 +2284,12 @@ type DatabaseBlobAuditingPolicyProperties struct { State BlobAuditingPolicyState `json:"state,omitempty"` // StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled is required. StorageEndpoint *string `json:"storageEndpoint,omitempty"` - // StorageAccountAccessKey - Specifies the identifier key of the auditing storage account. If state is Enabled and storageEndpoint is specified, storageAccountAccessKey is required. + // StorageAccountAccessKey - Specifies the identifier key of the auditing storage account. + // If state is Enabled and storageEndpoint is specified, not specifying the storageAccountAccessKey will use SQL server system-assigned managed identity to access the storage. + // Prerequisites for using managed identity authentication: + // 1. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD). + // 2. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data Contributor' RBAC role to the server identity. + // For more information, see [Auditing to storage using Managed Identity authentication](https://go.microsoft.com/fwlink/?linkid=2114355) StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"` // RetentionDays - Specifies the number of days to keep in the audit logs in the storage account. RetentionDays *int32 `json:"retentionDays,omitempty"` @@ -4774,6 +4779,154 @@ func (edbap *ExtendedDatabaseBlobAuditingPolicy) UnmarshalJSON(body []byte) erro return nil } +// ExtendedDatabaseBlobAuditingPolicyListResult a list of database extended auditing settings. +type ExtendedDatabaseBlobAuditingPolicyListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; Array of results. + Value *[]ExtendedDatabaseBlobAuditingPolicy `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to retrieve next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// ExtendedDatabaseBlobAuditingPolicyListResultIterator provides access to a complete listing of +// ExtendedDatabaseBlobAuditingPolicy values. +type ExtendedDatabaseBlobAuditingPolicyListResultIterator struct { + i int + page ExtendedDatabaseBlobAuditingPolicyListResultPage +} + +// 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 *ExtendedDatabaseBlobAuditingPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExtendedDatabaseBlobAuditingPolicyListResultIterator.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 *ExtendedDatabaseBlobAuditingPolicyListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ExtendedDatabaseBlobAuditingPolicyListResultIterator) 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 ExtendedDatabaseBlobAuditingPolicyListResultIterator) Response() ExtendedDatabaseBlobAuditingPolicyListResult { + 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 ExtendedDatabaseBlobAuditingPolicyListResultIterator) Value() ExtendedDatabaseBlobAuditingPolicy { + if !iter.page.NotDone() { + return ExtendedDatabaseBlobAuditingPolicy{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ExtendedDatabaseBlobAuditingPolicyListResultIterator type. +func NewExtendedDatabaseBlobAuditingPolicyListResultIterator(page ExtendedDatabaseBlobAuditingPolicyListResultPage) ExtendedDatabaseBlobAuditingPolicyListResultIterator { + return ExtendedDatabaseBlobAuditingPolicyListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (edbaplr ExtendedDatabaseBlobAuditingPolicyListResult) IsEmpty() bool { + return edbaplr.Value == nil || len(*edbaplr.Value) == 0 +} + +// extendedDatabaseBlobAuditingPolicyListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (edbaplr ExtendedDatabaseBlobAuditingPolicyListResult) extendedDatabaseBlobAuditingPolicyListResultPreparer(ctx context.Context) (*http.Request, error) { + if edbaplr.NextLink == nil || len(to.String(edbaplr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(edbaplr.NextLink))) +} + +// ExtendedDatabaseBlobAuditingPolicyListResultPage contains a page of ExtendedDatabaseBlobAuditingPolicy +// values. +type ExtendedDatabaseBlobAuditingPolicyListResultPage struct { + fn func(context.Context, ExtendedDatabaseBlobAuditingPolicyListResult) (ExtendedDatabaseBlobAuditingPolicyListResult, error) + edbaplr ExtendedDatabaseBlobAuditingPolicyListResult +} + +// 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 *ExtendedDatabaseBlobAuditingPolicyListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExtendedDatabaseBlobAuditingPolicyListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.edbaplr) + if err != nil { + return err + } + page.edbaplr = next + 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 *ExtendedDatabaseBlobAuditingPolicyListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ExtendedDatabaseBlobAuditingPolicyListResultPage) NotDone() bool { + return !page.edbaplr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ExtendedDatabaseBlobAuditingPolicyListResultPage) Response() ExtendedDatabaseBlobAuditingPolicyListResult { + return page.edbaplr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ExtendedDatabaseBlobAuditingPolicyListResultPage) Values() []ExtendedDatabaseBlobAuditingPolicy { + if page.edbaplr.IsEmpty() { + return nil + } + return *page.edbaplr.Value +} + +// Creates a new instance of the ExtendedDatabaseBlobAuditingPolicyListResultPage type. +func NewExtendedDatabaseBlobAuditingPolicyListResultPage(getNextPage func(context.Context, ExtendedDatabaseBlobAuditingPolicyListResult) (ExtendedDatabaseBlobAuditingPolicyListResult, error)) ExtendedDatabaseBlobAuditingPolicyListResultPage { + return ExtendedDatabaseBlobAuditingPolicyListResultPage{fn: getNextPage} +} + // ExtendedDatabaseBlobAuditingPolicyProperties properties of an extended database blob auditing policy. type ExtendedDatabaseBlobAuditingPolicyProperties struct { // PredicateExpression - Specifies condition of where clause when creating an audit. @@ -4782,7 +4935,12 @@ type ExtendedDatabaseBlobAuditingPolicyProperties struct { State BlobAuditingPolicyState `json:"state,omitempty"` // StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled is required. StorageEndpoint *string `json:"storageEndpoint,omitempty"` - // StorageAccountAccessKey - Specifies the identifier key of the auditing storage account. If state is Enabled and storageEndpoint is specified, storageAccountAccessKey is required. + // StorageAccountAccessKey - Specifies the identifier key of the auditing storage account. + // If state is Enabled and storageEndpoint is specified, not specifying the storageAccountAccessKey will use SQL server system-assigned managed identity to access the storage. + // Prerequisites for using managed identity authentication: + // 1. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD). + // 2. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data Contributor' RBAC role to the server identity. + // For more information, see [Auditing to storage using Managed Identity authentication](https://go.microsoft.com/fwlink/?linkid=2114355) StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"` // RetentionDays - Specifies the number of days to keep in the audit logs in the storage account. RetentionDays *int32 `json:"retentionDays,omitempty"` @@ -4967,6 +5125,154 @@ func (esbap *ExtendedServerBlobAuditingPolicy) UnmarshalJSON(body []byte) error return nil } +// ExtendedServerBlobAuditingPolicyListResult a list of server extended auditing settings. +type ExtendedServerBlobAuditingPolicyListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; Array of results. + Value *[]ExtendedServerBlobAuditingPolicy `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to retrieve next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// ExtendedServerBlobAuditingPolicyListResultIterator provides access to a complete listing of +// ExtendedServerBlobAuditingPolicy values. +type ExtendedServerBlobAuditingPolicyListResultIterator struct { + i int + page ExtendedServerBlobAuditingPolicyListResultPage +} + +// 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 *ExtendedServerBlobAuditingPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExtendedServerBlobAuditingPolicyListResultIterator.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 *ExtendedServerBlobAuditingPolicyListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ExtendedServerBlobAuditingPolicyListResultIterator) 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 ExtendedServerBlobAuditingPolicyListResultIterator) Response() ExtendedServerBlobAuditingPolicyListResult { + 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 ExtendedServerBlobAuditingPolicyListResultIterator) Value() ExtendedServerBlobAuditingPolicy { + if !iter.page.NotDone() { + return ExtendedServerBlobAuditingPolicy{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ExtendedServerBlobAuditingPolicyListResultIterator type. +func NewExtendedServerBlobAuditingPolicyListResultIterator(page ExtendedServerBlobAuditingPolicyListResultPage) ExtendedServerBlobAuditingPolicyListResultIterator { + return ExtendedServerBlobAuditingPolicyListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (esbaplr ExtendedServerBlobAuditingPolicyListResult) IsEmpty() bool { + return esbaplr.Value == nil || len(*esbaplr.Value) == 0 +} + +// extendedServerBlobAuditingPolicyListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (esbaplr ExtendedServerBlobAuditingPolicyListResult) extendedServerBlobAuditingPolicyListResultPreparer(ctx context.Context) (*http.Request, error) { + if esbaplr.NextLink == nil || len(to.String(esbaplr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(esbaplr.NextLink))) +} + +// ExtendedServerBlobAuditingPolicyListResultPage contains a page of ExtendedServerBlobAuditingPolicy +// values. +type ExtendedServerBlobAuditingPolicyListResultPage struct { + fn func(context.Context, ExtendedServerBlobAuditingPolicyListResult) (ExtendedServerBlobAuditingPolicyListResult, error) + esbaplr ExtendedServerBlobAuditingPolicyListResult +} + +// 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 *ExtendedServerBlobAuditingPolicyListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExtendedServerBlobAuditingPolicyListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.esbaplr) + if err != nil { + return err + } + page.esbaplr = next + 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 *ExtendedServerBlobAuditingPolicyListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ExtendedServerBlobAuditingPolicyListResultPage) NotDone() bool { + return !page.esbaplr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ExtendedServerBlobAuditingPolicyListResultPage) Response() ExtendedServerBlobAuditingPolicyListResult { + return page.esbaplr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ExtendedServerBlobAuditingPolicyListResultPage) Values() []ExtendedServerBlobAuditingPolicy { + if page.esbaplr.IsEmpty() { + return nil + } + return *page.esbaplr.Value +} + +// Creates a new instance of the ExtendedServerBlobAuditingPolicyListResultPage type. +func NewExtendedServerBlobAuditingPolicyListResultPage(getNextPage func(context.Context, ExtendedServerBlobAuditingPolicyListResult) (ExtendedServerBlobAuditingPolicyListResult, error)) ExtendedServerBlobAuditingPolicyListResultPage { + return ExtendedServerBlobAuditingPolicyListResultPage{fn: getNextPage} +} + // ExtendedServerBlobAuditingPolicyProperties properties of an extended server blob auditing policy. type ExtendedServerBlobAuditingPolicyProperties struct { // PredicateExpression - Specifies condition of where clause when creating an audit. @@ -4975,7 +5281,12 @@ type ExtendedServerBlobAuditingPolicyProperties struct { State BlobAuditingPolicyState `json:"state,omitempty"` // StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled is required. StorageEndpoint *string `json:"storageEndpoint,omitempty"` - // StorageAccountAccessKey - Specifies the identifier key of the auditing storage account. If state is Enabled and storageEndpoint is specified, storageAccountAccessKey is required. + // StorageAccountAccessKey - Specifies the identifier key of the auditing storage account. + // If state is Enabled and storageEndpoint is specified, not specifying the storageAccountAccessKey will use SQL server system-assigned managed identity to access the storage. + // Prerequisites for using managed identity authentication: + // 1. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD). + // 2. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data Contributor' RBAC role to the server identity. + // For more information, see [Auditing to storage using Managed Identity authentication](https://go.microsoft.com/fwlink/?linkid=2114355) StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"` // RetentionDays - Specifies the number of days to keep in the audit logs in the storage account. RetentionDays *int32 `json:"retentionDays,omitempty"` @@ -9288,6 +9599,8 @@ type ManagedInstanceProperties struct { TimezoneID *string `json:"timezoneId,omitempty"` // InstancePoolID - The Id of the instance pool this managed server belongs to. InstancePoolID *string `json:"instancePoolId,omitempty"` + // MaintenanceConfigurationID - Specifies maintenance configuration id to apply to this managed instance. + MaintenanceConfigurationID *string `json:"maintenanceConfigurationId,omitempty"` // MinimalTLSVersion - Minimal TLS version. Allowed values: 'None', '1.0', '1.1', '1.2' MinimalTLSVersion *string `json:"minimalTlsVersion,omitempty"` } @@ -11506,7 +11819,12 @@ type ServerBlobAuditingPolicyProperties struct { State BlobAuditingPolicyState `json:"state,omitempty"` // StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled is required. StorageEndpoint *string `json:"storageEndpoint,omitempty"` - // StorageAccountAccessKey - Specifies the identifier key of the auditing storage account. If state is Enabled and storageEndpoint is specified, storageAccountAccessKey is required. + // StorageAccountAccessKey - Specifies the identifier key of the auditing storage account. + // If state is Enabled and storageEndpoint is specified, not specifying the storageAccountAccessKey will use SQL server system-assigned managed identity to access the storage. + // Prerequisites for using managed identity authentication: + // 1. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD). + // 2. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data Contributor' RBAC role to the server identity. + // For more information, see [Auditing to storage using Managed Identity authentication](https://go.microsoft.com/fwlink/?linkid=2114355) StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"` // RetentionDays - Specifies the number of days to keep in the audit logs in the storage account. RetentionDays *int32 `json:"retentionDays,omitempty"` diff --git a/services/preview/sql/mgmt/2017-03-01-preview/sql/sqlapi/interfaces.go b/services/preview/sql/mgmt/2017-03-01-preview/sql/sqlapi/interfaces.go index dd94ba59b9ac..daf76d45bc00 100644 --- a/services/preview/sql/mgmt/2017-03-01-preview/sql/sqlapi/interfaces.go +++ b/services/preview/sql/mgmt/2017-03-01-preview/sql/sqlapi/interfaces.go @@ -401,6 +401,8 @@ var _ VirtualClustersClientAPI = (*sql.VirtualClustersClient)(nil) type ExtendedDatabaseBlobAuditingPoliciesClientAPI interface { CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters sql.ExtendedDatabaseBlobAuditingPolicy) (result sql.ExtendedDatabaseBlobAuditingPolicy, err error) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.ExtendedDatabaseBlobAuditingPolicy, err error) + ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.ExtendedDatabaseBlobAuditingPolicyListResultPage, err error) + ListByDatabaseComplete(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.ExtendedDatabaseBlobAuditingPolicyListResultIterator, err error) } var _ ExtendedDatabaseBlobAuditingPoliciesClientAPI = (*sql.ExtendedDatabaseBlobAuditingPoliciesClient)(nil) @@ -409,6 +411,8 @@ var _ ExtendedDatabaseBlobAuditingPoliciesClientAPI = (*sql.ExtendedDatabaseBlob type ExtendedServerBlobAuditingPoliciesClientAPI interface { CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters sql.ExtendedServerBlobAuditingPolicy) (result sql.ExtendedServerBlobAuditingPoliciesCreateOrUpdateFuture, err error) Get(ctx context.Context, resourceGroupName string, serverName string) (result sql.ExtendedServerBlobAuditingPolicy, err error) + ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result sql.ExtendedServerBlobAuditingPolicyListResultPage, err error) + ListByServerComplete(ctx context.Context, resourceGroupName string, serverName string) (result sql.ExtendedServerBlobAuditingPolicyListResultIterator, err error) } var _ ExtendedServerBlobAuditingPoliciesClientAPI = (*sql.ExtendedServerBlobAuditingPoliciesClient)(nil) diff --git a/services/preview/sql/mgmt/2017-10-01-preview/sql/models.go b/services/preview/sql/mgmt/2017-10-01-preview/sql/models.go index f9171f4e4af6..ec261e4f29f6 100644 --- a/services/preview/sql/mgmt/2017-10-01-preview/sql/models.go +++ b/services/preview/sql/mgmt/2017-10-01-preview/sql/models.go @@ -1321,7 +1321,7 @@ type DatabaseProperties struct { CatalogCollation CatalogCollationType `json:"catalogCollation,omitempty"` // ZoneRedundant - Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones. ZoneRedundant *bool `json:"zoneRedundant,omitempty"` - // LicenseType - The license type to apply for this database. Possible values include: 'LicenseIncluded', 'BasePrice' + // LicenseType - The license type to apply for this database. `LicenseIncluded` if you need a license, or `BasePrice` if you have a license and are eligible for the Azure Hybrid Benefit. Possible values include: 'LicenseIncluded', 'BasePrice' LicenseType DatabaseLicenseType `json:"licenseType,omitempty"` // MaxLogSizeBytes - READ-ONLY; The max log size for this database. MaxLogSizeBytes *int64 `json:"maxLogSizeBytes,omitempty"` diff --git a/services/preview/sql/mgmt/2018-06-01-preview/sql/models.go b/services/preview/sql/mgmt/2018-06-01-preview/sql/models.go index 428ecc465e13..8ff9d39db0e8 100644 --- a/services/preview/sql/mgmt/2018-06-01-preview/sql/models.go +++ b/services/preview/sql/mgmt/2018-06-01-preview/sql/models.go @@ -2728,6 +2728,8 @@ type ManagedInstanceProperties struct { TimezoneID *string `json:"timezoneId,omitempty"` // InstancePoolID - The Id of the instance pool this managed server belongs to. InstancePoolID *string `json:"instancePoolId,omitempty"` + // MaintenanceConfigurationID - Specifies maintenance configuration id to apply to this managed instance. + MaintenanceConfigurationID *string `json:"maintenanceConfigurationId,omitempty"` // MinimalTLSVersion - Minimal TLS version. Allowed values: 'None', '1.0', '1.1', '1.2' MinimalTLSVersion *string `json:"minimalTlsVersion,omitempty"` } diff --git a/services/preview/sql/mgmt/v3.0/sql/extendeddatabaseblobauditingpolicies.go b/services/preview/sql/mgmt/v3.0/sql/extendeddatabaseblobauditingpolicies.go index bbe1db0b5511..a32b47c6a125 100644 --- a/services/preview/sql/mgmt/v3.0/sql/extendeddatabaseblobauditingpolicies.go +++ b/services/preview/sql/mgmt/v3.0/sql/extendeddatabaseblobauditingpolicies.go @@ -207,3 +207,120 @@ func (client ExtendedDatabaseBlobAuditingPoliciesClient) GetResponder(resp *http result.Response = autorest.Response{Response: resp} return } + +// ListByDatabase lists extended auditing settings of a database. +// Parameters: +// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value +// from the Azure Resource Manager API or the portal. +// serverName - the name of the server. +// databaseName - the name of the database. +func (client ExtendedDatabaseBlobAuditingPoliciesClient) ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result ExtendedDatabaseBlobAuditingPolicyListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExtendedDatabaseBlobAuditingPoliciesClient.ListByDatabase") + defer func() { + sc := -1 + if result.edbaplr.Response.Response != nil { + sc = result.edbaplr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByDatabaseNextResults + req, err := client.ListByDatabasePreparer(ctx, resourceGroupName, serverName, databaseName) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ExtendedDatabaseBlobAuditingPoliciesClient", "ListByDatabase", nil, "Failure preparing request") + return + } + + resp, err := client.ListByDatabaseSender(req) + if err != nil { + result.edbaplr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "sql.ExtendedDatabaseBlobAuditingPoliciesClient", "ListByDatabase", resp, "Failure sending request") + return + } + + result.edbaplr, err = client.ListByDatabaseResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ExtendedDatabaseBlobAuditingPoliciesClient", "ListByDatabase", resp, "Failure responding to request") + } + + return +} + +// ListByDatabasePreparer prepares the ListByDatabase request. +func (client ExtendedDatabaseBlobAuditingPoliciesClient) ListByDatabasePreparer(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "databaseName": autorest.Encode("path", databaseName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serverName": autorest.Encode("path", serverName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-03-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.Sql/servers/{serverName}/databases/{databaseName}/extendedAuditingSettings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByDatabaseSender sends the ListByDatabase request. The method will close the +// http.Response Body if it receives an error. +func (client ExtendedDatabaseBlobAuditingPoliciesClient) ListByDatabaseSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByDatabaseResponder handles the response to the ListByDatabase request. The method always +// closes the http.Response Body. +func (client ExtendedDatabaseBlobAuditingPoliciesClient) ListByDatabaseResponder(resp *http.Response) (result ExtendedDatabaseBlobAuditingPolicyListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByDatabaseNextResults retrieves the next set of results, if any. +func (client ExtendedDatabaseBlobAuditingPoliciesClient) listByDatabaseNextResults(ctx context.Context, lastResults ExtendedDatabaseBlobAuditingPolicyListResult) (result ExtendedDatabaseBlobAuditingPolicyListResult, err error) { + req, err := lastResults.extendedDatabaseBlobAuditingPolicyListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "sql.ExtendedDatabaseBlobAuditingPoliciesClient", "listByDatabaseNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByDatabaseSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "sql.ExtendedDatabaseBlobAuditingPoliciesClient", "listByDatabaseNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByDatabaseResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ExtendedDatabaseBlobAuditingPoliciesClient", "listByDatabaseNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByDatabaseComplete enumerates all values, automatically crossing page boundaries as required. +func (client ExtendedDatabaseBlobAuditingPoliciesClient) ListByDatabaseComplete(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result ExtendedDatabaseBlobAuditingPolicyListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExtendedDatabaseBlobAuditingPoliciesClient.ListByDatabase") + 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.ListByDatabase(ctx, resourceGroupName, serverName, databaseName) + return +} diff --git a/services/preview/sql/mgmt/v3.0/sql/extendedserverblobauditingpolicies.go b/services/preview/sql/mgmt/v3.0/sql/extendedserverblobauditingpolicies.go index 1cd842295c5f..db61b94da6b4 100644 --- a/services/preview/sql/mgmt/v3.0/sql/extendedserverblobauditingpolicies.go +++ b/services/preview/sql/mgmt/v3.0/sql/extendedserverblobauditingpolicies.go @@ -203,3 +203,118 @@ func (client ExtendedServerBlobAuditingPoliciesClient) GetResponder(resp *http.R result.Response = autorest.Response{Response: resp} return } + +// ListByServer lists extended auditing settings of a server. +// Parameters: +// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value +// from the Azure Resource Manager API or the portal. +// serverName - the name of the server. +func (client ExtendedServerBlobAuditingPoliciesClient) ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result ExtendedServerBlobAuditingPolicyListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExtendedServerBlobAuditingPoliciesClient.ListByServer") + defer func() { + sc := -1 + if result.esbaplr.Response.Response != nil { + sc = result.esbaplr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByServerNextResults + req, err := client.ListByServerPreparer(ctx, resourceGroupName, serverName) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ExtendedServerBlobAuditingPoliciesClient", "ListByServer", nil, "Failure preparing request") + return + } + + resp, err := client.ListByServerSender(req) + if err != nil { + result.esbaplr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "sql.ExtendedServerBlobAuditingPoliciesClient", "ListByServer", resp, "Failure sending request") + return + } + + result.esbaplr, err = client.ListByServerResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ExtendedServerBlobAuditingPoliciesClient", "ListByServer", resp, "Failure responding to request") + } + + return +} + +// ListByServerPreparer prepares the ListByServer request. +func (client ExtendedServerBlobAuditingPoliciesClient) ListByServerPreparer(ctx context.Context, resourceGroupName string, serverName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "serverName": autorest.Encode("path", serverName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2017-03-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.Sql/servers/{serverName}/extendedAuditingSettings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByServerSender sends the ListByServer request. The method will close the +// http.Response Body if it receives an error. +func (client ExtendedServerBlobAuditingPoliciesClient) ListByServerSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByServerResponder handles the response to the ListByServer request. The method always +// closes the http.Response Body. +func (client ExtendedServerBlobAuditingPoliciesClient) ListByServerResponder(resp *http.Response) (result ExtendedServerBlobAuditingPolicyListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByServerNextResults retrieves the next set of results, if any. +func (client ExtendedServerBlobAuditingPoliciesClient) listByServerNextResults(ctx context.Context, lastResults ExtendedServerBlobAuditingPolicyListResult) (result ExtendedServerBlobAuditingPolicyListResult, err error) { + req, err := lastResults.extendedServerBlobAuditingPolicyListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "sql.ExtendedServerBlobAuditingPoliciesClient", "listByServerNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByServerSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "sql.ExtendedServerBlobAuditingPoliciesClient", "listByServerNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByServerResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "sql.ExtendedServerBlobAuditingPoliciesClient", "listByServerNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByServerComplete enumerates all values, automatically crossing page boundaries as required. +func (client ExtendedServerBlobAuditingPoliciesClient) ListByServerComplete(ctx context.Context, resourceGroupName string, serverName string) (result ExtendedServerBlobAuditingPolicyListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExtendedServerBlobAuditingPoliciesClient.ListByServer") + 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.ListByServer(ctx, resourceGroupName, serverName) + return +} diff --git a/services/preview/sql/mgmt/v3.0/sql/models.go b/services/preview/sql/mgmt/v3.0/sql/models.go index 4b1f7b6e5d17..a398814560f5 100644 --- a/services/preview/sql/mgmt/v3.0/sql/models.go +++ b/services/preview/sql/mgmt/v3.0/sql/models.go @@ -3054,7 +3054,12 @@ type DatabaseBlobAuditingPolicyProperties struct { State BlobAuditingPolicyState `json:"state,omitempty"` // StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled is required. StorageEndpoint *string `json:"storageEndpoint,omitempty"` - // StorageAccountAccessKey - Specifies the identifier key of the auditing storage account. If state is Enabled and storageEndpoint is specified, storageAccountAccessKey is required. + // StorageAccountAccessKey - Specifies the identifier key of the auditing storage account. + // If state is Enabled and storageEndpoint is specified, not specifying the storageAccountAccessKey will use SQL server system-assigned managed identity to access the storage. + // Prerequisites for using managed identity authentication: + // 1. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD). + // 2. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data Contributor' RBAC role to the server identity. + // For more information, see [Auditing to storage using Managed Identity authentication](https://go.microsoft.com/fwlink/?linkid=2114355) StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"` // RetentionDays - Specifies the number of days to keep in the audit logs in the storage account. RetentionDays *int32 `json:"retentionDays,omitempty"` @@ -3593,7 +3598,7 @@ type DatabaseProperties struct { CatalogCollation CatalogCollationType `json:"catalogCollation,omitempty"` // ZoneRedundant - Whether or not this database is zone redundant, which means the replicas of this database will be spread across multiple availability zones. ZoneRedundant *bool `json:"zoneRedundant,omitempty"` - // LicenseType - The license type to apply for this database. Possible values include: 'LicenseIncluded', 'BasePrice' + // LicenseType - The license type to apply for this database. `LicenseIncluded` if you need a license, or `BasePrice` if you have a license and are eligible for the Azure Hybrid Benefit. Possible values include: 'LicenseIncluded', 'BasePrice' LicenseType DatabaseLicenseType `json:"licenseType,omitempty"` // MaxLogSizeBytes - READ-ONLY; The max log size for this database. MaxLogSizeBytes *int64 `json:"maxLogSizeBytes,omitempty"` @@ -6237,6 +6242,154 @@ func (edbap *ExtendedDatabaseBlobAuditingPolicy) UnmarshalJSON(body []byte) erro return nil } +// ExtendedDatabaseBlobAuditingPolicyListResult a list of database extended auditing settings. +type ExtendedDatabaseBlobAuditingPolicyListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; Array of results. + Value *[]ExtendedDatabaseBlobAuditingPolicy `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to retrieve next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// ExtendedDatabaseBlobAuditingPolicyListResultIterator provides access to a complete listing of +// ExtendedDatabaseBlobAuditingPolicy values. +type ExtendedDatabaseBlobAuditingPolicyListResultIterator struct { + i int + page ExtendedDatabaseBlobAuditingPolicyListResultPage +} + +// 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 *ExtendedDatabaseBlobAuditingPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExtendedDatabaseBlobAuditingPolicyListResultIterator.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 *ExtendedDatabaseBlobAuditingPolicyListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ExtendedDatabaseBlobAuditingPolicyListResultIterator) 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 ExtendedDatabaseBlobAuditingPolicyListResultIterator) Response() ExtendedDatabaseBlobAuditingPolicyListResult { + 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 ExtendedDatabaseBlobAuditingPolicyListResultIterator) Value() ExtendedDatabaseBlobAuditingPolicy { + if !iter.page.NotDone() { + return ExtendedDatabaseBlobAuditingPolicy{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ExtendedDatabaseBlobAuditingPolicyListResultIterator type. +func NewExtendedDatabaseBlobAuditingPolicyListResultIterator(page ExtendedDatabaseBlobAuditingPolicyListResultPage) ExtendedDatabaseBlobAuditingPolicyListResultIterator { + return ExtendedDatabaseBlobAuditingPolicyListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (edbaplr ExtendedDatabaseBlobAuditingPolicyListResult) IsEmpty() bool { + return edbaplr.Value == nil || len(*edbaplr.Value) == 0 +} + +// extendedDatabaseBlobAuditingPolicyListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (edbaplr ExtendedDatabaseBlobAuditingPolicyListResult) extendedDatabaseBlobAuditingPolicyListResultPreparer(ctx context.Context) (*http.Request, error) { + if edbaplr.NextLink == nil || len(to.String(edbaplr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(edbaplr.NextLink))) +} + +// ExtendedDatabaseBlobAuditingPolicyListResultPage contains a page of ExtendedDatabaseBlobAuditingPolicy +// values. +type ExtendedDatabaseBlobAuditingPolicyListResultPage struct { + fn func(context.Context, ExtendedDatabaseBlobAuditingPolicyListResult) (ExtendedDatabaseBlobAuditingPolicyListResult, error) + edbaplr ExtendedDatabaseBlobAuditingPolicyListResult +} + +// 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 *ExtendedDatabaseBlobAuditingPolicyListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExtendedDatabaseBlobAuditingPolicyListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.edbaplr) + if err != nil { + return err + } + page.edbaplr = next + 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 *ExtendedDatabaseBlobAuditingPolicyListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ExtendedDatabaseBlobAuditingPolicyListResultPage) NotDone() bool { + return !page.edbaplr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ExtendedDatabaseBlobAuditingPolicyListResultPage) Response() ExtendedDatabaseBlobAuditingPolicyListResult { + return page.edbaplr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ExtendedDatabaseBlobAuditingPolicyListResultPage) Values() []ExtendedDatabaseBlobAuditingPolicy { + if page.edbaplr.IsEmpty() { + return nil + } + return *page.edbaplr.Value +} + +// Creates a new instance of the ExtendedDatabaseBlobAuditingPolicyListResultPage type. +func NewExtendedDatabaseBlobAuditingPolicyListResultPage(getNextPage func(context.Context, ExtendedDatabaseBlobAuditingPolicyListResult) (ExtendedDatabaseBlobAuditingPolicyListResult, error)) ExtendedDatabaseBlobAuditingPolicyListResultPage { + return ExtendedDatabaseBlobAuditingPolicyListResultPage{fn: getNextPage} +} + // ExtendedDatabaseBlobAuditingPolicyProperties properties of an extended database blob auditing policy. type ExtendedDatabaseBlobAuditingPolicyProperties struct { // PredicateExpression - Specifies condition of where clause when creating an audit. @@ -6245,7 +6398,12 @@ type ExtendedDatabaseBlobAuditingPolicyProperties struct { State BlobAuditingPolicyState `json:"state,omitempty"` // StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled is required. StorageEndpoint *string `json:"storageEndpoint,omitempty"` - // StorageAccountAccessKey - Specifies the identifier key of the auditing storage account. If state is Enabled and storageEndpoint is specified, storageAccountAccessKey is required. + // StorageAccountAccessKey - Specifies the identifier key of the auditing storage account. + // If state is Enabled and storageEndpoint is specified, not specifying the storageAccountAccessKey will use SQL server system-assigned managed identity to access the storage. + // Prerequisites for using managed identity authentication: + // 1. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD). + // 2. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data Contributor' RBAC role to the server identity. + // For more information, see [Auditing to storage using Managed Identity authentication](https://go.microsoft.com/fwlink/?linkid=2114355) StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"` // RetentionDays - Specifies the number of days to keep in the audit logs in the storage account. RetentionDays *int32 `json:"retentionDays,omitempty"` @@ -6430,6 +6588,154 @@ func (esbap *ExtendedServerBlobAuditingPolicy) UnmarshalJSON(body []byte) error return nil } +// ExtendedServerBlobAuditingPolicyListResult a list of server extended auditing settings. +type ExtendedServerBlobAuditingPolicyListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; Array of results. + Value *[]ExtendedServerBlobAuditingPolicy `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to retrieve next page of results. + NextLink *string `json:"nextLink,omitempty"` +} + +// ExtendedServerBlobAuditingPolicyListResultIterator provides access to a complete listing of +// ExtendedServerBlobAuditingPolicy values. +type ExtendedServerBlobAuditingPolicyListResultIterator struct { + i int + page ExtendedServerBlobAuditingPolicyListResultPage +} + +// 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 *ExtendedServerBlobAuditingPolicyListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExtendedServerBlobAuditingPolicyListResultIterator.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 *ExtendedServerBlobAuditingPolicyListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ExtendedServerBlobAuditingPolicyListResultIterator) 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 ExtendedServerBlobAuditingPolicyListResultIterator) Response() ExtendedServerBlobAuditingPolicyListResult { + 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 ExtendedServerBlobAuditingPolicyListResultIterator) Value() ExtendedServerBlobAuditingPolicy { + if !iter.page.NotDone() { + return ExtendedServerBlobAuditingPolicy{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ExtendedServerBlobAuditingPolicyListResultIterator type. +func NewExtendedServerBlobAuditingPolicyListResultIterator(page ExtendedServerBlobAuditingPolicyListResultPage) ExtendedServerBlobAuditingPolicyListResultIterator { + return ExtendedServerBlobAuditingPolicyListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (esbaplr ExtendedServerBlobAuditingPolicyListResult) IsEmpty() bool { + return esbaplr.Value == nil || len(*esbaplr.Value) == 0 +} + +// extendedServerBlobAuditingPolicyListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (esbaplr ExtendedServerBlobAuditingPolicyListResult) extendedServerBlobAuditingPolicyListResultPreparer(ctx context.Context) (*http.Request, error) { + if esbaplr.NextLink == nil || len(to.String(esbaplr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(esbaplr.NextLink))) +} + +// ExtendedServerBlobAuditingPolicyListResultPage contains a page of ExtendedServerBlobAuditingPolicy +// values. +type ExtendedServerBlobAuditingPolicyListResultPage struct { + fn func(context.Context, ExtendedServerBlobAuditingPolicyListResult) (ExtendedServerBlobAuditingPolicyListResult, error) + esbaplr ExtendedServerBlobAuditingPolicyListResult +} + +// 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 *ExtendedServerBlobAuditingPolicyListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ExtendedServerBlobAuditingPolicyListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.esbaplr) + if err != nil { + return err + } + page.esbaplr = next + 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 *ExtendedServerBlobAuditingPolicyListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ExtendedServerBlobAuditingPolicyListResultPage) NotDone() bool { + return !page.esbaplr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ExtendedServerBlobAuditingPolicyListResultPage) Response() ExtendedServerBlobAuditingPolicyListResult { + return page.esbaplr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ExtendedServerBlobAuditingPolicyListResultPage) Values() []ExtendedServerBlobAuditingPolicy { + if page.esbaplr.IsEmpty() { + return nil + } + return *page.esbaplr.Value +} + +// Creates a new instance of the ExtendedServerBlobAuditingPolicyListResultPage type. +func NewExtendedServerBlobAuditingPolicyListResultPage(getNextPage func(context.Context, ExtendedServerBlobAuditingPolicyListResult) (ExtendedServerBlobAuditingPolicyListResult, error)) ExtendedServerBlobAuditingPolicyListResultPage { + return ExtendedServerBlobAuditingPolicyListResultPage{fn: getNextPage} +} + // ExtendedServerBlobAuditingPolicyProperties properties of an extended server blob auditing policy. type ExtendedServerBlobAuditingPolicyProperties struct { // PredicateExpression - Specifies condition of where clause when creating an audit. @@ -6438,7 +6744,12 @@ type ExtendedServerBlobAuditingPolicyProperties struct { State BlobAuditingPolicyState `json:"state,omitempty"` // StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled is required. StorageEndpoint *string `json:"storageEndpoint,omitempty"` - // StorageAccountAccessKey - Specifies the identifier key of the auditing storage account. If state is Enabled and storageEndpoint is specified, storageAccountAccessKey is required. + // StorageAccountAccessKey - Specifies the identifier key of the auditing storage account. + // If state is Enabled and storageEndpoint is specified, not specifying the storageAccountAccessKey will use SQL server system-assigned managed identity to access the storage. + // Prerequisites for using managed identity authentication: + // 1. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD). + // 2. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data Contributor' RBAC role to the server identity. + // For more information, see [Auditing to storage using Managed Identity authentication](https://go.microsoft.com/fwlink/?linkid=2114355) StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"` // RetentionDays - Specifies the number of days to keep in the audit logs in the storage account. RetentionDays *int32 `json:"retentionDays,omitempty"` @@ -11099,7 +11410,7 @@ type ManagedDatabaseProperties struct { DefaultSecondaryLocation *string `json:"defaultSecondaryLocation,omitempty"` // CatalogCollation - Collation of the metadata catalog. Possible values include: 'DATABASEDEFAULT', 'SQLLatin1GeneralCP1CIAS' CatalogCollation CatalogCollationType `json:"catalogCollation,omitempty"` - // CreateMode - Managed database create mode. PointInTimeRestore: Create a database by restoring a point in time backup of an existing database. SourceDatabaseName, SourceManagedInstanceName and PointInTime must be specified. RestoreExternalBackup: Create a database by restoring from external backup files. Collation, StorageContainerUri and StorageContainerSasToken must be specified. Recovery: Creates a database by restoring a geo-replicated backup. RecoverableDatabaseId must be specified as the recoverable database resource ID to restore. Possible values include: 'ManagedDatabaseCreateModeDefault', 'ManagedDatabaseCreateModeRestoreExternalBackup', 'ManagedDatabaseCreateModePointInTimeRestore', 'ManagedDatabaseCreateModeRecovery', 'ManagedDatabaseCreateModeRestoreLongTermRetentionBackup' + // CreateMode - Managed database create mode. PointInTimeRestore: Create a database by restoring a point in time backup of an existing database. SourceDatabaseName, SourceManagedInstanceName and PointInTime must be specified. RestoreExternalBackup: Create a database by restoring from external backup files. Collation, StorageContainerUri and StorageContainerSasToken must be specified. Recovery: Creates a database by restoring a geo-replicated backup. RecoverableDatabaseId must be specified as the recoverable database resource ID to restore. RestoreLongTermRetentionBackup: Create a database by restoring from a long term retention backup (longTermRetentionBackupResourceId required). Possible values include: 'ManagedDatabaseCreateModeDefault', 'ManagedDatabaseCreateModeRestoreExternalBackup', 'ManagedDatabaseCreateModePointInTimeRestore', 'ManagedDatabaseCreateModeRecovery', 'ManagedDatabaseCreateModeRestoreLongTermRetentionBackup' CreateMode ManagedDatabaseCreateMode `json:"createMode,omitempty"` // StorageContainerURI - Conditional. If createMode is RestoreExternalBackup, this value is required. Specifies the uri of the storage container where backups for this restore are stored. StorageContainerURI *string `json:"storageContainerUri,omitempty"` @@ -13585,6 +13896,8 @@ type ManagedInstanceProperties struct { TimezoneID *string `json:"timezoneId,omitempty"` // InstancePoolID - The Id of the instance pool this managed server belongs to. InstancePoolID *string `json:"instancePoolId,omitempty"` + // MaintenanceConfigurationID - Specifies maintenance configuration id to apply to this managed instance. + MaintenanceConfigurationID *string `json:"maintenanceConfigurationId,omitempty"` // MinimalTLSVersion - Minimal TLS version. Allowed values: 'None', '1.0', '1.1', '1.2' MinimalTLSVersion *string `json:"minimalTlsVersion,omitempty"` } @@ -17273,7 +17586,12 @@ type ServerBlobAuditingPolicyProperties struct { State BlobAuditingPolicyState `json:"state,omitempty"` // StorageEndpoint - Specifies the blob storage endpoint (e.g. https://MyAccount.blob.core.windows.net). If state is Enabled, storageEndpoint or isAzureMonitorTargetEnabled is required. StorageEndpoint *string `json:"storageEndpoint,omitempty"` - // StorageAccountAccessKey - Specifies the identifier key of the auditing storage account. If state is Enabled and storageEndpoint is specified, storageAccountAccessKey is required. + // StorageAccountAccessKey - Specifies the identifier key of the auditing storage account. + // If state is Enabled and storageEndpoint is specified, not specifying the storageAccountAccessKey will use SQL server system-assigned managed identity to access the storage. + // Prerequisites for using managed identity authentication: + // 1. Assign SQL Server a system-assigned managed identity in Azure Active Directory (AAD). + // 2. Grant SQL Server identity access to the storage account by adding 'Storage Blob Data Contributor' RBAC role to the server identity. + // For more information, see [Auditing to storage using Managed Identity authentication](https://go.microsoft.com/fwlink/?linkid=2114355) StorageAccountAccessKey *string `json:"storageAccountAccessKey,omitempty"` // RetentionDays - Specifies the number of days to keep in the audit logs in the storage account. RetentionDays *int32 `json:"retentionDays,omitempty"` @@ -20671,6 +20989,8 @@ type SyncGroupProperties struct { SyncState SyncGroupState `json:"syncState,omitempty"` // Schema - Sync schema of the sync group. Schema *SyncGroupSchema `json:"schema,omitempty"` + // UsePrivateLinkConnection - If use private link connection is enabled. + UsePrivateLinkConnection *bool `json:"usePrivateLinkConnection,omitempty"` } // SyncGroupSchema properties of sync group schema. @@ -21030,6 +21350,10 @@ type SyncMemberProperties struct { SyncAgentID *string `json:"syncAgentId,omitempty"` // SQLServerDatabaseID - SQL Server database id of the sync member. SQLServerDatabaseID *uuid.UUID `json:"sqlServerDatabaseId,omitempty"` + // SyncMemberAzureDatabaseResourceID - ARM resource id of the sync member logical database, for sync members in Azure. + SyncMemberAzureDatabaseResourceID *string `json:"syncMemberAzureDatabaseResourceId,omitempty"` + // UsePrivateLinkConnection - Whether to use private link connection. + UsePrivateLinkConnection *bool `json:"usePrivateLinkConnection,omitempty"` // ServerName - Server name of the member database in the sync member ServerName *string `json:"serverName,omitempty"` // DatabaseName - Database name of the member database in the sync member. diff --git a/services/preview/sql/mgmt/v3.0/sql/sqlapi/interfaces.go b/services/preview/sql/mgmt/v3.0/sql/sqlapi/interfaces.go index b5c25cb47eb8..b59fcb7f63b7 100644 --- a/services/preview/sql/mgmt/v3.0/sql/sqlapi/interfaces.go +++ b/services/preview/sql/mgmt/v3.0/sql/sqlapi/interfaces.go @@ -287,42 +287,6 @@ type SyncAgentsClientAPI interface { var _ SyncAgentsClientAPI = (*sql.SyncAgentsClient)(nil) -// SyncGroupsClientAPI contains the set of methods on the SyncGroupsClient type. -type SyncGroupsClientAPI interface { - CancelSync(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string) (result autorest.Response, err error) - CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, parameters sql.SyncGroup) (result sql.SyncGroupsCreateOrUpdateFuture, err error) - Delete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string) (result sql.SyncGroupsDeleteFuture, err error) - Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string) (result sql.SyncGroup, err error) - ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.SyncGroupListResultPage, err error) - ListByDatabaseComplete(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.SyncGroupListResultIterator, err error) - ListHubSchemas(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string) (result sql.SyncFullSchemaPropertiesListResultPage, err error) - ListHubSchemasComplete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string) (result sql.SyncFullSchemaPropertiesListResultIterator, err error) - ListLogs(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, startTime string, endTime string, typeParameter string, continuationToken string) (result sql.SyncGroupLogListResultPage, err error) - ListLogsComplete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, startTime string, endTime string, typeParameter string, continuationToken string) (result sql.SyncGroupLogListResultIterator, err error) - ListSyncDatabaseIds(ctx context.Context, locationName string) (result sql.SyncDatabaseIDListResultPage, err error) - ListSyncDatabaseIdsComplete(ctx context.Context, locationName string) (result sql.SyncDatabaseIDListResultIterator, err error) - RefreshHubSchema(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string) (result sql.SyncGroupsRefreshHubSchemaFuture, err error) - TriggerSync(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string) (result autorest.Response, err error) - Update(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, parameters sql.SyncGroup) (result sql.SyncGroupsUpdateFuture, err error) -} - -var _ SyncGroupsClientAPI = (*sql.SyncGroupsClient)(nil) - -// SyncMembersClientAPI contains the set of methods on the SyncMembersClient type. -type SyncMembersClientAPI interface { - CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string, parameters sql.SyncMember) (result sql.SyncMembersCreateOrUpdateFuture, err error) - Delete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string) (result sql.SyncMembersDeleteFuture, err error) - Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string) (result sql.SyncMember, err error) - ListBySyncGroup(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string) (result sql.SyncMemberListResultPage, err error) - ListBySyncGroupComplete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string) (result sql.SyncMemberListResultIterator, err error) - ListMemberSchemas(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string) (result sql.SyncFullSchemaPropertiesListResultPage, err error) - ListMemberSchemasComplete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string) (result sql.SyncFullSchemaPropertiesListResultIterator, err error) - RefreshMemberSchema(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string) (result sql.SyncMembersRefreshMemberSchemaFuture, err error) - Update(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string, parameters sql.SyncMember) (result sql.SyncMembersUpdateFuture, err error) -} - -var _ SyncMembersClientAPI = (*sql.SyncMembersClient)(nil) - // SubscriptionUsagesClientAPI contains the set of methods on the SubscriptionUsagesClient type. type SubscriptionUsagesClientAPI interface { Get(ctx context.Context, locationName string, usageName string) (result sql.SubscriptionUsage, err error) @@ -360,6 +324,8 @@ var _ VirtualNetworkRulesClientAPI = (*sql.VirtualNetworkRulesClient)(nil) type ExtendedDatabaseBlobAuditingPoliciesClientAPI interface { CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, parameters sql.ExtendedDatabaseBlobAuditingPolicy) (result sql.ExtendedDatabaseBlobAuditingPolicy, err error) Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.ExtendedDatabaseBlobAuditingPolicy, err error) + ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.ExtendedDatabaseBlobAuditingPolicyListResultPage, err error) + ListByDatabaseComplete(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.ExtendedDatabaseBlobAuditingPolicyListResultIterator, err error) } var _ ExtendedDatabaseBlobAuditingPoliciesClientAPI = (*sql.ExtendedDatabaseBlobAuditingPoliciesClient)(nil) @@ -368,6 +334,8 @@ var _ ExtendedDatabaseBlobAuditingPoliciesClientAPI = (*sql.ExtendedDatabaseBlob type ExtendedServerBlobAuditingPoliciesClientAPI interface { CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, parameters sql.ExtendedServerBlobAuditingPolicy) (result sql.ExtendedServerBlobAuditingPoliciesCreateOrUpdateFuture, err error) Get(ctx context.Context, resourceGroupName string, serverName string) (result sql.ExtendedServerBlobAuditingPolicy, err error) + ListByServer(ctx context.Context, resourceGroupName string, serverName string) (result sql.ExtendedServerBlobAuditingPolicyListResultPage, err error) + ListByServerComplete(ctx context.Context, resourceGroupName string, serverName string) (result sql.ExtendedServerBlobAuditingPolicyListResultIterator, err error) } var _ ExtendedServerBlobAuditingPoliciesClientAPI = (*sql.ExtendedServerBlobAuditingPoliciesClient)(nil) @@ -1005,3 +973,39 @@ type ManagedInstanceOperationsClientAPI interface { } var _ ManagedInstanceOperationsClientAPI = (*sql.ManagedInstanceOperationsClient)(nil) + +// SyncGroupsClientAPI contains the set of methods on the SyncGroupsClient type. +type SyncGroupsClientAPI interface { + CancelSync(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string) (result autorest.Response, err error) + CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, parameters sql.SyncGroup) (result sql.SyncGroupsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string) (result sql.SyncGroupsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string) (result sql.SyncGroup, err error) + ListByDatabase(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.SyncGroupListResultPage, err error) + ListByDatabaseComplete(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (result sql.SyncGroupListResultIterator, err error) + ListHubSchemas(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string) (result sql.SyncFullSchemaPropertiesListResultPage, err error) + ListHubSchemasComplete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string) (result sql.SyncFullSchemaPropertiesListResultIterator, err error) + ListLogs(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, startTime string, endTime string, typeParameter string, continuationToken string) (result sql.SyncGroupLogListResultPage, err error) + ListLogsComplete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, startTime string, endTime string, typeParameter string, continuationToken string) (result sql.SyncGroupLogListResultIterator, err error) + ListSyncDatabaseIds(ctx context.Context, locationName string) (result sql.SyncDatabaseIDListResultPage, err error) + ListSyncDatabaseIdsComplete(ctx context.Context, locationName string) (result sql.SyncDatabaseIDListResultIterator, err error) + RefreshHubSchema(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string) (result sql.SyncGroupsRefreshHubSchemaFuture, err error) + TriggerSync(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string) (result autorest.Response, err error) + Update(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, parameters sql.SyncGroup) (result sql.SyncGroupsUpdateFuture, err error) +} + +var _ SyncGroupsClientAPI = (*sql.SyncGroupsClient)(nil) + +// SyncMembersClientAPI contains the set of methods on the SyncMembersClient type. +type SyncMembersClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string, parameters sql.SyncMember) (result sql.SyncMembersCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string) (result sql.SyncMembersDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string) (result sql.SyncMember, err error) + ListBySyncGroup(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string) (result sql.SyncMemberListResultPage, err error) + ListBySyncGroupComplete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string) (result sql.SyncMemberListResultIterator, err error) + ListMemberSchemas(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string) (result sql.SyncFullSchemaPropertiesListResultPage, err error) + ListMemberSchemasComplete(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string) (result sql.SyncFullSchemaPropertiesListResultIterator, err error) + RefreshMemberSchema(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string) (result sql.SyncMembersRefreshMemberSchemaFuture, err error) + Update(ctx context.Context, resourceGroupName string, serverName string, databaseName string, syncGroupName string, syncMemberName string, parameters sql.SyncMember) (result sql.SyncMembersUpdateFuture, err error) +} + +var _ SyncMembersClientAPI = (*sql.SyncMembersClient)(nil) diff --git a/services/preview/sql/mgmt/v3.0/sql/syncgroups.go b/services/preview/sql/mgmt/v3.0/sql/syncgroups.go index bd9c9ba699cf..16265201d2ba 100644 --- a/services/preview/sql/mgmt/v3.0/sql/syncgroups.go +++ b/services/preview/sql/mgmt/v3.0/sql/syncgroups.go @@ -92,7 +92,7 @@ func (client SyncGroupsClient) CancelSyncPreparer(ctx context.Context, resourceG "syncGroupName": autorest.Encode("path", syncGroupName), } - const APIVersion = "2015-05-01-preview" + const APIVersion = "2019-06-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -167,7 +167,7 @@ func (client SyncGroupsClient) CreateOrUpdatePreparer(ctx context.Context, resou "syncGroupName": autorest.Encode("path", syncGroupName), } - const APIVersion = "2015-05-01-preview" + const APIVersion = "2019-06-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -250,7 +250,7 @@ func (client SyncGroupsClient) DeletePreparer(ctx context.Context, resourceGroup "syncGroupName": autorest.Encode("path", syncGroupName), } - const APIVersion = "2015-05-01-preview" + const APIVersion = "2019-06-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -336,7 +336,7 @@ func (client SyncGroupsClient) GetPreparer(ctx context.Context, resourceGroupNam "syncGroupName": autorest.Encode("path", syncGroupName), } - const APIVersion = "2015-05-01-preview" + const APIVersion = "2019-06-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -416,7 +416,7 @@ func (client SyncGroupsClient) ListByDatabasePreparer(ctx context.Context, resou "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2015-05-01-preview" + const APIVersion = "2019-06-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -535,7 +535,7 @@ func (client SyncGroupsClient) ListHubSchemasPreparer(ctx context.Context, resou "syncGroupName": autorest.Encode("path", syncGroupName), } - const APIVersion = "2015-05-01-preview" + const APIVersion = "2019-06-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -658,7 +658,7 @@ func (client SyncGroupsClient) ListLogsPreparer(ctx context.Context, resourceGro "syncGroupName": autorest.Encode("path", syncGroupName), } - const APIVersion = "2015-05-01-preview" + const APIVersion = "2019-06-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, "endTime": autorest.Encode("query", endTime), @@ -776,7 +776,7 @@ func (client SyncGroupsClient) ListSyncDatabaseIdsPreparer(ctx context.Context, "subscriptionId": autorest.Encode("path", client.SubscriptionID), } - const APIVersion = "2015-05-01-preview" + const APIVersion = "2019-06-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -888,7 +888,7 @@ func (client SyncGroupsClient) RefreshHubSchemaPreparer(ctx context.Context, res "syncGroupName": autorest.Encode("path", syncGroupName), } - const APIVersion = "2015-05-01-preview" + const APIVersion = "2019-06-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -974,7 +974,7 @@ func (client SyncGroupsClient) TriggerSyncPreparer(ctx context.Context, resource "syncGroupName": autorest.Encode("path", syncGroupName), } - const APIVersion = "2015-05-01-preview" + const APIVersion = "2019-06-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -1049,7 +1049,7 @@ func (client SyncGroupsClient) UpdatePreparer(ctx context.Context, resourceGroup "syncGroupName": autorest.Encode("path", syncGroupName), } - const APIVersion = "2015-05-01-preview" + const APIVersion = "2019-06-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/preview/sql/mgmt/v3.0/sql/syncmembers.go b/services/preview/sql/mgmt/v3.0/sql/syncmembers.go index 78815b94ab31..95d81e684f3b 100644 --- a/services/preview/sql/mgmt/v3.0/sql/syncmembers.go +++ b/services/preview/sql/mgmt/v3.0/sql/syncmembers.go @@ -89,7 +89,7 @@ func (client SyncMembersClient) CreateOrUpdatePreparer(ctx context.Context, reso "syncMemberName": autorest.Encode("path", syncMemberName), } - const APIVersion = "2015-05-01-preview" + const APIVersion = "2019-06-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -174,7 +174,7 @@ func (client SyncMembersClient) DeletePreparer(ctx context.Context, resourceGrou "syncMemberName": autorest.Encode("path", syncMemberName), } - const APIVersion = "2015-05-01-preview" + const APIVersion = "2019-06-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -262,7 +262,7 @@ func (client SyncMembersClient) GetPreparer(ctx context.Context, resourceGroupNa "syncMemberName": autorest.Encode("path", syncMemberName), } - const APIVersion = "2015-05-01-preview" + const APIVersion = "2019-06-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -344,7 +344,7 @@ func (client SyncMembersClient) ListBySyncGroupPreparer(ctx context.Context, res "syncGroupName": autorest.Encode("path", syncGroupName), } - const APIVersion = "2015-05-01-preview" + const APIVersion = "2019-06-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -465,7 +465,7 @@ func (client SyncMembersClient) ListMemberSchemasPreparer(ctx context.Context, r "syncMemberName": autorest.Encode("path", syncMemberName), } - const APIVersion = "2015-05-01-preview" + const APIVersion = "2019-06-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -579,7 +579,7 @@ func (client SyncMembersClient) RefreshMemberSchemaPreparer(ctx context.Context, "syncMemberName": autorest.Encode("path", syncMemberName), } - const APIVersion = "2015-05-01-preview" + const APIVersion = "2019-06-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } @@ -662,7 +662,7 @@ func (client SyncMembersClient) UpdatePreparer(ctx context.Context, resourceGrou "syncMemberName": autorest.Encode("path", syncMemberName), } - const APIVersion = "2015-05-01-preview" + const APIVersion = "2019-06-01-preview" queryParameters := map[string]interface{}{ "api-version": APIVersion, } diff --git a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/models.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/models.go index 29320b1ac28d..122d3496e87c 100644 --- a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/models.go +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/models.go @@ -503,6 +503,21 @@ func PossibleProvisioningStateValues() []ProvisioningState { return []ProvisioningState{ProvisioningStateDeleteError, ProvisioningStateDeleting, ProvisioningStateFailed, ProvisioningStateProvisioning, ProvisioningStateSucceeded} } +// ProvisioningState1 enumerates the values for provisioning state 1. +type ProvisioningState1 string + +const ( + // ProvisioningState1Failed ... + ProvisioningState1Failed ProvisioningState1 = "Failed" + // ProvisioningState1Succeeded ... + ProvisioningState1Succeeded ProvisioningState1 = "Succeeded" +) + +// PossibleProvisioningState1Values returns an array of possible values for the ProvisioningState1 const type. +func PossibleProvisioningState1Values() []ProvisioningState1 { + return []ProvisioningState1{ProvisioningState1Failed, ProvisioningState1Succeeded} +} + // QueryAggregationFunction enumerates the values for query aggregation function. type QueryAggregationFunction string @@ -4843,6 +4858,274 @@ func (future *PrivateEndpointConnectionsDeleteFuture) Result(client PrivateEndpo return } +// PrivateLinkHub a privateLinkHub +type PrivateLinkHub struct { + autorest.Response `json:"-"` + // PrivateLinkHubProperties - PrivateLinkHub resource properties + *PrivateLinkHubProperties `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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateLinkHub. +func (plh PrivateLinkHub) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if plh.PrivateLinkHubProperties != nil { + objectMap["properties"] = plh.PrivateLinkHubProperties + } + if plh.Tags != nil { + objectMap["tags"] = plh.Tags + } + if plh.Location != nil { + objectMap["location"] = plh.Location + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PrivateLinkHub struct. +func (plh *PrivateLinkHub) 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 privateLinkHubProperties PrivateLinkHubProperties + err = json.Unmarshal(*v, &privateLinkHubProperties) + if err != nil { + return err + } + plh.PrivateLinkHubProperties = &privateLinkHubProperties + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + plh.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + plh.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + plh.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + plh.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + plh.Type = &typeVar + } + } + } + + return nil +} + +// PrivateLinkHubInfoListResult list of privateLinkHubs +type PrivateLinkHubInfoListResult struct { + autorest.Response `json:"-"` + // NextLink - Link to the next page of results + NextLink *string `json:"nextLink,omitempty"` + // Value - List of privateLinkHubs + Value *[]PrivateLinkHub `json:"value,omitempty"` +} + +// PrivateLinkHubInfoListResultIterator provides access to a complete listing of PrivateLinkHub values. +type PrivateLinkHubInfoListResultIterator struct { + i int + page PrivateLinkHubInfoListResultPage +} + +// 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 *PrivateLinkHubInfoListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkHubInfoListResultIterator.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 *PrivateLinkHubInfoListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter PrivateLinkHubInfoListResultIterator) 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 PrivateLinkHubInfoListResultIterator) Response() PrivateLinkHubInfoListResult { + 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 PrivateLinkHubInfoListResultIterator) Value() PrivateLinkHub { + if !iter.page.NotDone() { + return PrivateLinkHub{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the PrivateLinkHubInfoListResultIterator type. +func NewPrivateLinkHubInfoListResultIterator(page PrivateLinkHubInfoListResultPage) PrivateLinkHubInfoListResultIterator { + return PrivateLinkHubInfoListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (plhilr PrivateLinkHubInfoListResult) IsEmpty() bool { + return plhilr.Value == nil || len(*plhilr.Value) == 0 +} + +// privateLinkHubInfoListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (plhilr PrivateLinkHubInfoListResult) privateLinkHubInfoListResultPreparer(ctx context.Context) (*http.Request, error) { + if plhilr.NextLink == nil || len(to.String(plhilr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(plhilr.NextLink))) +} + +// PrivateLinkHubInfoListResultPage contains a page of PrivateLinkHub values. +type PrivateLinkHubInfoListResultPage struct { + fn func(context.Context, PrivateLinkHubInfoListResult) (PrivateLinkHubInfoListResult, error) + plhilr PrivateLinkHubInfoListResult +} + +// 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 *PrivateLinkHubInfoListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkHubInfoListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.plhilr) + if err != nil { + return err + } + page.plhilr = next + 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 *PrivateLinkHubInfoListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page PrivateLinkHubInfoListResultPage) NotDone() bool { + return !page.plhilr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page PrivateLinkHubInfoListResultPage) Response() PrivateLinkHubInfoListResult { + return page.plhilr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page PrivateLinkHubInfoListResultPage) Values() []PrivateLinkHub { + if page.plhilr.IsEmpty() { + return nil + } + return *page.plhilr.Value +} + +// Creates a new instance of the PrivateLinkHubInfoListResultPage type. +func NewPrivateLinkHubInfoListResultPage(getNextPage func(context.Context, PrivateLinkHubInfoListResult) (PrivateLinkHubInfoListResult, error)) PrivateLinkHubInfoListResultPage { + return PrivateLinkHubInfoListResultPage{fn: getNextPage} +} + +// PrivateLinkHubPatchInfo privateLinkHub patch details +type PrivateLinkHubPatchInfo struct { + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for PrivateLinkHubPatchInfo. +func (plhpi PrivateLinkHubPatchInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if plhpi.Tags != nil { + objectMap["tags"] = plhpi.Tags + } + return json.Marshal(objectMap) +} + +// PrivateLinkHubProperties privateLinkHub properties +type PrivateLinkHubProperties struct { + // ProvisioningState - READ-ONLY; PrivateLinkHub provisioning state. Possible values include: 'ProvisioningState1Succeeded', 'ProvisioningState1Failed' + ProvisioningState ProvisioningState1 `json:"provisioningState,omitempty"` +} + // PrivateLinkResource a private link resource type PrivateLinkResource struct { autorest.Response `json:"-"` diff --git a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/privatelinkhubs.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/privatelinkhubs.go new file mode 100644 index 000000000000..264e456e815f --- /dev/null +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/privatelinkhubs.go @@ -0,0 +1,629 @@ +package synapse + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// PrivateLinkHubsClient is the azure Synapse Analytics Management Client +type PrivateLinkHubsClient struct { + BaseClient +} + +// NewPrivateLinkHubsClient creates an instance of the PrivateLinkHubsClient client. +func NewPrivateLinkHubsClient(subscriptionID string) PrivateLinkHubsClient { + return NewPrivateLinkHubsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPrivateLinkHubsClientWithBaseURI creates an instance of the PrivateLinkHubsClient 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 NewPrivateLinkHubsClientWithBaseURI(baseURI string, subscriptionID string) PrivateLinkHubsClient { + return PrivateLinkHubsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate creates or updates a privateLinkHub +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// privateLinkHubName - the name of the privateLinkHub +// privateLinkHubInfo - privateLinkHub create or update request properties +func (client PrivateLinkHubsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, privateLinkHubName string, privateLinkHubInfo PrivateLinkHub) (result PrivateLinkHub, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkHubsClient.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: 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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("synapse.PrivateLinkHubsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, privateLinkHubName, privateLinkHubInfo) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.PrivateLinkHubsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "synapse.PrivateLinkHubsClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.PrivateLinkHubsClient", "CreateOrUpdate", resp, "Failure responding to request") + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client PrivateLinkHubsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, privateLinkHubName string, privateLinkHubInfo PrivateLinkHub) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "privateLinkHubName": autorest.Encode("path", privateLinkHubName), + "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.Synapse/privateLinkHubs/{privateLinkHubName}", pathParameters), + autorest.WithJSON(privateLinkHubInfo), + 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 PrivateLinkHubsClient) 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 PrivateLinkHubsClient) CreateOrUpdateResponder(resp *http.Response) (result PrivateLinkHub, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a privateLinkHub +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// privateLinkHubName - the name of the privateLinkHub +func (client PrivateLinkHubsClient) Delete(ctx context.Context, resourceGroupName string, privateLinkHubName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkHubsClient.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: 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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("synapse.PrivateLinkHubsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, privateLinkHubName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.PrivateLinkHubsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "synapse.PrivateLinkHubsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.PrivateLinkHubsClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client PrivateLinkHubsClient) DeletePreparer(ctx context.Context, resourceGroupName string, privateLinkHubName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "privateLinkHubName": autorest.Encode("path", privateLinkHubName), + "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.Synapse/privateLinkHubs/{privateLinkHubName}", 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 PrivateLinkHubsClient) 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 PrivateLinkHubsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets a privateLinkHub +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// privateLinkHubName - the name of the privateLinkHub +func (client PrivateLinkHubsClient) Get(ctx context.Context, resourceGroupName string, privateLinkHubName string) (result PrivateLinkHub, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkHubsClient.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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("synapse.PrivateLinkHubsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, privateLinkHubName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.PrivateLinkHubsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "synapse.PrivateLinkHubsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.PrivateLinkHubsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client PrivateLinkHubsClient) GetPreparer(ctx context.Context, resourceGroupName string, privateLinkHubName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "privateLinkHubName": autorest.Encode("path", privateLinkHubName), + "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.Synapse/privateLinkHubs/{privateLinkHubName}", 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 PrivateLinkHubsClient) 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 PrivateLinkHubsClient) GetResponder(resp *http.Response) (result PrivateLinkHub, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List returns a list of privateLinkHubs in a subscription +func (client PrivateLinkHubsClient) List(ctx context.Context) (result PrivateLinkHubInfoListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkHubsClient.List") + defer func() { + sc := -1 + if result.plhilr.Response.Response != nil { + sc = result.plhilr.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("synapse.PrivateLinkHubsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.PrivateLinkHubsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.plhilr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "synapse.PrivateLinkHubsClient", "List", resp, "Failure sending request") + return + } + + result.plhilr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.PrivateLinkHubsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client PrivateLinkHubsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "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}/providers/Microsoft.Synapse/privateLinkHubs", 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 PrivateLinkHubsClient) 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 PrivateLinkHubsClient) ListResponder(resp *http.Response) (result PrivateLinkHubInfoListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 PrivateLinkHubsClient) listNextResults(ctx context.Context, lastResults PrivateLinkHubInfoListResult) (result PrivateLinkHubInfoListResult, err error) { + req, err := lastResults.privateLinkHubInfoListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "synapse.PrivateLinkHubsClient", "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, "synapse.PrivateLinkHubsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.PrivateLinkHubsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client PrivateLinkHubsClient) ListComplete(ctx context.Context) (result PrivateLinkHubInfoListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkHubsClient.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 returns a list of privateLinkHubs in a resource group +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +func (client PrivateLinkHubsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result PrivateLinkHubInfoListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkHubsClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.plhilr.Response.Response != nil { + sc = result.plhilr.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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("synapse.PrivateLinkHubsClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.PrivateLinkHubsClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.plhilr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "synapse.PrivateLinkHubsClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.plhilr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.PrivateLinkHubsClient", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client PrivateLinkHubsClient) 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 = "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.Synapse/privateLinkHub", 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 PrivateLinkHubsClient) 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 PrivateLinkHubsClient) ListByResourceGroupResponder(resp *http.Response) (result PrivateLinkHubInfoListResult, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 PrivateLinkHubsClient) listByResourceGroupNextResults(ctx context.Context, lastResults PrivateLinkHubInfoListResult) (result PrivateLinkHubInfoListResult, err error) { + req, err := lastResults.privateLinkHubInfoListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "synapse.PrivateLinkHubsClient", "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, "synapse.PrivateLinkHubsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.PrivateLinkHubsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client PrivateLinkHubsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result PrivateLinkHubInfoListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkHubsClient.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 updates a privateLinkHub +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// privateLinkHubName - the name of the privateLinkHub +// privateLinkHubPatchInfo - privateLinkHub patch request properties +func (client PrivateLinkHubsClient) Update(ctx context.Context, resourceGroupName string, privateLinkHubName string, privateLinkHubPatchInfo PrivateLinkHubPatchInfo) (result PrivateLinkHub, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkHubsClient.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}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("synapse.PrivateLinkHubsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, privateLinkHubName, privateLinkHubPatchInfo) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.PrivateLinkHubsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "synapse.PrivateLinkHubsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "synapse.PrivateLinkHubsClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client PrivateLinkHubsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, privateLinkHubName string, privateLinkHubPatchInfo PrivateLinkHubPatchInfo) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "privateLinkHubName": autorest.Encode("path", privateLinkHubName), + "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.Synapse/privateLinkHubs/{privateLinkHubName}", pathParameters), + autorest.WithJSON(privateLinkHubPatchInfo), + 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 PrivateLinkHubsClient) 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 PrivateLinkHubsClient) UpdateResponder(resp *http.Response) (result PrivateLinkHub, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/synapseapi/interfaces.go b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/synapseapi/interfaces.go index 120ac5662f5a..45ee27be2802 100644 --- a/services/preview/synapse/mgmt/2019-06-01-preview/synapse/synapseapi/interfaces.go +++ b/services/preview/synapse/mgmt/2019-06-01-preview/synapse/synapseapi/interfaces.go @@ -357,3 +357,17 @@ type PrivateEndpointConnectionsClientAPI interface { } var _ PrivateEndpointConnectionsClientAPI = (*synapse.PrivateEndpointConnectionsClient)(nil) + +// PrivateLinkHubsClientAPI contains the set of methods on the PrivateLinkHubsClient type. +type PrivateLinkHubsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, privateLinkHubName string, privateLinkHubInfo synapse.PrivateLinkHub) (result synapse.PrivateLinkHub, err error) + Delete(ctx context.Context, resourceGroupName string, privateLinkHubName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, privateLinkHubName string) (result synapse.PrivateLinkHub, err error) + List(ctx context.Context) (result synapse.PrivateLinkHubInfoListResultPage, err error) + ListComplete(ctx context.Context) (result synapse.PrivateLinkHubInfoListResultIterator, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result synapse.PrivateLinkHubInfoListResultPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result synapse.PrivateLinkHubInfoListResultIterator, err error) + Update(ctx context.Context, resourceGroupName string, privateLinkHubName string, privateLinkHubPatchInfo synapse.PrivateLinkHubPatchInfo) (result synapse.PrivateLinkHub, err error) +} + +var _ PrivateLinkHubsClientAPI = (*synapse.PrivateLinkHubsClient)(nil) diff --git a/services/preview/timeseriesinsights/mgmt/2018-08-15-preview/timeseriesinsights/environments.go b/services/preview/timeseriesinsights/mgmt/2018-08-15-preview/timeseriesinsights/environments.go index 43436c2d09a0..1b6f81c60bef 100644 --- a/services/preview/timeseriesinsights/mgmt/2018-08-15-preview/timeseriesinsights/environments.go +++ b/services/preview/timeseriesinsights/mgmt/2018-08-15-preview/timeseriesinsights/environments.go @@ -445,9 +445,8 @@ func (client EnvironmentsClient) ListBySubscriptionResponder(resp *http.Response // resourceGroupName - name of an Azure Resource group. // environmentName - the name of the Time Series Insights environment associated with the specified resource // group. -// standardEnvironmentUpdateParameters - request object that contains the updated information for the -// environment. -func (client EnvironmentsClient) Update(ctx context.Context, resourceGroupName string, environmentName string, standardEnvironmentUpdateParameters StandardEnvironmentUpdateParameters) (result EnvironmentsUpdateFuture, err error) { +// environmentUpdateParameters - request object that contains the updated information for the environment. +func (client EnvironmentsClient) Update(ctx context.Context, resourceGroupName string, environmentName string, environmentUpdateParameters EnvironmentUpdateParameters) (result EnvironmentsUpdateFuture, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/EnvironmentsClient.Update") defer func() { @@ -458,7 +457,7 @@ func (client EnvironmentsClient) Update(ctx context.Context, resourceGroupName s tracing.EndSpan(ctx, sc, err) }() } - req, err := client.UpdatePreparer(ctx, resourceGroupName, environmentName, standardEnvironmentUpdateParameters) + req, err := client.UpdatePreparer(ctx, resourceGroupName, environmentName, environmentUpdateParameters) if err != nil { err = autorest.NewErrorWithError(err, "timeseriesinsights.EnvironmentsClient", "Update", nil, "Failure preparing request") return @@ -474,7 +473,7 @@ func (client EnvironmentsClient) Update(ctx context.Context, resourceGroupName s } // UpdatePreparer prepares the Update request. -func (client EnvironmentsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, environmentName string, standardEnvironmentUpdateParameters StandardEnvironmentUpdateParameters) (*http.Request, error) { +func (client EnvironmentsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, environmentName string, environmentUpdateParameters EnvironmentUpdateParameters) (*http.Request, error) { pathParameters := map[string]interface{}{ "environmentName": autorest.Encode("path", environmentName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -491,7 +490,7 @@ func (client EnvironmentsClient) UpdatePreparer(ctx context.Context, resourceGro autorest.AsPatch(), autorest.WithBaseURL(client.BaseURI), autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.TimeSeriesInsights/environments/{environmentName}", pathParameters), - autorest.WithJSON(standardEnvironmentUpdateParameters), + autorest.WithJSON(environmentUpdateParameters), autorest.WithQueryParameters(queryParameters)) return preparer.Prepare((&http.Request{}).WithContext(ctx)) } diff --git a/services/preview/timeseriesinsights/mgmt/2018-08-15-preview/timeseriesinsights/models.go b/services/preview/timeseriesinsights/mgmt/2018-08-15-preview/timeseriesinsights/models.go index 668b58548d1f..2b714ad58811 100644 --- a/services/preview/timeseriesinsights/mgmt/2018-08-15-preview/timeseriesinsights/models.go +++ b/services/preview/timeseriesinsights/mgmt/2018-08-15-preview/timeseriesinsights/models.go @@ -143,13 +143,13 @@ const ( KindBasicEventSourceResourceKindEventSourceResource KindBasicEventSourceResource = "EventSourceResource" // KindBasicEventSourceResourceKindMicrosoftEventHub ... KindBasicEventSourceResourceKindMicrosoftEventHub KindBasicEventSourceResource = "Microsoft.EventHub" - // KindBasicEventSourceResourceKindMicrosoftIotHub ... - KindBasicEventSourceResourceKindMicrosoftIotHub KindBasicEventSourceResource = "Microsoft.IotHub" + // KindBasicEventSourceResourceKindMicrosoftIoTHub ... + KindBasicEventSourceResourceKindMicrosoftIoTHub KindBasicEventSourceResource = "Microsoft.IoTHub" ) // PossibleKindBasicEventSourceResourceValues returns an array of possible values for the KindBasicEventSourceResource const type. func PossibleKindBasicEventSourceResourceValues() []KindBasicEventSourceResource { - return []KindBasicEventSourceResource{KindBasicEventSourceResourceKindEventSourceResource, KindBasicEventSourceResourceKindMicrosoftEventHub, KindBasicEventSourceResourceKindMicrosoftIotHub} + return []KindBasicEventSourceResource{KindBasicEventSourceResourceKindEventSourceResource, KindBasicEventSourceResourceKindMicrosoftEventHub, KindBasicEventSourceResourceKindMicrosoftIoTHub} } // LocalTimestampFormat enumerates the values for local timestamp format. @@ -158,15 +158,11 @@ type LocalTimestampFormat string const ( // Embedded ... Embedded LocalTimestampFormat = "Embedded" - // Iana ... - Iana LocalTimestampFormat = "Iana" - // TimeSpan ... - TimeSpan LocalTimestampFormat = "TimeSpan" ) // PossibleLocalTimestampFormatValues returns an array of possible values for the LocalTimestampFormat const type. func PossibleLocalTimestampFormatValues() []LocalTimestampFormat { - return []LocalTimestampFormat{Embedded, Iana, TimeSpan} + return []LocalTimestampFormat{Embedded} } // PropertyType enumerates the values for property type. @@ -885,6 +881,8 @@ type EventHubEventSourceCommonProperties struct { // operation for an EventHub event source. type EventHubEventSourceCreateOrUpdateParameters struct { *EventHubEventSourceCreationProperties `json:"properties,omitempty"` + // LocalTimestamp - An object that represents the local timestamp property. It contains the format of local timestamp that needs to be used and the corresponding timezone offset information. If a value isn't specified for localTimestamp, or if null, then the local timestamp will not be ingressed with the events. + LocalTimestamp *LocalTimestamp `json:"localTimestamp,omitempty"` // Location - The location of the resource. Location *string `json:"location,omitempty"` // Tags - Key-value pairs of additional properties for the resource. @@ -900,6 +898,9 @@ func (ehescoup EventHubEventSourceCreateOrUpdateParameters) MarshalJSON() ([]byt if ehescoup.EventHubEventSourceCreationProperties != nil { objectMap["properties"] = ehescoup.EventHubEventSourceCreationProperties } + if ehescoup.LocalTimestamp != nil { + objectMap["localTimestamp"] = ehescoup.LocalTimestamp + } if ehescoup.Kind != "" { objectMap["kind"] = ehescoup.Kind } @@ -950,6 +951,15 @@ func (ehescoup *EventHubEventSourceCreateOrUpdateParameters) UnmarshalJSON(body } ehescoup.EventHubEventSourceCreationProperties = &eventHubEventSourceCreationProperties } + case "localTimestamp": + if v != nil { + var localTimestamp LocalTimestamp + err = json.Unmarshal(*v, &localTimestamp) + if err != nil { + return err + } + ehescoup.LocalTimestamp = &localTimestamp + } case "kind": if v != nil { var kind KindBasicEventSourceCreateOrUpdateParameters @@ -1030,7 +1040,7 @@ type EventHubEventSourceResource struct { Name *string `json:"name,omitempty"` // Type - READ-ONLY; Resource type Type *string `json:"type,omitempty"` - // Kind - Possible values include: 'KindBasicEventSourceResourceKindEventSourceResource', 'KindBasicEventSourceResourceKindMicrosoftEventHub', 'KindBasicEventSourceResourceKindMicrosoftIotHub' + // Kind - Possible values include: 'KindBasicEventSourceResourceKindEventSourceResource', 'KindBasicEventSourceResourceKindMicrosoftEventHub', 'KindBasicEventSourceResourceKindMicrosoftIoTHub' Kind KindBasicEventSourceResource `json:"kind,omitempty"` } @@ -1244,6 +1254,8 @@ type BasicEventSourceCreateOrUpdateParameters interface { // EventSourceCreateOrUpdateParameters parameters supplied to the Create or Update Event Source operation. type EventSourceCreateOrUpdateParameters struct { + // LocalTimestamp - An object that represents the local timestamp property. It contains the format of local timestamp that needs to be used and the corresponding timezone offset information. If a value isn't specified for localTimestamp, or if null, then the local timestamp will not be ingressed with the events. + LocalTimestamp *LocalTimestamp `json:"localTimestamp,omitempty"` // Kind - Possible values include: 'KindEventSourceCreateOrUpdateParameters', 'KindMicrosoftEventHub', 'KindMicrosoftIoTHub' Kind KindBasicEventSourceCreateOrUpdateParameters `json:"kind,omitempty"` // Location - The location of the resource. @@ -1297,6 +1309,9 @@ func unmarshalBasicEventSourceCreateOrUpdateParametersArray(body []byte) ([]Basi func (escoup EventSourceCreateOrUpdateParameters) MarshalJSON() ([]byte, error) { escoup.Kind = KindEventSourceCreateOrUpdateParameters objectMap := make(map[string]interface{}) + if escoup.LocalTimestamp != nil { + objectMap["localTimestamp"] = escoup.LocalTimestamp + } if escoup.Kind != "" { objectMap["kind"] = escoup.Kind } @@ -1382,7 +1397,7 @@ type BasicEventSourceResource interface { // from the event source type EventSourceResource struct { autorest.Response `json:"-"` - // Kind - Possible values include: 'KindBasicEventSourceResourceKindEventSourceResource', 'KindBasicEventSourceResourceKindMicrosoftEventHub', 'KindBasicEventSourceResourceKindMicrosoftIotHub' + // Kind - Possible values include: 'KindBasicEventSourceResourceKindEventSourceResource', 'KindBasicEventSourceResourceKindMicrosoftEventHub', 'KindBasicEventSourceResourceKindMicrosoftIoTHub' Kind KindBasicEventSourceResource `json:"kind,omitempty"` // Location - Resource location Location *string `json:"location,omitempty"` @@ -1408,7 +1423,7 @@ func unmarshalBasicEventSourceResource(body []byte) (BasicEventSourceResource, e var ehesr EventHubEventSourceResource err := json.Unmarshal(body, &ehesr) return ehesr, err - case string(KindBasicEventSourceResourceKindMicrosoftIotHub): + case string(KindBasicEventSourceResourceKindMicrosoftIoTHub): var ithesr IoTHubEventSourceResource err := json.Unmarshal(body, &ithesr) return ithesr, err @@ -1535,6 +1550,8 @@ type IoTHubEventSourceCommonProperties struct { // operation for an IoTHub event source. type IoTHubEventSourceCreateOrUpdateParameters struct { *IoTHubEventSourceCreationProperties `json:"properties,omitempty"` + // LocalTimestamp - An object that represents the local timestamp property. It contains the format of local timestamp that needs to be used and the corresponding timezone offset information. If a value isn't specified for localTimestamp, or if null, then the local timestamp will not be ingressed with the events. + LocalTimestamp *LocalTimestamp `json:"localTimestamp,omitempty"` // Kind - Possible values include: 'KindEventSourceCreateOrUpdateParameters', 'KindMicrosoftEventHub', 'KindMicrosoftIoTHub' Kind KindBasicEventSourceCreateOrUpdateParameters `json:"kind,omitempty"` // Location - The location of the resource. @@ -1550,6 +1567,9 @@ func (ithescoup IoTHubEventSourceCreateOrUpdateParameters) MarshalJSON() ([]byte if ithescoup.IoTHubEventSourceCreationProperties != nil { objectMap["properties"] = ithescoup.IoTHubEventSourceCreationProperties } + if ithescoup.LocalTimestamp != nil { + objectMap["localTimestamp"] = ithescoup.LocalTimestamp + } if ithescoup.Kind != "" { objectMap["kind"] = ithescoup.Kind } @@ -1600,6 +1620,15 @@ func (ithescoup *IoTHubEventSourceCreateOrUpdateParameters) UnmarshalJSON(body [ } ithescoup.IoTHubEventSourceCreationProperties = &ioTHubEventSourceCreationProperties } + case "localTimestamp": + if v != nil { + var localTimestamp LocalTimestamp + err = json.Unmarshal(*v, &localTimestamp) + if err != nil { + return err + } + ithescoup.LocalTimestamp = &localTimestamp + } case "kind": if v != nil { var kind KindBasicEventSourceCreateOrUpdateParameters @@ -1668,7 +1697,7 @@ type IoTHubEventSourceMutableProperties struct { // IoTHubEventSourceResource an event source that receives its data from an Azure IoTHub. type IoTHubEventSourceResource struct { *IoTHubEventSourceResourceProperties `json:"properties,omitempty"` - // Kind - Possible values include: 'KindBasicEventSourceResourceKindEventSourceResource', 'KindBasicEventSourceResourceKindMicrosoftEventHub', 'KindBasicEventSourceResourceKindMicrosoftIotHub' + // Kind - Possible values include: 'KindBasicEventSourceResourceKindEventSourceResource', 'KindBasicEventSourceResourceKindMicrosoftEventHub', 'KindBasicEventSourceResourceKindMicrosoftIoTHub' Kind KindBasicEventSourceResource `json:"kind,omitempty"` // Location - Resource location Location *string `json:"location,omitempty"` @@ -1684,7 +1713,7 @@ type IoTHubEventSourceResource struct { // MarshalJSON is the custom marshaler for IoTHubEventSourceResource. func (ithesr IoTHubEventSourceResource) MarshalJSON() ([]byte, error) { - ithesr.Kind = KindBasicEventSourceResourceKindMicrosoftIotHub + ithesr.Kind = KindBasicEventSourceResourceKindMicrosoftIoTHub objectMap := make(map[string]interface{}) if ithesr.IoTHubEventSourceResourceProperties != nil { objectMap["properties"] = ithesr.IoTHubEventSourceResourceProperties @@ -1876,7 +1905,7 @@ func (ithesup *IoTHubEventSourceUpdateParameters) UnmarshalJSON(body []byte) err // specified for localTimestamp, or if null, then the local timestamp will not be ingressed with the // events. type LocalTimestamp struct { - // Format - An enum that represents the format of the local timestamp property that needs to be set. Possible values include: 'Embedded', 'Iana', 'TimeSpan' + // Format - An enum that represents the format of the local timestamp property that needs to be set. Possible values include: 'Embedded' Format LocalTimestampFormat `json:"format,omitempty"` // TimeZoneOffset - An object that represents the offset information for the local timestamp format specified. Should not be specified for LocalTimestampFormat - Embedded. TimeZoneOffset *LocalTimestampTimeZoneOffset `json:"timeZoneOffset,omitempty"` @@ -2011,65 +2040,8 @@ type LongTermEnvironmentCreationProperties struct { TimeSeriesIDProperties *[]TimeSeriesIDProperty `json:"timeSeriesIdProperties,omitempty"` // StorageConfiguration - The storage configuration provides the connection details that allows the Time Series Insights service to connect to the customer storage account that is used to store the environment's data. StorageConfiguration *LongTermStorageConfigurationInput `json:"storageConfiguration,omitempty"` - // WarmStoreConfigurationProperties - The warm store configuration provides the details to create a warm store cache that will retain a copy of the environment's data available for faster query. - *WarmStoreConfigurationProperties `json:"warmStoreConfiguration,omitempty"` -} - -// MarshalJSON is the custom marshaler for LongTermEnvironmentCreationProperties. -func (ltecp LongTermEnvironmentCreationProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ltecp.TimeSeriesIDProperties != nil { - objectMap["timeSeriesIdProperties"] = ltecp.TimeSeriesIDProperties - } - if ltecp.StorageConfiguration != nil { - objectMap["storageConfiguration"] = ltecp.StorageConfiguration - } - if ltecp.WarmStoreConfigurationProperties != nil { - objectMap["warmStoreConfiguration"] = ltecp.WarmStoreConfigurationProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for LongTermEnvironmentCreationProperties struct. -func (ltecp *LongTermEnvironmentCreationProperties) 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 "timeSeriesIdProperties": - if v != nil { - var timeSeriesIDProperties []TimeSeriesIDProperty - err = json.Unmarshal(*v, &timeSeriesIDProperties) - if err != nil { - return err - } - ltecp.TimeSeriesIDProperties = &timeSeriesIDProperties - } - case "storageConfiguration": - if v != nil { - var storageConfiguration LongTermStorageConfigurationInput - err = json.Unmarshal(*v, &storageConfiguration) - if err != nil { - return err - } - ltecp.StorageConfiguration = &storageConfiguration - } - case "warmStoreConfiguration": - if v != nil { - var warmStoreConfigurationProperties WarmStoreConfigurationProperties - err = json.Unmarshal(*v, &warmStoreConfigurationProperties) - if err != nil { - return err - } - ltecp.WarmStoreConfigurationProperties = &warmStoreConfigurationProperties - } - } - } - - return nil + // WarmStoreConfiguration - The warm store configuration provides the details to create a warm store cache that will retain a copy of the environment's data available for faster query. + WarmStoreConfiguration *WarmStoreConfigurationProperties `json:"warmStoreConfiguration,omitempty"` } // LongTermEnvironmentMutableProperties an object that represents a set of mutable long-term environment @@ -2077,53 +2049,8 @@ func (ltecp *LongTermEnvironmentCreationProperties) UnmarshalJSON(body []byte) e type LongTermEnvironmentMutableProperties struct { // StorageConfiguration - The storage configuration provides the connection details that allows the Time Series Insights service to connect to the customer storage account that is used to store the environment's data. StorageConfiguration *LongTermStorageConfigurationMutableProperties `json:"storageConfiguration,omitempty"` - // WarmStoreConfigurationProperties - The warm store configuration provides the details to create a warm store cache that will retain a copy of the environment's data available for faster query. - *WarmStoreConfigurationProperties `json:"warmStoreConfiguration,omitempty"` -} - -// MarshalJSON is the custom marshaler for LongTermEnvironmentMutableProperties. -func (ltemp LongTermEnvironmentMutableProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if ltemp.StorageConfiguration != nil { - objectMap["storageConfiguration"] = ltemp.StorageConfiguration - } - if ltemp.WarmStoreConfigurationProperties != nil { - objectMap["warmStoreConfiguration"] = ltemp.WarmStoreConfigurationProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for LongTermEnvironmentMutableProperties struct. -func (ltemp *LongTermEnvironmentMutableProperties) 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 "storageConfiguration": - if v != nil { - var storageConfiguration LongTermStorageConfigurationMutableProperties - err = json.Unmarshal(*v, &storageConfiguration) - if err != nil { - return err - } - ltemp.StorageConfiguration = &storageConfiguration - } - case "warmStoreConfiguration": - if v != nil { - var warmStoreConfigurationProperties WarmStoreConfigurationProperties - err = json.Unmarshal(*v, &warmStoreConfigurationProperties) - if err != nil { - return err - } - ltemp.WarmStoreConfigurationProperties = &warmStoreConfigurationProperties - } - } - } - - return nil + // WarmStoreConfiguration - The warm store configuration provides the details to create a warm store cache that will retain a copy of the environment's data available for faster query. + WarmStoreConfiguration *WarmStoreConfigurationProperties `json:"warmStoreConfiguration,omitempty"` } // LongTermEnvironmentResource an environment is a set of time-series data available for query, and is the @@ -2292,116 +2219,8 @@ type LongTermEnvironmentResourceProperties struct { TimeSeriesIDProperties *[]TimeSeriesIDProperty `json:"timeSeriesIdProperties,omitempty"` // StorageConfiguration - The storage configuration provides the connection details that allows the Time Series Insights service to connect to the customer storage account that is used to store the environment's data. StorageConfiguration *LongTermStorageConfigurationOutput `json:"storageConfiguration,omitempty"` - // WarmStoreConfigurationProperties - The warm store configuration provides the details to create a warm store cache that will retain a copy of the environment's data available for faster query. - *WarmStoreConfigurationProperties `json:"warmStoreConfiguration,omitempty"` -} - -// MarshalJSON is the custom marshaler for LongTermEnvironmentResourceProperties. -func (lterp LongTermEnvironmentResourceProperties) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if lterp.Status != nil { - objectMap["status"] = lterp.Status - } - if lterp.ProvisioningState != "" { - objectMap["provisioningState"] = lterp.ProvisioningState - } - if lterp.TimeSeriesIDProperties != nil { - objectMap["timeSeriesIdProperties"] = lterp.TimeSeriesIDProperties - } - if lterp.StorageConfiguration != nil { - objectMap["storageConfiguration"] = lterp.StorageConfiguration - } - if lterp.WarmStoreConfigurationProperties != nil { - objectMap["warmStoreConfiguration"] = lterp.WarmStoreConfigurationProperties - } - return json.Marshal(objectMap) -} - -// UnmarshalJSON is the custom unmarshaler for LongTermEnvironmentResourceProperties struct. -func (lterp *LongTermEnvironmentResourceProperties) 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 "dataAccessId": - if v != nil { - var dataAccessID uuid.UUID - err = json.Unmarshal(*v, &dataAccessID) - if err != nil { - return err - } - lterp.DataAccessID = &dataAccessID - } - case "dataAccessFqdn": - if v != nil { - var dataAccessFqdn string - err = json.Unmarshal(*v, &dataAccessFqdn) - if err != nil { - return err - } - lterp.DataAccessFqdn = &dataAccessFqdn - } - case "status": - if v != nil { - var status EnvironmentStatus - err = json.Unmarshal(*v, &status) - if err != nil { - return err - } - lterp.Status = &status - } - case "provisioningState": - if v != nil { - var provisioningState ProvisioningState - err = json.Unmarshal(*v, &provisioningState) - if err != nil { - return err - } - lterp.ProvisioningState = provisioningState - } - case "creationTime": - if v != nil { - var creationTime date.Time - err = json.Unmarshal(*v, &creationTime) - if err != nil { - return err - } - lterp.CreationTime = &creationTime - } - case "timeSeriesIdProperties": - if v != nil { - var timeSeriesIDProperties []TimeSeriesIDProperty - err = json.Unmarshal(*v, &timeSeriesIDProperties) - if err != nil { - return err - } - lterp.TimeSeriesIDProperties = &timeSeriesIDProperties - } - case "storageConfiguration": - if v != nil { - var storageConfiguration LongTermStorageConfigurationOutput - err = json.Unmarshal(*v, &storageConfiguration) - if err != nil { - return err - } - lterp.StorageConfiguration = &storageConfiguration - } - case "warmStoreConfiguration": - if v != nil { - var warmStoreConfigurationProperties WarmStoreConfigurationProperties - err = json.Unmarshal(*v, &warmStoreConfigurationProperties) - if err != nil { - return err - } - lterp.WarmStoreConfigurationProperties = &warmStoreConfigurationProperties - } - } - } - - return nil + // WarmStoreConfiguration - The warm store configuration provides the details to create a warm store cache that will retain a copy of the environment's data available for faster query. + WarmStoreConfiguration *WarmStoreConfigurationProperties `json:"warmStoreConfiguration,omitempty"` } // LongTermEnvironmentUpdateParameters parameters supplied to the Update Environment operation to update a @@ -3020,7 +2839,7 @@ type StandardEnvironmentCreationProperties struct { DataRetentionTime *string `json:"dataRetentionTime,omitempty"` // StorageLimitExceededBehavior - The behavior the Time Series Insights service should take when the environment's capacity has been exceeded. If "PauseIngress" is specified, new events will not be read from the event source. If "PurgeOldData" is specified, new events will continue to be read and old events will be deleted from the environment. The default behavior is PurgeOldData. Possible values include: 'PurgeOldData', 'PauseIngress' StorageLimitExceededBehavior StorageLimitExceededBehavior `json:"storageLimitExceededBehavior,omitempty"` - // PartitionKeyProperties - The list of event properties which will be used to partition data in the environment. + // PartitionKeyProperties - The list of event properties which will be used to partition data in the environment. Currently, only a single partition key property is supported. PartitionKeyProperties *[]TimeSeriesIDProperty `json:"partitionKeyProperties,omitempty"` } @@ -3031,8 +2850,6 @@ type StandardEnvironmentMutableProperties struct { DataRetentionTime *string `json:"dataRetentionTime,omitempty"` // StorageLimitExceededBehavior - The behavior the Time Series Insights service should take when the environment's capacity has been exceeded. If "PauseIngress" is specified, new events will not be read from the event source. If "PurgeOldData" is specified, new events will continue to be read and old events will be deleted from the environment. The default behavior is PurgeOldData. Possible values include: 'PurgeOldData', 'PauseIngress' StorageLimitExceededBehavior StorageLimitExceededBehavior `json:"storageLimitExceededBehavior,omitempty"` - // PartitionKeyProperties - The list of event properties which will be used to partition data in the environment. - PartitionKeyProperties *[]TimeSeriesIDProperty `json:"partitionKeyProperties,omitempty"` } // StandardEnvironmentResource an environment is a set of time-series data available for query, and is the @@ -3190,7 +3007,7 @@ type StandardEnvironmentResourceProperties struct { DataRetentionTime *string `json:"dataRetentionTime,omitempty"` // StorageLimitExceededBehavior - The behavior the Time Series Insights service should take when the environment's capacity has been exceeded. If "PauseIngress" is specified, new events will not be read from the event source. If "PurgeOldData" is specified, new events will continue to be read and old events will be deleted from the environment. The default behavior is PurgeOldData. Possible values include: 'PurgeOldData', 'PauseIngress' StorageLimitExceededBehavior StorageLimitExceededBehavior `json:"storageLimitExceededBehavior,omitempty"` - // PartitionKeyProperties - The list of event properties which will be used to partition data in the environment. + // PartitionKeyProperties - The list of event properties which will be used to partition data in the environment. Currently, only a single partition key property is supported. PartitionKeyProperties *[]TimeSeriesIDProperty `json:"partitionKeyProperties,omitempty"` // DataAccessID - READ-ONLY; An id used to access the environment data, e.g. to query the environment's events or upload reference data for the environment. DataAccessID *uuid.UUID `json:"dataAccessId,omitempty"` diff --git a/services/preview/timeseriesinsights/mgmt/2018-08-15-preview/timeseriesinsights/timeseriesinsightsapi/interfaces.go b/services/preview/timeseriesinsights/mgmt/2018-08-15-preview/timeseriesinsights/timeseriesinsightsapi/interfaces.go index 33fbc2136231..389b6b36ee55 100644 --- a/services/preview/timeseriesinsights/mgmt/2018-08-15-preview/timeseriesinsights/timeseriesinsightsapi/interfaces.go +++ b/services/preview/timeseriesinsights/mgmt/2018-08-15-preview/timeseriesinsights/timeseriesinsightsapi/interfaces.go @@ -38,7 +38,7 @@ type EnvironmentsClientAPI interface { Get(ctx context.Context, resourceGroupName string, environmentName string, expand string) (result timeseriesinsights.EnvironmentResourceModel, err error) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result timeseriesinsights.EnvironmentListResponse, err error) ListBySubscription(ctx context.Context) (result timeseriesinsights.EnvironmentListResponse, err error) - Update(ctx context.Context, resourceGroupName string, environmentName string, standardEnvironmentUpdateParameters timeseriesinsights.StandardEnvironmentUpdateParameters) (result timeseriesinsights.EnvironmentsUpdateFuture, err error) + Update(ctx context.Context, resourceGroupName string, environmentName string, environmentUpdateParameters timeseriesinsights.EnvironmentUpdateParameters) (result timeseriesinsights.EnvironmentsUpdateFuture, err error) } var _ EnvironmentsClientAPI = (*timeseriesinsights.EnvironmentsClient)(nil) diff --git a/services/recoveryservices/mgmt/2018-07-10/siterecovery/models.go b/services/recoveryservices/mgmt/2018-07-10/siterecovery/models.go index d7416ee1a04c..403e226d7cac 100644 --- a/services/recoveryservices/mgmt/2018-07-10/siterecovery/models.go +++ b/services/recoveryservices/mgmt/2018-07-10/siterecovery/models.go @@ -750,15 +750,15 @@ func PossibleInstanceTypeBasicRecoveryPlanActionDetailsValues() []InstanceTypeBa type InstanceTypeBasicRecoveryPlanProviderSpecificDetails string const ( - // InstanceTypeRecoveryPlanA2ADetails ... - InstanceTypeRecoveryPlanA2ADetails InstanceTypeBasicRecoveryPlanProviderSpecificDetails = "RecoveryPlanA2ADetails" - // InstanceTypeRecoveryPlanProviderSpecificDetails ... - InstanceTypeRecoveryPlanProviderSpecificDetails InstanceTypeBasicRecoveryPlanProviderSpecificDetails = "RecoveryPlanProviderSpecificDetails" + // InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A ... + InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A InstanceTypeBasicRecoveryPlanProviderSpecificDetails = "A2A" + // InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeRecoveryPlanProviderSpecificDetails ... + InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeRecoveryPlanProviderSpecificDetails InstanceTypeBasicRecoveryPlanProviderSpecificDetails = "RecoveryPlanProviderSpecificDetails" ) // PossibleInstanceTypeBasicRecoveryPlanProviderSpecificDetailsValues returns an array of possible values for the InstanceTypeBasicRecoveryPlanProviderSpecificDetails const type. func PossibleInstanceTypeBasicRecoveryPlanProviderSpecificDetailsValues() []InstanceTypeBasicRecoveryPlanProviderSpecificDetails { - return []InstanceTypeBasicRecoveryPlanProviderSpecificDetails{InstanceTypeRecoveryPlanA2ADetails, InstanceTypeRecoveryPlanProviderSpecificDetails} + return []InstanceTypeBasicRecoveryPlanProviderSpecificDetails{InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A, InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeRecoveryPlanProviderSpecificDetails} } // InstanceTypeBasicRecoveryPlanProviderSpecificFailoverInput enumerates the values for instance type basic @@ -2270,6 +2270,10 @@ type A2AReplicationDetails struct { InitialPrimaryFabricLocation *string `json:"initialPrimaryFabricLocation,omitempty"` // InitialRecoveryFabricLocation - READ-ONLY; The initial recovery fabric location. InitialRecoveryFabricLocation *string `json:"initialRecoveryFabricLocation,omitempty"` + // InitialPrimaryZone - READ-ONLY; The initial primary availability zone. + InitialPrimaryZone *string `json:"initialPrimaryZone,omitempty"` + // InitialRecoveryZone - READ-ONLY; The initial recovery availability zone. + InitialRecoveryZone *string `json:"initialRecoveryZone,omitempty"` // MultiVMGroupID - The multi vm group Id. MultiVMGroupID *string `json:"multiVmGroupId,omitempty"` // MultiVMGroupName - The multi vm group name. @@ -14908,13 +14912,13 @@ type RecoveryPlanA2ADetails struct { PrimaryZone *string `json:"primaryZone,omitempty"` // RecoveryZone - The recovery zone. RecoveryZone *string `json:"recoveryZone,omitempty"` - // InstanceType - Possible values include: 'InstanceTypeRecoveryPlanProviderSpecificDetails', 'InstanceTypeRecoveryPlanA2ADetails' + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeRecoveryPlanProviderSpecificDetails', 'InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A' InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificDetails `json:"instanceType,omitempty"` } // MarshalJSON is the custom marshaler for RecoveryPlanA2ADetails. func (rpad RecoveryPlanA2ADetails) MarshalJSON() ([]byte, error) { - rpad.InstanceType = InstanceTypeRecoveryPlanA2ADetails + rpad.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A objectMap := make(map[string]interface{}) if rpad.PrimaryZone != nil { objectMap["primaryZone"] = rpad.PrimaryZone @@ -16037,7 +16041,7 @@ type BasicRecoveryPlanProviderSpecificDetails interface { // RecoveryPlanProviderSpecificDetails recovery plan provider specific details. type RecoveryPlanProviderSpecificDetails struct { - // InstanceType - Possible values include: 'InstanceTypeRecoveryPlanProviderSpecificDetails', 'InstanceTypeRecoveryPlanA2ADetails' + // InstanceType - Possible values include: 'InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeRecoveryPlanProviderSpecificDetails', 'InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A' InstanceType InstanceTypeBasicRecoveryPlanProviderSpecificDetails `json:"instanceType,omitempty"` } @@ -16049,7 +16053,7 @@ func unmarshalBasicRecoveryPlanProviderSpecificDetails(body []byte) (BasicRecove } switch m["instanceType"] { - case string(InstanceTypeRecoveryPlanA2ADetails): + case string(InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeA2A): var rpad RecoveryPlanA2ADetails err := json.Unmarshal(body, &rpad) return rpad, err @@ -16080,7 +16084,7 @@ func unmarshalBasicRecoveryPlanProviderSpecificDetailsArray(body []byte) ([]Basi // MarshalJSON is the custom marshaler for RecoveryPlanProviderSpecificDetails. func (rppsd RecoveryPlanProviderSpecificDetails) MarshalJSON() ([]byte, error) { - rppsd.InstanceType = InstanceTypeRecoveryPlanProviderSpecificDetails + rppsd.InstanceType = InstanceTypeBasicRecoveryPlanProviderSpecificDetailsInstanceTypeRecoveryPlanProviderSpecificDetails objectMap := make(map[string]interface{}) if rppsd.InstanceType != "" { objectMap["instanceType"] = rppsd.InstanceType diff --git a/services/signalr/mgmt/2020-05-01/signalr/client.go b/services/signalr/mgmt/2020-05-01/signalr/client.go new file mode 100644 index 000000000000..7d615b08f13c --- /dev/null +++ b/services/signalr/mgmt/2020-05-01/signalr/client.go @@ -0,0 +1,52 @@ +// Package signalr implements the Azure ARM Signalr service API version 2020-05-01. +// +// REST API for Azure SignalR Service +package signalr + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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 Signalr + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Signalr. +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/signalr/mgmt/2020-05-01/signalr/models.go b/services/signalr/mgmt/2020-05-01/signalr/models.go new file mode 100644 index 000000000000..4f4aeef3248d --- /dev/null +++ b/services/signalr/mgmt/2020-05-01/signalr/models.go @@ -0,0 +1,1609 @@ +package signalr + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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/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/signalr/mgmt/2020-05-01/signalr" + +// ACLAction enumerates the values for acl action. +type ACLAction string + +const ( + // Allow ... + Allow ACLAction = "Allow" + // Deny ... + Deny ACLAction = "Deny" +) + +// PossibleACLActionValues returns an array of possible values for the ACLAction const type. +func PossibleACLActionValues() []ACLAction { + return []ACLAction{Allow, Deny} +} + +// FeatureFlags enumerates the values for feature flags. +type FeatureFlags string + +const ( + // EnableConnectivityLogs ... + EnableConnectivityLogs FeatureFlags = "EnableConnectivityLogs" + // EnableMessagingLogs ... + EnableMessagingLogs FeatureFlags = "EnableMessagingLogs" + // ServiceMode ... + ServiceMode FeatureFlags = "ServiceMode" +) + +// PossibleFeatureFlagsValues returns an array of possible values for the FeatureFlags const type. +func PossibleFeatureFlagsValues() []FeatureFlags { + return []FeatureFlags{EnableConnectivityLogs, EnableMessagingLogs, ServiceMode} +} + +// KeyType enumerates the values for key type. +type KeyType string + +const ( + // Primary ... + Primary KeyType = "Primary" + // Secondary ... + Secondary KeyType = "Secondary" +) + +// PossibleKeyTypeValues returns an array of possible values for the KeyType const type. +func PossibleKeyTypeValues() []KeyType { + return []KeyType{Primary, Secondary} +} + +// PrivateLinkServiceConnectionStatus enumerates the values for private link service connection status. +type PrivateLinkServiceConnectionStatus string + +const ( + // Approved ... + Approved PrivateLinkServiceConnectionStatus = "Approved" + // Disconnected ... + Disconnected PrivateLinkServiceConnectionStatus = "Disconnected" + // Pending ... + Pending PrivateLinkServiceConnectionStatus = "Pending" + // Rejected ... + Rejected PrivateLinkServiceConnectionStatus = "Rejected" +) + +// PossiblePrivateLinkServiceConnectionStatusValues returns an array of possible values for the PrivateLinkServiceConnectionStatus const type. +func PossiblePrivateLinkServiceConnectionStatusValues() []PrivateLinkServiceConnectionStatus { + return []PrivateLinkServiceConnectionStatus{Approved, Disconnected, Pending, Rejected} +} + +// ProvisioningState enumerates the values for provisioning state. +type ProvisioningState string + +const ( + // Canceled ... + Canceled ProvisioningState = "Canceled" + // Creating ... + Creating ProvisioningState = "Creating" + // Deleting ... + Deleting ProvisioningState = "Deleting" + // Failed ... + Failed ProvisioningState = "Failed" + // Moving ... + Moving ProvisioningState = "Moving" + // Running ... + Running ProvisioningState = "Running" + // Succeeded ... + Succeeded ProvisioningState = "Succeeded" + // Unknown ... + Unknown ProvisioningState = "Unknown" + // Updating ... + Updating ProvisioningState = "Updating" +) + +// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. +func PossibleProvisioningStateValues() []ProvisioningState { + return []ProvisioningState{Canceled, Creating, Deleting, Failed, Moving, Running, Succeeded, Unknown, Updating} +} + +// RequestType enumerates the values for request type. +type RequestType string + +const ( + // ClientConnection ... + ClientConnection RequestType = "ClientConnection" + // RESTAPI ... + RESTAPI RequestType = "RESTAPI" + // ServerConnection ... + ServerConnection RequestType = "ServerConnection" +) + +// PossibleRequestTypeValues returns an array of possible values for the RequestType const type. +func PossibleRequestTypeValues() []RequestType { + return []RequestType{ClientConnection, RESTAPI, ServerConnection} +} + +// ServiceKind enumerates the values for service kind. +type ServiceKind string + +const ( + // RawWebSockets ... + RawWebSockets ServiceKind = "RawWebSockets" + // SignalR ... + SignalR ServiceKind = "SignalR" +) + +// PossibleServiceKindValues returns an array of possible values for the ServiceKind const type. +func PossibleServiceKindValues() []ServiceKind { + return []ServiceKind{RawWebSockets, SignalR} +} + +// SkuTier enumerates the values for sku tier. +type SkuTier string + +const ( + // Basic ... + Basic SkuTier = "Basic" + // Free ... + Free SkuTier = "Free" + // Premium ... + Premium SkuTier = "Premium" + // Standard ... + Standard SkuTier = "Standard" +) + +// PossibleSkuTierValues returns an array of possible values for the SkuTier const type. +func PossibleSkuTierValues() []SkuTier { + return []SkuTier{Basic, Free, Premium, Standard} +} + +// CorsSettings cross-Origin Resource Sharing (CORS) settings. +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. If omitted, allow all by default. + AllowedOrigins *[]string `json:"allowedOrigins,omitempty"` +} + +// CreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type CreateOrUpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *CreateOrUpdateFuture) Result(client Client) (rt ResourceType, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "signalr.CreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("signalr.CreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rt.Response.Response, err = future.GetResult(sender); err == nil && rt.Response.Response.StatusCode != http.StatusNoContent { + rt, err = client.CreateOrUpdateResponder(rt.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "signalr.CreateOrUpdateFuture", "Result", rt.Response.Response, "Failure responding to request") + } + } + return +} + +// CreateOrUpdateProperties settings used to provision or configure the resource. +type CreateOrUpdateProperties struct { + // HostNamePrefix - Prefix for the hostName of the SignalR service. Retained for future use. + // The hostname will be of format: <hostNamePrefix>.service.signalr.net. + HostNamePrefix *string `json:"hostNamePrefix,omitempty"` + // Features - List of SignalR featureFlags. e.g. ServiceMode. + // + // FeatureFlags that are not included in the parameters for the update operation will not be modified. + // And the response will only include featureFlags that are explicitly set. + // When a featureFlag is not explicitly set, SignalR service will use its globally default value. + // But keep in mind, the default value doesn't mean "false". It varies in terms of different FeatureFlags. + Features *[]Feature `json:"features,omitempty"` + // Cors - Cross-Origin Resource Sharing (CORS) settings. + Cors *CorsSettings `json:"cors,omitempty"` + // Upstream - Upstream settings when the Azure SignalR is in server-less mode. + Upstream *ServerlessUpstreamSettings `json:"upstream,omitempty"` + // NetworkACLs - Network ACLs + NetworkACLs *NetworkACLs `json:"networkACLs,omitempty"` +} + +// DeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type DeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *DeleteFuture) Result(client Client) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "signalr.DeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("signalr.DeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// Dimension specifications of the Dimension of metrics. +type Dimension struct { + // Name - The public facing name of the dimension. + Name *string `json:"name,omitempty"` + // DisplayName - Localized friendly display name of the dimension. + DisplayName *string `json:"displayName,omitempty"` + // InternalName - Name of the dimension as it appears in MDM. + InternalName *string `json:"internalName,omitempty"` + // ToBeExportedForShoebox - A Boolean flag indicating whether this dimension should be included for the shoebox export scenario. + ToBeExportedForShoebox *bool `json:"toBeExportedForShoebox,omitempty"` +} + +// ErrorResponse contains information about an API error. +type ErrorResponse struct { + // Error - Describes a particular API error with an error code and a message. + Error *ErrorResponseBody `json:"error,omitempty"` +} + +// ErrorResponseBody describes a particular API error with an error code and a message. +type ErrorResponseBody struct { + // Code - An error code that describes the error condition more precisely than an HTTP status code. + // Can be used to programmatically handle specific error cases. + Code *string `json:"code,omitempty"` + // Message - A message that describes the error in detail and provides debugging information. + Message *string `json:"message,omitempty"` + // Target - The target of the particular error (for example, the name of the property in error). + Target *string `json:"target,omitempty"` + // Details - Contains nested errors that are related to this error. + Details *[]ErrorResponseBody `json:"details,omitempty"` +} + +// Feature feature of a SignalR resource, which controls the SignalR runtime behavior. +type Feature struct { + // Flag - FeatureFlags is the supported features of Azure SignalR service. + // - ServiceMode: Flag for backend server for SignalR service. Values allowed: "Default": have your own backend server; "Serverless": your application doesn't have a backend server; "Classic": for backward compatibility. Support both Default and Serverless mode but not recommended; "PredefinedOnly": for future use. + // - EnableConnectivityLogs: "true"/"false", to enable/disable the connectivity log category respectively. Possible values include: 'ServiceMode', 'EnableConnectivityLogs', 'EnableMessagingLogs' + Flag FeatureFlags `json:"flag,omitempty"` + // Value - Value of the feature flag. See Azure SignalR service document https://docs.microsoft.com/azure/azure-signalr/ for allowed values. + Value *string `json:"value,omitempty"` + // Properties - Optional properties related to this feature. + Properties map[string]*string `json:"properties"` +} + +// MarshalJSON is the custom marshaler for Feature. +func (f Feature) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if f.Flag != "" { + objectMap["flag"] = f.Flag + } + if f.Value != nil { + objectMap["value"] = f.Value + } + if f.Properties != nil { + objectMap["properties"] = f.Properties + } + return json.Marshal(objectMap) +} + +// Keys a class represents the access keys of SignalR service. +type Keys struct { + autorest.Response `json:"-"` + // PrimaryKey - The primary access key. + PrimaryKey *string `json:"primaryKey,omitempty"` + // SecondaryKey - The secondary access key. + SecondaryKey *string `json:"secondaryKey,omitempty"` + // PrimaryConnectionString - SignalR connection string constructed via the primaryKey + PrimaryConnectionString *string `json:"primaryConnectionString,omitempty"` + // SecondaryConnectionString - SignalR connection string constructed via the secondaryKey + SecondaryConnectionString *string `json:"secondaryConnectionString,omitempty"` +} + +// LogSpecification specifications of the Logs for Azure Monitoring. +type LogSpecification struct { + // Name - Name of the log. + Name *string `json:"name,omitempty"` + // DisplayName - Localized friendly display name of the log. + DisplayName *string `json:"displayName,omitempty"` +} + +// MetricSpecification specifications of the Metrics for Azure Monitoring. +type MetricSpecification struct { + // Name - Name of the metric. + Name *string `json:"name,omitempty"` + // DisplayName - Localized friendly display name of the metric. + DisplayName *string `json:"displayName,omitempty"` + // DisplayDescription - Localized friendly description of the metric. + DisplayDescription *string `json:"displayDescription,omitempty"` + // Unit - The unit that makes sense for the metric. + Unit *string `json:"unit,omitempty"` + // AggregationType - Only provide one value for this field. Valid values: Average, Minimum, Maximum, Total, Count. + AggregationType *string `json:"aggregationType,omitempty"` + // FillGapWithZero - Optional. If set to true, then zero will be returned for time duration where no metric is emitted/published. + // Ex. a metric that returns the number of times a particular error code was emitted. The error code may not appear + // often, instead of the RP publishing 0, Shoebox can auto fill in 0s for time periods where nothing was emitted. + FillGapWithZero *string `json:"fillGapWithZero,omitempty"` + // Category - The name of the metric category that the metric belongs to. A metric can only belong to a single category. + Category *string `json:"category,omitempty"` + // Dimensions - The dimensions of the metrics. + Dimensions *[]Dimension `json:"dimensions,omitempty"` +} + +// NameAvailability result of the request to check name availability. It contains a flag and possible +// reason of failure. +type NameAvailability struct { + autorest.Response `json:"-"` + // NameAvailable - Indicates whether the name is available or not. + NameAvailable *bool `json:"nameAvailable,omitempty"` + // Reason - The reason of the availability. Required if name is not available. + Reason *string `json:"reason,omitempty"` + // Message - The message of the operation. + Message *string `json:"message,omitempty"` +} + +// NameAvailabilityParameters data POST-ed to the nameAvailability action +type NameAvailabilityParameters struct { + // Type - The resource type. Should be always "Microsoft.SignalRService/SignalR". + Type *string `json:"type,omitempty"` + // Name - The SignalR service name to validate. e.g."my-signalR-name-here" + Name *string `json:"name,omitempty"` +} + +// NetworkACL network ACL +type NetworkACL struct { + // Allow - Allowed request types. The value can be one or more of: ClientConnection, ServerConnection, RESTAPI. + Allow *[]RequestType `json:"allow,omitempty"` + // Deny - Denied request types. The value can be one or more of: ClientConnection, ServerConnection, RESTAPI. + Deny *[]RequestType `json:"deny,omitempty"` +} + +// NetworkACLs network ACLs for SignalR +type NetworkACLs struct { + // DefaultAction - Default action when no other rule matches. Possible values include: 'Allow', 'Deny' + DefaultAction ACLAction `json:"defaultAction,omitempty"` + // PublicNetwork - ACL for requests from public network + PublicNetwork *NetworkACL `json:"publicNetwork,omitempty"` + // PrivateEndpoints - ACLs for requests from private endpoints + PrivateEndpoints *[]PrivateEndpointACL `json:"privateEndpoints,omitempty"` +} + +// Operation REST API operation supported by SignalR resource provider. +type Operation struct { + // Name - Name of the operation with format: {provider}/{resource}/{operation} + Name *string `json:"name,omitempty"` + // IsDataAction - If the operation is a data action. (for data plane rbac) + IsDataAction *bool `json:"isDataAction,omitempty"` + // Display - The object that describes the operation. + Display *OperationDisplay `json:"display,omitempty"` + // Origin - Optional. The intended executor of the operation; governs the display of the operation in the RBAC UX and the audit logs UX. + Origin *string `json:"origin,omitempty"` + // Properties - Extra properties for the operation. + Properties *OperationProperties `json:"properties,omitempty"` +} + +// OperationDisplay the object that describes a operation. +type OperationDisplay struct { + // Provider - Friendly name of the resource provider + Provider *string `json:"provider,omitempty"` + // Resource - Resource type on which the operation is performed. + Resource *string `json:"resource,omitempty"` + // Operation - The localized friendly name for the operation. + Operation *string `json:"operation,omitempty"` + // Description - The localized friendly description for the operation + Description *string `json:"description,omitempty"` +} + +// OperationList result of the request to list REST API operations. It contains a list of operations. +type OperationList struct { + autorest.Response `json:"-"` + // Value - List of operations supported by the resource provider. + Value *[]Operation `json:"value,omitempty"` + // NextLink - The URL the client should use to fetch the next page (per server side paging). + // It's null for now, added for future use. + NextLink *string `json:"nextLink,omitempty"` +} + +// OperationListIterator provides access to a complete listing of Operation values. +type OperationListIterator struct { + i int + page OperationListPage +} + +// 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 *OperationListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationListIterator.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 *OperationListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter OperationListIterator) 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 OperationListIterator) Response() OperationList { + 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 OperationListIterator) Value() Operation { + if !iter.page.NotDone() { + return Operation{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the OperationListIterator type. +func NewOperationListIterator(page OperationListPage) OperationListIterator { + return OperationListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ol OperationList) IsEmpty() bool { + return ol.Value == nil || len(*ol.Value) == 0 +} + +// operationListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ol OperationList) operationListPreparer(ctx context.Context) (*http.Request, error) { + if ol.NextLink == nil || len(to.String(ol.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ol.NextLink))) +} + +// OperationListPage contains a page of Operation values. +type OperationListPage struct { + fn func(context.Context, OperationList) (OperationList, error) + ol OperationList +} + +// 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 *OperationListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.ol) + if err != nil { + return err + } + page.ol = next + 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 *OperationListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page OperationListPage) NotDone() bool { + return !page.ol.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page OperationListPage) Response() OperationList { + return page.ol +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page OperationListPage) Values() []Operation { + if page.ol.IsEmpty() { + return nil + } + return *page.ol.Value +} + +// Creates a new instance of the OperationListPage type. +func NewOperationListPage(getNextPage func(context.Context, OperationList) (OperationList, error)) OperationListPage { + return OperationListPage{fn: getNextPage} +} + +// OperationProperties extra Operation properties. +type OperationProperties struct { + // ServiceSpecification - The service specifications. + ServiceSpecification *ServiceSpecification `json:"serviceSpecification,omitempty"` +} + +// PrivateEndpoint private endpoint +type PrivateEndpoint struct { + // ID - Full qualified Id of the private endpoint + ID *string `json:"id,omitempty"` +} + +// PrivateEndpointACL ACL for a private endpoint +type PrivateEndpointACL struct { + // Name - Name of the private endpoint connection + Name *string `json:"name,omitempty"` + // Allow - Allowed request types. The value can be one or more of: ClientConnection, ServerConnection, RESTAPI. + Allow *[]RequestType `json:"allow,omitempty"` + // Deny - Denied request types. The value can be one or more of: ClientConnection, ServerConnection, RESTAPI. + Deny *[]RequestType `json:"deny,omitempty"` +} + +// PrivateEndpointConnection a private endpoint connection to SignalR resource +type PrivateEndpointConnection struct { + autorest.Response `json:"-"` + // PrivateEndpointConnectionProperties - Properties of the private endpoint connection + *PrivateEndpointConnectionProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource Id for the resource. + 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.SignalRService/SignalR" + Type *string `json:"type,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 + } + } + } + + return nil +} + +// PrivateEndpointConnectionProperties private endpoint connection properties +type PrivateEndpointConnectionProperties struct { + // ProvisioningState - READ-ONLY; Provisioning state of the private endpoint connection. Possible values include: 'Unknown', 'Succeeded', 'Failed', 'Canceled', 'Running', 'Creating', 'Updating', 'Deleting', 'Moving' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // PrivateEndpoint - Private endpoint associated with the private endpoint connection + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + // PrivateLinkServiceConnectionState - Connection state + PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` +} + +// PrivateEndpointConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type PrivateEndpointConnectionsDeleteFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +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, "signalr.PrivateEndpointConnectionsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("signalr.PrivateEndpointConnectionsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// PrivateLinkResource private link resource +type PrivateLinkResource struct { + // PrivateLinkResourceProperties - Properties of a private link resource + *PrivateLinkResourceProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource Id for the resource. + 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.SignalRService/SignalR" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateLinkResource. +func (plr PrivateLinkResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + 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 "properties": + if v != nil { + var privateLinkResourceProperties PrivateLinkResourceProperties + err = json.Unmarshal(*v, &privateLinkResourceProperties) + if err != nil { + return err + } + plr.PrivateLinkResourceProperties = &privateLinkResourceProperties + } + 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 "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + plr.Type = &typeVar + } + } + } + + return nil +} + +// PrivateLinkResourceList contains a list of AzSignalR.Models.Response.PrivateLink.PrivateLinkResource and +// a possible link to query more results +type PrivateLinkResourceList struct { + autorest.Response `json:"-"` + // Value - List of PrivateLinkResource + Value *[]PrivateLinkResource `json:"value,omitempty"` + // NextLink - The URL the client should use to fetch the next page (per server side paging). + // It's null for now, added for future use. + NextLink *string `json:"nextLink,omitempty"` +} + +// PrivateLinkResourceListIterator provides access to a complete listing of PrivateLinkResource values. +type PrivateLinkResourceListIterator struct { + i int + page PrivateLinkResourceListPage +} + +// 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 *PrivateLinkResourceListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourceListIterator.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 *PrivateLinkResourceListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter PrivateLinkResourceListIterator) 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 PrivateLinkResourceListIterator) Response() PrivateLinkResourceList { + 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 PrivateLinkResourceListIterator) Value() PrivateLinkResource { + if !iter.page.NotDone() { + return PrivateLinkResource{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the PrivateLinkResourceListIterator type. +func NewPrivateLinkResourceListIterator(page PrivateLinkResourceListPage) PrivateLinkResourceListIterator { + return PrivateLinkResourceListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (plrl PrivateLinkResourceList) IsEmpty() bool { + return plrl.Value == nil || len(*plrl.Value) == 0 +} + +// privateLinkResourceListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (plrl PrivateLinkResourceList) privateLinkResourceListPreparer(ctx context.Context) (*http.Request, error) { + if plrl.NextLink == nil || len(to.String(plrl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(plrl.NextLink))) +} + +// PrivateLinkResourceListPage contains a page of PrivateLinkResource values. +type PrivateLinkResourceListPage struct { + fn func(context.Context, PrivateLinkResourceList) (PrivateLinkResourceList, error) + plrl PrivateLinkResourceList +} + +// 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 *PrivateLinkResourceListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourceListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.plrl) + if err != nil { + return err + } + page.plrl = next + 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 *PrivateLinkResourceListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page PrivateLinkResourceListPage) NotDone() bool { + return !page.plrl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page PrivateLinkResourceListPage) Response() PrivateLinkResourceList { + return page.plrl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page PrivateLinkResourceListPage) Values() []PrivateLinkResource { + if page.plrl.IsEmpty() { + return nil + } + return *page.plrl.Value +} + +// Creates a new instance of the PrivateLinkResourceListPage type. +func NewPrivateLinkResourceListPage(getNextPage func(context.Context, PrivateLinkResourceList) (PrivateLinkResourceList, error)) PrivateLinkResourceListPage { + return PrivateLinkResourceListPage{fn: getNextPage} +} + +// PrivateLinkResourceProperties private link resource properties +type PrivateLinkResourceProperties struct { + // GroupID - Group Id of the private link resource + GroupID *string `json:"groupId,omitempty"` + // RequiredMembers - Required members of the private link resource + RequiredMembers *[]string `json:"requiredMembers,omitempty"` + // RequiredZoneNames - Required private DNS zone names + RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"` +} + +// PrivateLinkServiceConnectionState connection state of the private endpoint connection +type PrivateLinkServiceConnectionState struct { + // Status - Indicates whether the connection has been Approved/Rejected/Removed by the owner of the service. Possible values include: 'Pending', 'Approved', 'Rejected', 'Disconnected' + Status PrivateLinkServiceConnectionStatus `json:"status,omitempty"` + // Description - The reason for approval/rejection of the connection. + Description *string `json:"description,omitempty"` + // ActionsRequired - A message indicating if changes on the service provider require any updates on the consumer. + ActionsRequired *string `json:"actionsRequired,omitempty"` +} + +// Properties a class that describes the properties of the SignalR service that should contain more +// read-only properties than AzSignalR.Models.SignalRCreateOrUpdateProperties +type Properties struct { + // ProvisioningState - READ-ONLY; Provisioning state of the resource. Possible values include: 'Unknown', 'Succeeded', 'Failed', 'Canceled', 'Running', 'Creating', 'Updating', 'Deleting', 'Moving' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // ExternalIP - READ-ONLY; The publicly accessible IP of the SignalR service. + ExternalIP *string `json:"externalIP,omitempty"` + // HostName - READ-ONLY; FQDN of the SignalR service instance. Format: xxx.service.signalr.net + HostName *string `json:"hostName,omitempty"` + // PublicPort - READ-ONLY; The publicly accessible port of the SignalR service which is designed for browser/client side usage. + PublicPort *int32 `json:"publicPort,omitempty"` + // ServerPort - READ-ONLY; The publicly accessible port of the SignalR service which is designed for customer server side usage. + ServerPort *int32 `json:"serverPort,omitempty"` + // Version - READ-ONLY; Version of the SignalR resource. Probably you need the same or higher version of client SDKs. + Version *string `json:"version,omitempty"` + // PrivateEndpointConnections - READ-ONLY; Private endpoint connections to the SignalR resource. + PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` + // HostNamePrefix - Prefix for the hostName of the SignalR service. Retained for future use. + // The hostname will be of format: <hostNamePrefix>.service.signalr.net. + HostNamePrefix *string `json:"hostNamePrefix,omitempty"` + // Features - List of SignalR featureFlags. e.g. ServiceMode. + // + // FeatureFlags that are not included in the parameters for the update operation will not be modified. + // And the response will only include featureFlags that are explicitly set. + // When a featureFlag is not explicitly set, SignalR service will use its globally default value. + // But keep in mind, the default value doesn't mean "false". It varies in terms of different FeatureFlags. + Features *[]Feature `json:"features,omitempty"` + // Cors - Cross-Origin Resource Sharing (CORS) settings. + Cors *CorsSettings `json:"cors,omitempty"` + // Upstream - Upstream settings when the Azure SignalR is in server-less mode. + Upstream *ServerlessUpstreamSettings `json:"upstream,omitempty"` + // NetworkACLs - Network ACLs + NetworkACLs *NetworkACLs `json:"networkACLs,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; Fully qualified resource Id for the resource. + 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.SignalRService/SignalR" + Type *string `json:"type,omitempty"` +} + +// RegenerateKeyFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type RegenerateKeyFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *RegenerateKeyFuture) Result(client Client) (kVar Keys, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "signalr.RegenerateKeyFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("signalr.RegenerateKeyFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if kVar.Response.Response, err = future.GetResult(sender); err == nil && kVar.Response.Response.StatusCode != http.StatusNoContent { + kVar, err = client.RegenerateKeyResponder(kVar.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "signalr.RegenerateKeyFuture", "Result", kVar.Response.Response, "Failure responding to request") + } + } + return +} + +// RegenerateKeyParameters parameters describes the request to regenerate access keys +type RegenerateKeyParameters struct { + // KeyType - The keyType to regenerate. Must be either 'primary' or 'secondary'(case-insensitive). Possible values include: 'Primary', 'Secondary' + KeyType KeyType `json:"keyType,omitempty"` +} + +// Resource the core properties of ARM resources. +type Resource struct { + // ID - READ-ONLY; Fully qualified resource Id for the resource. + 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.SignalRService/SignalR" + Type *string `json:"type,omitempty"` +} + +// ResourceList object that includes an array of SignalR services and a possible link for next set. +type ResourceList struct { + autorest.Response `json:"-"` + // Value - List of SignalR services + Value *[]ResourceType `json:"value,omitempty"` + // NextLink - The URL the client should use to fetch the next page (per server side paging). + // It's null for now, added for future use. + NextLink *string `json:"nextLink,omitempty"` +} + +// ResourceListIterator provides access to a complete listing of ResourceType values. +type ResourceListIterator struct { + i int + page ResourceListPage +} + +// 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 *ResourceListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceListIterator.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 *ResourceListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ResourceListIterator) 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 ResourceListIterator) Response() ResourceList { + 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 ResourceListIterator) Value() ResourceType { + if !iter.page.NotDone() { + return ResourceType{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ResourceListIterator type. +func NewResourceListIterator(page ResourceListPage) ResourceListIterator { + return ResourceListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rl ResourceList) IsEmpty() bool { + return rl.Value == nil || len(*rl.Value) == 0 +} + +// resourceListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rl ResourceList) resourceListPreparer(ctx context.Context) (*http.Request, error) { + if rl.NextLink == nil || len(to.String(rl.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rl.NextLink))) +} + +// ResourceListPage contains a page of ResourceType values. +type ResourceListPage struct { + fn func(context.Context, ResourceList) (ResourceList, error) + rl ResourceList +} + +// 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 *ResourceListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.rl) + if err != nil { + return err + } + page.rl = next + 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 *ResourceListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ResourceListPage) NotDone() bool { + return !page.rl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ResourceListPage) Response() ResourceList { + return page.rl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ResourceListPage) Values() []ResourceType { + if page.rl.IsEmpty() { + return nil + } + return *page.rl.Value +} + +// Creates a new instance of the ResourceListPage type. +func NewResourceListPage(getNextPage func(context.Context, ResourceList) (ResourceList, error)) ResourceListPage { + return ResourceListPage{fn: getNextPage} +} + +// ResourceSku the billing information of the SignalR resource. +type ResourceSku struct { + // Name - The name of the SKU. Required. + // + // Allowed values: Standard_S1, Free_F1 + Name *string `json:"name,omitempty"` + // Tier - Optional tier of this particular SKU. 'Standard' or 'Free'. + // + // `Basic` is deprecated, use `Standard` instead. Possible values include: 'Free', 'Basic', 'Standard', 'Premium' + Tier SkuTier `json:"tier,omitempty"` + // Size - Optional string. For future use. + Size *string `json:"size,omitempty"` + // Family - Optional string. For future use. + Family *string `json:"family,omitempty"` + // Capacity - Optional, integer. The unit count of SignalR resource. 1 by default. + // + // If present, following values are allowed: + // Free: 1 + // Standard: 1,2,5,10,20,50,100 + Capacity *int32 `json:"capacity,omitempty"` +} + +// ResourceType a class represent a SignalR service resource. +type ResourceType struct { + autorest.Response `json:"-"` + // Sku - The billing information of the resource.(e.g. Free, Standard) + Sku *ResourceSku `json:"sku,omitempty"` + // Properties - Settings used to provision or configure the resource + *Properties `json:"properties,omitempty"` + // Kind - The kind of the service - e.g. "SignalR", or "RawWebSockets" for "Microsoft.SignalRService/SignalR". Possible values include: 'SignalR', 'RawWebSockets' + Kind ServiceKind `json:"kind,omitempty"` + // Location - The GEO location of the SignalR service. e.g. West US | East US | North Central US | South Central US. + Location *string `json:"location,omitempty"` + // Tags - Tags of the service which is a list of key value pairs that describe the resource. + Tags map[string]*string `json:"tags"` + // ID - READ-ONLY; Fully qualified resource Id for the resource. + 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.SignalRService/SignalR" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ResourceType. +func (rt ResourceType) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rt.Sku != nil { + objectMap["sku"] = rt.Sku + } + if rt.Properties != nil { + objectMap["properties"] = rt.Properties + } + if rt.Kind != "" { + objectMap["kind"] = rt.Kind + } + if rt.Location != nil { + objectMap["location"] = rt.Location + } + if rt.Tags != nil { + objectMap["tags"] = rt.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ResourceType struct. +func (rt *ResourceType) 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 ResourceSku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + rt.Sku = &sku + } + case "properties": + if v != nil { + var properties Properties + err = json.Unmarshal(*v, &properties) + if err != nil { + return err + } + rt.Properties = &properties + } + case "kind": + if v != nil { + var kind ServiceKind + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + rt.Kind = kind + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + rt.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + rt.Tags = tags + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rt.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rt.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rt.Type = &typeVar + } + } + } + + return nil +} + +// RestartFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type RestartFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *RestartFuture) Result(client Client) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "signalr.RestartFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("signalr.RestartFuture") + return + } + ar.Response = future.Response() + return +} + +// ServerlessUpstreamSettings the settings for the Upstream when the Azure SignalR is in server-less mode. +type ServerlessUpstreamSettings struct { + // Templates - Gets or sets the list of Upstream URL templates. Order matters, and the first matching template takes effects. + Templates *[]UpstreamTemplate `json:"templates,omitempty"` +} + +// ServiceSpecification an object that describes a specification. +type ServiceSpecification struct { + // MetricSpecifications - Specifications of the Metrics for Azure Monitoring. + MetricSpecifications *[]MetricSpecification `json:"metricSpecifications,omitempty"` + // LogSpecifications - Specifications of the Logs for Azure Monitoring. + LogSpecifications *[]LogSpecification `json:"logSpecifications,omitempty"` +} + +// TrackedResource the resource model definition for a ARM tracked top level resource. +type TrackedResource struct { + // Location - The GEO location of the SignalR service. e.g. West US | East US | North Central US | South Central US. + Location *string `json:"location,omitempty"` + // Tags - Tags of the service which is a list of key value pairs that describe the resource. + Tags map[string]*string `json:"tags"` + // ID - READ-ONLY; Fully qualified resource Id for the resource. + 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.SignalRService/SignalR" + 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.Location != nil { + objectMap["location"] = tr.Location + } + if tr.Tags != nil { + objectMap["tags"] = tr.Tags + } + return json.Marshal(objectMap) +} + +// UpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type UpdateFuture struct { + azure.Future +} + +// Result returns the result of the asynchronous operation. +// If the operation has not completed it will return an error. +func (future *UpdateFuture) Result(client Client) (rt ResourceType, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "signalr.UpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + err = azure.NewAsyncOpIncompleteError("signalr.UpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rt.Response.Response, err = future.GetResult(sender); err == nil && rt.Response.Response.StatusCode != http.StatusNoContent { + rt, err = client.UpdateResponder(rt.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "signalr.UpdateFuture", "Result", rt.Response.Response, "Failure responding to request") + } + } + return +} + +// UpstreamTemplate upstream template item settings. It defines the Upstream URL of the incoming requests. +// The template defines the pattern of the event, the hub or the category of the incoming request that +// matches current URL template. +type UpstreamTemplate struct { + // HubPattern - Gets or sets the matching pattern for hub names. If not set, it matches any hub. + // There are 3 kind of patterns supported: + // 1. "*", it to matches any hub name + // 2. Combine multiple hubs with ",", for example "hub1,hub2", it matches "hub1" and "hub2" + // 3. The single hub name, for example, "hub1", it matches "hub1" + HubPattern *string `json:"hubPattern,omitempty"` + // EventPattern - Gets or sets the matching pattern for event names. If not set, it matches any event. + // There are 3 kind of patterns supported: + // 1. "*", it to matches any event name + // 2. Combine multiple events with ",", for example "connect,disconnect", it matches event "connect" and "disconnect" + // 3. The single event name, for example, "connect", it matches "connect" + EventPattern *string `json:"eventPattern,omitempty"` + // CategoryPattern - Gets or sets the matching pattern for category names. If not set, it matches any category. + // There are 3 kind of patterns supported: + // 1. "*", it to matches any category name + // 2. Combine multiple categories with ",", for example "connections,messages", it matches category "connections" and "messages" + // 3. The single category name, for example, "connections", it matches the category "connections" + CategoryPattern *string `json:"categoryPattern,omitempty"` + // URLTemplate - Gets or sets the Upstream URL template. You can use 3 predefined parameters {hub}, {category} {event} inside the template, the value of the Upstream URL is dynamically calculated when the client request comes in. + // For example, if the urlTemplate is `http://example.com/{hub}/api/{event}`, with a client request from hub `chat` connects, it will first POST to this URL: `http://example.com/chat/api/connect`. + URLTemplate *string `json:"urlTemplate,omitempty"` +} + +// Usage object that describes a specific usage of SignalR resources. +type Usage struct { + // ID - Fully qualified ARM resource id + ID *string `json:"id,omitempty"` + // CurrentValue - Current value for the usage quota. + CurrentValue *int64 `json:"currentValue,omitempty"` + // Limit - The maximum permitted value for the usage quota. If there is no limit, this value will be -1. + Limit *int64 `json:"limit,omitempty"` + // Name - Localizable String object containing the name and a localized value. + Name *UsageName `json:"name,omitempty"` + // Unit - Representing the units of the usage quota. Possible values are: Count, Bytes, Seconds, Percent, CountPerSecond, BytesPerSecond. + Unit *string `json:"unit,omitempty"` +} + +// UsageList object that includes an array of SignalR resource usages and a possible link for next set. +type UsageList struct { + autorest.Response `json:"-"` + // Value - List of SignalR usages + Value *[]Usage `json:"value,omitempty"` + // NextLink - The URL the client should use to fetch the next page (per server side paging). + // It's null for now, added for future use. + NextLink *string `json:"nextLink,omitempty"` +} + +// UsageListIterator provides access to a complete listing of Usage values. +type UsageListIterator struct { + i int + page UsageListPage +} + +// 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 *UsageListIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UsageListIterator.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 *UsageListIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter UsageListIterator) 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 UsageListIterator) Response() UsageList { + 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 UsageListIterator) Value() Usage { + if !iter.page.NotDone() { + return Usage{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the UsageListIterator type. +func NewUsageListIterator(page UsageListPage) UsageListIterator { + return UsageListIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ul UsageList) IsEmpty() bool { + return ul.Value == nil || len(*ul.Value) == 0 +} + +// usageListPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ul UsageList) usageListPreparer(ctx context.Context) (*http.Request, error) { + if ul.NextLink == nil || len(to.String(ul.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ul.NextLink))) +} + +// UsageListPage contains a page of Usage values. +type UsageListPage struct { + fn func(context.Context, UsageList) (UsageList, error) + ul UsageList +} + +// 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 *UsageListPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UsageListPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.ul) + if err != nil { + return err + } + page.ul = next + 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 *UsageListPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page UsageListPage) NotDone() bool { + return !page.ul.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page UsageListPage) Response() UsageList { + return page.ul +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page UsageListPage) Values() []Usage { + if page.ul.IsEmpty() { + return nil + } + return *page.ul.Value +} + +// Creates a new instance of the UsageListPage type. +func NewUsageListPage(getNextPage func(context.Context, UsageList) (UsageList, error)) UsageListPage { + return UsageListPage{fn: getNextPage} +} + +// UsageName localizable String object containing the name and a localized value. +type UsageName struct { + // Value - The identifier of the usage. + Value *string `json:"value,omitempty"` + // LocalizedValue - Localized name of the usage. + LocalizedValue *string `json:"localizedValue,omitempty"` +} diff --git a/services/signalr/mgmt/2020-05-01/signalr/operations.go b/services/signalr/mgmt/2020-05-01/signalr/operations.go new file mode 100644 index 000000000000..f36c712089cb --- /dev/null +++ b/services/signalr/mgmt/2020-05-01/signalr/operations.go @@ -0,0 +1,147 @@ +package signalr + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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 REST API for Azure SignalR 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 REST API operations of the Microsoft.SignalRService provider. +func (client OperationsClient) List(ctx context.Context) (result OperationListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.ol.Response.Response != nil { + sc = result.ol.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "signalr.OperationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.ol.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "signalr.OperationsClient", "List", resp, "Failure sending request") + return + } + + result.ol, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "signalr.OperationsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.SignalRService/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 OperationList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 OperationList) (result OperationList, err error) { + req, err := lastResults.operationListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "signalr.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, "signalr.OperationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "signalr.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 OperationListIterator, 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/signalr/mgmt/2020-05-01/signalr/privateendpointconnections.go b/services/signalr/mgmt/2020-05-01/signalr/privateendpointconnections.go new file mode 100644 index 000000000000..466e94fc9fc8 --- /dev/null +++ b/services/signalr/mgmt/2020-05-01/signalr/privateendpointconnections.go @@ -0,0 +1,288 @@ +package signalr + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// PrivateEndpointConnectionsClient is the REST API for Azure SignalR 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)} +} + +// Delete delete the specified private endpoint connection associated with a SignalR resource. +// Parameters: +// privateEndpointConnectionName - the name of the private endpoint connection associated with the SignalR +// resource. +// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value +// from the Azure Resource Manager API or the portal. +// resourceName - the name of the SignalR resource. +func (client PrivateEndpointConnectionsClient) Delete(ctx context.Context, privateEndpointConnectionName string, resourceGroupName string, resourceName string) (result PrivateEndpointConnectionsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, privateEndpointConnectionName, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "signalr.PrivateEndpointConnectionsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "signalr.PrivateEndpointConnectionsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client PrivateEndpointConnectionsClient) DeletePreparer(ctx context.Context, privateEndpointConnectionName string, resourceGroupName string, resourceName 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 = "2020-05-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.SignalRService/signalR/{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 + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + 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, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get the specified private endpoint connection associated with a SignalR resource. +// Parameters: +// privateEndpointConnectionName - the name of the private endpoint connection associated with the SignalR +// resource. +// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value +// from the Azure Resource Manager API or the portal. +// resourceName - the name of the SignalR resource. +func (client PrivateEndpointConnectionsClient) Get(ctx context.Context, privateEndpointConnectionName string, resourceGroupName string, resourceName 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, privateEndpointConnectionName, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "signalr.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, "signalr.PrivateEndpointConnectionsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "signalr.PrivateEndpointConnectionsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client PrivateEndpointConnectionsClient) GetPreparer(ctx context.Context, privateEndpointConnectionName string, resourceGroupName string, resourceName 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 = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{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, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update update the state of specified private endpoint connection associated with a SignalR resource. +// Parameters: +// privateEndpointConnectionName - the name of the private endpoint connection associated with the SignalR +// resource. +// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value +// from the Azure Resource Manager API or the portal. +// resourceName - the name of the SignalR resource. +// parameters - the resource of private endpoint and its properties. +func (client PrivateEndpointConnectionsClient) Update(ctx context.Context, privateEndpointConnectionName string, resourceGroupName string, resourceName string, parameters *PrivateEndpointConnection) (result PrivateEndpointConnection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, privateEndpointConnectionName, resourceGroupName, resourceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "signalr.PrivateEndpointConnectionsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "signalr.PrivateEndpointConnectionsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "signalr.PrivateEndpointConnectionsClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client PrivateEndpointConnectionsClient) UpdatePreparer(ctx context.Context, privateEndpointConnectionName string, resourceGroupName string, resourceName string, parameters *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 = "2020-05-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.SignalRService/signalR/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if parameters != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(parameters)) + } + 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) (*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 PrivateEndpointConnectionsClient) UpdateResponder(resp *http.Response) (result PrivateEndpointConnection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/signalr/mgmt/2020-05-01/signalr/privatelinkresources.go b/services/signalr/mgmt/2020-05-01/signalr/privatelinkresources.go new file mode 100644 index 000000000000..eeb94c523dcc --- /dev/null +++ b/services/signalr/mgmt/2020-05-01/signalr/privatelinkresources.go @@ -0,0 +1,158 @@ +package signalr + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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 REST API for Azure SignalR Service +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)} +} + +// List get the private link resources that need to be created for a SignalR resource. +// Parameters: +// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value +// from the Azure Resource Manager API or the portal. +// resourceName - the name of the SignalR resource. +func (client PrivateLinkResourcesClient) List(ctx context.Context, resourceGroupName string, resourceName string) (result PrivateLinkResourceListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourcesClient.List") + defer func() { + sc := -1 + if result.plrl.Response.Response != nil { + sc = result.plrl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "signalr.PrivateLinkResourcesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.plrl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "signalr.PrivateLinkResourcesClient", "List", resp, "Failure sending request") + return + } + + result.plrl, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "signalr.PrivateLinkResourcesClient", "List", resp, "Failure responding to request") + } + + 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 = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{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 PrivateLinkResourceList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 PrivateLinkResourcesClient) listNextResults(ctx context.Context, lastResults PrivateLinkResourceList) (result PrivateLinkResourceList, err error) { + req, err := lastResults.privateLinkResourceListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "signalr.PrivateLinkResourcesClient", "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, "signalr.PrivateLinkResourcesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "signalr.PrivateLinkResourcesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client PrivateLinkResourcesClient) ListComplete(ctx context.Context, resourceGroupName string, resourceName string) (result PrivateLinkResourceListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourcesClient.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, resourceName) + return +} diff --git a/services/signalr/mgmt/2020-05-01/signalr/signalr.go b/services/signalr/mgmt/2020-05-01/signalr/signalr.go new file mode 100644 index 000000000000..feda404f0cfa --- /dev/null +++ b/services/signalr/mgmt/2020-05-01/signalr/signalr.go @@ -0,0 +1,919 @@ +package signalr + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// Client is the REST API for Azure SignalR Service +type Client struct { + BaseClient +} + +// NewClient creates an instance of the Client client. +func NewClient(subscriptionID string) Client { + return NewClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewClientWithBaseURI creates an instance of the Client 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 NewClientWithBaseURI(baseURI string, subscriptionID string) Client { + return Client{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CheckNameAvailability checks that the SignalR name is valid and is not already in use. +// Parameters: +// location - the region +// parameters - parameters supplied to the operation. +func (client Client) CheckNameAvailability(ctx context.Context, location string, parameters *NameAvailabilityParameters) (result NameAvailability, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/Client.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: parameters, + Constraints: []validation.Constraint{{Target: "parameters", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Type", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "parameters.Name", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("signalr.Client", "CheckNameAvailability", err.Error()) + } + + req, err := client.CheckNameAvailabilityPreparer(ctx, location, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "signalr.Client", "CheckNameAvailability", nil, "Failure preparing request") + return + } + + resp, err := client.CheckNameAvailabilitySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "signalr.Client", "CheckNameAvailability", resp, "Failure sending request") + return + } + + result, err = client.CheckNameAvailabilityResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "signalr.Client", "CheckNameAvailability", resp, "Failure responding to request") + } + + return +} + +// CheckNameAvailabilityPreparer prepares the CheckNameAvailability request. +func (client Client) CheckNameAvailabilityPreparer(ctx context.Context, location string, parameters *NameAvailabilityParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-05-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.SignalRService/locations/{location}/checkNameAvailability", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if parameters != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(parameters)) + } + 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 Client) 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 Client) CheckNameAvailabilityResponder(resp *http.Response) (result NameAvailability, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdate create a new SignalR service and update an exiting SignalR service. +// Parameters: +// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value +// from the Azure Resource Manager API or the portal. +// resourceName - the name of the SignalR resource. +// parameters - parameters for the create or update operation +func (client Client) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, parameters *ResourceType) (result CreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/Client.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Sku", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Sku.Name", Name: validation.Null, Rule: true, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("signalr.Client", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, resourceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "signalr.Client", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "signalr.Client", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client Client) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, resourceName string, parameters *ResourceType) (*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 = "2020-05-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.SignalRService/signalR/{resourceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if parameters != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(parameters)) + } + 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 Client) CreateOrUpdateSender(req *http.Request) (future CreateOrUpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client Client) CreateOrUpdateResponder(resp *http.Response) (result ResourceType, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 SignalR service. +// Parameters: +// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value +// from the Azure Resource Manager API or the portal. +// resourceName - the name of the SignalR resource. +func (client Client) Delete(ctx context.Context, resourceGroupName string, resourceName string) (result DeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/Client.Delete") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "signalr.Client", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "signalr.Client", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client Client) 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 = "2020-05-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.SignalRService/signalR/{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 Client) DeleteSender(req *http.Request) (future DeleteFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client Client) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get the SignalR service and its properties. +// Parameters: +// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value +// from the Azure Resource Manager API or the portal. +// resourceName - the name of the SignalR resource. +func (client Client) Get(ctx context.Context, resourceGroupName string, resourceName string) (result ResourceType, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/Client.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, "signalr.Client", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "signalr.Client", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "signalr.Client", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client Client) 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 = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR/{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 Client) 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 Client) GetResponder(resp *http.Response) (result ResourceType, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByResourceGroup handles requests to list all resources in a resource group. +// Parameters: +// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value +// from the Azure Resource Manager API or the portal. +func (client Client) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ResourceListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListByResourceGroup") + defer func() { + sc := -1 + if result.rl.Response.Response != nil { + sc = result.rl.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, "signalr.Client", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.rl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "signalr.Client", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.rl, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "signalr.Client", "ListByResourceGroup", resp, "Failure responding to request") + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client Client) 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 = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.SignalRService/signalR", 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 Client) 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 Client) ListByResourceGroupResponder(resp *http.Response) (result ResourceList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 Client) listByResourceGroupNextResults(ctx context.Context, lastResults ResourceList) (result ResourceList, err error) { + req, err := lastResults.resourceListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "signalr.Client", "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, "signalr.Client", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "signalr.Client", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client Client) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ResourceListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/Client.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 handles requests to list all resources in a subscription. +func (client Client) ListBySubscription(ctx context.Context) (result ResourceListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListBySubscription") + defer func() { + sc := -1 + if result.rl.Response.Response != nil { + sc = result.rl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listBySubscriptionNextResults + req, err := client.ListBySubscriptionPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "signalr.Client", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.rl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "signalr.Client", "ListBySubscription", resp, "Failure sending request") + return + } + + result.rl, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "signalr.Client", "ListBySubscription", resp, "Failure responding to request") + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client Client) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.SignalRService/signalR", 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 Client) 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 Client) ListBySubscriptionResponder(resp *http.Response) (result ResourceList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 Client) listBySubscriptionNextResults(ctx context.Context, lastResults ResourceList) (result ResourceList, err error) { + req, err := lastResults.resourceListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "signalr.Client", "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, "signalr.Client", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "signalr.Client", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client Client) ListBySubscriptionComplete(ctx context.Context) (result ResourceListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/Client.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 +} + +// ListKeys get the access keys of the SignalR resource. +// Parameters: +// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value +// from the Azure Resource Manager API or the portal. +// resourceName - the name of the SignalR resource. +func (client Client) ListKeys(ctx context.Context, resourceGroupName string, resourceName string) (result Keys, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/Client.ListKeys") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListKeysPreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "signalr.Client", "ListKeys", nil, "Failure preparing request") + return + } + + resp, err := client.ListKeysSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "signalr.Client", "ListKeys", resp, "Failure sending request") + return + } + + result, err = client.ListKeysResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "signalr.Client", "ListKeys", resp, "Failure responding to request") + } + + return +} + +// ListKeysPreparer prepares the ListKeys request. +func (client Client) 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 = "2020-05-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.SignalRService/signalR/{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 Client) 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 Client) ListKeysResponder(resp *http.Response) (result Keys, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RegenerateKey regenerate SignalR service access key. PrimaryKey and SecondaryKey cannot be regenerated at the same +// time. +// Parameters: +// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value +// from the Azure Resource Manager API or the portal. +// resourceName - the name of the SignalR resource. +// parameters - parameter that describes the Regenerate Key Operation. +func (client Client) RegenerateKey(ctx context.Context, resourceGroupName string, resourceName string, parameters *RegenerateKeyParameters) (result RegenerateKeyFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/Client.RegenerateKey") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RegenerateKeyPreparer(ctx, resourceGroupName, resourceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "signalr.Client", "RegenerateKey", nil, "Failure preparing request") + return + } + + result, err = client.RegenerateKeySender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "signalr.Client", "RegenerateKey", result.Response(), "Failure sending request") + return + } + + return +} + +// RegenerateKeyPreparer prepares the RegenerateKey request. +func (client Client) RegenerateKeyPreparer(ctx context.Context, resourceGroupName string, resourceName string, parameters *RegenerateKeyParameters) (*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 = "2020-05-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.SignalRService/signalR/{resourceName}/regenerateKey", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if parameters != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(parameters)) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RegenerateKeySender sends the RegenerateKey request. The method will close the +// http.Response Body if it receives an error. +func (client Client) RegenerateKeySender(req *http.Request) (future RegenerateKeyFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// RegenerateKeyResponder handles the response to the RegenerateKey request. The method always +// closes the http.Response Body. +func (client Client) RegenerateKeyResponder(resp *http.Response) (result Keys, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Restart operation to restart a SignalR service. +// Parameters: +// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value +// from the Azure Resource Manager API or the portal. +// resourceName - the name of the SignalR resource. +func (client Client) Restart(ctx context.Context, resourceGroupName string, resourceName string) (result RestartFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/Client.Restart") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.RestartPreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "signalr.Client", "Restart", nil, "Failure preparing request") + return + } + + result, err = client.RestartSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "signalr.Client", "Restart", result.Response(), "Failure sending request") + return + } + + return +} + +// RestartPreparer prepares the Restart request. +func (client Client) RestartPreparer(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 = "2020-05-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.SignalRService/signalR/{resourceName}/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 Client) RestartSender(req *http.Request) (future RestartFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// RestartResponder handles the response to the Restart request. The method always +// closes the http.Response Body. +func (client Client) RestartResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Update operation to update an exiting SignalR service. +// Parameters: +// resourceGroupName - the name of the resource group that contains the resource. You can obtain this value +// from the Azure Resource Manager API or the portal. +// resourceName - the name of the SignalR resource. +// parameters - parameters for the update operation +func (client Client) Update(ctx context.Context, resourceGroupName string, resourceName string, parameters *ResourceType) (result UpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/Client.Update") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, resourceName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "signalr.Client", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "signalr.Client", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client Client) UpdatePreparer(ctx context.Context, resourceGroupName string, resourceName string, parameters *ResourceType) (*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 = "2020-05-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.SignalRService/signalR/{resourceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + if parameters != nil { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithJSON(parameters)) + } + 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 Client) UpdateSender(req *http.Request) (future UpdateFuture, err error) { + var resp *http.Response + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + future.Future, err = azure.NewFutureFromResponse(resp) + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client Client) UpdateResponder(resp *http.Response) (result ResourceType, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/signalr/mgmt/2020-05-01/signalr/signalrapi/interfaces.go b/services/signalr/mgmt/2020-05-01/signalr/signalrapi/interfaces.go new file mode 100644 index 000000000000..4c367fdb7ad0 --- /dev/null +++ b/services/signalr/mgmt/2020-05-01/signalr/signalrapi/interfaces.go @@ -0,0 +1,74 @@ +package signalrapi + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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/signalr/mgmt/2020-05-01/signalr" +) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result signalr.OperationListPage, err error) + ListComplete(ctx context.Context) (result signalr.OperationListIterator, err error) +} + +var _ OperationsClientAPI = (*signalr.OperationsClient)(nil) + +// ClientAPI contains the set of methods on the Client type. +type ClientAPI interface { + CheckNameAvailability(ctx context.Context, location string, parameters *signalr.NameAvailabilityParameters) (result signalr.NameAvailability, err error) + CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, parameters *signalr.ResourceType) (result signalr.CreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, resourceName string) (result signalr.DeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, resourceName string) (result signalr.ResourceType, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result signalr.ResourceListPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result signalr.ResourceListIterator, err error) + ListBySubscription(ctx context.Context) (result signalr.ResourceListPage, err error) + ListBySubscriptionComplete(ctx context.Context) (result signalr.ResourceListIterator, err error) + ListKeys(ctx context.Context, resourceGroupName string, resourceName string) (result signalr.Keys, err error) + RegenerateKey(ctx context.Context, resourceGroupName string, resourceName string, parameters *signalr.RegenerateKeyParameters) (result signalr.RegenerateKeyFuture, err error) + Restart(ctx context.Context, resourceGroupName string, resourceName string) (result signalr.RestartFuture, err error) + Update(ctx context.Context, resourceGroupName string, resourceName string, parameters *signalr.ResourceType) (result signalr.UpdateFuture, err error) +} + +var _ ClientAPI = (*signalr.Client)(nil) + +// PrivateEndpointConnectionsClientAPI contains the set of methods on the PrivateEndpointConnectionsClient type. +type PrivateEndpointConnectionsClientAPI interface { + Delete(ctx context.Context, privateEndpointConnectionName string, resourceGroupName string, resourceName string) (result signalr.PrivateEndpointConnectionsDeleteFuture, err error) + Get(ctx context.Context, privateEndpointConnectionName string, resourceGroupName string, resourceName string) (result signalr.PrivateEndpointConnection, err error) + Update(ctx context.Context, privateEndpointConnectionName string, resourceGroupName string, resourceName string, parameters *signalr.PrivateEndpointConnection) (result signalr.PrivateEndpointConnection, err error) +} + +var _ PrivateEndpointConnectionsClientAPI = (*signalr.PrivateEndpointConnectionsClient)(nil) + +// PrivateLinkResourcesClientAPI contains the set of methods on the PrivateLinkResourcesClient type. +type PrivateLinkResourcesClientAPI interface { + List(ctx context.Context, resourceGroupName string, resourceName string) (result signalr.PrivateLinkResourceListPage, err error) + ListComplete(ctx context.Context, resourceGroupName string, resourceName string) (result signalr.PrivateLinkResourceListIterator, err error) +} + +var _ PrivateLinkResourcesClientAPI = (*signalr.PrivateLinkResourcesClient)(nil) + +// UsagesClientAPI contains the set of methods on the UsagesClient type. +type UsagesClientAPI interface { + List(ctx context.Context, location string) (result signalr.UsageListPage, err error) + ListComplete(ctx context.Context, location string) (result signalr.UsageListIterator, err error) +} + +var _ UsagesClientAPI = (*signalr.UsagesClient)(nil) diff --git a/services/signalr/mgmt/2020-05-01/signalr/usages.go b/services/signalr/mgmt/2020-05-01/signalr/usages.go new file mode 100644 index 000000000000..703ca9c03457 --- /dev/null +++ b/services/signalr/mgmt/2020-05-01/signalr/usages.go @@ -0,0 +1,154 @@ +package signalr + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// UsagesClient is the REST API for Azure SignalR 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)} +} + +// List list usage quotas for Azure SignalR service by location. +// Parameters: +// location - the location like "eastus" +func (client UsagesClient) List(ctx context.Context, location string) (result UsageListPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UsagesClient.List") + defer func() { + sc := -1 + if result.ul.Response.Response != nil { + sc = result.ul.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, location) + if err != nil { + err = autorest.NewErrorWithError(err, "signalr.UsagesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.ul.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "signalr.UsagesClient", "List", resp, "Failure sending request") + return + } + + result.ul, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "signalr.UsagesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client UsagesClient) ListPreparer(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 = "2020-05-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.SignalRService/locations/{location}/usages", 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 UsagesClient) 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 UsagesClient) ListResponder(resp *http.Response) (result UsageList, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 UsagesClient) listNextResults(ctx context.Context, lastResults UsageList) (result UsageList, err error) { + req, err := lastResults.usageListPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "signalr.UsagesClient", "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, "signalr.UsagesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "signalr.UsagesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client UsagesClient) ListComplete(ctx context.Context, location string) (result UsageListIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UsagesClient.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, location) + return +} diff --git a/services/signalr/mgmt/2020-05-01/signalr/version.go b/services/signalr/mgmt/2020-05-01/signalr/version.go new file mode 100644 index 000000000000..bae3f1e10e52 --- /dev/null +++ b/services/signalr/mgmt/2020-05-01/signalr/version.go @@ -0,0 +1,30 @@ +package signalr + +import "github.com/Azure/azure-sdk-for-go/version" + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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() + " signalr/2020-05-01" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/services/storage/mgmt/2016-12-01/storage/models.go b/services/storage/mgmt/2016-12-01/storage/models.go index 5cc3605e7584..986a67174736 100644 --- a/services/storage/mgmt/2016-12-01/storage/models.go +++ b/services/storage/mgmt/2016-12-01/storage/models.go @@ -190,25 +190,6 @@ func PossibleReasonValues() []Reason { return []Reason{AccountNameInvalid, AlreadyExists} } -// ResourceEnum enumerates the values for resource enum. -type ResourceEnum string - -const ( - // ResourceEnumB ... - ResourceEnumB ResourceEnum = "b" - // ResourceEnumC ... - ResourceEnumC ResourceEnum = "c" - // ResourceEnumF ... - ResourceEnumF ResourceEnum = "f" - // ResourceEnumS ... - ResourceEnumS ResourceEnum = "s" -) - -// PossibleResourceEnumValues returns an array of possible values for the ResourceEnum const type. -func PossibleResourceEnumValues() []ResourceEnum { - return []ResourceEnum{ResourceEnumB, ResourceEnumC, ResourceEnumF, ResourceEnumS} -} - // ResourceTypes enumerates the values for resource types. type ResourceTypes string @@ -245,6 +226,25 @@ func PossibleServicesValues() []Services { return []Services{B, F, Q, T} } +// SignedResource enumerates the values for signed resource. +type SignedResource string + +const ( + // SignedResourceB ... + SignedResourceB SignedResource = "b" + // SignedResourceC ... + SignedResourceC SignedResource = "c" + // SignedResourceF ... + SignedResourceF SignedResource = "f" + // SignedResourceS ... + SignedResourceS SignedResource = "s" +) + +// PossibleSignedResourceValues returns an array of possible values for the SignedResource const type. +func PossibleSignedResourceValues() []SignedResource { + return []SignedResource{SignedResourceB, SignedResourceC, SignedResourceF, SignedResourceS} +} + // SkuName enumerates the values for sku name. type SkuName string @@ -616,8 +616,8 @@ type AccountSasParameters struct { Services Services `json:"signedServices,omitempty"` // ResourceTypes - The signed resource types that are accessible with the account SAS. Service (s): Access to service-level APIs; Container (c): Access to container-level APIs; Object (o): Access to object-level APIs for blobs, queue messages, table entities, and files. Possible values include: 'ResourceTypesS', 'ResourceTypesC', 'ResourceTypesO' ResourceTypes ResourceTypes `json:"signedResourceTypes,omitempty"` - // Permissions - The signed permissions for the account SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p). Possible values include: 'R', 'D', 'W', 'L', 'A', 'C', 'U', 'P' - Permissions Permissions `json:"signedPermission,omitempty"` + // Permissions - The signed permissions for the account SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p). Possible values include: 'Permissions1R', 'Permissions1D', 'Permissions1W', 'Permissions1L', 'Permissions1A', 'Permissions1C', 'Permissions1U', 'Permissions1P' + Permissions Permissions1 `json:"signedPermission,omitempty"` // IPAddressOrRange - An IP address or a range of IP addresses from which to accept requests. IPAddressOrRange *string `json:"signedIp,omitempty"` // Protocols - The protocol permitted for a request made with the account SAS. Possible values include: 'Httpshttp', 'HTTPS' @@ -829,10 +829,10 @@ func (r Resource) MarshalJSON() ([]byte, error) { type ServiceSasParameters struct { // CanonicalizedResource - The canonical path to the signed resource. CanonicalizedResource *string `json:"canonicalizedResource,omitempty"` - // Resource - The signed services accessible with the service SAS. Possible values include: Blob (b), Container (c), File (f), Share (s). Possible values include: 'ResourceEnumB', 'ResourceEnumC', 'ResourceEnumF', 'ResourceEnumS' - Resource ResourceEnum `json:"signedResource,omitempty"` - // Permissions - The signed permissions for the service SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p). Possible values include: 'Permissions1R', 'Permissions1D', 'Permissions1W', 'Permissions1L', 'Permissions1A', 'Permissions1C', 'Permissions1U', 'Permissions1P' - Permissions Permissions1 `json:"signedPermission,omitempty"` + // Resource - The signed services accessible with the service SAS. Possible values include: Blob (b), Container (c), File (f), Share (s). Possible values include: 'SignedResourceB', 'SignedResourceC', 'SignedResourceF', 'SignedResourceS' + Resource SignedResource `json:"signedResource,omitempty"` + // Permissions - The signed permissions for the service SAS. Possible values include: Read (r), Write (w), Delete (d), List (l), Add (a), Create (c), Update (u) and Process (p). Possible values include: 'R', 'D', 'W', 'L', 'A', 'C', 'U', 'P' + Permissions Permissions `json:"signedPermission,omitempty"` // IPAddressOrRange - An IP address or a range of IP addresses from which to accept requests. IPAddressOrRange *string `json:"signedIp,omitempty"` // Protocols - The protocol permitted for a request made with the account SAS. Possible values include: 'Httpshttp', 'HTTPS' diff --git a/services/storage/mgmt/2019-06-01/storage/blobcontainers.go b/services/storage/mgmt/2019-06-01/storage/blobcontainers.go index 0de8bb154b5b..79cd2688269e 100644 --- a/services/storage/mgmt/2019-06-01/storage/blobcontainers.go +++ b/services/storage/mgmt/2019-06-01/storage/blobcontainers.go @@ -1000,7 +1000,8 @@ func (client BlobContainersClient) LeaseResponder(resp *http.Response) (result L // must be between 3 and 24 characters in length and use numbers and lower-case letters only. // maxpagesize - optional. Specified maximum number of containers that can be included in the list. // filter - optional. When specified, only container names starting with the filter will be listed. -func (client BlobContainersClient) List(ctx context.Context, resourceGroupName string, accountName string, maxpagesize string, filter string) (result ListContainerItemsPage, err error) { +// include - optional, used to include the properties for soft deleted blob containers. +func (client BlobContainersClient) List(ctx context.Context, resourceGroupName string, accountName string, maxpagesize string, filter string, include ListContainersInclude) (result ListContainerItemsPage, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/BlobContainersClient.List") defer func() { @@ -1025,7 +1026,7 @@ func (client BlobContainersClient) List(ctx context.Context, resourceGroupName s } result.fn = client.listNextResults - req, err := client.ListPreparer(ctx, resourceGroupName, accountName, maxpagesize, filter) + req, err := client.ListPreparer(ctx, resourceGroupName, accountName, maxpagesize, filter, include) if err != nil { err = autorest.NewErrorWithError(err, "storage.BlobContainersClient", "List", nil, "Failure preparing request") return @@ -1047,7 +1048,7 @@ func (client BlobContainersClient) List(ctx context.Context, resourceGroupName s } // ListPreparer prepares the List request. -func (client BlobContainersClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string, maxpagesize string, filter string) (*http.Request, error) { +func (client BlobContainersClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string, maxpagesize string, filter string, include ListContainersInclude) (*http.Request, error) { pathParameters := map[string]interface{}{ "accountName": autorest.Encode("path", accountName), "resourceGroupName": autorest.Encode("path", resourceGroupName), @@ -1064,6 +1065,9 @@ func (client BlobContainersClient) ListPreparer(ctx context.Context, resourceGro if len(filter) > 0 { queryParameters["$filter"] = autorest.Encode("query", filter) } + if len(string(include)) > 0 { + queryParameters["$include"] = autorest.Encode("query", include) + } preparer := autorest.CreatePreparer( autorest.AsGet(), @@ -1114,7 +1118,7 @@ func (client BlobContainersClient) listNextResults(ctx context.Context, lastResu } // ListComplete enumerates all values, automatically crossing page boundaries as required. -func (client BlobContainersClient) ListComplete(ctx context.Context, resourceGroupName string, accountName string, maxpagesize string, filter string) (result ListContainerItemsIterator, err error) { +func (client BlobContainersClient) ListComplete(ctx context.Context, resourceGroupName string, accountName string, maxpagesize string, filter string, include ListContainersInclude) (result ListContainerItemsIterator, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/BlobContainersClient.List") defer func() { @@ -1125,7 +1129,7 @@ func (client BlobContainersClient) ListComplete(ctx context.Context, resourceGro tracing.EndSpan(ctx, sc, err) }() } - result.page, err = client.List(ctx, resourceGroupName, accountName, maxpagesize, filter) + result.page, err = client.List(ctx, resourceGroupName, accountName, maxpagesize, filter, include) return } diff --git a/services/storage/mgmt/2019-06-01/storage/models.go b/services/storage/mgmt/2019-06-01/storage/models.go index 1c75c2981a68..57db327f83bf 100644 --- a/services/storage/mgmt/2019-06-01/storage/models.go +++ b/services/storage/mgmt/2019-06-01/storage/models.go @@ -432,6 +432,19 @@ func PossibleLeaseStatusValues() []LeaseStatus { return []LeaseStatus{LeaseStatusLocked, LeaseStatusUnlocked} } +// ListContainersInclude enumerates the values for list containers include. +type ListContainersInclude string + +const ( + // Deleted ... + Deleted ListContainersInclude = "deleted" +) + +// PossibleListContainersIncludeValues returns an array of possible values for the ListContainersInclude const type. +func PossibleListContainersIncludeValues() []ListContainersInclude { + return []ListContainersInclude{Deleted} +} + // ListKeyExpand enumerates the values for list key expand. type ListKeyExpand string @@ -449,13 +462,13 @@ func PossibleListKeyExpandValues() []ListKeyExpand { type ListSharesExpand string const ( - // Deleted ... - Deleted ListSharesExpand = "deleted" + // ListSharesExpandDeleted ... + ListSharesExpandDeleted ListSharesExpand = "deleted" ) // PossibleListSharesExpandValues returns an array of possible values for the ListSharesExpand const type. func PossibleListSharesExpandValues() []ListSharesExpand { - return []ListSharesExpand{Deleted} + return []ListSharesExpand{ListSharesExpandDeleted} } // Permissions enumerates the values for permissions. @@ -1815,6 +1828,14 @@ type CloudErrorBody struct { // ContainerProperties the properties of a container. type ContainerProperties struct { + // Version - READ-ONLY; The version of the deleted blob container. + Version *string `json:"version,omitempty"` + // Deleted - READ-ONLY; Indicates whether the blob container was deleted. + Deleted *bool `json:"deleted,omitempty"` + // DeletedTime - READ-ONLY; Blob container deletion time. + DeletedTime *date.Time `json:"deletedTime,omitempty"` + // RemainingRetentionDays - READ-ONLY; Remaining retention days for soft deleted blob container. + RemainingRetentionDays *int32 `json:"remainingRetentionDays,omitempty"` // DefaultEncryptionScope - Default the container to use specified encryption scope for all writes. DefaultEncryptionScope *string `json:"defaultEncryptionScope,omitempty"` // DenyEncryptionScopeOverride - Block override of encryption scope from the container default. @@ -1929,6 +1950,8 @@ type Encryption struct { Services *EncryptionServices `json:"services,omitempty"` // KeySource - The encryption keySource (provider). Possible values (case-insensitive): Microsoft.Storage, Microsoft.Keyvault. Possible values include: 'KeySourceMicrosoftStorage', 'KeySourceMicrosoftKeyvault' KeySource KeySource `json:"keySource,omitempty"` + // RequireInfrastructureEncryption - A boolean indicating whether or not the service applies a secondary layer of encryption with platform managed keys for data at rest. + RequireInfrastructureEncryption *bool `json:"requireInfrastructureEncryption,omitempty"` // KeyVaultProperties - Properties provided by key vault. KeyVaultProperties *KeyVaultProperties `json:"keyvaultproperties,omitempty"` } @@ -2665,7 +2688,7 @@ type FileShareProperties struct { // AccessTierStatus - READ-ONLY; Indicates if there is a pending transition for access tier. AccessTierStatus *string `json:"accessTierStatus,omitempty"` // ShareUsageBytes - READ-ONLY; The approximate size of the data stored on the share. Note that this value may not include all recently created or recently resized files. - ShareUsageBytes *int32 `json:"shareUsageBytes,omitempty"` + ShareUsageBytes *int64 `json:"shareUsageBytes,omitempty"` } // MarshalJSON is the custom marshaler for FileShareProperties. @@ -3165,18 +3188,10 @@ func NewListContainerItemsPage(getNextPage func(context.Context, ListContainerIt return ListContainerItemsPage{fn: getNextPage} } -// ListServiceSasResponse the List service SAS credentials operation response. -type ListServiceSasResponse struct { - autorest.Response `json:"-"` - // ServiceSasToken - READ-ONLY; List service SAS credentials of specific resource. - ServiceSasToken *string `json:"serviceSasToken,omitempty"` -} - -// ManagementPolicy the Get Storage Account ManagementPolicies operation response. -type ManagementPolicy struct { - autorest.Response `json:"-"` - // ManagementPolicyProperties - Returns the Storage Account Data Policies Rules. - *ManagementPolicyProperties `json:"properties,omitempty"` +// ListQueue ... +type ListQueue struct { + // ListQueueProperties - List Queue resource properties. + *ListQueueProperties `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 @@ -3185,17 +3200,17 @@ type ManagementPolicy struct { Type *string `json:"type,omitempty"` } -// MarshalJSON is the custom marshaler for ManagementPolicy. -func (mp ManagementPolicy) MarshalJSON() ([]byte, error) { +// MarshalJSON is the custom marshaler for ListQueue. +func (lq ListQueue) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) - if mp.ManagementPolicyProperties != nil { - objectMap["properties"] = mp.ManagementPolicyProperties + if lq.ListQueueProperties != nil { + objectMap["properties"] = lq.ListQueueProperties } return json.Marshal(objectMap) } -// UnmarshalJSON is the custom unmarshaler for ManagementPolicy struct. -func (mp *ManagementPolicy) UnmarshalJSON(body []byte) error { +// UnmarshalJSON is the custom unmarshaler for ListQueue struct. +func (lq *ListQueue) UnmarshalJSON(body []byte) error { var m map[string]*json.RawMessage err := json.Unmarshal(body, &m) if err != nil { @@ -3205,12 +3220,12 @@ func (mp *ManagementPolicy) UnmarshalJSON(body []byte) error { switch k { case "properties": if v != nil { - var managementPolicyProperties ManagementPolicyProperties - err = json.Unmarshal(*v, &managementPolicyProperties) + var queueProperties ListQueueProperties + err = json.Unmarshal(*v, &queueProperties) if err != nil { return err } - mp.ManagementPolicyProperties = &managementPolicyProperties + lq.ListQueueProperties = &queueProperties } case "id": if v != nil { @@ -3219,7 +3234,7 @@ func (mp *ManagementPolicy) UnmarshalJSON(body []byte) error { if err != nil { return err } - mp.ID = &ID + lq.ID = &ID } case "name": if v != nil { @@ -3228,7 +3243,7 @@ func (mp *ManagementPolicy) UnmarshalJSON(body []byte) error { if err != nil { return err } - mp.Name = &name + lq.Name = &name } case "type": if v != nil { @@ -3237,7 +3252,7 @@ func (mp *ManagementPolicy) UnmarshalJSON(body []byte) error { if err != nil { return err } - mp.Type = &typeVar + lq.Type = &typeVar } } } @@ -3245,198 +3260,599 @@ func (mp *ManagementPolicy) UnmarshalJSON(body []byte) error { return nil } -// ManagementPolicyAction actions are applied to the filtered blobs when the execution condition is met. -type ManagementPolicyAction struct { - // BaseBlob - The management policy action for base blob - BaseBlob *ManagementPolicyBaseBlob `json:"baseBlob,omitempty"` - // Snapshot - The management policy action for snapshot - Snapshot *ManagementPolicySnapShot `json:"snapshot,omitempty"` +// ListQueueProperties ... +type ListQueueProperties struct { + // Metadata - A name-value pair that represents queue metadata. + Metadata map[string]*string `json:"metadata"` } -// ManagementPolicyBaseBlob management policy action for base blob. -type ManagementPolicyBaseBlob struct { - // TierToCool - The function to tier blobs to cool storage. Support blobs currently at Hot tier - TierToCool *DateAfterModification `json:"tierToCool,omitempty"` - // TierToArchive - The function to tier blobs to archive storage. Support blobs currently at Hot or Cool tier - TierToArchive *DateAfterModification `json:"tierToArchive,omitempty"` - // Delete - The function to delete the blob - Delete *DateAfterModification `json:"delete,omitempty"` +// MarshalJSON is the custom marshaler for ListQueueProperties. +func (lqp ListQueueProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lqp.Metadata != nil { + objectMap["metadata"] = lqp.Metadata + } + return json.Marshal(objectMap) } -// ManagementPolicyDefinition an object that defines the Lifecycle rule. Each definition is made up with a -// filters set and an actions set. -type ManagementPolicyDefinition struct { - // Actions - An object that defines the action set. - Actions *ManagementPolicyAction `json:"actions,omitempty"` - // Filters - An object that defines the filter set. - Filters *ManagementPolicyFilter `json:"filters,omitempty"` +// ListQueueResource response schema. Contains list of queues returned +type ListQueueResource struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of queues returned. + Value *[]ListQueue `json:"value,omitempty"` + // NextLink - READ-ONLY; Request URL that can be used to list next page of queues + NextLink *string `json:"nextLink,omitempty"` } -// ManagementPolicyFilter filters limit rule actions to a subset of blobs within the storage account. If -// multiple filters are defined, a logical AND is performed on all filters. -type ManagementPolicyFilter struct { - // PrefixMatch - An array of strings for prefixes to be match. - PrefixMatch *[]string `json:"prefixMatch,omitempty"` - // BlobTypes - An array of predefined enum values. Only blockBlob is supported. - BlobTypes *[]string `json:"blobTypes,omitempty"` - // BlobIndexMatch - An array of blob index tag based filters, there can be at most 10 tag filters - BlobIndexMatch *[]TagFilter `json:"blobIndexMatch,omitempty"` +// ListQueueResourceIterator provides access to a complete listing of ListQueue values. +type ListQueueResourceIterator struct { + i int + page ListQueueResourcePage } -// ManagementPolicyProperties the Storage Account ManagementPolicy properties. -type ManagementPolicyProperties struct { - // LastModifiedTime - READ-ONLY; Returns the date and time the ManagementPolicies was last modified. - LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` - // Policy - The Storage Account ManagementPolicy, in JSON format. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - Policy *ManagementPolicySchema `json:"policy,omitempty"` +// 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 *ListQueueResourceIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ListQueueResourceIterator.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 } -// ManagementPolicyRule an object that wraps the Lifecycle rule. Each rule is uniquely defined by name. -type ManagementPolicyRule struct { - // Enabled - Rule is enabled if set to true. - Enabled *bool `json:"enabled,omitempty"` - // Name - A rule name can contain any combination of alpha numeric characters. Rule name is case-sensitive. It must be unique within a policy. - Name *string `json:"name,omitempty"` - // Type - The valid value is Lifecycle - Type *string `json:"type,omitempty"` - // Definition - An object that defines the Lifecycle rule. - Definition *ManagementPolicyDefinition `json:"definition,omitempty"` +// 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 *ListQueueResourceIterator) Next() error { + return iter.NextWithContext(context.Background()) } -// ManagementPolicySchema the Storage Account ManagementPolicies Rules. See more details in: -// https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. -type ManagementPolicySchema struct { - // Rules - The Storage Account ManagementPolicies Rules. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. - Rules *[]ManagementPolicyRule `json:"rules,omitempty"` +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ListQueueResourceIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) } -// ManagementPolicySnapShot management policy action for snapshot. -type ManagementPolicySnapShot struct { - // Delete - The function to delete the blob snapshot - Delete *DateAfterCreation `json:"delete,omitempty"` +// Response returns the raw server response from the last page request. +func (iter ListQueueResourceIterator) Response() ListQueueResource { + return iter.page.Response() } -// MetricSpecification metric specification of operation. -type MetricSpecification struct { - // Name - Name of metric specification. - Name *string `json:"name,omitempty"` - // DisplayName - Display name of metric specification. - DisplayName *string `json:"displayName,omitempty"` - // DisplayDescription - Display description of metric specification. - DisplayDescription *string `json:"displayDescription,omitempty"` - // Unit - Unit could be Bytes or Count. - Unit *string `json:"unit,omitempty"` - // Dimensions - Dimensions of blobs, including blob type and access tier. - Dimensions *[]Dimension `json:"dimensions,omitempty"` - // AggregationType - Aggregation type could be Average. - AggregationType *string `json:"aggregationType,omitempty"` - // FillGapWithZero - The property to decide fill gap with zero or not. - FillGapWithZero *bool `json:"fillGapWithZero,omitempty"` - // Category - The category this metric specification belong to, could be Capacity. - Category *string `json:"category,omitempty"` - // ResourceIDDimensionNameOverride - Account Resource Id. - ResourceIDDimensionNameOverride *string `json:"resourceIdDimensionNameOverride,omitempty"` +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ListQueueResourceIterator) Value() ListQueue { + if !iter.page.NotDone() { + return ListQueue{} + } + return iter.page.Values()[iter.i] } -// NetworkRuleSet network rule set -type NetworkRuleSet struct { - // Bypass - Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None to bypass none of those traffics. Possible values include: 'None', 'Logging', 'Metrics', 'AzureServices' - Bypass Bypass `json:"bypass,omitempty"` - // VirtualNetworkRules - Sets the virtual network rules - VirtualNetworkRules *[]VirtualNetworkRule `json:"virtualNetworkRules,omitempty"` - // IPRules - Sets the IP ACL rules - IPRules *[]IPRule `json:"ipRules,omitempty"` - // DefaultAction - Specifies the default action of allow or deny when no other rules match. Possible values include: 'DefaultActionAllow', 'DefaultActionDeny' - DefaultAction DefaultAction `json:"defaultAction,omitempty"` +// Creates a new instance of the ListQueueResourceIterator type. +func NewListQueueResourceIterator(page ListQueueResourcePage) ListQueueResourceIterator { + return ListQueueResourceIterator{page: page} } -// ObjectReplicationPolicies list storage account object replication policies. -type ObjectReplicationPolicies struct { - autorest.Response `json:"-"` - // Value - The replication policy between two storage accounts. - Value *[]ObjectReplicationPolicy `json:"value,omitempty"` +// IsEmpty returns true if the ListResult contains no values. +func (lqr ListQueueResource) IsEmpty() bool { + return lqr.Value == nil || len(*lqr.Value) == 0 } -// ObjectReplicationPolicy the replication policy between two storage accounts. Multiple rules can be -// defined in one policy. -type ObjectReplicationPolicy struct { - autorest.Response `json:"-"` - // ObjectReplicationPolicyProperties - Returns the Storage Account Object Replication Policy. - *ObjectReplicationPolicyProperties `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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. - Type *string `json:"type,omitempty"` +// listQueueResourcePreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (lqr ListQueueResource) listQueueResourcePreparer(ctx context.Context) (*http.Request, error) { + if lqr.NextLink == nil || len(to.String(lqr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(lqr.NextLink))) } -// MarshalJSON is the custom marshaler for ObjectReplicationPolicy. -func (orp ObjectReplicationPolicy) MarshalJSON() ([]byte, error) { - objectMap := make(map[string]interface{}) - if orp.ObjectReplicationPolicyProperties != nil { - objectMap["properties"] = orp.ObjectReplicationPolicyProperties - } - return json.Marshal(objectMap) +// ListQueueResourcePage contains a page of ListQueue values. +type ListQueueResourcePage struct { + fn func(context.Context, ListQueueResource) (ListQueueResource, error) + lqr ListQueueResource } -// UnmarshalJSON is the custom unmarshaler for ObjectReplicationPolicy struct. -func (orp *ObjectReplicationPolicy) UnmarshalJSON(body []byte) error { - var m map[string]*json.RawMessage - err := json.Unmarshal(body, &m) +// 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 *ListQueueResourcePage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ListQueueResourcePage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.lqr) if err != nil { return err } - for k, v := range m { - switch k { - case "properties": - if v != nil { - var objectReplicationPolicyProperties ObjectReplicationPolicyProperties - err = json.Unmarshal(*v, &objectReplicationPolicyProperties) - if err != nil { - return err - } - orp.ObjectReplicationPolicyProperties = &objectReplicationPolicyProperties - } - case "id": - if v != nil { - var ID string - err = json.Unmarshal(*v, &ID) - if err != nil { - return err - } - orp.ID = &ID - } - case "name": - if v != nil { - var name string - err = json.Unmarshal(*v, &name) - if err != nil { - return err - } - orp.Name = &name - } - case "type": - if v != nil { - var typeVar string - err = json.Unmarshal(*v, &typeVar) - if err != nil { - return err - } - orp.Type = &typeVar - } - } - } - + page.lqr = next return nil } -// ObjectReplicationPolicyFilter filters limit replication to a subset of blobs within the storage account. -// A logical OR is performed on values in the filter. If multiple filters are defined, a logical AND is -// performed on all filters. -type ObjectReplicationPolicyFilter struct { - // PrefixMatch - Optional. Filters the results to replicate only blobs whose names begin with the specified prefix. - PrefixMatch *[]string `json:"prefixMatch,omitempty"` +// 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 *ListQueueResourcePage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ListQueueResourcePage) NotDone() bool { + return !page.lqr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ListQueueResourcePage) Response() ListQueueResource { + return page.lqr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ListQueueResourcePage) Values() []ListQueue { + if page.lqr.IsEmpty() { + return nil + } + return *page.lqr.Value +} + +// Creates a new instance of the ListQueueResourcePage type. +func NewListQueueResourcePage(getNextPage func(context.Context, ListQueueResource) (ListQueueResource, error)) ListQueueResourcePage { + return ListQueueResourcePage{fn: getNextPage} +} + +// ListQueueServices ... +type ListQueueServices struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of queue services returned. + Value *[]QueueServiceProperties `json:"value,omitempty"` +} + +// ListServiceSasResponse the List service SAS credentials operation response. +type ListServiceSasResponse struct { + autorest.Response `json:"-"` + // ServiceSasToken - READ-ONLY; List service SAS credentials of specific resource. + ServiceSasToken *string `json:"serviceSasToken,omitempty"` +} + +// ListTableResource response schema. Contains list of tables returned +type ListTableResource struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of tables returned. + Value *[]Table `json:"value,omitempty"` + // NextLink - READ-ONLY; Request URL that can be used to query next page of tables + NextLink *string `json:"nextLink,omitempty"` +} + +// ListTableResourceIterator provides access to a complete listing of Table values. +type ListTableResourceIterator struct { + i int + page ListTableResourcePage +} + +// 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 *ListTableResourceIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ListTableResourceIterator.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 *ListTableResourceIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ListTableResourceIterator) 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 ListTableResourceIterator) Response() ListTableResource { + 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 ListTableResourceIterator) Value() Table { + if !iter.page.NotDone() { + return Table{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ListTableResourceIterator type. +func NewListTableResourceIterator(page ListTableResourcePage) ListTableResourceIterator { + return ListTableResourceIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ltr ListTableResource) IsEmpty() bool { + return ltr.Value == nil || len(*ltr.Value) == 0 +} + +// listTableResourcePreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ltr ListTableResource) listTableResourcePreparer(ctx context.Context) (*http.Request, error) { + if ltr.NextLink == nil || len(to.String(ltr.NextLink)) < 1 { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ltr.NextLink))) +} + +// ListTableResourcePage contains a page of Table values. +type ListTableResourcePage struct { + fn func(context.Context, ListTableResource) (ListTableResource, error) + ltr ListTableResource +} + +// 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 *ListTableResourcePage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ListTableResourcePage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + next, err := page.fn(ctx, page.ltr) + if err != nil { + return err + } + page.ltr = next + 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 *ListTableResourcePage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ListTableResourcePage) NotDone() bool { + return !page.ltr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ListTableResourcePage) Response() ListTableResource { + return page.ltr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ListTableResourcePage) Values() []Table { + if page.ltr.IsEmpty() { + return nil + } + return *page.ltr.Value +} + +// Creates a new instance of the ListTableResourcePage type. +func NewListTableResourcePage(getNextPage func(context.Context, ListTableResource) (ListTableResource, error)) ListTableResourcePage { + return ListTableResourcePage{fn: getNextPage} +} + +// ListTableServices ... +type ListTableServices struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of table services returned. + Value *[]TableServiceProperties `json:"value,omitempty"` +} + +// ManagementPolicy the Get Storage Account ManagementPolicies operation response. +type ManagementPolicy struct { + autorest.Response `json:"-"` + // ManagementPolicyProperties - Returns the Storage Account Data Policies Rules. + *ManagementPolicyProperties `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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ManagementPolicy. +func (mp ManagementPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mp.ManagementPolicyProperties != nil { + objectMap["properties"] = mp.ManagementPolicyProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ManagementPolicy struct. +func (mp *ManagementPolicy) 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 managementPolicyProperties ManagementPolicyProperties + err = json.Unmarshal(*v, &managementPolicyProperties) + if err != nil { + return err + } + mp.ManagementPolicyProperties = &managementPolicyProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + mp.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mp.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mp.Type = &typeVar + } + } + } + + return nil +} + +// ManagementPolicyAction actions are applied to the filtered blobs when the execution condition is met. +type ManagementPolicyAction struct { + // BaseBlob - The management policy action for base blob + BaseBlob *ManagementPolicyBaseBlob `json:"baseBlob,omitempty"` + // Snapshot - The management policy action for snapshot + Snapshot *ManagementPolicySnapShot `json:"snapshot,omitempty"` +} + +// ManagementPolicyBaseBlob management policy action for base blob. +type ManagementPolicyBaseBlob struct { + // TierToCool - The function to tier blobs to cool storage. Support blobs currently at Hot tier + TierToCool *DateAfterModification `json:"tierToCool,omitempty"` + // TierToArchive - The function to tier blobs to archive storage. Support blobs currently at Hot or Cool tier + TierToArchive *DateAfterModification `json:"tierToArchive,omitempty"` + // Delete - The function to delete the blob + Delete *DateAfterModification `json:"delete,omitempty"` +} + +// ManagementPolicyDefinition an object that defines the Lifecycle rule. Each definition is made up with a +// filters set and an actions set. +type ManagementPolicyDefinition struct { + // Actions - An object that defines the action set. + Actions *ManagementPolicyAction `json:"actions,omitempty"` + // Filters - An object that defines the filter set. + Filters *ManagementPolicyFilter `json:"filters,omitempty"` +} + +// ManagementPolicyFilter filters limit rule actions to a subset of blobs within the storage account. If +// multiple filters are defined, a logical AND is performed on all filters. +type ManagementPolicyFilter struct { + // PrefixMatch - An array of strings for prefixes to be match. + PrefixMatch *[]string `json:"prefixMatch,omitempty"` + // BlobTypes - An array of predefined enum values. Only blockBlob is supported. + BlobTypes *[]string `json:"blobTypes,omitempty"` + // BlobIndexMatch - An array of blob index tag based filters, there can be at most 10 tag filters + BlobIndexMatch *[]TagFilter `json:"blobIndexMatch,omitempty"` +} + +// ManagementPolicyProperties the Storage Account ManagementPolicy properties. +type ManagementPolicyProperties struct { + // LastModifiedTime - READ-ONLY; Returns the date and time the ManagementPolicies was last modified. + LastModifiedTime *date.Time `json:"lastModifiedTime,omitempty"` + // Policy - The Storage Account ManagementPolicy, in JSON format. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + Policy *ManagementPolicySchema `json:"policy,omitempty"` +} + +// ManagementPolicyRule an object that wraps the Lifecycle rule. Each rule is uniquely defined by name. +type ManagementPolicyRule struct { + // Enabled - Rule is enabled if set to true. + Enabled *bool `json:"enabled,omitempty"` + // Name - A rule name can contain any combination of alpha numeric characters. Rule name is case-sensitive. It must be unique within a policy. + Name *string `json:"name,omitempty"` + // Type - The valid value is Lifecycle + Type *string `json:"type,omitempty"` + // Definition - An object that defines the Lifecycle rule. + Definition *ManagementPolicyDefinition `json:"definition,omitempty"` +} + +// ManagementPolicySchema the Storage Account ManagementPolicies Rules. See more details in: +// https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. +type ManagementPolicySchema struct { + // Rules - The Storage Account ManagementPolicies Rules. See more details in: https://docs.microsoft.com/en-us/azure/storage/common/storage-lifecycle-managment-concepts. + Rules *[]ManagementPolicyRule `json:"rules,omitempty"` +} + +// ManagementPolicySnapShot management policy action for snapshot. +type ManagementPolicySnapShot struct { + // Delete - The function to delete the blob snapshot + Delete *DateAfterCreation `json:"delete,omitempty"` +} + +// MetricSpecification metric specification of operation. +type MetricSpecification struct { + // Name - Name of metric specification. + Name *string `json:"name,omitempty"` + // DisplayName - Display name of metric specification. + DisplayName *string `json:"displayName,omitempty"` + // DisplayDescription - Display description of metric specification. + DisplayDescription *string `json:"displayDescription,omitempty"` + // Unit - Unit could be Bytes or Count. + Unit *string `json:"unit,omitempty"` + // Dimensions - Dimensions of blobs, including blob type and access tier. + Dimensions *[]Dimension `json:"dimensions,omitempty"` + // AggregationType - Aggregation type could be Average. + AggregationType *string `json:"aggregationType,omitempty"` + // FillGapWithZero - The property to decide fill gap with zero or not. + FillGapWithZero *bool `json:"fillGapWithZero,omitempty"` + // Category - The category this metric specification belong to, could be Capacity. + Category *string `json:"category,omitempty"` + // ResourceIDDimensionNameOverride - Account Resource Id. + ResourceIDDimensionNameOverride *string `json:"resourceIdDimensionNameOverride,omitempty"` +} + +// NetworkRuleSet network rule set +type NetworkRuleSet struct { + // Bypass - Specifies whether traffic is bypassed for Logging/Metrics/AzureServices. Possible values are any combination of Logging|Metrics|AzureServices (For example, "Logging, Metrics"), or None to bypass none of those traffics. Possible values include: 'None', 'Logging', 'Metrics', 'AzureServices' + Bypass Bypass `json:"bypass,omitempty"` + // VirtualNetworkRules - Sets the virtual network rules + VirtualNetworkRules *[]VirtualNetworkRule `json:"virtualNetworkRules,omitempty"` + // IPRules - Sets the IP ACL rules + IPRules *[]IPRule `json:"ipRules,omitempty"` + // DefaultAction - Specifies the default action of allow or deny when no other rules match. Possible values include: 'DefaultActionAllow', 'DefaultActionDeny' + DefaultAction DefaultAction `json:"defaultAction,omitempty"` +} + +// ObjectReplicationPolicies list storage account object replication policies. +type ObjectReplicationPolicies struct { + autorest.Response `json:"-"` + // Value - The replication policy between two storage accounts. + Value *[]ObjectReplicationPolicy `json:"value,omitempty"` +} + +// ObjectReplicationPolicy the replication policy between two storage accounts. Multiple rules can be +// defined in one policy. +type ObjectReplicationPolicy struct { + autorest.Response `json:"-"` + // ObjectReplicationPolicyProperties - Returns the Storage Account Object Replication Policy. + *ObjectReplicationPolicyProperties `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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ObjectReplicationPolicy. +func (orp ObjectReplicationPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if orp.ObjectReplicationPolicyProperties != nil { + objectMap["properties"] = orp.ObjectReplicationPolicyProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ObjectReplicationPolicy struct. +func (orp *ObjectReplicationPolicy) 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 objectReplicationPolicyProperties ObjectReplicationPolicyProperties + err = json.Unmarshal(*v, &objectReplicationPolicyProperties) + if err != nil { + return err + } + orp.ObjectReplicationPolicyProperties = &objectReplicationPolicyProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + orp.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + orp.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + orp.Type = &typeVar + } + } + } + + return nil +} + +// ObjectReplicationPolicyFilter filters limit replication to a subset of blobs within the storage account. +// A logical OR is performed on values in the filter. If multiple filters are defined, a logical AND is +// performed on all filters. +type ObjectReplicationPolicyFilter struct { + // PrefixMatch - Optional. Filters the results to replicate only blobs whose names begin with the specified prefix. + PrefixMatch *[]string `json:"prefixMatch,omitempty"` // MinCreationTime - Blobs created after the time will be replicated to the destination. It must be in datetime format 'yyyy-MM-ddTHH:mm:ssZ'. Example: 2020-02-19T16:05:00Z MinCreationTime *string `json:"minCreationTime,omitempty"` } @@ -3653,6 +4069,14 @@ func (pec *PrivateEndpointConnection) UnmarshalJSON(body []byte) error { return nil } +// PrivateEndpointConnectionListResult list of private endpoint connection associated with the specified +// storage account +type PrivateEndpointConnectionListResult struct { + autorest.Response `json:"-"` + // Value - Array of private endpoint connections + Value *[]PrivateEndpointConnection `json:"value,omitempty"` +} + // PrivateEndpointConnectionProperties properties of the PrivateEndpointConnectProperties. type PrivateEndpointConnectionProperties struct { // PrivateEndpoint - The resource of private end point. @@ -3774,6 +4198,175 @@ type ProxyResource struct { Type *string `json:"type,omitempty"` } +// Queue ... +type Queue struct { + autorest.Response `json:"-"` + // QueueProperties - Queue resource properties. + *QueueProperties `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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Queue. +func (q Queue) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if q.QueueProperties != nil { + objectMap["properties"] = q.QueueProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Queue struct. +func (q *Queue) 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 queueProperties QueueProperties + err = json.Unmarshal(*v, &queueProperties) + if err != nil { + return err + } + q.QueueProperties = &queueProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + q.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + q.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + q.Type = &typeVar + } + } + } + + return nil +} + +// QueueProperties ... +type QueueProperties struct { + // Metadata - A name-value pair that represents queue metadata. + Metadata map[string]*string `json:"metadata"` + // ApproximateMessageCount - READ-ONLY; Integer indicating an approximate number of messages in the queue. This number is not lower than the actual number of messages in the queue, but could be higher. + ApproximateMessageCount *int32 `json:"approximateMessageCount,omitempty"` +} + +// MarshalJSON is the custom marshaler for QueueProperties. +func (qp QueueProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if qp.Metadata != nil { + objectMap["metadata"] = qp.Metadata + } + return json.Marshal(objectMap) +} + +// QueueServiceProperties the properties of a storage account’s Queue service. +type QueueServiceProperties struct { + autorest.Response `json:"-"` + // QueueServicePropertiesProperties - The properties of a storage account’s Queue service. + *QueueServicePropertiesProperties `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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for QueueServiceProperties. +func (qsp QueueServiceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if qsp.QueueServicePropertiesProperties != nil { + objectMap["properties"] = qsp.QueueServicePropertiesProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for QueueServiceProperties struct. +func (qsp *QueueServiceProperties) 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 queueServiceProperties QueueServicePropertiesProperties + err = json.Unmarshal(*v, &queueServiceProperties) + if err != nil { + return err + } + qsp.QueueServicePropertiesProperties = &queueServiceProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + qsp.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + qsp.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + qsp.Type = &typeVar + } + } + } + + return nil +} + +// QueueServicePropertiesProperties the properties of a storage account’s Queue service. +type QueueServicePropertiesProperties struct { + // Cors - Specifies CORS rules for the Queue service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the Queue service. + Cors *CorsRules `json:"cors,omitempty"` +} + // Resource ... type Resource struct { // ID - READ-ONLY; Fully qualified resource Id for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} @@ -3903,6 +4496,164 @@ type SkuListResult struct { Value *[]SkuInformation `json:"value,omitempty"` } +// Table properties of the table, including Id, resource name, resource type. +type Table struct { + autorest.Response `json:"-"` + // TableProperties - Table resource properties. + *TableProperties `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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Table. +func (t Table) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if t.TableProperties != nil { + objectMap["properties"] = t.TableProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Table struct. +func (t *Table) 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 tableProperties TableProperties + err = json.Unmarshal(*v, &tableProperties) + if err != nil { + return err + } + t.TableProperties = &tableProperties + } + 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 + } + } + } + + return nil +} + +// TableProperties ... +type TableProperties struct { + // TableName - READ-ONLY; Table name under the specified account + TableName *string `json:"tableName,omitempty"` +} + +// TableServiceProperties the properties of a storage account’s Table service. +type TableServiceProperties struct { + autorest.Response `json:"-"` + // TableServicePropertiesProperties - The properties of a storage account’s Table service. + *TableServicePropertiesProperties `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. Ex- Microsoft.Compute/virtualMachines or Microsoft.Storage/storageAccounts. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for TableServiceProperties. +func (tsp TableServiceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tsp.TableServicePropertiesProperties != nil { + objectMap["properties"] = tsp.TableServicePropertiesProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for TableServiceProperties struct. +func (tsp *TableServiceProperties) 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 tableServiceProperties TableServicePropertiesProperties + err = json.Unmarshal(*v, &tableServiceProperties) + if err != nil { + return err + } + tsp.TableServicePropertiesProperties = &tableServiceProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + tsp.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + tsp.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + tsp.Type = &typeVar + } + } + } + + return nil +} + +// TableServicePropertiesProperties the properties of a storage account’s Table service. +type TableServicePropertiesProperties struct { + // Cors - Specifies CORS rules for the Table service. You can include up to five CorsRule elements in the request. If no CorsRule elements are included in the request body, all CORS rules will be deleted, and CORS will be disabled for the Table service. + Cors *CorsRules `json:"cors,omitempty"` +} + // TagFilter blob index tag based filtering for blob objects type TagFilter struct { // Name - This is the filter tag name, it can have 1 - 128 characters diff --git a/services/storage/mgmt/2019-06-01/storage/privateendpointconnections.go b/services/storage/mgmt/2019-06-01/storage/privateendpointconnections.go index 2f0246c0cc3b..326ba923a452 100644 --- a/services/storage/mgmt/2019-06-01/storage/privateendpointconnections.go +++ b/services/storage/mgmt/2019-06-01/storage/privateendpointconnections.go @@ -49,8 +49,8 @@ func NewPrivateEndpointConnectionsClientWithBaseURI(baseURI string, subscription // insensitive. // accountName - the name of the storage account within the specified resource group. Storage account names // must be between 3 and 24 characters in length and use numbers and lower-case letters only. -// privateEndpointConnectionName - the name of the private endpoint connection associated with the Storage -// Account +// privateEndpointConnectionName - the name of the private endpoint connection associated with the Azure +// resource func (client PrivateEndpointConnectionsClient) Delete(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string) (result autorest.Response, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.Delete") @@ -142,8 +142,8 @@ func (client PrivateEndpointConnectionsClient) DeleteResponder(resp *http.Respon // insensitive. // accountName - the name of the storage account within the specified resource group. Storage account names // must be between 3 and 24 characters in length and use numbers and lower-case letters only. -// privateEndpointConnectionName - the name of the private endpoint connection associated with the Storage -// Account +// privateEndpointConnectionName - the name of the private endpoint connection associated with the Azure +// resource func (client PrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string) (result PrivateEndpointConnection, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.Get") @@ -230,14 +230,105 @@ func (client PrivateEndpointConnectionsClient) GetResponder(resp *http.Response) return } +// List list all the private endpoint connections associated with the storage account. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// accountName - the name of the storage account within the specified resource group. Storage account names +// must be between 3 and 24 characters in length and use numbers and lower-case letters only. +func (client PrivateEndpointConnectionsClient) List(ctx context.Context, resourceGroupName string, accountName string) (result PrivateEndpointConnectionListResult, 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) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: 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: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("storage.PrivateEndpointConnectionsClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "storage.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, "storage.PrivateEndpointConnectionsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storage.PrivateEndpointConnectionsClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client PrivateEndpointConnectionsClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/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, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + // Put update the state of specified private endpoint connection associated with the storage account. // Parameters: // resourceGroupName - the name of the resource group within the user's subscription. The name is case // insensitive. // accountName - the name of the storage account within the specified resource group. Storage account names // must be between 3 and 24 characters in length and use numbers and lower-case letters only. -// privateEndpointConnectionName - the name of the private endpoint connection associated with the Storage -// Account +// privateEndpointConnectionName - the name of the private endpoint connection associated with the Azure +// resource // properties - the private endpoint connection properties. func (client PrivateEndpointConnectionsClient) Put(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string, properties PrivateEndpointConnection) (result PrivateEndpointConnection, err error) { if tracing.IsEnabled() { diff --git a/services/storage/mgmt/2019-06-01/storage/queue.go b/services/storage/mgmt/2019-06-01/storage/queue.go new file mode 100644 index 000000000000..d44aaac7d1d0 --- /dev/null +++ b/services/storage/mgmt/2019-06-01/storage/queue.go @@ -0,0 +1,578 @@ +package storage + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// QueueClient is the the Azure Storage Management API. +type QueueClient struct { + BaseClient +} + +// NewQueueClient creates an instance of the QueueClient client. +func NewQueueClient(subscriptionID string) QueueClient { + return NewQueueClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewQueueClientWithBaseURI creates an instance of the QueueClient 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 NewQueueClientWithBaseURI(baseURI string, subscriptionID string) QueueClient { + return QueueClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create creates a new queue with the specified queue name, under the specified account. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// accountName - the name of the storage account within the specified resource group. Storage account names +// must be between 3 and 24 characters in length and use numbers and lower-case letters only. +// queueName - a queue name must be unique within a storage account and must be between 3 and 63 characters.The +// name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an +// alphanumeric character and it cannot have two consecutive dash(-) characters. +// queue - queue properties and metadata to be created with +func (client QueueClient) Create(ctx context.Context, resourceGroupName string, accountName string, queueName string, queue Queue) (result Queue, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/QueueClient.Create") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: 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: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: queueName, + Constraints: []validation.Constraint{{Target: "queueName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "queueName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("storage.QueueClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, accountName, queueName, queue) + if err != nil { + err = autorest.NewErrorWithError(err, "storage.QueueClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "storage.QueueClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storage.QueueClient", "Create", resp, "Failure responding to request") + } + + return +} + +// CreatePreparer prepares the Create request. +func (client QueueClient) CreatePreparer(ctx context.Context, resourceGroupName string, accountName string, queueName string, queue Queue) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "queueName": autorest.Encode("path", queueName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-06-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.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}", pathParameters), + autorest.WithJSON(queue), + 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 QueueClient) CreateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client QueueClient) CreateResponder(resp *http.Response) (result Queue, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the queue with the specified queue name, under the specified account if it exists. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// accountName - the name of the storage account within the specified resource group. Storage account names +// must be between 3 and 24 characters in length and use numbers and lower-case letters only. +// queueName - a queue name must be unique within a storage account and must be between 3 and 63 characters.The +// name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an +// alphanumeric character and it cannot have two consecutive dash(-) characters. +func (client QueueClient) Delete(ctx context.Context, resourceGroupName string, accountName string, queueName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/QueueClient.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}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: queueName, + Constraints: []validation.Constraint{{Target: "queueName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "queueName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("storage.QueueClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, queueName) + if err != nil { + err = autorest.NewErrorWithError(err, "storage.QueueClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "storage.QueueClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storage.QueueClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client QueueClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, queueName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "queueName": autorest.Encode("path", queueName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-06-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.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}", 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 QueueClient) 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 QueueClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the queue with the specified queue name, under the specified account if it exists. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// accountName - the name of the storage account within the specified resource group. Storage account names +// must be between 3 and 24 characters in length and use numbers and lower-case letters only. +// queueName - a queue name must be unique within a storage account and must be between 3 and 63 characters.The +// name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an +// alphanumeric character and it cannot have two consecutive dash(-) characters. +func (client QueueClient) Get(ctx context.Context, resourceGroupName string, accountName string, queueName string) (result Queue, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/QueueClient.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}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: queueName, + Constraints: []validation.Constraint{{Target: "queueName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "queueName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("storage.QueueClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, accountName, queueName) + if err != nil { + err = autorest.NewErrorWithError(err, "storage.QueueClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "storage.QueueClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storage.QueueClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client QueueClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, queueName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "queueName": autorest.Encode("path", queueName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}", 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 QueueClient) 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 QueueClient) GetResponder(resp *http.Response) (result Queue, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets a list of all the queues under the specified storage account +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// accountName - the name of the storage account within the specified resource group. Storage account names +// must be between 3 and 24 characters in length and use numbers and lower-case letters only. +// maxpagesize - optional, a maximum number of queues that should be included in a list queue response +// filter - optional, When specified, only the queues with a name starting with the given filter will be +// listed. +func (client QueueClient) List(ctx context.Context, resourceGroupName string, accountName string, maxpagesize string, filter string) (result ListQueueResourcePage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/QueueClient.List") + defer func() { + sc := -1 + if result.lqr.Response.Response != nil { + sc = result.lqr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: 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: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("storage.QueueClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, accountName, maxpagesize, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "storage.QueueClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.lqr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "storage.QueueClient", "List", resp, "Failure sending request") + return + } + + result.lqr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storage.QueueClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client QueueClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string, maxpagesize string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(maxpagesize) > 0 { + queryParameters["$maxpagesize"] = autorest.Encode("query", maxpagesize) + } + 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.Storage/storageAccounts/{accountName}/queueServices/default/queues", 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 QueueClient) 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 QueueClient) ListResponder(resp *http.Response) (result ListQueueResource, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 QueueClient) listNextResults(ctx context.Context, lastResults ListQueueResource) (result ListQueueResource, err error) { + req, err := lastResults.listQueueResourcePreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "storage.QueueClient", "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, "storage.QueueClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storage.QueueClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client QueueClient) ListComplete(ctx context.Context, resourceGroupName string, accountName string, maxpagesize string, filter string) (result ListQueueResourceIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/QueueClient.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, accountName, maxpagesize, filter) + return +} + +// Update creates a new queue with the specified queue name, under the specified account. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// accountName - the name of the storage account within the specified resource group. Storage account names +// must be between 3 and 24 characters in length and use numbers and lower-case letters only. +// queueName - a queue name must be unique within a storage account and must be between 3 and 63 characters.The +// name must comprise of lowercase alphanumeric and dash(-) characters only, it should begin and end with an +// alphanumeric character and it cannot have two consecutive dash(-) characters. +// queue - queue properties and metadata to be created with +func (client QueueClient) Update(ctx context.Context, resourceGroupName string, accountName string, queueName string, queue Queue) (result Queue, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/QueueClient.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: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: queueName, + Constraints: []validation.Constraint{{Target: "queueName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "queueName", Name: validation.MinLength, Rule: 3, Chain: nil}}}}); err != nil { + return result, validation.NewError("storage.QueueClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, accountName, queueName, queue) + if err != nil { + err = autorest.NewErrorWithError(err, "storage.QueueClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "storage.QueueClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storage.QueueClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client QueueClient) UpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, queueName string, queue Queue) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "queueName": autorest.Encode("path", queueName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-06-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.Storage/storageAccounts/{accountName}/queueServices/default/queues/{queueName}", pathParameters), + autorest.WithJSON(queue), + 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 QueueClient) 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 QueueClient) UpdateResponder(resp *http.Response) (result Queue, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/storage/mgmt/2019-06-01/storage/queueservices.go b/services/storage/mgmt/2019-06-01/storage/queueservices.go new file mode 100644 index 000000000000..100131162faf --- /dev/null +++ b/services/storage/mgmt/2019-06-01/storage/queueservices.go @@ -0,0 +1,324 @@ +package storage + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// QueueServicesClient is the the Azure Storage Management API. +type QueueServicesClient struct { + BaseClient +} + +// NewQueueServicesClient creates an instance of the QueueServicesClient client. +func NewQueueServicesClient(subscriptionID string) QueueServicesClient { + return NewQueueServicesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewQueueServicesClientWithBaseURI creates an instance of the QueueServicesClient 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 NewQueueServicesClientWithBaseURI(baseURI string, subscriptionID string) QueueServicesClient { + return QueueServicesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// GetServiceProperties gets the properties of a storage account’s Queue service, including properties for Storage +// Analytics and CORS (Cross-Origin Resource Sharing) rules. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// accountName - the name of the storage account within the specified resource group. Storage account names +// must be between 3 and 24 characters in length and use numbers and lower-case letters only. +func (client QueueServicesClient) GetServiceProperties(ctx context.Context, resourceGroupName string, accountName string) (result QueueServiceProperties, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/QueueServicesClient.GetServiceProperties") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: 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: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("storage.QueueServicesClient", "GetServiceProperties", err.Error()) + } + + req, err := client.GetServicePropertiesPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "storage.QueueServicesClient", "GetServiceProperties", nil, "Failure preparing request") + return + } + + resp, err := client.GetServicePropertiesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "storage.QueueServicesClient", "GetServiceProperties", resp, "Failure sending request") + return + } + + result, err = client.GetServicePropertiesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storage.QueueServicesClient", "GetServiceProperties", resp, "Failure responding to request") + } + + return +} + +// GetServicePropertiesPreparer prepares the GetServiceProperties request. +func (client QueueServicesClient) GetServicePropertiesPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "queueServiceName": autorest.Encode("path", "default"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices/{queueServiceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetServicePropertiesSender sends the GetServiceProperties request. The method will close the +// http.Response Body if it receives an error. +func (client QueueServicesClient) GetServicePropertiesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetServicePropertiesResponder handles the response to the GetServiceProperties request. The method always +// closes the http.Response Body. +func (client QueueServicesClient) GetServicePropertiesResponder(resp *http.Response) (result QueueServiceProperties, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List list all queue services for the storage account +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// accountName - the name of the storage account within the specified resource group. Storage account names +// must be between 3 and 24 characters in length and use numbers and lower-case letters only. +func (client QueueServicesClient) List(ctx context.Context, resourceGroupName string, accountName string) (result ListQueueServices, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/QueueServicesClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: 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: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("storage.QueueServicesClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "storage.QueueServicesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "storage.QueueServicesClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storage.QueueServicesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client QueueServicesClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/queueServices", 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 QueueServicesClient) 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 QueueServicesClient) ListResponder(resp *http.Response) (result ListQueueServices, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// SetServiceProperties sets the properties of a storage account’s Queue service, including properties for Storage +// Analytics and CORS (Cross-Origin Resource Sharing) rules. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// accountName - the name of the storage account within the specified resource group. Storage account names +// must be between 3 and 24 characters in length and use numbers and lower-case letters only. +// parameters - the properties of a storage account’s Queue service, only properties for Storage Analytics and +// CORS (Cross-Origin Resource Sharing) rules can be specified. +func (client QueueServicesClient) SetServiceProperties(ctx context.Context, resourceGroupName string, accountName string, parameters QueueServiceProperties) (result QueueServiceProperties, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/QueueServicesClient.SetServiceProperties") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: 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: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("storage.QueueServicesClient", "SetServiceProperties", err.Error()) + } + + req, err := client.SetServicePropertiesPreparer(ctx, resourceGroupName, accountName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "storage.QueueServicesClient", "SetServiceProperties", nil, "Failure preparing request") + return + } + + resp, err := client.SetServicePropertiesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "storage.QueueServicesClient", "SetServiceProperties", resp, "Failure sending request") + return + } + + result, err = client.SetServicePropertiesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storage.QueueServicesClient", "SetServiceProperties", resp, "Failure responding to request") + } + + return +} + +// SetServicePropertiesPreparer prepares the SetServiceProperties request. +func (client QueueServicesClient) SetServicePropertiesPreparer(ctx context.Context, resourceGroupName string, accountName string, parameters QueueServiceProperties) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "queueServiceName": autorest.Encode("path", "default"), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-06-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.Storage/storageAccounts/{accountName}/queueServices/{queueServiceName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SetServicePropertiesSender sends the SetServiceProperties request. The method will close the +// http.Response Body if it receives an error. +func (client QueueServicesClient) SetServicePropertiesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// SetServicePropertiesResponder handles the response to the SetServiceProperties request. The method always +// closes the http.Response Body. +func (client QueueServicesClient) SetServicePropertiesResponder(resp *http.Response) (result QueueServiceProperties, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/storage/mgmt/2019-06-01/storage/storageapi/interfaces.go b/services/storage/mgmt/2019-06-01/storage/storageapi/interfaces.go index aaac613ed804..c69a3b7256b1 100644 --- a/services/storage/mgmt/2019-06-01/storage/storageapi/interfaces.go +++ b/services/storage/mgmt/2019-06-01/storage/storageapi/interfaces.go @@ -78,6 +78,7 @@ var _ ManagementPoliciesClientAPI = (*storage.ManagementPoliciesClient)(nil) type PrivateEndpointConnectionsClientAPI interface { Delete(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string) (result autorest.Response, err error) Get(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string) (result storage.PrivateEndpointConnection, err error) + List(ctx context.Context, resourceGroupName string, accountName string) (result storage.PrivateEndpointConnectionListResult, err error) Put(ctx context.Context, resourceGroupName string, accountName string, privateEndpointConnectionName string, properties storage.PrivateEndpointConnection) (result storage.PrivateEndpointConnection, err error) } @@ -131,8 +132,8 @@ type BlobContainersClientAPI interface { Get(ctx context.Context, resourceGroupName string, accountName string, containerName string) (result storage.BlobContainer, err error) GetImmutabilityPolicy(ctx context.Context, resourceGroupName string, accountName string, containerName string, ifMatch string) (result storage.ImmutabilityPolicy, err error) Lease(ctx context.Context, resourceGroupName string, accountName string, containerName string, parameters *storage.LeaseContainerRequest) (result storage.LeaseContainerResponse, err error) - List(ctx context.Context, resourceGroupName string, accountName string, maxpagesize string, filter string) (result storage.ListContainerItemsPage, err error) - ListComplete(ctx context.Context, resourceGroupName string, accountName string, maxpagesize string, filter string) (result storage.ListContainerItemsIterator, err error) + List(ctx context.Context, resourceGroupName string, accountName string, maxpagesize string, filter string, include storage.ListContainersInclude) (result storage.ListContainerItemsPage, err error) + ListComplete(ctx context.Context, resourceGroupName string, accountName string, maxpagesize string, filter string, include storage.ListContainersInclude) (result storage.ListContainerItemsIterator, err error) LockImmutabilityPolicy(ctx context.Context, resourceGroupName string, accountName string, containerName string, ifMatch string) (result storage.ImmutabilityPolicy, err error) SetLegalHold(ctx context.Context, resourceGroupName string, accountName string, containerName string, legalHold storage.LegalHold) (result storage.LegalHold, err error) Update(ctx context.Context, resourceGroupName string, accountName string, containerName string, blobContainer storage.BlobContainer) (result storage.BlobContainer, err error) @@ -161,3 +162,45 @@ type FileSharesClientAPI interface { } var _ FileSharesClientAPI = (*storage.FileSharesClient)(nil) + +// QueueServicesClientAPI contains the set of methods on the QueueServicesClient type. +type QueueServicesClientAPI interface { + GetServiceProperties(ctx context.Context, resourceGroupName string, accountName string) (result storage.QueueServiceProperties, err error) + List(ctx context.Context, resourceGroupName string, accountName string) (result storage.ListQueueServices, err error) + SetServiceProperties(ctx context.Context, resourceGroupName string, accountName string, parameters storage.QueueServiceProperties) (result storage.QueueServiceProperties, err error) +} + +var _ QueueServicesClientAPI = (*storage.QueueServicesClient)(nil) + +// QueueClientAPI contains the set of methods on the QueueClient type. +type QueueClientAPI interface { + Create(ctx context.Context, resourceGroupName string, accountName string, queueName string, queue storage.Queue) (result storage.Queue, err error) + Delete(ctx context.Context, resourceGroupName string, accountName string, queueName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, accountName string, queueName string) (result storage.Queue, err error) + List(ctx context.Context, resourceGroupName string, accountName string, maxpagesize string, filter string) (result storage.ListQueueResourcePage, err error) + ListComplete(ctx context.Context, resourceGroupName string, accountName string, maxpagesize string, filter string) (result storage.ListQueueResourceIterator, err error) + Update(ctx context.Context, resourceGroupName string, accountName string, queueName string, queue storage.Queue) (result storage.Queue, err error) +} + +var _ QueueClientAPI = (*storage.QueueClient)(nil) + +// TableServicesClientAPI contains the set of methods on the TableServicesClient type. +type TableServicesClientAPI interface { + GetServiceProperties(ctx context.Context, resourceGroupName string, accountName string) (result storage.TableServiceProperties, err error) + List(ctx context.Context, resourceGroupName string, accountName string) (result storage.ListTableServices, err error) + SetServiceProperties(ctx context.Context, resourceGroupName string, accountName string, parameters storage.TableServiceProperties) (result storage.TableServiceProperties, err error) +} + +var _ TableServicesClientAPI = (*storage.TableServicesClient)(nil) + +// TableClientAPI contains the set of methods on the TableClient type. +type TableClientAPI interface { + Create(ctx context.Context, resourceGroupName string, accountName string, tableName string) (result storage.Table, err error) + Delete(ctx context.Context, resourceGroupName string, accountName string, tableName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, accountName string, tableName string) (result storage.Table, err error) + List(ctx context.Context, resourceGroupName string, accountName string) (result storage.ListTableResourcePage, err error) + ListComplete(ctx context.Context, resourceGroupName string, accountName string) (result storage.ListTableResourceIterator, err error) + Update(ctx context.Context, resourceGroupName string, accountName string, tableName string) (result storage.Table, err error) +} + +var _ TableClientAPI = (*storage.TableClient)(nil) diff --git a/services/storage/mgmt/2019-06-01/storage/table.go b/services/storage/mgmt/2019-06-01/storage/table.go new file mode 100644 index 000000000000..c484e37580aa --- /dev/null +++ b/services/storage/mgmt/2019-06-01/storage/table.go @@ -0,0 +1,563 @@ +package storage + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// TableClient is the the Azure Storage Management API. +type TableClient struct { + BaseClient +} + +// NewTableClient creates an instance of the TableClient client. +func NewTableClient(subscriptionID string) TableClient { + return NewTableClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewTableClientWithBaseURI creates an instance of the TableClient 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 NewTableClientWithBaseURI(baseURI string, subscriptionID string) TableClient { + return TableClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create creates a new table with the specified table name, under the specified account. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// accountName - the name of the storage account within the specified resource group. Storage account names +// must be between 3 and 24 characters in length and use numbers and lower-case letters only. +// tableName - a table name must be unique within a storage account and must be between 3 and 63 characters.The +// name must comprise of only alphanumeric characters and it cannot begin with a numeric character. +func (client TableClient) Create(ctx context.Context, resourceGroupName string, accountName string, tableName string) (result Table, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TableClient.Create") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: 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: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: tableName, + Constraints: []validation.Constraint{{Target: "tableName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "tableName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "tableName", Name: validation.Pattern, Rule: `^[A-Za-z][A-Za-z0-9]{2,62}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("storage.TableClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, accountName, tableName) + if err != nil { + err = autorest.NewErrorWithError(err, "storage.TableClient", "Create", nil, "Failure preparing request") + return + } + + resp, err := client.CreateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "storage.TableClient", "Create", resp, "Failure sending request") + return + } + + result, err = client.CreateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storage.TableClient", "Create", resp, "Failure responding to request") + } + + return +} + +// CreatePreparer prepares the Create request. +func (client TableClient) CreatePreparer(ctx context.Context, resourceGroupName string, accountName string, tableName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tableName": autorest.Encode("path", tableName), + } + + const APIVersion = "2019-06-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.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}", pathParameters), + 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 TableClient) CreateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client TableClient) CreateResponder(resp *http.Response) (result Table, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the table with the specified table name, under the specified account if it exists. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// accountName - the name of the storage account within the specified resource group. Storage account names +// must be between 3 and 24 characters in length and use numbers and lower-case letters only. +// tableName - a table name must be unique within a storage account and must be between 3 and 63 characters.The +// name must comprise of only alphanumeric characters and it cannot begin with a numeric character. +func (client TableClient) Delete(ctx context.Context, resourceGroupName string, accountName string, tableName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TableClient.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}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: tableName, + Constraints: []validation.Constraint{{Target: "tableName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "tableName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "tableName", Name: validation.Pattern, Rule: `^[A-Za-z][A-Za-z0-9]{2,62}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("storage.TableClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, accountName, tableName) + if err != nil { + err = autorest.NewErrorWithError(err, "storage.TableClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "storage.TableClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storage.TableClient", "Delete", resp, "Failure responding to request") + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client TableClient) DeletePreparer(ctx context.Context, resourceGroupName string, accountName string, tableName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tableName": autorest.Encode("path", tableName), + } + + const APIVersion = "2019-06-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.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}", 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 TableClient) 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 TableClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the table with the specified table name, under the specified account if it exists. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// accountName - the name of the storage account within the specified resource group. Storage account names +// must be between 3 and 24 characters in length and use numbers and lower-case letters only. +// tableName - a table name must be unique within a storage account and must be between 3 and 63 characters.The +// name must comprise of only alphanumeric characters and it cannot begin with a numeric character. +func (client TableClient) Get(ctx context.Context, resourceGroupName string, accountName string, tableName string) (result Table, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TableClient.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}}}, + {TargetValue: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: tableName, + Constraints: []validation.Constraint{{Target: "tableName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "tableName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "tableName", Name: validation.Pattern, Rule: `^[A-Za-z][A-Za-z0-9]{2,62}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("storage.TableClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, accountName, tableName) + if err != nil { + err = autorest.NewErrorWithError(err, "storage.TableClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "storage.TableClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storage.TableClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client TableClient) GetPreparer(ctx context.Context, resourceGroupName string, accountName string, tableName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tableName": autorest.Encode("path", tableName), + } + + const APIVersion = "2019-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}", 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 TableClient) 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 TableClient) GetResponder(resp *http.Response) (result Table, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets a list of all the tables under the specified storage account +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// accountName - the name of the storage account within the specified resource group. Storage account names +// must be between 3 and 24 characters in length and use numbers and lower-case letters only. +func (client TableClient) List(ctx context.Context, resourceGroupName string, accountName string) (result ListTableResourcePage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TableClient.List") + defer func() { + sc := -1 + if result.ltr.Response.Response != nil { + sc = result.ltr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: 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: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("storage.TableClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "storage.TableClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.ltr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "storage.TableClient", "List", resp, "Failure sending request") + return + } + + result.ltr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storage.TableClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client TableClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables", 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 TableClient) 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 TableClient) ListResponder(resp *http.Response) (result ListTableResource, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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 TableClient) listNextResults(ctx context.Context, lastResults ListTableResource) (result ListTableResource, err error) { + req, err := lastResults.listTableResourcePreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "storage.TableClient", "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, "storage.TableClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storage.TableClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client TableClient) ListComplete(ctx context.Context, resourceGroupName string, accountName string) (result ListTableResourceIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TableClient.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, accountName) + return +} + +// Update creates a new table with the specified table name, under the specified account. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// accountName - the name of the storage account within the specified resource group. Storage account names +// must be between 3 and 24 characters in length and use numbers and lower-case letters only. +// tableName - a table name must be unique within a storage account and must be between 3 and 63 characters.The +// name must comprise of only alphanumeric characters and it cannot begin with a numeric character. +func (client TableClient) Update(ctx context.Context, resourceGroupName string, accountName string, tableName string) (result Table, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TableClient.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: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: tableName, + Constraints: []validation.Constraint{{Target: "tableName", Name: validation.MaxLength, Rule: 63, Chain: nil}, + {Target: "tableName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "tableName", Name: validation.Pattern, Rule: `^[A-Za-z][A-Za-z0-9]{2,62}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("storage.TableClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, accountName, tableName) + if err != nil { + err = autorest.NewErrorWithError(err, "storage.TableClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "storage.TableClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storage.TableClient", "Update", resp, "Failure responding to request") + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client TableClient) UpdatePreparer(ctx context.Context, resourceGroupName string, accountName string, tableName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tableName": autorest.Encode("path", tableName), + } + + const APIVersion = "2019-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/default/tables/{tableName}", pathParameters), + 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 TableClient) 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 TableClient) UpdateResponder(resp *http.Response) (result Table, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/storage/mgmt/2019-06-01/storage/tableservices.go b/services/storage/mgmt/2019-06-01/storage/tableservices.go new file mode 100644 index 000000000000..371904a222d9 --- /dev/null +++ b/services/storage/mgmt/2019-06-01/storage/tableservices.go @@ -0,0 +1,324 @@ +package storage + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// TableServicesClient is the the Azure Storage Management API. +type TableServicesClient struct { + BaseClient +} + +// NewTableServicesClient creates an instance of the TableServicesClient client. +func NewTableServicesClient(subscriptionID string) TableServicesClient { + return NewTableServicesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewTableServicesClientWithBaseURI creates an instance of the TableServicesClient 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 NewTableServicesClientWithBaseURI(baseURI string, subscriptionID string) TableServicesClient { + return TableServicesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// GetServiceProperties gets the properties of a storage account’s Table service, including properties for Storage +// Analytics and CORS (Cross-Origin Resource Sharing) rules. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// accountName - the name of the storage account within the specified resource group. Storage account names +// must be between 3 and 24 characters in length and use numbers and lower-case letters only. +func (client TableServicesClient) GetServiceProperties(ctx context.Context, resourceGroupName string, accountName string) (result TableServiceProperties, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TableServicesClient.GetServiceProperties") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: 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: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("storage.TableServicesClient", "GetServiceProperties", err.Error()) + } + + req, err := client.GetServicePropertiesPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "storage.TableServicesClient", "GetServiceProperties", nil, "Failure preparing request") + return + } + + resp, err := client.GetServicePropertiesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "storage.TableServicesClient", "GetServiceProperties", resp, "Failure sending request") + return + } + + result, err = client.GetServicePropertiesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storage.TableServicesClient", "GetServiceProperties", resp, "Failure responding to request") + } + + return +} + +// GetServicePropertiesPreparer prepares the GetServiceProperties request. +func (client TableServicesClient) GetServicePropertiesPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tableServiceName": autorest.Encode("path", "default"), + } + + const APIVersion = "2019-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices/{tableServiceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetServicePropertiesSender sends the GetServiceProperties request. The method will close the +// http.Response Body if it receives an error. +func (client TableServicesClient) GetServicePropertiesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetServicePropertiesResponder handles the response to the GetServiceProperties request. The method always +// closes the http.Response Body. +func (client TableServicesClient) GetServicePropertiesResponder(resp *http.Response) (result TableServiceProperties, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List list all table services for the storage account. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// accountName - the name of the storage account within the specified resource group. Storage account names +// must be between 3 and 24 characters in length and use numbers and lower-case letters only. +func (client TableServicesClient) List(ctx context.Context, resourceGroupName string, accountName string) (result ListTableServices, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TableServicesClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: 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: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("storage.TableServicesClient", "List", err.Error()) + } + + req, err := client.ListPreparer(ctx, resourceGroupName, accountName) + if err != nil { + err = autorest.NewErrorWithError(err, "storage.TableServicesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "storage.TableServicesClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storage.TableServicesClient", "List", resp, "Failure responding to request") + } + + return +} + +// ListPreparer prepares the List request. +func (client TableServicesClient) ListPreparer(ctx context.Context, resourceGroupName string, accountName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-06-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Storage/storageAccounts/{accountName}/tableServices", 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 TableServicesClient) 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 TableServicesClient) ListResponder(resp *http.Response) (result ListTableServices, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// SetServiceProperties sets the properties of a storage account’s Table service, including properties for Storage +// Analytics and CORS (Cross-Origin Resource Sharing) rules. +// Parameters: +// resourceGroupName - the name of the resource group within the user's subscription. The name is case +// insensitive. +// accountName - the name of the storage account within the specified resource group. Storage account names +// must be between 3 and 24 characters in length and use numbers and lower-case letters only. +// parameters - the properties of a storage account’s Table service, only properties for Storage Analytics and +// CORS (Cross-Origin Resource Sharing) rules can be specified. +func (client TableServicesClient) SetServiceProperties(ctx context.Context, resourceGroupName string, accountName string, parameters TableServiceProperties) (result TableServiceProperties, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TableServicesClient.SetServiceProperties") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: 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: accountName, + Constraints: []validation.Constraint{{Target: "accountName", Name: validation.MaxLength, Rule: 24, Chain: nil}, + {Target: "accountName", Name: validation.MinLength, Rule: 3, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("storage.TableServicesClient", "SetServiceProperties", err.Error()) + } + + req, err := client.SetServicePropertiesPreparer(ctx, resourceGroupName, accountName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "storage.TableServicesClient", "SetServiceProperties", nil, "Failure preparing request") + return + } + + resp, err := client.SetServicePropertiesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "storage.TableServicesClient", "SetServiceProperties", resp, "Failure sending request") + return + } + + result, err = client.SetServicePropertiesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storage.TableServicesClient", "SetServiceProperties", resp, "Failure responding to request") + } + + return +} + +// SetServicePropertiesPreparer prepares the SetServiceProperties request. +func (client TableServicesClient) SetServicePropertiesPreparer(ctx context.Context, resourceGroupName string, accountName string, parameters TableServiceProperties) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "accountName": autorest.Encode("path", accountName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "tableServiceName": autorest.Encode("path", "default"), + } + + const APIVersion = "2019-06-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.Storage/storageAccounts/{accountName}/tableServices/{tableServiceName}", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SetServicePropertiesSender sends the SetServiceProperties request. The method will close the +// http.Response Body if it receives an error. +func (client TableServicesClient) SetServicePropertiesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// SetServicePropertiesResponder handles the response to the SetServiceProperties request. The method always +// closes the http.Response Body. +func (client TableServicesClient) SetServicePropertiesResponder(resp *http.Response) (result TableServiceProperties, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/storagecache/mgmt/2020-03-01/storagecache/ascoperations.go b/services/storagecache/mgmt/2020-03-01/storagecache/ascoperations.go new file mode 100644 index 000000000000..abe8c845dcae --- /dev/null +++ b/services/storagecache/mgmt/2020-03-01/storagecache/ascoperations.go @@ -0,0 +1,120 @@ +package storagecache + +// Copyright (c) Microsoft and contributors. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// +// See the License for the specific language governing permissions and +// limitations under the License. +// +// 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" +) + +// AscOperationsClient is the a Storage Cache provides scalable caching service for NAS clients, serving data from +// either NFSv3 or Blob at-rest storage (referred to as "Storage Targets"). These operations allow you to manage +// Caches. +type AscOperationsClient struct { + BaseClient +} + +// NewAscOperationsClient creates an instance of the AscOperationsClient client. +func NewAscOperationsClient(subscriptionID string) AscOperationsClient { + return NewAscOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewAscOperationsClientWithBaseURI creates an instance of the AscOperationsClient 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 NewAscOperationsClientWithBaseURI(baseURI string, subscriptionID string) AscOperationsClient { + return AscOperationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get gets the status of an asynchronous operation for the Azure HPC cache +// Parameters: +// location - the region name which the operation will lookup into. +// operationID - the operation id which uniquely identifies the asynchronous operation. +func (client AscOperationsClient) Get(ctx context.Context, location string, operationID string) (result AscOperation, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AscOperationsClient.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, location, operationID) + if err != nil { + err = autorest.NewErrorWithError(err, "storagecache.AscOperationsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "storagecache.AscOperationsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "storagecache.AscOperationsClient", "Get", resp, "Failure responding to request") + } + + return +} + +// GetPreparer prepares the Get request. +func (client AscOperationsClient) GetPreparer(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 = "2020-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.StorageCache/locations/{location}/ascOperations/{operationId}", 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 AscOperationsClient) 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 AscOperationsClient) GetResponder(resp *http.Response) (result AscOperation, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/storagecache/mgmt/2020-03-01/storagecache/models.go b/services/storagecache/mgmt/2020-03-01/storagecache/models.go index 5cfff80f2a78..5f0607a7369f 100644 --- a/services/storagecache/mgmt/2020-03-01/storagecache/models.go +++ b/services/storagecache/mgmt/2020-03-01/storagecache/models.go @@ -330,6 +330,23 @@ func NewAPIOperationListResultPage(getNextPage func(context.Context, APIOperatio return APIOperationListResultPage{fn: getNextPage} } +// AscOperation the status of operation. +type AscOperation struct { + autorest.Response `json:"-"` + // ID - The operation Id. + ID *string `json:"id,omitempty"` + // Name - The operation name. + Name *string `json:"name,omitempty"` + // StartTime - The start time of the operation. + StartTime *string `json:"startTime,omitempty"` + // EndTime - The end time of the operation. + EndTime *string `json:"endTime,omitempty"` + // Status - The status of the operation. + Status *string `json:"status,omitempty"` + // Error - The error detail of the operation if any. + Error *ErrorResponse `json:"error,omitempty"` +} + // Cache a Cache instance. Follows Azure Resource Manager standards: // https://github.com/Azure/azure-resource-manager-rpc/blob/master/v1.0/resource-api-reference.md type Cache struct { @@ -953,6 +970,14 @@ type CloudErrorBody struct { Target *string `json:"target,omitempty"` } +// ErrorResponse describes the format of Error response. +type ErrorResponse struct { + // Code - Error code + Code *string `json:"code,omitempty"` + // Message - Error message indicating why the operation failed. + Message *string `json:"message,omitempty"` +} + // KeyVaultKeyReference describes a reference to Key Vault Key. type KeyVaultKeyReference struct { // KeyURL - The URL referencing a key encryption key in Key Vault. diff --git a/services/storagecache/mgmt/2020-03-01/storagecache/storagecacheapi/interfaces.go b/services/storagecache/mgmt/2020-03-01/storagecache/storagecacheapi/interfaces.go index 8e45316ab436..acf71eaeb9df 100644 --- a/services/storagecache/mgmt/2020-03-01/storagecache/storagecacheapi/interfaces.go +++ b/services/storagecache/mgmt/2020-03-01/storagecache/storagecacheapi/interfaces.go @@ -46,6 +46,13 @@ type UsageModelsClientAPI interface { var _ UsageModelsClientAPI = (*storagecache.UsageModelsClient)(nil) +// AscOperationsClientAPI contains the set of methods on the AscOperationsClient type. +type AscOperationsClientAPI interface { + Get(ctx context.Context, location string, operationID string) (result storagecache.AscOperation, err error) +} + +var _ AscOperationsClientAPI = (*storagecache.AscOperationsClient)(nil) + // CachesClientAPI contains the set of methods on the CachesClient type. type CachesClientAPI interface { CreateOrUpdate(ctx context.Context, resourceGroupName string, cacheName string, cache *storagecache.Cache) (result storagecache.CachesCreateOrUpdateFuture, err error) diff --git a/services/storagesync/mgmt/2019-10-01/storagesync/models.go b/services/storagesync/mgmt/2019-10-01/storagesync/models.go index 5b0d9419093b..a5a9976f7960 100644 --- a/services/storagesync/mgmt/2019-10-01/storagesync/models.go +++ b/services/storagesync/mgmt/2019-10-01/storagesync/models.go @@ -1797,40 +1797,6 @@ func (future *ServerEndpointsUpdateFuture) Result(client ServerEndpointsClient) return } -// ServerEndpointSyncActivityStatus sync Session status object. -type ServerEndpointSyncActivityStatus struct { - // Timestamp - READ-ONLY; Timestamp when properties were updated - Timestamp *date.Time `json:"timestamp,omitempty"` - // PerItemErrorCount - READ-ONLY; Per item error count - PerItemErrorCount *int64 `json:"perItemErrorCount,omitempty"` - // AppliedItemCount - READ-ONLY; Applied item count. - AppliedItemCount *int64 `json:"appliedItemCount,omitempty"` - // TotalItemCount - READ-ONLY; Total item count (if available) - TotalItemCount *int64 `json:"totalItemCount,omitempty"` - // AppliedBytes - READ-ONLY; Applied bytes - AppliedBytes *int64 `json:"appliedBytes,omitempty"` - // TotalBytes - READ-ONLY; Total bytes (if available) - TotalBytes *int64 `json:"totalBytes,omitempty"` -} - -// ServerEndpointSyncSessionStatus sync Session status object. -type ServerEndpointSyncSessionStatus struct { - // LastSyncResult - READ-ONLY; Last sync result (HResult) - LastSyncResult *int32 `json:"lastSyncResult,omitempty"` - // LastSyncTimestamp - READ-ONLY; Last sync timestamp - LastSyncTimestamp *date.Time `json:"lastSyncTimestamp,omitempty"` - // LastSyncSuccessTimestamp - READ-ONLY; Last sync success timestamp - LastSyncSuccessTimestamp *date.Time `json:"lastSyncSuccessTimestamp,omitempty"` - // LastSyncPerItemErrorCount - READ-ONLY; Last sync per item error count. - LastSyncPerItemErrorCount *int64 `json:"lastSyncPerItemErrorCount,omitempty"` - // PersistentFilesNotSyncingCount - READ-ONLY; Count of persistent files not syncing. - PersistentFilesNotSyncingCount *int64 `json:"persistentFilesNotSyncingCount,omitempty"` - // TransientFilesNotSyncingCount - READ-ONLY; Count of transient files not syncing. - TransientFilesNotSyncingCount *int64 `json:"transientFilesNotSyncingCount,omitempty"` - // FilesNotSyncingErrors - READ-ONLY; Array of per-item errors coming from the last sync session. - FilesNotSyncingErrors *[]ServerEndpointFilesNotSyncingError `json:"filesNotSyncingErrors,omitempty"` -} - // ServerEndpointSyncStatus server Endpoint sync status type ServerEndpointSyncStatus struct { // DownloadHealth - READ-ONLY; Download Health Status. Possible values include: 'DownloadHealthHealthy', 'DownloadHealthError', 'DownloadHealthSyncBlockedForRestore', 'DownloadHealthSyncBlockedForChangeDetectionPostRestore', 'DownloadHealthNoActivity' @@ -1846,13 +1812,13 @@ type ServerEndpointSyncStatus struct { // LastUpdatedTimestamp - READ-ONLY; Last Updated Timestamp LastUpdatedTimestamp *date.Time `json:"lastUpdatedTimestamp,omitempty"` // UploadStatus - READ-ONLY; Upload Status - UploadStatus *ServerEndpointSyncSessionStatus `json:"uploadStatus,omitempty"` + UploadStatus *SyncSessionStatus `json:"uploadStatus,omitempty"` // DownloadStatus - READ-ONLY; Download Status - DownloadStatus *ServerEndpointSyncSessionStatus `json:"downloadStatus,omitempty"` + DownloadStatus *SyncSessionStatus `json:"downloadStatus,omitempty"` // UploadActivity - READ-ONLY; Upload sync activity - UploadActivity *ServerEndpointSyncActivityStatus `json:"uploadActivity,omitempty"` + UploadActivity *SyncActivityStatus `json:"uploadActivity,omitempty"` // DownloadActivity - READ-ONLY; Download sync activity - DownloadActivity *ServerEndpointSyncActivityStatus `json:"downloadActivity,omitempty"` + DownloadActivity *SyncActivityStatus `json:"downloadActivity,omitempty"` // OfflineDataTransferStatus - READ-ONLY; Offline Data Transfer State. Possible values include: 'InProgress', 'Stopping', 'NotRunning', 'Complete' OfflineDataTransferStatus OfflineDataTransferStatus `json:"offlineDataTransferStatus,omitempty"` } @@ -2080,6 +2046,22 @@ type SubscriptionState struct { Properties interface{} `json:"properties,omitempty"` } +// SyncActivityStatus sync Session status object. +type SyncActivityStatus struct { + // Timestamp - READ-ONLY; Timestamp when properties were updated + Timestamp *date.Time `json:"timestamp,omitempty"` + // PerItemErrorCount - READ-ONLY; Per item error count + PerItemErrorCount *int64 `json:"perItemErrorCount,omitempty"` + // AppliedItemCount - READ-ONLY; Applied item count. + AppliedItemCount *int64 `json:"appliedItemCount,omitempty"` + // TotalItemCount - READ-ONLY; Total item count (if available) + TotalItemCount *int64 `json:"totalItemCount,omitempty"` + // AppliedBytes - READ-ONLY; Applied bytes + AppliedBytes *int64 `json:"appliedBytes,omitempty"` + // TotalBytes - READ-ONLY; Total bytes (if available) + TotalBytes *int64 `json:"totalBytes,omitempty"` +} + // SyncGroup sync Group object. type SyncGroup struct { autorest.Response `json:"-"` @@ -2180,6 +2162,24 @@ type SyncGroupProperties struct { SyncGroupStatus *string `json:"syncGroupStatus,omitempty"` } +// SyncSessionStatus sync Session status object. +type SyncSessionStatus struct { + // LastSyncResult - READ-ONLY; Last sync result (HResult) + LastSyncResult *int32 `json:"lastSyncResult,omitempty"` + // LastSyncTimestamp - READ-ONLY; Last sync timestamp + LastSyncTimestamp *date.Time `json:"lastSyncTimestamp,omitempty"` + // LastSyncSuccessTimestamp - READ-ONLY; Last sync success timestamp + LastSyncSuccessTimestamp *date.Time `json:"lastSyncSuccessTimestamp,omitempty"` + // LastSyncPerItemErrorCount - READ-ONLY; Last sync per item error count. + LastSyncPerItemErrorCount *int64 `json:"lastSyncPerItemErrorCount,omitempty"` + // PersistentFilesNotSyncingCount - READ-ONLY; Count of persistent files not syncing. + PersistentFilesNotSyncingCount *int64 `json:"persistentFilesNotSyncingCount,omitempty"` + // TransientFilesNotSyncingCount - READ-ONLY; Count of transient files not syncing. + TransientFilesNotSyncingCount *int64 `json:"transientFilesNotSyncingCount,omitempty"` + // FilesNotSyncingErrors - READ-ONLY; Array of per-item errors coming from the last sync session. + FilesNotSyncingErrors *[]ServerEndpointFilesNotSyncingError `json:"filesNotSyncingErrors,omitempty"` +} + // TrackedResource the resource model definition for a ARM tracked top level resource type TrackedResource struct { // Tags - Resource tags. diff --git a/services/web/mgmt/2019-08-01/web/apps.go b/services/web/mgmt/2019-08-01/web/apps.go index 3c0c778a96e3..f5f3381c4d13 100644 --- a/services/web/mgmt/2019-08-01/web/apps.go +++ b/services/web/mgmt/2019-08-01/web/apps.go @@ -9082,6 +9082,91 @@ func (client AppsClient) GetBackupStatusSlotResponder(resp *http.Response) (resu return } +// GetBasicPublishingCredentialsPolicies 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) GetBasicPublishingCredentialsPolicies(ctx context.Context, resourceGroupName string, name string) (result CsmPublishingCredentialsPoliciesCollection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetBasicPublishingCredentialsPolicies") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetBasicPublishingCredentialsPolicies", err.Error()) + } + + req, err := client.GetBasicPublishingCredentialsPoliciesPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetBasicPublishingCredentialsPolicies", nil, "Failure preparing request") + return + } + + resp, err := client.GetBasicPublishingCredentialsPoliciesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetBasicPublishingCredentialsPolicies", resp, "Failure sending request") + return + } + + result, err = client.GetBasicPublishingCredentialsPoliciesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetBasicPublishingCredentialsPolicies", resp, "Failure responding to request") + } + + return +} + +// GetBasicPublishingCredentialsPoliciesPreparer prepares the GetBasicPublishingCredentialsPolicies request. +func (client AppsClient) GetBasicPublishingCredentialsPoliciesPreparer(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 = "2019-08-01" + 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)) +} + +// GetBasicPublishingCredentialsPoliciesSender sends the GetBasicPublishingCredentialsPolicies request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetBasicPublishingCredentialsPoliciesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetBasicPublishingCredentialsPoliciesResponder handles the response to the GetBasicPublishingCredentialsPolicies request. The method always +// closes the http.Response Body. +func (client AppsClient) GetBasicPublishingCredentialsPoliciesResponder(resp *http.Response) (result CsmPublishingCredentialsPoliciesCollection, err error) { + err = autorest.Respond( + resp, + client.ByInspecting(), + 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: @@ -10295,6 +10380,90 @@ func (client AppsClient) GetDomainOwnershipIdentifierSlotResponder(resp *http.Re 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 +} + +// 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 = "2019-08-01" + 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, + client.ByInspecting(), + 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. @@ -14680,6 +14849,90 @@ func (client AppsClient) GetRelayServiceConnectionSlotResponder(resp *http.Respo 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 +} + +// 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 = "2019-08-01" + 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, + client.ByInspecting(), + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + 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. @@ -32731,6 +32984,95 @@ func (client AppsClient) UpdateDomainOwnershipIdentifierSlotResponder(resp *http 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 +} + +// 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 = "2019-08-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, + client.ByInspecting(), + 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. @@ -33456,6 +33798,95 @@ func (client AppsClient) UpdateRelayServiceConnectionSlotResponder(resp *http.Re 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 +} + +// 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 = "2019-08-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, + client.ByInspecting(), + 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. diff --git a/services/web/mgmt/2019-08-01/web/models.go b/services/web/mgmt/2019-08-01/web/models.go index cfbd146bda43..5356ed674ce3 100644 --- a/services/web/mgmt/2019-08-01/web/models.go +++ b/services/web/mgmt/2019-08-01/web/models.go @@ -861,13 +861,15 @@ const ( 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, ManagedServiceIdentityTypeUserAssigned} + return []ManagedServiceIdentityType{ManagedServiceIdentityTypeNone, ManagedServiceIdentityTypeSystemAssigned, ManagedServiceIdentityTypeSystemAssignedUserAssigned, ManagedServiceIdentityTypeUserAssigned} } // MSDeployLogEntryType enumerates the values for ms deploy log entry type. @@ -1681,7 +1683,7 @@ type APIKVReference struct { VaultName *string `json:"vaultName,omitempty"` SecretName *string `json:"secretName,omitempty"` SecretVersion *string `json:"secretVersion,omitempty"` - // IdentityType - Possible values include: 'ManagedServiceIdentityTypeNone', 'ManagedServiceIdentityTypeSystemAssigned', 'ManagedServiceIdentityTypeUserAssigned' + // IdentityType - Possible values include: 'ManagedServiceIdentityTypeSystemAssigned', 'ManagedServiceIdentityTypeUserAssigned', 'ManagedServiceIdentityTypeSystemAssignedUserAssigned', 'ManagedServiceIdentityTypeNone' IdentityType ManagedServiceIdentityType `json:"identityType,omitempty"` Details *string `json:"details,omitempty"` // Source - Possible values include: 'KeyVault' @@ -7345,6 +7347,196 @@ type CsmOperationDisplay struct { Description *string `json:"description,omitempty"` } +// CsmPublishingCredentialsPoliciesCollection publishing Credentials Policies collection. +type CsmPublishingCredentialsPoliciesCollection struct { + autorest.Response `json:"-"` + // CsmPublishingCredentialsPoliciesCollectionProperties - CsmPublishingCredentialsPoliciesCollection resource specific properties + *CsmPublishingCredentialsPoliciesCollectionProperties `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 CsmPublishingCredentialsPoliciesCollection. +func (cpcpc CsmPublishingCredentialsPoliciesCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cpcpc.CsmPublishingCredentialsPoliciesCollectionProperties != nil { + objectMap["properties"] = cpcpc.CsmPublishingCredentialsPoliciesCollectionProperties + } + if cpcpc.Kind != nil { + objectMap["kind"] = cpcpc.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CsmPublishingCredentialsPoliciesCollection struct. +func (cpcpc *CsmPublishingCredentialsPoliciesCollection) 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 csmPublishingCredentialsPoliciesCollectionProperties CsmPublishingCredentialsPoliciesCollectionProperties + err = json.Unmarshal(*v, &csmPublishingCredentialsPoliciesCollectionProperties) + if err != nil { + return err + } + cpcpc.CsmPublishingCredentialsPoliciesCollectionProperties = &csmPublishingCredentialsPoliciesCollectionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + cpcpc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + cpcpc.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + cpcpc.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + cpcpc.Type = &typeVar + } + } + } + + return nil +} + +// CsmPublishingCredentialsPoliciesCollectionProperties csmPublishingCredentialsPoliciesCollection resource +// specific properties +type CsmPublishingCredentialsPoliciesCollectionProperties struct { + // Ftp - Whether FTP is allowed. + Ftp *CsmPublishingCredentialsPoliciesEntity `json:"ftp,omitempty"` + // Scm - Whether Scm Basic Auth is allowed. + Scm *CsmPublishingCredentialsPoliciesEntity `json:"scm,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: @@ -12738,7 +12930,7 @@ type LogSpecification struct { // ManagedServiceIdentity managed service identity. type ManagedServiceIdentity struct { - // Type - Type of managed service identity. Possible values include: 'ManagedServiceIdentityTypeNone', 'ManagedServiceIdentityTypeSystemAssigned', 'ManagedServiceIdentityTypeUserAssigned' + // 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"` diff --git a/services/web/mgmt/2019-08-01/web/webapi/interfaces.go b/services/web/mgmt/2019-08-01/web/webapi/interfaces.go index 3c50f5ee92d7..22123ed31d35 100644 --- a/services/web/mgmt/2019-08-01/web/webapi/interfaces.go +++ b/services/web/mgmt/2019-08-01/web/webapi/interfaces.go @@ -335,6 +335,7 @@ type AppsClientAPI interface { 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) + GetBasicPublishingCredentialsPolicies(ctx context.Context, resourceGroupName string, name string) (result web.CsmPublishingCredentialsPoliciesCollection, 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) @@ -349,6 +350,7 @@ type AppsClientAPI interface { 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) 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) @@ -399,6 +401,7 @@ type AppsClientAPI interface { 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) 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) @@ -636,6 +639,7 @@ type AppsClientAPI interface { 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) 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) @@ -644,6 +648,7 @@ type AppsClientAPI interface { 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) 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) diff --git a/swagger_to_sdk_config.json b/swagger_to_sdk_config.json index e55bc48a028a..2a11f9afceee 100644 --- a/swagger_to_sdk_config.json +++ b/swagger_to_sdk_config.json @@ -8,7 +8,7 @@ "gofmt -w ./services/" ], "autorest_options": { - "use": "@microsoft.azure/autorest.go@~2.1.144", + "use": "@microsoft.azure/autorest.go@~2.1.145", "go": "", "verbose": "", "sdkrel:go-sdk-folder": ".", diff --git a/version/version.go b/version/version.go index 3b40bfba94b4..ae1ef97e166e 100644 --- a/version/version.go +++ b/version/version.go @@ -18,4 +18,4 @@ package version // Changes may cause incorrect behavior and will be lost if the code is regenerated. // Number contains the semantic version of this SDK. -const Number = "v42.3.0" +const Number = "v43.0.0"